projectA.ll 124 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008
  1. ; ModuleID = 'data/projectA.c'
  2. source_filename = "data/projectA.c"
  3. target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
  4. target triple = "x86_64-pc-linux-gnu"
  5. %struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, %struct._IO_codecvt*, %struct._IO_wide_data*, %struct._IO_FILE*, i8*, i64, i32, [20 x i8] }
  6. %struct._IO_marker = type opaque
  7. %struct._IO_codecvt = type opaque
  8. %struct._IO_wide_data = type opaque
  9. %struct.DynamicArray = type { i32*, i32, i32, i32, i32 }
  10. %struct.Matrix = type { i32**, i32, i32, i32, double }
  11. %struct.Node = type { i32, %struct.Node*, %struct.Node*, i32, i32 }
  12. %struct.Point = type { i32, i32, [256 x i8], double }
  13. %struct.Circle = type { %struct.Point, double, i32, [256 x i8] }
  14. @globalCounter = dso_local global i32 0, align 4
  15. @globalErrorMessage = dso_local global i8* null, align 8
  16. @recursionDepth = dso_local global i32 0, align 4
  17. @.str = private unnamed_addr constant [9 x i8] c"No error\00", align 1
  18. @stderr = external dso_local global %struct._IO_FILE*, align 8
  19. @.str.1 = private unnamed_addr constant [55 x i8] c"Critical: Failed to allocate memory for error message\0A\00", align 1
  20. @.str.2 = private unnamed_addr constant [33 x i8] c"Maximum recursion depth exceeded\00", align 1
  21. @.str.3 = private unnamed_addr constant [29 x i8] c"Factorial of negative number\00", align 1
  22. @.str.4 = private unnamed_addr constant [36 x i8] c"Input too large, potential overflow\00", align 1
  23. @.str.5 = private unnamed_addr constant [31 x i8] c"Factorial calculation overflow\00", align 1
  24. @.str.6 = private unnamed_addr constant [25 x i8] c"Invalid initial capacity\00", align 1
  25. @.str.7 = private unnamed_addr constant [46 x i8] c"Initial capacity exceeds maximum allowed size\00", align 1
  26. @.str.8 = private unnamed_addr constant [49 x i8] c"Memory allocation failed for DynamicArray struct\00", align 1
  27. @.str.9 = private unnamed_addr constant [35 x i8] c"Memory allocation failed for array\00", align 1
  28. @.str.10 = private unnamed_addr constant [19 x i8] c"Null array pointer\00", align 1
  29. @.str.11 = private unnamed_addr constant [25 x i8] c"Array size limit reached\00", align 1
  30. @.str.12 = private unnamed_addr constant [27 x i8] c"Memory reallocation failed\00", align 1
  31. @.str.13 = private unnamed_addr constant [46 x i8] c"Maximum recursion depth exceeded in quickSort\00", align 1
  32. @.str.14 = private unnamed_addr constant [32 x i8] c"Null array pointer in quickSort\00", align 1
  33. @.str.15 = private unnamed_addr constant [39 x i8] c"Array index out of bounds in quickSort\00", align 1
  34. @.str.16 = private unnamed_addr constant [28 x i8] c"Matrix dimensions too small\00", align 1
  35. @.str.17 = private unnamed_addr constant [46 x i8] c"Matrix dimensions exceed maximum allowed size\00", align 1
  36. @.str.18 = private unnamed_addr constant [43 x i8] c"Memory allocation failed for matrix struct\00", align 1
  37. @.str.19 = private unnamed_addr constant [41 x i8] c"Memory allocation failed for matrix rows\00", align 1
  38. @.str.20 = private unnamed_addr constant [44 x i8] c"Memory allocation failed for matrix columns\00", align 1
  39. @.str.21 = private unnamed_addr constant [20 x i8] c"Null matrix pointer\00", align 1
  40. @.str.22 = private unnamed_addr constant [20 x i8] c"Invalid matrix data\00", align 1
  41. @.str.23 = private unnamed_addr constant [45 x i8] c"Invalid matrix dimensions for multiplication\00", align 1
  42. @.str.24 = private unnamed_addr constant [42 x i8] c"Integer overflow in matrix multiplication\00", align 1
  43. @insertNode.maxDepth = internal global i32 0, align 4
  44. @.str.25 = private unnamed_addr constant [38 x i8] c"Memory allocation failed for new node\00", align 1
  45. @.str.26 = private unnamed_addr constant [34 x i8] c"List exceeds maximum allowed size\00", align 1
  46. @calculationResult = internal global i32 0, align 4
  47. @.str.27 = private unnamed_addr constant [30 x i8] c"Final calculation result: %d\0A\00", align 1
  48. @.str.28 = private unnamed_addr constant [11 x i8] c"Error: %s\0A\00", align 1
  49. @.str.29 = private unnamed_addr constant [29 x i8] c"Error during array push: %s\0A\00", align 1
  50. @.str.30 = private unnamed_addr constant [33 x i8] c"Error during list insertion: %s\0A\00", align 1
  51. @.str.31 = private unnamed_addr constant [43 x i8] c"Circular reference detected in linked list\00", align 1
  52. @.str.32 = private unnamed_addr constant [22 x i8] c"Invalid point weights\00", align 1
  53. @.str.33 = private unnamed_addr constant [31 x i8] c"Coordinates out of valid range\00", align 1
  54. @.str.34 = private unnamed_addr constant [30 x i8] c"Distance calculation overflow\00", align 1
  55. @.str.35 = private unnamed_addr constant [36 x i8] c"Invalid distance calculation result\00", align 1
  56. @.str.36 = private unnamed_addr constant [15 x i8] c"Invalid circle\00", align 1
  57. @.str.37 = private unnamed_addr constant [22 x i8] c"Invalid circle radius\00", align 1
  58. @.str.38 = private unnamed_addr constant [24 x i8] c"Circle radius too large\00", align 1
  59. @.str.39 = private unnamed_addr constant [45 x i8] c"Circle center coordinates out of valid range\00", align 1
  60. @.str.40 = private unnamed_addr constant [26 x i8] c"Area calculation overflow\00", align 1
  61. @.str.41 = private unnamed_addr constant [9 x i8] c"standard\00", align 1
  62. @.str.42 = private unnamed_addr constant [9 x i8] c"weighted\00", align 1
  63. @.str.43 = private unnamed_addr constant [35 x i8] c"Invalid weight for weighted circle\00", align 1
  64. @.str.44 = private unnamed_addr constant [20 x i8] c"Unknown circle type\00", align 1
  65. @.str.45 = private unnamed_addr constant [17 x i8] c"Null matrix data\00", align 1
  66. @.str.46 = private unnamed_addr constant [28 x i8] c"Matrix dimensions too large\00", align 1
  67. @.str.47 = private unnamed_addr constant [27 x i8] c"Invalid matrix row pointer\00", align 1
  68. @.str.48 = private unnamed_addr constant [32 x i8] c"Inconsistent square matrix flag\00", align 1
  69. @.str.49 = private unnamed_addr constant [14 x i8] c"Invalid array\00", align 1
  70. @.str.50 = private unnamed_addr constant [21 x i8] c"Invalid points array\00", align 1
  71. @.str.51 = private unnamed_addr constant [16 x i8] c"Too many points\00", align 1
  72. @.str.52 = private unnamed_addr constant [39 x i8] c"Failed to allocate memory for centroid\00", align 1
  73. @.str.53 = private unnamed_addr constant [21 x i8] c"Invalid point weight\00", align 1
  74. @.str.54 = private unnamed_addr constant [30 x i8] c"Centroid calculation overflow\00", align 1
  75. @.str.55 = private unnamed_addr constant [21 x i8] c"Total weight is zero\00", align 1
  76. @.str.56 = private unnamed_addr constant [9 x i8] c"Centroid\00", align 1
  77. ; Function Attrs: noinline nounwind optnone uwtable
  78. define dso_local i8* @getErrorMessage() #0 {
  79. %1 = load i8*, i8** @globalErrorMessage, align 8
  80. %2 = icmp ne i8* %1, null
  81. br i1 %2, label %3, label %5
  82. 3: ; preds = %0
  83. %4 = load i8*, i8** @globalErrorMessage, align 8
  84. br label %6
  85. 5: ; preds = %0
  86. br label %6
  87. 6: ; preds = %5, %3
  88. %7 = phi i8* [ %4, %3 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %5 ]
  89. ret i8* %7
  90. }
  91. ; Function Attrs: noinline nounwind optnone uwtable
  92. define dso_local void @setErrorMessage(i8* %0) #0 {
  93. %2 = alloca i8*, align 8
  94. store i8* %0, i8** %2, align 8
  95. %3 = load i8*, i8** @globalErrorMessage, align 8
  96. %4 = icmp ne i8* %3, null
  97. br i1 %4, label %5, label %7
  98. 5: ; preds = %1
  99. %6 = load i8*, i8** @globalErrorMessage, align 8
  100. call void @free(i8* %6) #6
  101. br label %7
  102. 7: ; preds = %5, %1
  103. %8 = load i8*, i8** %2, align 8
  104. %9 = icmp ne i8* %8, null
  105. br i1 %9, label %10, label %19
  106. 10: ; preds = %7
  107. %11 = load i8*, i8** %2, align 8
  108. %12 = call noalias i8* @strdup(i8* %11) #6
  109. store i8* %12, i8** @globalErrorMessage, align 8
  110. %13 = load i8*, i8** @globalErrorMessage, align 8
  111. %14 = icmp eq i8* %13, null
  112. br i1 %14, label %15, label %18
  113. 15: ; preds = %10
  114. %16 = load %struct._IO_FILE*, %struct._IO_FILE** @stderr, align 8
  115. %17 = call i32 (%struct._IO_FILE*, i8*, ...) @fprintf(%struct._IO_FILE* %16, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
  116. br label %18
  117. 18: ; preds = %15, %10
  118. br label %20
  119. 19: ; preds = %7
  120. store i8* null, i8** @globalErrorMessage, align 8
  121. br label %20
  122. 20: ; preds = %19, %18
  123. ret void
  124. }
  125. ; Function Attrs: nounwind
  126. declare dso_local void @free(i8*) #1
  127. ; Function Attrs: nounwind
  128. declare dso_local noalias i8* @strdup(i8*) #1
  129. declare dso_local i32 @fprintf(%struct._IO_FILE*, i8*, ...) #2
  130. ; Function Attrs: noinline nounwind optnone uwtable
  131. define dso_local i32 @factorial(i32 %0) #0 {
  132. %2 = alloca i32, align 4
  133. %3 = alloca i32, align 4
  134. %4 = alloca i32, align 4
  135. %5 = alloca i32, align 4
  136. store i32 %0, i32* %3, align 4
  137. %6 = load i32, i32* @recursionDepth, align 4
  138. %7 = add nsw i32 %6, 1
  139. store i32 %7, i32* @recursionDepth, align 4
  140. %8 = icmp sgt i32 %7, 1000
  141. br i1 %8, label %9, label %12
  142. 9: ; preds = %1
  143. call void @setErrorMessage(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
  144. %10 = load i32, i32* @recursionDepth, align 4
  145. %11 = add nsw i32 %10, -1
  146. store i32 %11, i32* @recursionDepth, align 4
  147. store i32 -1, i32* %2, align 4
  148. br label %53
  149. 12: ; preds = %1
  150. %13 = load i32, i32* %3, align 4
  151. %14 = icmp slt i32 %13, 0
  152. br i1 %14, label %15, label %18
  153. 15: ; preds = %12
  154. call void @setErrorMessage(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
  155. %16 = load i32, i32* @recursionDepth, align 4
  156. %17 = add nsw i32 %16, -1
  157. store i32 %17, i32* @recursionDepth, align 4
  158. store i32 -1, i32* %2, align 4
  159. br label %53
  160. 18: ; preds = %12
  161. %19 = load i32, i32* %3, align 4
  162. %20 = icmp sgt i32 %19, 20
  163. br i1 %20, label %21, label %24
  164. 21: ; preds = %18
  165. call void @setErrorMessage(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
  166. %22 = load i32, i32* @recursionDepth, align 4
  167. %23 = add nsw i32 %22, -1
  168. store i32 %23, i32* @recursionDepth, align 4
  169. store i32 -1, i32* %2, align 4
  170. br label %53
  171. 24: ; preds = %18
  172. %25 = load i32, i32* %3, align 4
  173. %26 = icmp sle i32 %25, 1
  174. br i1 %26, label %27, label %28
  175. 27: ; preds = %24
  176. store i32 1, i32* %4, align 4
  177. br label %49
  178. 28: ; preds = %24
  179. %29 = load i32, i32* %3, align 4
  180. %30 = sub nsw i32 %29, 1
  181. %31 = call i32 @factorial(i32 %30)
  182. store i32 %31, i32* %5, align 4
  183. %32 = load i32, i32* %5, align 4
  184. %33 = icmp eq i32 %32, -1
  185. br i1 %33, label %34, label %37
  186. 34: ; preds = %28
  187. %35 = load i32, i32* @recursionDepth, align 4
  188. %36 = add nsw i32 %35, -1
  189. store i32 %36, i32* @recursionDepth, align 4
  190. store i32 -1, i32* %2, align 4
  191. br label %53
  192. 37: ; preds = %28
  193. %38 = load i32, i32* %5, align 4
  194. %39 = load i32, i32* %3, align 4
  195. %40 = sdiv i32 2147483647, %39
  196. %41 = icmp sgt i32 %38, %40
  197. br i1 %41, label %42, label %45
  198. 42: ; preds = %37
  199. call void @setErrorMessage(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
  200. %43 = load i32, i32* @recursionDepth, align 4
  201. %44 = add nsw i32 %43, -1
  202. store i32 %44, i32* @recursionDepth, align 4
  203. store i32 -1, i32* %2, align 4
  204. br label %53
  205. 45: ; preds = %37
  206. %46 = load i32, i32* %3, align 4
  207. %47 = load i32, i32* %5, align 4
  208. %48 = mul nsw i32 %46, %47
  209. store i32 %48, i32* %4, align 4
  210. br label %49
  211. 49: ; preds = %45, %27
  212. %50 = load i32, i32* @recursionDepth, align 4
  213. %51 = add nsw i32 %50, -1
  214. store i32 %51, i32* @recursionDepth, align 4
  215. %52 = load i32, i32* %4, align 4
  216. store i32 %52, i32* %2, align 4
  217. br label %53
  218. 53: ; preds = %49, %42, %34, %21, %15, %9
  219. %54 = load i32, i32* %2, align 4
  220. ret i32 %54
  221. }
  222. ; Function Attrs: noinline nounwind optnone uwtable
  223. define dso_local %struct.DynamicArray* @createDynamicArray(i32 %0) #0 {
  224. %2 = alloca %struct.DynamicArray*, align 8
  225. %3 = alloca i32, align 4
  226. %4 = alloca %struct.DynamicArray*, align 8
  227. store i32 %0, i32* %3, align 4
  228. %5 = load i32, i32* %3, align 4
  229. %6 = icmp sle i32 %5, 0
  230. br i1 %6, label %7, label %8
  231. 7: ; preds = %1
  232. call void @setErrorMessage(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
  233. store %struct.DynamicArray* null, %struct.DynamicArray** %2, align 8
  234. br label %44
  235. 8: ; preds = %1
  236. %9 = load i32, i32* %3, align 4
  237. %10 = icmp sgt i32 %9, 1000
  238. br i1 %10, label %11, label %12
  239. 11: ; preds = %8
  240. call void @setErrorMessage(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.7, i64 0, i64 0))
  241. store %struct.DynamicArray* null, %struct.DynamicArray** %2, align 8
  242. br label %44
  243. 12: ; preds = %8
  244. %13 = call noalias i8* @malloc(i64 24) #6
  245. %14 = bitcast i8* %13 to %struct.DynamicArray*
  246. store %struct.DynamicArray* %14, %struct.DynamicArray** %4, align 8
  247. %15 = load %struct.DynamicArray*, %struct.DynamicArray** %4, align 8
  248. %16 = icmp ne %struct.DynamicArray* %15, null
  249. br i1 %16, label %18, label %17
  250. 17: ; preds = %12
  251. call void @setErrorMessage(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.8, i64 0, i64 0))
  252. store %struct.DynamicArray* null, %struct.DynamicArray** %2, align 8
  253. br label %44
  254. 18: ; preds = %12
  255. %19 = load i32, i32* %3, align 4
  256. %20 = sext i32 %19 to i64
  257. %21 = mul i64 4, %20
  258. %22 = call noalias i8* @malloc(i64 %21) #6
  259. %23 = bitcast i8* %22 to i32*
  260. %24 = load %struct.DynamicArray*, %struct.DynamicArray** %4, align 8
  261. %25 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %24, i32 0, i32 0
  262. store i32* %23, i32** %25, align 8
  263. %26 = load %struct.DynamicArray*, %struct.DynamicArray** %4, align 8
  264. %27 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %26, i32 0, i32 0
  265. %28 = load i32*, i32** %27, align 8
  266. %29 = icmp ne i32* %28, null
  267. br i1 %29, label %33, label %30
  268. 30: ; preds = %18
  269. %31 = load %struct.DynamicArray*, %struct.DynamicArray** %4, align 8
  270. %32 = bitcast %struct.DynamicArray* %31 to i8*
  271. call void @free(i8* %32) #6
  272. call void @setErrorMessage(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0))
  273. store %struct.DynamicArray* null, %struct.DynamicArray** %2, align 8
  274. br label %44
  275. 33: ; preds = %18
  276. %34 = load %struct.DynamicArray*, %struct.DynamicArray** %4, align 8
  277. %35 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %34, i32 0, i32 1
  278. store i32 0, i32* %35, align 8
  279. %36 = load i32, i32* %3, align 4
  280. %37 = load %struct.DynamicArray*, %struct.DynamicArray** %4, align 8
  281. %38 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %37, i32 0, i32 2
  282. store i32 %36, i32* %38, align 4
  283. %39 = load %struct.DynamicArray*, %struct.DynamicArray** %4, align 8
  284. %40 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %39, i32 0, i32 3
  285. store i32 1, i32* %40, align 8
  286. %41 = load %struct.DynamicArray*, %struct.DynamicArray** %4, align 8
  287. %42 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %41, i32 0, i32 4
  288. store i32 0, i32* %42, align 4
  289. %43 = load %struct.DynamicArray*, %struct.DynamicArray** %4, align 8
  290. store %struct.DynamicArray* %43, %struct.DynamicArray** %2, align 8
  291. br label %44
  292. 44: ; preds = %33, %30, %17, %11, %7
  293. %45 = load %struct.DynamicArray*, %struct.DynamicArray** %2, align 8
  294. ret %struct.DynamicArray* %45
  295. }
  296. ; Function Attrs: nounwind
  297. declare dso_local noalias i8* @malloc(i64) #1
  298. ; Function Attrs: noinline nounwind optnone uwtable
  299. define dso_local void @pushBack(%struct.DynamicArray* %0, i32 %1) #0 {
  300. %3 = alloca %struct.DynamicArray*, align 8
  301. %4 = alloca i32, align 4
  302. %5 = alloca i32, align 4
  303. %6 = alloca i32*, align 8
  304. store %struct.DynamicArray* %0, %struct.DynamicArray** %3, align 8
  305. store i32 %1, i32* %4, align 4
  306. %7 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  307. %8 = icmp ne %struct.DynamicArray* %7, null
  308. br i1 %8, label %10, label %9
  309. 9: ; preds = %2
  310. call void @setErrorMessage(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0))
  311. br label %91
  312. 10: ; preds = %2
  313. %11 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  314. %12 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %11, i32 0, i32 1
  315. %13 = load i32, i32* %12, align 8
  316. %14 = icmp sge i32 %13, 1000
  317. br i1 %14, label %15, label %16
  318. 15: ; preds = %10
  319. call void @setErrorMessage(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.11, i64 0, i64 0))
  320. br label %91
  321. 16: ; preds = %10
  322. %17 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  323. %18 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %17, i32 0, i32 1
  324. %19 = load i32, i32* %18, align 8
  325. %20 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  326. %21 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %20, i32 0, i32 2
  327. %22 = load i32, i32* %21, align 4
  328. %23 = icmp sge i32 %19, %22
  329. br i1 %23, label %24, label %52
  330. 24: ; preds = %16
  331. %25 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  332. %26 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %25, i32 0, i32 2
  333. %27 = load i32, i32* %26, align 4
  334. %28 = mul nsw i32 %27, 2
  335. store i32 %28, i32* %5, align 4
  336. %29 = load i32, i32* %5, align 4
  337. %30 = icmp sgt i32 %29, 1000
  338. br i1 %30, label %31, label %32
  339. 31: ; preds = %24
  340. store i32 1000, i32* %5, align 4
  341. br label %32
  342. 32: ; preds = %31, %24
  343. %33 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  344. %34 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %33, i32 0, i32 0
  345. %35 = load i32*, i32** %34, align 8
  346. %36 = bitcast i32* %35 to i8*
  347. %37 = load i32, i32* %5, align 4
  348. %38 = sext i32 %37 to i64
  349. %39 = mul i64 4, %38
  350. %40 = call i8* @realloc(i8* %36, i64 %39) #6
  351. %41 = bitcast i8* %40 to i32*
  352. store i32* %41, i32** %6, align 8
  353. %42 = load i32*, i32** %6, align 8
  354. %43 = icmp ne i32* %42, null
  355. br i1 %43, label %45, label %44
  356. 44: ; preds = %32
  357. call void @setErrorMessage(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0))
  358. br label %91
  359. 45: ; preds = %32
  360. %46 = load i32*, i32** %6, align 8
  361. %47 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  362. %48 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %47, i32 0, i32 0
  363. store i32* %46, i32** %48, align 8
  364. %49 = load i32, i32* %5, align 4
  365. %50 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  366. %51 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %50, i32 0, i32 2
  367. store i32 %49, i32* %51, align 4
  368. br label %52
  369. 52: ; preds = %45, %16
  370. %53 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  371. %54 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %53, i32 0, i32 3
  372. %55 = load i32, i32* %54, align 8
  373. %56 = icmp ne i32 %55, 0
  374. br i1 %56, label %57, label %78
  375. 57: ; preds = %52
  376. %58 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  377. %59 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %58, i32 0, i32 1
  378. %60 = load i32, i32* %59, align 8
  379. %61 = icmp sgt i32 %60, 0
  380. br i1 %61, label %62, label %78
  381. 62: ; preds = %57
  382. %63 = load i32, i32* %4, align 4
  383. %64 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  384. %65 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %64, i32 0, i32 0
  385. %66 = load i32*, i32** %65, align 8
  386. %67 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  387. %68 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %67, i32 0, i32 1
  388. %69 = load i32, i32* %68, align 8
  389. %70 = sub nsw i32 %69, 1
  390. %71 = sext i32 %70 to i64
  391. %72 = getelementptr inbounds i32, i32* %66, i64 %71
  392. %73 = load i32, i32* %72, align 4
  393. %74 = icmp slt i32 %63, %73
  394. br i1 %74, label %75, label %78
  395. 75: ; preds = %62
  396. %76 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  397. %77 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %76, i32 0, i32 3
  398. store i32 0, i32* %77, align 8
  399. br label %78
  400. 78: ; preds = %75, %62, %57, %52
  401. %79 = load i32, i32* %4, align 4
  402. %80 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  403. %81 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %80, i32 0, i32 0
  404. %82 = load i32*, i32** %81, align 8
  405. %83 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  406. %84 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %83, i32 0, i32 1
  407. %85 = load i32, i32* %84, align 8
  408. %86 = add nsw i32 %85, 1
  409. store i32 %86, i32* %84, align 8
  410. %87 = sext i32 %85 to i64
  411. %88 = getelementptr inbounds i32, i32* %82, i64 %87
  412. store i32 %79, i32* %88, align 4
  413. %89 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  414. %90 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %89, i32 0, i32 4
  415. store i32 1, i32* %90, align 4
  416. br label %91
  417. 91: ; preds = %78, %44, %15, %9
  418. ret void
  419. }
  420. ; Function Attrs: nounwind
  421. declare dso_local i8* @realloc(i8*, i64) #1
  422. ; Function Attrs: noinline nounwind optnone uwtable
  423. define dso_local void @quickSort(i32* %0, i32 %1, i32 %2, i32* %3) #0 {
  424. %5 = alloca i32*, align 8
  425. %6 = alloca i32, align 4
  426. %7 = alloca i32, align 4
  427. %8 = alloca i32*, align 8
  428. %9 = alloca i32, align 4
  429. %10 = alloca i32, align 4
  430. %11 = alloca i32, align 4
  431. %12 = alloca i32, align 4
  432. %13 = alloca i32, align 4
  433. %14 = alloca i32, align 4
  434. store i32* %0, i32** %5, align 8
  435. store i32 %1, i32* %6, align 4
  436. store i32 %2, i32* %7, align 4
  437. store i32* %3, i32** %8, align 8
  438. %15 = load i32, i32* @recursionDepth, align 4
  439. %16 = add nsw i32 %15, 1
  440. store i32 %16, i32* @recursionDepth, align 4
  441. %17 = icmp sgt i32 %16, 1000
  442. br i1 %17, label %18, label %22
  443. 18: ; preds = %4
  444. call void @setErrorMessage(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.13, i64 0, i64 0))
  445. %19 = load i32*, i32** %8, align 8
  446. store i32 1, i32* %19, align 4
  447. %20 = load i32, i32* @recursionDepth, align 4
  448. %21 = add nsw i32 %20, -1
  449. store i32 %21, i32* @recursionDepth, align 4
  450. br label %247
  451. 22: ; preds = %4
  452. %23 = load i32*, i32** %5, align 8
  453. %24 = icmp ne i32* %23, null
  454. br i1 %24, label %29, label %25
  455. 25: ; preds = %22
  456. call void @setErrorMessage(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.14, i64 0, i64 0))
  457. %26 = load i32*, i32** %8, align 8
  458. store i32 1, i32* %26, align 4
  459. %27 = load i32, i32* @recursionDepth, align 4
  460. %28 = add nsw i32 %27, -1
  461. store i32 %28, i32* @recursionDepth, align 4
  462. br label %247
  463. 29: ; preds = %22
  464. %30 = load i32, i32* %6, align 4
  465. %31 = icmp slt i32 %30, 0
  466. br i1 %31, label %41, label %32
  467. 32: ; preds = %29
  468. %33 = load i32, i32* %7, align 4
  469. %34 = icmp slt i32 %33, 0
  470. br i1 %34, label %41, label %35
  471. 35: ; preds = %32
  472. %36 = load i32, i32* %6, align 4
  473. %37 = icmp sge i32 %36, 1000
  474. br i1 %37, label %41, label %38
  475. 38: ; preds = %35
  476. %39 = load i32, i32* %7, align 4
  477. %40 = icmp sge i32 %39, 1000
  478. br i1 %40, label %41, label %45
  479. 41: ; preds = %38, %35, %32, %29
  480. call void @setErrorMessage(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.15, i64 0, i64 0))
  481. %42 = load i32*, i32** %8, align 8
  482. store i32 1, i32* %42, align 4
  483. %43 = load i32, i32* @recursionDepth, align 4
  484. %44 = add nsw i32 %43, -1
  485. store i32 %44, i32* @recursionDepth, align 4
  486. br label %247
  487. 45: ; preds = %38
  488. %46 = load i32, i32* %6, align 4
  489. %47 = load i32, i32* %7, align 4
  490. %48 = icmp slt i32 %46, %47
  491. br i1 %48, label %49, label %244
  492. 49: ; preds = %45
  493. %50 = load i32, i32* %6, align 4
  494. %51 = load i32, i32* %7, align 4
  495. %52 = load i32, i32* %6, align 4
  496. %53 = sub nsw i32 %51, %52
  497. %54 = sdiv i32 %53, 2
  498. %55 = add nsw i32 %50, %54
  499. store i32 %55, i32* %9, align 4
  500. %56 = load i32*, i32** %5, align 8
  501. %57 = load i32, i32* %6, align 4
  502. %58 = sext i32 %57 to i64
  503. %59 = getelementptr inbounds i32, i32* %56, i64 %58
  504. %60 = load i32, i32* %59, align 4
  505. %61 = load i32*, i32** %5, align 8
  506. %62 = load i32, i32* %9, align 4
  507. %63 = sext i32 %62 to i64
  508. %64 = getelementptr inbounds i32, i32* %61, i64 %63
  509. %65 = load i32, i32* %64, align 4
  510. %66 = icmp sle i32 %60, %65
  511. br i1 %66, label %67, label %99
  512. 67: ; preds = %49
  513. %68 = load i32*, i32** %5, align 8
  514. %69 = load i32, i32* %9, align 4
  515. %70 = sext i32 %69 to i64
  516. %71 = getelementptr inbounds i32, i32* %68, i64 %70
  517. %72 = load i32, i32* %71, align 4
  518. %73 = load i32*, i32** %5, align 8
  519. %74 = load i32, i32* %7, align 4
  520. %75 = sext i32 %74 to i64
  521. %76 = getelementptr inbounds i32, i32* %73, i64 %75
  522. %77 = load i32, i32* %76, align 4
  523. %78 = icmp sle i32 %72, %77
  524. br i1 %78, label %79, label %81
  525. 79: ; preds = %67
  526. %80 = load i32, i32* %9, align 4
  527. store i32 %80, i32* %10, align 4
  528. br label %98
  529. 81: ; preds = %67
  530. %82 = load i32*, i32** %5, align 8
  531. %83 = load i32, i32* %6, align 4
  532. %84 = sext i32 %83 to i64
  533. %85 = getelementptr inbounds i32, i32* %82, i64 %84
  534. %86 = load i32, i32* %85, align 4
  535. %87 = load i32*, i32** %5, align 8
  536. %88 = load i32, i32* %7, align 4
  537. %89 = sext i32 %88 to i64
  538. %90 = getelementptr inbounds i32, i32* %87, i64 %89
  539. %91 = load i32, i32* %90, align 4
  540. %92 = icmp sle i32 %86, %91
  541. br i1 %92, label %93, label %95
  542. 93: ; preds = %81
  543. %94 = load i32, i32* %7, align 4
  544. store i32 %94, i32* %10, align 4
  545. br label %97
  546. 95: ; preds = %81
  547. %96 = load i32, i32* %6, align 4
  548. store i32 %96, i32* %10, align 4
  549. br label %97
  550. 97: ; preds = %95, %93
  551. br label %98
  552. 98: ; preds = %97, %79
  553. br label %131
  554. 99: ; preds = %49
  555. %100 = load i32*, i32** %5, align 8
  556. %101 = load i32, i32* %6, align 4
  557. %102 = sext i32 %101 to i64
  558. %103 = getelementptr inbounds i32, i32* %100, i64 %102
  559. %104 = load i32, i32* %103, align 4
  560. %105 = load i32*, i32** %5, align 8
  561. %106 = load i32, i32* %7, align 4
  562. %107 = sext i32 %106 to i64
  563. %108 = getelementptr inbounds i32, i32* %105, i64 %107
  564. %109 = load i32, i32* %108, align 4
  565. %110 = icmp sle i32 %104, %109
  566. br i1 %110, label %111, label %113
  567. 111: ; preds = %99
  568. %112 = load i32, i32* %6, align 4
  569. store i32 %112, i32* %10, align 4
  570. br label %130
  571. 113: ; preds = %99
  572. %114 = load i32*, i32** %5, align 8
  573. %115 = load i32, i32* %9, align 4
  574. %116 = sext i32 %115 to i64
  575. %117 = getelementptr inbounds i32, i32* %114, i64 %116
  576. %118 = load i32, i32* %117, align 4
  577. %119 = load i32*, i32** %5, align 8
  578. %120 = load i32, i32* %7, align 4
  579. %121 = sext i32 %120 to i64
  580. %122 = getelementptr inbounds i32, i32* %119, i64 %121
  581. %123 = load i32, i32* %122, align 4
  582. %124 = icmp sle i32 %118, %123
  583. br i1 %124, label %125, label %127
  584. 125: ; preds = %113
  585. %126 = load i32, i32* %7, align 4
  586. store i32 %126, i32* %10, align 4
  587. br label %129
  588. 127: ; preds = %113
  589. %128 = load i32, i32* %9, align 4
  590. store i32 %128, i32* %10, align 4
  591. br label %129
  592. 129: ; preds = %127, %125
  593. br label %130
  594. 130: ; preds = %129, %111
  595. br label %131
  596. 131: ; preds = %130, %98
  597. %132 = load i32*, i32** %5, align 8
  598. %133 = load i32, i32* %7, align 4
  599. %134 = sext i32 %133 to i64
  600. %135 = getelementptr inbounds i32, i32* %132, i64 %134
  601. %136 = load i32, i32* %135, align 4
  602. store i32 %136, i32* %11, align 4
  603. %137 = load i32*, i32** %5, align 8
  604. %138 = load i32, i32* %10, align 4
  605. %139 = sext i32 %138 to i64
  606. %140 = getelementptr inbounds i32, i32* %137, i64 %139
  607. %141 = load i32, i32* %140, align 4
  608. %142 = load i32*, i32** %5, align 8
  609. %143 = load i32, i32* %7, align 4
  610. %144 = sext i32 %143 to i64
  611. %145 = getelementptr inbounds i32, i32* %142, i64 %144
  612. store i32 %141, i32* %145, align 4
  613. %146 = load i32, i32* %11, align 4
  614. %147 = load i32*, i32** %5, align 8
  615. %148 = load i32, i32* %10, align 4
  616. %149 = sext i32 %148 to i64
  617. %150 = getelementptr inbounds i32, i32* %147, i64 %149
  618. store i32 %146, i32* %150, align 4
  619. %151 = load i32*, i32** %5, align 8
  620. %152 = load i32, i32* %7, align 4
  621. %153 = sext i32 %152 to i64
  622. %154 = getelementptr inbounds i32, i32* %151, i64 %153
  623. %155 = load i32, i32* %154, align 4
  624. store i32 %155, i32* %12, align 4
  625. %156 = load i32, i32* %6, align 4
  626. %157 = sub nsw i32 %156, 1
  627. store i32 %157, i32* %13, align 4
  628. %158 = load i32, i32* %6, align 4
  629. store i32 %158, i32* %14, align 4
  630. br label %159
  631. 159: ; preds = %196, %131
  632. %160 = load i32, i32* %14, align 4
  633. %161 = load i32, i32* %7, align 4
  634. %162 = icmp slt i32 %160, %161
  635. br i1 %162, label %163, label %199
  636. 163: ; preds = %159
  637. %164 = load i32*, i32** %5, align 8
  638. %165 = load i32, i32* %14, align 4
  639. %166 = sext i32 %165 to i64
  640. %167 = getelementptr inbounds i32, i32* %164, i64 %166
  641. %168 = load i32, i32* %167, align 4
  642. %169 = load i32, i32* %12, align 4
  643. %170 = icmp sle i32 %168, %169
  644. br i1 %170, label %171, label %195
  645. 171: ; preds = %163
  646. %172 = load i32, i32* %13, align 4
  647. %173 = add nsw i32 %172, 1
  648. store i32 %173, i32* %13, align 4
  649. %174 = load i32*, i32** %5, align 8
  650. %175 = load i32, i32* %13, align 4
  651. %176 = sext i32 %175 to i64
  652. %177 = getelementptr inbounds i32, i32* %174, i64 %176
  653. %178 = load i32, i32* %177, align 4
  654. store i32 %178, i32* %11, align 4
  655. %179 = load i32*, i32** %5, align 8
  656. %180 = load i32, i32* %14, align 4
  657. %181 = sext i32 %180 to i64
  658. %182 = getelementptr inbounds i32, i32* %179, i64 %181
  659. %183 = load i32, i32* %182, align 4
  660. %184 = load i32*, i32** %5, align 8
  661. %185 = load i32, i32* %13, align 4
  662. %186 = sext i32 %185 to i64
  663. %187 = getelementptr inbounds i32, i32* %184, i64 %186
  664. store i32 %183, i32* %187, align 4
  665. %188 = load i32, i32* %11, align 4
  666. %189 = load i32*, i32** %5, align 8
  667. %190 = load i32, i32* %14, align 4
  668. %191 = sext i32 %190 to i64
  669. %192 = getelementptr inbounds i32, i32* %189, i64 %191
  670. store i32 %188, i32* %192, align 4
  671. %193 = load i32, i32* @globalCounter, align 4
  672. %194 = add nsw i32 %193, 1
  673. store i32 %194, i32* @globalCounter, align 4
  674. br label %195
  675. 195: ; preds = %171, %163
  676. br label %196
  677. 196: ; preds = %195
  678. %197 = load i32, i32* %14, align 4
  679. %198 = add nsw i32 %197, 1
  680. store i32 %198, i32* %14, align 4
  681. br label %159
  682. 199: ; preds = %159
  683. %200 = load i32*, i32** %5, align 8
  684. %201 = load i32, i32* %13, align 4
  685. %202 = add nsw i32 %201, 1
  686. %203 = sext i32 %202 to i64
  687. %204 = getelementptr inbounds i32, i32* %200, i64 %203
  688. %205 = load i32, i32* %204, align 4
  689. store i32 %205, i32* %11, align 4
  690. %206 = load i32*, i32** %5, align 8
  691. %207 = load i32, i32* %7, align 4
  692. %208 = sext i32 %207 to i64
  693. %209 = getelementptr inbounds i32, i32* %206, i64 %208
  694. %210 = load i32, i32* %209, align 4
  695. %211 = load i32*, i32** %5, align 8
  696. %212 = load i32, i32* %13, align 4
  697. %213 = add nsw i32 %212, 1
  698. %214 = sext i32 %213 to i64
  699. %215 = getelementptr inbounds i32, i32* %211, i64 %214
  700. store i32 %210, i32* %215, align 4
  701. %216 = load i32, i32* %11, align 4
  702. %217 = load i32*, i32** %5, align 8
  703. %218 = load i32, i32* %7, align 4
  704. %219 = sext i32 %218 to i64
  705. %220 = getelementptr inbounds i32, i32* %217, i64 %219
  706. store i32 %216, i32* %220, align 4
  707. %221 = load i32*, i32** %5, align 8
  708. %222 = load i32, i32* %6, align 4
  709. %223 = load i32, i32* %13, align 4
  710. %224 = load i32*, i32** %8, align 8
  711. call void @quickSort(i32* %221, i32 %222, i32 %223, i32* %224)
  712. %225 = load i32*, i32** %8, align 8
  713. %226 = load i32, i32* %225, align 4
  714. %227 = icmp ne i32 %226, 0
  715. br i1 %227, label %228, label %231
  716. 228: ; preds = %199
  717. %229 = load i32, i32* @recursionDepth, align 4
  718. %230 = add nsw i32 %229, -1
  719. store i32 %230, i32* @recursionDepth, align 4
  720. br label %247
  721. 231: ; preds = %199
  722. %232 = load i32*, i32** %5, align 8
  723. %233 = load i32, i32* %13, align 4
  724. %234 = add nsw i32 %233, 2
  725. %235 = load i32, i32* %7, align 4
  726. %236 = load i32*, i32** %8, align 8
  727. call void @quickSort(i32* %232, i32 %234, i32 %235, i32* %236)
  728. %237 = load i32*, i32** %8, align 8
  729. %238 = load i32, i32* %237, align 4
  730. %239 = icmp ne i32 %238, 0
  731. br i1 %239, label %240, label %243
  732. 240: ; preds = %231
  733. %241 = load i32, i32* @recursionDepth, align 4
  734. %242 = add nsw i32 %241, -1
  735. store i32 %242, i32* @recursionDepth, align 4
  736. br label %247
  737. 243: ; preds = %231
  738. br label %244
  739. 244: ; preds = %243, %45
  740. %245 = load i32, i32* @recursionDepth, align 4
  741. %246 = add nsw i32 %245, -1
  742. store i32 %246, i32* @recursionDepth, align 4
  743. br label %247
  744. 247: ; preds = %244, %240, %228, %41, %25, %18
  745. ret void
  746. }
  747. ; Function Attrs: noinline nounwind optnone uwtable
  748. define dso_local %struct.Matrix* @createMatrix(i32 %0, i32 %1) #0 {
  749. %3 = alloca %struct.Matrix*, align 8
  750. %4 = alloca i32, align 4
  751. %5 = alloca i32, align 4
  752. %6 = alloca %struct.Matrix*, align 8
  753. %7 = alloca i32, align 4
  754. %8 = alloca i32, align 4
  755. store i32 %0, i32* %4, align 4
  756. store i32 %1, i32* %5, align 4
  757. %9 = load i32, i32* %4, align 4
  758. %10 = icmp slt i32 %9, 1
  759. br i1 %10, label %14, label %11
  760. 11: ; preds = %2
  761. %12 = load i32, i32* %5, align 4
  762. %13 = icmp slt i32 %12, 1
  763. br i1 %13, label %14, label %15
  764. 14: ; preds = %11, %2
  765. call void @setErrorMessage(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.16, i64 0, i64 0))
  766. store %struct.Matrix* null, %struct.Matrix** %3, align 8
  767. br label %111
  768. 15: ; preds = %11
  769. %16 = load i32, i32* %4, align 4
  770. %17 = icmp sgt i32 %16, 100
  771. br i1 %17, label %21, label %18
  772. 18: ; preds = %15
  773. %19 = load i32, i32* %5, align 4
  774. %20 = icmp sgt i32 %19, 100
  775. br i1 %20, label %21, label %22
  776. 21: ; preds = %18, %15
  777. call void @setErrorMessage(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.17, i64 0, i64 0))
  778. store %struct.Matrix* null, %struct.Matrix** %3, align 8
  779. br label %111
  780. 22: ; preds = %18
  781. %23 = call noalias i8* @malloc(i64 32) #6
  782. %24 = bitcast i8* %23 to %struct.Matrix*
  783. store %struct.Matrix* %24, %struct.Matrix** %6, align 8
  784. %25 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  785. %26 = icmp ne %struct.Matrix* %25, null
  786. br i1 %26, label %28, label %27
  787. 27: ; preds = %22
  788. call void @setErrorMessage(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.18, i64 0, i64 0))
  789. store %struct.Matrix* null, %struct.Matrix** %3, align 8
  790. br label %111
  791. 28: ; preds = %22
  792. %29 = load i32, i32* %4, align 4
  793. %30 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  794. %31 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %30, i32 0, i32 1
  795. store i32 %29, i32* %31, align 8
  796. %32 = load i32, i32* %5, align 4
  797. %33 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  798. %34 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %33, i32 0, i32 2
  799. store i32 %32, i32* %34, align 4
  800. %35 = load i32, i32* %4, align 4
  801. %36 = load i32, i32* %5, align 4
  802. %37 = icmp eq i32 %35, %36
  803. %38 = zext i1 %37 to i32
  804. %39 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  805. %40 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %39, i32 0, i32 3
  806. store i32 %38, i32* %40, align 8
  807. %41 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  808. %42 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %41, i32 0, i32 4
  809. store double 0.000000e+00, double* %42, align 8
  810. %43 = load i32, i32* %4, align 4
  811. %44 = sext i32 %43 to i64
  812. %45 = mul i64 %44, 8
  813. %46 = call noalias i8* @malloc(i64 %45) #6
  814. %47 = bitcast i8* %46 to i32**
  815. %48 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  816. %49 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %48, i32 0, i32 0
  817. store i32** %47, i32*** %49, align 8
  818. %50 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  819. %51 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %50, i32 0, i32 0
  820. %52 = load i32**, i32*** %51, align 8
  821. %53 = icmp ne i32** %52, null
  822. br i1 %53, label %57, label %54
  823. 54: ; preds = %28
  824. %55 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  825. %56 = bitcast %struct.Matrix* %55 to i8*
  826. call void @free(i8* %56) #6
  827. call void @setErrorMessage(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.19, i64 0, i64 0))
  828. store %struct.Matrix* null, %struct.Matrix** %3, align 8
  829. br label %111
  830. 57: ; preds = %28
  831. store i32 0, i32* %7, align 4
  832. br label %58
  833. 58: ; preds = %106, %57
  834. %59 = load i32, i32* %7, align 4
  835. %60 = load i32, i32* %4, align 4
  836. %61 = icmp slt i32 %59, %60
  837. br i1 %61, label %62, label %109
  838. 62: ; preds = %58
  839. %63 = load i32, i32* %5, align 4
  840. %64 = sext i32 %63 to i64
  841. %65 = call noalias i8* @calloc(i64 %64, i64 4) #6
  842. %66 = bitcast i8* %65 to i32*
  843. %67 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  844. %68 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %67, i32 0, i32 0
  845. %69 = load i32**, i32*** %68, align 8
  846. %70 = load i32, i32* %7, align 4
  847. %71 = sext i32 %70 to i64
  848. %72 = getelementptr inbounds i32*, i32** %69, i64 %71
  849. store i32* %66, i32** %72, align 8
  850. %73 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  851. %74 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %73, i32 0, i32 0
  852. %75 = load i32**, i32*** %74, align 8
  853. %76 = load i32, i32* %7, align 4
  854. %77 = sext i32 %76 to i64
  855. %78 = getelementptr inbounds i32*, i32** %75, i64 %77
  856. %79 = load i32*, i32** %78, align 8
  857. %80 = icmp ne i32* %79, null
  858. br i1 %80, label %105, label %81
  859. 81: ; preds = %62
  860. store i32 0, i32* %8, align 4
  861. br label %82
  862. 82: ; preds = %95, %81
  863. %83 = load i32, i32* %8, align 4
  864. %84 = load i32, i32* %7, align 4
  865. %85 = icmp slt i32 %83, %84
  866. br i1 %85, label %86, label %98
  867. 86: ; preds = %82
  868. %87 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  869. %88 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %87, i32 0, i32 0
  870. %89 = load i32**, i32*** %88, align 8
  871. %90 = load i32, i32* %8, align 4
  872. %91 = sext i32 %90 to i64
  873. %92 = getelementptr inbounds i32*, i32** %89, i64 %91
  874. %93 = load i32*, i32** %92, align 8
  875. %94 = bitcast i32* %93 to i8*
  876. call void @free(i8* %94) #6
  877. br label %95
  878. 95: ; preds = %86
  879. %96 = load i32, i32* %8, align 4
  880. %97 = add nsw i32 %96, 1
  881. store i32 %97, i32* %8, align 4
  882. br label %82
  883. 98: ; preds = %82
  884. %99 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  885. %100 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %99, i32 0, i32 0
  886. %101 = load i32**, i32*** %100, align 8
  887. %102 = bitcast i32** %101 to i8*
  888. call void @free(i8* %102) #6
  889. %103 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  890. %104 = bitcast %struct.Matrix* %103 to i8*
  891. call void @free(i8* %104) #6
  892. call void @setErrorMessage(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.20, i64 0, i64 0))
  893. store %struct.Matrix* null, %struct.Matrix** %3, align 8
  894. br label %111
  895. 105: ; preds = %62
  896. br label %106
  897. 106: ; preds = %105
  898. %107 = load i32, i32* %7, align 4
  899. %108 = add nsw i32 %107, 1
  900. store i32 %108, i32* %7, align 4
  901. br label %58
  902. 109: ; preds = %58
  903. %110 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  904. store %struct.Matrix* %110, %struct.Matrix** %3, align 8
  905. br label %111
  906. 111: ; preds = %109, %98, %54, %27, %21, %14
  907. %112 = load %struct.Matrix*, %struct.Matrix** %3, align 8
  908. ret %struct.Matrix* %112
  909. }
  910. ; Function Attrs: nounwind
  911. declare dso_local noalias i8* @calloc(i64, i64) #1
  912. ; Function Attrs: noinline nounwind optnone uwtable
  913. define dso_local %struct.Matrix* @multiplyMatrices(%struct.Matrix* %0, %struct.Matrix* %1) #0 {
  914. %3 = alloca %struct.Matrix*, align 8
  915. %4 = alloca %struct.Matrix*, align 8
  916. %5 = alloca %struct.Matrix*, align 8
  917. %6 = alloca %struct.Matrix*, align 8
  918. %7 = alloca i64, align 8
  919. %8 = alloca i32, align 4
  920. %9 = alloca i32, align 4
  921. %10 = alloca i64, align 8
  922. %11 = alloca i32, align 4
  923. %12 = alloca i64, align 8
  924. %13 = alloca i32, align 4
  925. store %struct.Matrix* %0, %struct.Matrix** %4, align 8
  926. store %struct.Matrix* %1, %struct.Matrix** %5, align 8
  927. %14 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  928. %15 = icmp ne %struct.Matrix* %14, null
  929. br i1 %15, label %16, label %19
  930. 16: ; preds = %2
  931. %17 = load %struct.Matrix*, %struct.Matrix** %5, align 8
  932. %18 = icmp ne %struct.Matrix* %17, null
  933. br i1 %18, label %20, label %19
  934. 19: ; preds = %16, %2
  935. call void @setErrorMessage(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.21, i64 0, i64 0))
  936. store %struct.Matrix* null, %struct.Matrix** %3, align 8
  937. br label %209
  938. 20: ; preds = %16
  939. %21 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  940. %22 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %21, i32 0, i32 0
  941. %23 = load i32**, i32*** %22, align 8
  942. %24 = icmp ne i32** %23, null
  943. br i1 %24, label %25, label %30
  944. 25: ; preds = %20
  945. %26 = load %struct.Matrix*, %struct.Matrix** %5, align 8
  946. %27 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %26, i32 0, i32 0
  947. %28 = load i32**, i32*** %27, align 8
  948. %29 = icmp ne i32** %28, null
  949. br i1 %29, label %31, label %30
  950. 30: ; preds = %25, %20
  951. call void @setErrorMessage(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.22, i64 0, i64 0))
  952. store %struct.Matrix* null, %struct.Matrix** %3, align 8
  953. br label %209
  954. 31: ; preds = %25
  955. %32 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  956. %33 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %32, i32 0, i32 2
  957. %34 = load i32, i32* %33, align 4
  958. %35 = load %struct.Matrix*, %struct.Matrix** %5, align 8
  959. %36 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %35, i32 0, i32 1
  960. %37 = load i32, i32* %36, align 8
  961. %38 = icmp ne i32 %34, %37
  962. br i1 %38, label %39, label %40
  963. 39: ; preds = %31
  964. call void @setErrorMessage(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.23, i64 0, i64 0))
  965. store %struct.Matrix* null, %struct.Matrix** %3, align 8
  966. br label %209
  967. 40: ; preds = %31
  968. %41 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  969. %42 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %41, i32 0, i32 2
  970. %43 = load i32, i32* %42, align 4
  971. %44 = icmp sgt i32 %43, 100
  972. br i1 %44, label %50, label %45
  973. 45: ; preds = %40
  974. %46 = load %struct.Matrix*, %struct.Matrix** %5, align 8
  975. %47 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %46, i32 0, i32 1
  976. %48 = load i32, i32* %47, align 8
  977. %49 = icmp sgt i32 %48, 100
  978. br i1 %49, label %50, label %51
  979. 50: ; preds = %45, %40
  980. call void @setErrorMessage(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.17, i64 0, i64 0))
  981. store %struct.Matrix* null, %struct.Matrix** %3, align 8
  982. br label %209
  983. 51: ; preds = %45
  984. %52 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  985. %53 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %52, i32 0, i32 1
  986. %54 = load i32, i32* %53, align 8
  987. %55 = load %struct.Matrix*, %struct.Matrix** %5, align 8
  988. %56 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %55, i32 0, i32 2
  989. %57 = load i32, i32* %56, align 4
  990. %58 = call %struct.Matrix* @createMatrix(i32 %54, i32 %57)
  991. store %struct.Matrix* %58, %struct.Matrix** %6, align 8
  992. %59 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  993. %60 = icmp ne %struct.Matrix* %59, null
  994. br i1 %60, label %62, label %61
  995. 61: ; preds = %51
  996. store %struct.Matrix* null, %struct.Matrix** %3, align 8
  997. br label %209
  998. 62: ; preds = %51
  999. store i64 0, i64* %7, align 8
  1000. store i32 0, i32* %8, align 4
  1001. br label %63
  1002. 63: ; preds = %194, %62
  1003. %64 = load i32, i32* %8, align 4
  1004. %65 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  1005. %66 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %65, i32 0, i32 1
  1006. %67 = load i32, i32* %66, align 8
  1007. %68 = icmp slt i32 %64, %67
  1008. br i1 %68, label %69, label %197
  1009. 69: ; preds = %63
  1010. store i32 0, i32* %9, align 4
  1011. br label %70
  1012. 70: ; preds = %190, %69
  1013. %71 = load i32, i32* %9, align 4
  1014. %72 = load %struct.Matrix*, %struct.Matrix** %5, align 8
  1015. %73 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %72, i32 0, i32 2
  1016. %74 = load i32, i32* %73, align 4
  1017. %75 = icmp slt i32 %71, %74
  1018. br i1 %75, label %76, label %193
  1019. 76: ; preds = %70
  1020. store i64 0, i64* %10, align 8
  1021. store i32 0, i32* %11, align 4
  1022. br label %77
  1023. 77: ; preds = %144, %76
  1024. %78 = load i32, i32* %11, align 4
  1025. %79 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  1026. %80 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %79, i32 0, i32 2
  1027. %81 = load i32, i32* %80, align 4
  1028. %82 = icmp slt i32 %78, %81
  1029. br i1 %82, label %83, label %147
  1030. 83: ; preds = %77
  1031. %84 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  1032. %85 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %84, i32 0, i32 0
  1033. %86 = load i32**, i32*** %85, align 8
  1034. %87 = load i32, i32* %8, align 4
  1035. %88 = sext i32 %87 to i64
  1036. %89 = getelementptr inbounds i32*, i32** %86, i64 %88
  1037. %90 = load i32*, i32** %89, align 8
  1038. %91 = load i32, i32* %11, align 4
  1039. %92 = sext i32 %91 to i64
  1040. %93 = getelementptr inbounds i32, i32* %90, i64 %92
  1041. %94 = load i32, i32* %93, align 4
  1042. %95 = sext i32 %94 to i64
  1043. %96 = load %struct.Matrix*, %struct.Matrix** %5, align 8
  1044. %97 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %96, i32 0, i32 0
  1045. %98 = load i32**, i32*** %97, align 8
  1046. %99 = load i32, i32* %11, align 4
  1047. %100 = sext i32 %99 to i64
  1048. %101 = getelementptr inbounds i32*, i32** %98, i64 %100
  1049. %102 = load i32*, i32** %101, align 8
  1050. %103 = load i32, i32* %9, align 4
  1051. %104 = sext i32 %103 to i64
  1052. %105 = getelementptr inbounds i32, i32* %102, i64 %104
  1053. %106 = load i32, i32* %105, align 4
  1054. %107 = sext i32 %106 to i64
  1055. %108 = mul nsw i64 %95, %107
  1056. store i64 %108, i64* %12, align 8
  1057. %109 = load i64, i64* %12, align 8
  1058. %110 = load i64, i64* %10, align 8
  1059. %111 = add nsw i64 %110, %109
  1060. store i64 %111, i64* %10, align 8
  1061. %112 = load i64, i64* %10, align 8
  1062. %113 = icmp sgt i64 %112, 2147483647
  1063. br i1 %113, label %117, label %114
  1064. 114: ; preds = %83
  1065. %115 = load i64, i64* %10, align 8
  1066. %116 = icmp slt i64 %115, -2147483648
  1067. br i1 %116, label %117, label %143
  1068. 117: ; preds = %114, %83
  1069. call void @setErrorMessage(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.24, i64 0, i64 0))
  1070. store i32 0, i32* %13, align 4
  1071. br label %118
  1072. 118: ; preds = %133, %117
  1073. %119 = load i32, i32* %13, align 4
  1074. %120 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  1075. %121 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %120, i32 0, i32 1
  1076. %122 = load i32, i32* %121, align 8
  1077. %123 = icmp slt i32 %119, %122
  1078. br i1 %123, label %124, label %136
  1079. 124: ; preds = %118
  1080. %125 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  1081. %126 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %125, i32 0, i32 0
  1082. %127 = load i32**, i32*** %126, align 8
  1083. %128 = load i32, i32* %13, align 4
  1084. %129 = sext i32 %128 to i64
  1085. %130 = getelementptr inbounds i32*, i32** %127, i64 %129
  1086. %131 = load i32*, i32** %130, align 8
  1087. %132 = bitcast i32* %131 to i8*
  1088. call void @free(i8* %132) #6
  1089. br label %133
  1090. 133: ; preds = %124
  1091. %134 = load i32, i32* %13, align 4
  1092. %135 = add nsw i32 %134, 1
  1093. store i32 %135, i32* %13, align 4
  1094. br label %118
  1095. 136: ; preds = %118
  1096. %137 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  1097. %138 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %137, i32 0, i32 0
  1098. %139 = load i32**, i32*** %138, align 8
  1099. %140 = bitcast i32** %139 to i8*
  1100. call void @free(i8* %140) #6
  1101. %141 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  1102. %142 = bitcast %struct.Matrix* %141 to i8*
  1103. call void @free(i8* %142) #6
  1104. store %struct.Matrix* null, %struct.Matrix** %3, align 8
  1105. br label %209
  1106. 143: ; preds = %114
  1107. br label %144
  1108. 144: ; preds = %143
  1109. %145 = load i32, i32* %11, align 4
  1110. %146 = add nsw i32 %145, 1
  1111. store i32 %146, i32* %11, align 4
  1112. br label %77
  1113. 147: ; preds = %77
  1114. %148 = load i64, i64* %10, align 8
  1115. %149 = trunc i64 %148 to i32
  1116. %150 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  1117. %151 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %150, i32 0, i32 0
  1118. %152 = load i32**, i32*** %151, align 8
  1119. %153 = load i32, i32* %8, align 4
  1120. %154 = sext i32 %153 to i64
  1121. %155 = getelementptr inbounds i32*, i32** %152, i64 %154
  1122. %156 = load i32*, i32** %155, align 8
  1123. %157 = load i32, i32* %9, align 4
  1124. %158 = sext i32 %157 to i64
  1125. %159 = getelementptr inbounds i32, i32* %156, i64 %158
  1126. store i32 %149, i32* %159, align 4
  1127. %160 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  1128. %161 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %160, i32 0, i32 0
  1129. %162 = load i32**, i32*** %161, align 8
  1130. %163 = load i32, i32* %8, align 4
  1131. %164 = sext i32 %163 to i64
  1132. %165 = getelementptr inbounds i32*, i32** %162, i64 %164
  1133. %166 = load i32*, i32** %165, align 8
  1134. %167 = load i32, i32* %9, align 4
  1135. %168 = sext i32 %167 to i64
  1136. %169 = getelementptr inbounds i32, i32* %166, i64 %168
  1137. %170 = load i32, i32* %169, align 4
  1138. %171 = call i32 @abs(i32 %170) #7
  1139. %172 = sext i32 %171 to i64
  1140. %173 = load i64, i64* %7, align 8
  1141. %174 = icmp sgt i64 %172, %173
  1142. br i1 %174, label %175, label %189
  1143. 175: ; preds = %147
  1144. %176 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  1145. %177 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %176, i32 0, i32 0
  1146. %178 = load i32**, i32*** %177, align 8
  1147. %179 = load i32, i32* %8, align 4
  1148. %180 = sext i32 %179 to i64
  1149. %181 = getelementptr inbounds i32*, i32** %178, i64 %180
  1150. %182 = load i32*, i32** %181, align 8
  1151. %183 = load i32, i32* %9, align 4
  1152. %184 = sext i32 %183 to i64
  1153. %185 = getelementptr inbounds i32, i32* %182, i64 %184
  1154. %186 = load i32, i32* %185, align 4
  1155. %187 = call i32 @abs(i32 %186) #7
  1156. %188 = sext i32 %187 to i64
  1157. store i64 %188, i64* %7, align 8
  1158. br label %189
  1159. 189: ; preds = %175, %147
  1160. br label %190
  1161. 190: ; preds = %189
  1162. %191 = load i32, i32* %9, align 4
  1163. %192 = add nsw i32 %191, 1
  1164. store i32 %192, i32* %9, align 4
  1165. br label %70
  1166. 193: ; preds = %70
  1167. br label %194
  1168. 194: ; preds = %193
  1169. %195 = load i32, i32* %8, align 4
  1170. %196 = add nsw i32 %195, 1
  1171. store i32 %196, i32* %8, align 4
  1172. br label %63
  1173. 197: ; preds = %63
  1174. %198 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  1175. %199 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %198, i32 0, i32 1
  1176. %200 = load i32, i32* %199, align 8
  1177. %201 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  1178. %202 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %201, i32 0, i32 2
  1179. %203 = load i32, i32* %202, align 4
  1180. %204 = icmp eq i32 %200, %203
  1181. %205 = zext i1 %204 to i32
  1182. %206 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  1183. %207 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %206, i32 0, i32 3
  1184. store i32 %205, i32* %207, align 8
  1185. %208 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  1186. store %struct.Matrix* %208, %struct.Matrix** %3, align 8
  1187. br label %209
  1188. 209: ; preds = %197, %136, %61, %50, %39, %30, %19
  1189. %210 = load %struct.Matrix*, %struct.Matrix** %3, align 8
  1190. ret %struct.Matrix* %210
  1191. }
  1192. ; Function Attrs: nounwind readnone
  1193. declare dso_local i32 @abs(i32) #3
  1194. ; Function Attrs: noinline nounwind optnone uwtable
  1195. define dso_local %struct.Node* @insertNode(%struct.Node* %0, i32 %1) #0 {
  1196. %3 = alloca %struct.Node*, align 8
  1197. %4 = alloca %struct.Node*, align 8
  1198. %5 = alloca i32, align 4
  1199. %6 = alloca %struct.Node*, align 8
  1200. %7 = alloca %struct.Node*, align 8
  1201. %8 = alloca %struct.Node*, align 8
  1202. %9 = alloca i32, align 4
  1203. store %struct.Node* %0, %struct.Node** %4, align 8
  1204. store i32 %1, i32* %5, align 4
  1205. %10 = call noalias i8* @malloc(i64 32) #6
  1206. %11 = bitcast i8* %10 to %struct.Node*
  1207. store %struct.Node* %11, %struct.Node** %6, align 8
  1208. %12 = load %struct.Node*, %struct.Node** %6, align 8
  1209. %13 = icmp ne %struct.Node* %12, null
  1210. br i1 %13, label %16, label %14
  1211. 14: ; preds = %2
  1212. call void @setErrorMessage(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.25, i64 0, i64 0))
  1213. %15 = load %struct.Node*, %struct.Node** %4, align 8
  1214. store %struct.Node* %15, %struct.Node** %3, align 8
  1215. br label %92
  1216. 16: ; preds = %2
  1217. %17 = load i32, i32* %5, align 4
  1218. %18 = load %struct.Node*, %struct.Node** %6, align 8
  1219. %19 = getelementptr inbounds %struct.Node, %struct.Node* %18, i32 0, i32 0
  1220. store i32 %17, i32* %19, align 8
  1221. %20 = load %struct.Node*, %struct.Node** %6, align 8
  1222. %21 = getelementptr inbounds %struct.Node, %struct.Node* %20, i32 0, i32 1
  1223. store %struct.Node* null, %struct.Node** %21, align 8
  1224. %22 = load %struct.Node*, %struct.Node** %6, align 8
  1225. %23 = getelementptr inbounds %struct.Node, %struct.Node* %22, i32 0, i32 2
  1226. store %struct.Node* null, %struct.Node** %23, align 8
  1227. %24 = load %struct.Node*, %struct.Node** %6, align 8
  1228. %25 = getelementptr inbounds %struct.Node, %struct.Node* %24, i32 0, i32 3
  1229. store i32 0, i32* %25, align 8
  1230. %26 = load %struct.Node*, %struct.Node** %4, align 8
  1231. %27 = icmp ne %struct.Node* %26, null
  1232. br i1 %27, label %32, label %28
  1233. 28: ; preds = %16
  1234. %29 = load %struct.Node*, %struct.Node** %6, align 8
  1235. %30 = getelementptr inbounds %struct.Node, %struct.Node* %29, i32 0, i32 4
  1236. store i32 0, i32* %30, align 4
  1237. store i32 0, i32* @insertNode.maxDepth, align 4
  1238. %31 = load %struct.Node*, %struct.Node** %6, align 8
  1239. store %struct.Node* %31, %struct.Node** %3, align 8
  1240. br label %92
  1241. 32: ; preds = %16
  1242. %33 = load %struct.Node*, %struct.Node** %4, align 8
  1243. store %struct.Node* %33, %struct.Node** %7, align 8
  1244. store %struct.Node* null, %struct.Node** %8, align 8
  1245. store i32 0, i32* %9, align 4
  1246. br label %34
  1247. 34: ; preds = %58, %32
  1248. %35 = load %struct.Node*, %struct.Node** %7, align 8
  1249. %36 = icmp ne %struct.Node* %35, null
  1250. br i1 %36, label %37, label %43
  1251. 37: ; preds = %34
  1252. %38 = load %struct.Node*, %struct.Node** %7, align 8
  1253. %39 = getelementptr inbounds %struct.Node, %struct.Node* %38, i32 0, i32 0
  1254. %40 = load i32, i32* %39, align 8
  1255. %41 = load i32, i32* %5, align 4
  1256. %42 = icmp slt i32 %40, %41
  1257. br label %43
  1258. 43: ; preds = %37, %34
  1259. %44 = phi i1 [ false, %34 ], [ %42, %37 ]
  1260. br i1 %44, label %45, label %59
  1261. 45: ; preds = %43
  1262. %46 = load %struct.Node*, %struct.Node** %7, align 8
  1263. store %struct.Node* %46, %struct.Node** %8, align 8
  1264. %47 = load %struct.Node*, %struct.Node** %7, align 8
  1265. %48 = getelementptr inbounds %struct.Node, %struct.Node* %47, i32 0, i32 1
  1266. %49 = load %struct.Node*, %struct.Node** %48, align 8
  1267. store %struct.Node* %49, %struct.Node** %7, align 8
  1268. %50 = load i32, i32* %9, align 4
  1269. %51 = add nsw i32 %50, 1
  1270. store i32 %51, i32* %9, align 4
  1271. %52 = load i32, i32* %9, align 4
  1272. %53 = icmp sgt i32 %52, 1000
  1273. br i1 %53, label %54, label %58
  1274. 54: ; preds = %45
  1275. call void @setErrorMessage(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.26, i64 0, i64 0))
  1276. %55 = load %struct.Node*, %struct.Node** %6, align 8
  1277. %56 = bitcast %struct.Node* %55 to i8*
  1278. call void @free(i8* %56) #6
  1279. %57 = load %struct.Node*, %struct.Node** %4, align 8
  1280. store %struct.Node* %57, %struct.Node** %3, align 8
  1281. br label %92
  1282. 58: ; preds = %45
  1283. br label %34
  1284. 59: ; preds = %43
  1285. %60 = load i32, i32* %9, align 4
  1286. %61 = load i32, i32* @insertNode.maxDepth, align 4
  1287. %62 = icmp sgt i32 %60, %61
  1288. br i1 %62, label %63, label %65
  1289. 63: ; preds = %59
  1290. %64 = load i32, i32* %9, align 4
  1291. store i32 %64, i32* @insertNode.maxDepth, align 4
  1292. br label %65
  1293. 65: ; preds = %63, %59
  1294. %66 = load i32, i32* %9, align 4
  1295. %67 = load %struct.Node*, %struct.Node** %6, align 8
  1296. %68 = getelementptr inbounds %struct.Node, %struct.Node* %67, i32 0, i32 4
  1297. store i32 %66, i32* %68, align 4
  1298. %69 = load %struct.Node*, %struct.Node** %7, align 8
  1299. %70 = load %struct.Node*, %struct.Node** %6, align 8
  1300. %71 = getelementptr inbounds %struct.Node, %struct.Node* %70, i32 0, i32 1
  1301. store %struct.Node* %69, %struct.Node** %71, align 8
  1302. %72 = load %struct.Node*, %struct.Node** %8, align 8
  1303. %73 = icmp ne %struct.Node* %72, null
  1304. br i1 %73, label %74, label %81
  1305. 74: ; preds = %65
  1306. %75 = load %struct.Node*, %struct.Node** %6, align 8
  1307. %76 = load %struct.Node*, %struct.Node** %8, align 8
  1308. %77 = getelementptr inbounds %struct.Node, %struct.Node* %76, i32 0, i32 1
  1309. store %struct.Node* %75, %struct.Node** %77, align 8
  1310. %78 = load %struct.Node*, %struct.Node** %8, align 8
  1311. %79 = load %struct.Node*, %struct.Node** %6, align 8
  1312. %80 = getelementptr inbounds %struct.Node, %struct.Node* %79, i32 0, i32 2
  1313. store %struct.Node* %78, %struct.Node** %80, align 8
  1314. br label %83
  1315. 81: ; preds = %65
  1316. %82 = load %struct.Node*, %struct.Node** %6, align 8
  1317. store %struct.Node* %82, %struct.Node** %3, align 8
  1318. br label %92
  1319. 83: ; preds = %74
  1320. %84 = load %struct.Node*, %struct.Node** %7, align 8
  1321. %85 = icmp ne %struct.Node* %84, null
  1322. br i1 %85, label %86, label %90
  1323. 86: ; preds = %83
  1324. %87 = load %struct.Node*, %struct.Node** %6, align 8
  1325. %88 = load %struct.Node*, %struct.Node** %7, align 8
  1326. %89 = getelementptr inbounds %struct.Node, %struct.Node* %88, i32 0, i32 2
  1327. store %struct.Node* %87, %struct.Node** %89, align 8
  1328. br label %90
  1329. 90: ; preds = %86, %83
  1330. %91 = load %struct.Node*, %struct.Node** %4, align 8
  1331. store %struct.Node* %91, %struct.Node** %3, align 8
  1332. br label %92
  1333. 92: ; preds = %90, %81, %54, %28, %14
  1334. %93 = load %struct.Node*, %struct.Node** %3, align 8
  1335. ret %struct.Node* %93
  1336. }
  1337. ; Function Attrs: noinline nounwind optnone uwtable
  1338. define dso_local void @performSimpleCalculations() #0 {
  1339. %1 = alloca i32, align 4
  1340. store i32 100, i32* %1, align 4
  1341. %2 = load i32, i32* %1, align 4
  1342. %3 = icmp sgt i32 %2, 50
  1343. br i1 %3, label %4, label %9
  1344. 4: ; preds = %0
  1345. %5 = load i32, i32* %1, align 4
  1346. %6 = mul nsw i32 %5, 2
  1347. %7 = load i32, i32* @calculationResult, align 4
  1348. %8 = add nsw i32 %7, %6
  1349. store i32 %8, i32* @calculationResult, align 4
  1350. br label %14
  1351. 9: ; preds = %0
  1352. %10 = load i32, i32* %1, align 4
  1353. %11 = sdiv i32 %10, 2
  1354. %12 = load i32, i32* @calculationResult, align 4
  1355. %13 = add nsw i32 %12, %11
  1356. store i32 %13, i32* @calculationResult, align 4
  1357. br label %14
  1358. 14: ; preds = %9, %4
  1359. %15 = load i32, i32* %1, align 4
  1360. %16 = srem i32 %15, 3
  1361. %17 = icmp eq i32 %16, 0
  1362. br i1 %17, label %18, label %21
  1363. 18: ; preds = %14
  1364. %19 = load i32, i32* @calculationResult, align 4
  1365. %20 = mul nsw i32 %19, 3
  1366. store i32 %20, i32* @calculationResult, align 4
  1367. br label %24
  1368. 21: ; preds = %14
  1369. %22 = load i32, i32* @calculationResult, align 4
  1370. %23 = add nsw i32 %22, 3
  1371. store i32 %23, i32* @calculationResult, align 4
  1372. br label %24
  1373. 24: ; preds = %21, %18
  1374. %25 = load i32, i32* @calculationResult, align 4
  1375. %26 = icmp sge i32 %25, 150
  1376. br i1 %26, label %27, label %33
  1377. 27: ; preds = %24
  1378. %28 = load i32, i32* @calculationResult, align 4
  1379. %29 = icmp sle i32 %28, 300
  1380. br i1 %29, label %30, label %33
  1381. 30: ; preds = %27
  1382. %31 = load i32, i32* @calculationResult, align 4
  1383. %32 = sub nsw i32 %31, 50
  1384. store i32 %32, i32* @calculationResult, align 4
  1385. br label %36
  1386. 33: ; preds = %27, %24
  1387. %34 = load i32, i32* @calculationResult, align 4
  1388. %35 = add nsw i32 %34, 50
  1389. store i32 %35, i32* @calculationResult, align 4
  1390. br label %36
  1391. 36: ; preds = %33, %30
  1392. %37 = load i32, i32* @calculationResult, align 4
  1393. %38 = srem i32 %37, 2
  1394. %39 = icmp eq i32 %38, 0
  1395. br i1 %39, label %40, label %43
  1396. 40: ; preds = %36
  1397. %41 = load i32, i32* @calculationResult, align 4
  1398. %42 = sdiv i32 %41, 2
  1399. store i32 %42, i32* @calculationResult, align 4
  1400. br label %46
  1401. 43: ; preds = %36
  1402. %44 = load i32, i32* @calculationResult, align 4
  1403. %45 = mul nsw i32 %44, 2
  1404. store i32 %45, i32* @calculationResult, align 4
  1405. br label %46
  1406. 46: ; preds = %43, %40
  1407. %47 = load i32, i32* @calculationResult, align 4
  1408. %48 = srem i32 %47, 10
  1409. %49 = icmp slt i32 %48, 5
  1410. br i1 %49, label %50, label %53
  1411. 50: ; preds = %46
  1412. %51 = load i32, i32* @calculationResult, align 4
  1413. %52 = add nsw i32 %51, 5
  1414. store i32 %52, i32* @calculationResult, align 4
  1415. br label %56
  1416. 53: ; preds = %46
  1417. %54 = load i32, i32* @calculationResult, align 4
  1418. %55 = sub nsw i32 %54, 5
  1419. store i32 %55, i32* @calculationResult, align 4
  1420. br label %56
  1421. 56: ; preds = %53, %50
  1422. %57 = load i32, i32* @calculationResult, align 4
  1423. %58 = icmp sgt i32 %57, 1000
  1424. br i1 %58, label %59, label %60
  1425. 59: ; preds = %56
  1426. store i32 1000, i32* @calculationResult, align 4
  1427. br label %63
  1428. 60: ; preds = %56
  1429. %61 = load i32, i32* @calculationResult, align 4
  1430. %62 = add nsw i32 %61, 10
  1431. store i32 %62, i32* @calculationResult, align 4
  1432. br label %63
  1433. 63: ; preds = %60, %59
  1434. %64 = load i32, i32* @calculationResult, align 4
  1435. %65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.27, i64 0, i64 0), i32 %64)
  1436. ret void
  1437. }
  1438. declare dso_local i32 @printf(i8*, ...) #2
  1439. ; Function Attrs: noinline nounwind optnone uwtable
  1440. define dso_local i32 @projectA_main() #0 {
  1441. %1 = alloca i32, align 4
  1442. %2 = alloca %struct.DynamicArray*, align 8
  1443. %3 = alloca i32, align 4
  1444. %4 = alloca %struct.Matrix*, align 8
  1445. %5 = alloca %struct.Matrix*, align 8
  1446. %6 = alloca i32, align 4
  1447. %7 = alloca i32, align 4
  1448. %8 = alloca %struct.Matrix*, align 8
  1449. %9 = alloca i32, align 4
  1450. %10 = alloca %struct.Node*, align 8
  1451. %11 = alloca i32, align 4
  1452. %12 = alloca i32, align 4
  1453. %13 = alloca %struct.Node*, align 8
  1454. %14 = alloca %struct.Node*, align 8
  1455. %15 = alloca i32, align 4
  1456. %16 = alloca %struct.Node*, align 8
  1457. %17 = alloca i32, align 4
  1458. %18 = alloca i32, align 4
  1459. %19 = alloca %struct.Node*, align 8
  1460. %20 = call i64 @time(i64* null) #6
  1461. %21 = trunc i64 %20 to i32
  1462. call void @srand(i32 %21) #6
  1463. %22 = call %struct.DynamicArray* @createDynamicArray(i32 10)
  1464. store %struct.DynamicArray* %22, %struct.DynamicArray** %2, align 8
  1465. %23 = load %struct.DynamicArray*, %struct.DynamicArray** %2, align 8
  1466. %24 = icmp ne %struct.DynamicArray* %23, null
  1467. br i1 %24, label %28, label %25
  1468. 25: ; preds = %0
  1469. %26 = call i8* @getErrorMessage()
  1470. %27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.28, i64 0, i64 0), i8* %26)
  1471. store i32 -1, i32* %1, align 4
  1472. br label %322
  1473. 28: ; preds = %0
  1474. store i32 0, i32* %3, align 4
  1475. br label %29
  1476. 29: ; preds = %42, %28
  1477. %30 = load i32, i32* %3, align 4
  1478. %31 = icmp slt i32 %30, 15
  1479. br i1 %31, label %32, label %45
  1480. 32: ; preds = %29
  1481. %33 = load %struct.DynamicArray*, %struct.DynamicArray** %2, align 8
  1482. %34 = call i32 @rand() #6
  1483. %35 = srem i32 %34, 100
  1484. call void @pushBack(%struct.DynamicArray* %33, i32 %35)
  1485. %36 = load i8*, i8** @globalErrorMessage, align 8
  1486. %37 = icmp ne i8* %36, null
  1487. br i1 %37, label %38, label %41
  1488. 38: ; preds = %32
  1489. %39 = call i8* @getErrorMessage()
  1490. %40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.29, i64 0, i64 0), i8* %39)
  1491. br label %45
  1492. 41: ; preds = %32
  1493. br label %42
  1494. 42: ; preds = %41
  1495. %43 = load i32, i32* %3, align 4
  1496. %44 = add nsw i32 %43, 1
  1497. store i32 %44, i32* %3, align 4
  1498. br label %29
  1499. 45: ; preds = %38, %29
  1500. %46 = call %struct.Matrix* @createMatrix(i32 3, i32 3)
  1501. store %struct.Matrix* %46, %struct.Matrix** %4, align 8
  1502. %47 = call %struct.Matrix* @createMatrix(i32 3, i32 3)
  1503. store %struct.Matrix* %47, %struct.Matrix** %5, align 8
  1504. %48 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  1505. %49 = icmp ne %struct.Matrix* %48, null
  1506. br i1 %49, label %50, label %53
  1507. 50: ; preds = %45
  1508. %51 = load %struct.Matrix*, %struct.Matrix** %5, align 8
  1509. %52 = icmp ne %struct.Matrix* %51, null
  1510. br i1 %52, label %74, label %53
  1511. 53: ; preds = %50, %45
  1512. %54 = call i8* @getErrorMessage()
  1513. %55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.28, i64 0, i64 0), i8* %54)
  1514. %56 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  1515. %57 = icmp ne %struct.Matrix* %56, null
  1516. br i1 %57, label %58, label %61
  1517. 58: ; preds = %53
  1518. %59 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  1519. %60 = bitcast %struct.Matrix* %59 to i8*
  1520. call void @free(i8* %60) #6
  1521. br label %61
  1522. 61: ; preds = %58, %53
  1523. %62 = load %struct.Matrix*, %struct.Matrix** %5, align 8
  1524. %63 = icmp ne %struct.Matrix* %62, null
  1525. br i1 %63, label %64, label %67
  1526. 64: ; preds = %61
  1527. %65 = load %struct.Matrix*, %struct.Matrix** %5, align 8
  1528. %66 = bitcast %struct.Matrix* %65 to i8*
  1529. call void @free(i8* %66) #6
  1530. br label %67
  1531. 67: ; preds = %64, %61
  1532. %68 = load %struct.DynamicArray*, %struct.DynamicArray** %2, align 8
  1533. %69 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %68, i32 0, i32 0
  1534. %70 = load i32*, i32** %69, align 8
  1535. %71 = bitcast i32* %70 to i8*
  1536. call void @free(i8* %71) #6
  1537. %72 = load %struct.DynamicArray*, %struct.DynamicArray** %2, align 8
  1538. %73 = bitcast %struct.DynamicArray* %72 to i8*
  1539. call void @free(i8* %73) #6
  1540. store i32 -1, i32* %1, align 4
  1541. br label %322
  1542. 74: ; preds = %50
  1543. store i32 0, i32* %6, align 4
  1544. br label %75
  1545. 75: ; preds = %111, %74
  1546. %76 = load i32, i32* %6, align 4
  1547. %77 = icmp slt i32 %76, 3
  1548. br i1 %77, label %78, label %114
  1549. 78: ; preds = %75
  1550. store i32 0, i32* %7, align 4
  1551. br label %79
  1552. 79: ; preds = %107, %78
  1553. %80 = load i32, i32* %7, align 4
  1554. %81 = icmp slt i32 %80, 3
  1555. br i1 %81, label %82, label %110
  1556. 82: ; preds = %79
  1557. %83 = call i32 @rand() #6
  1558. %84 = srem i32 %83, 10
  1559. %85 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  1560. %86 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %85, i32 0, i32 0
  1561. %87 = load i32**, i32*** %86, align 8
  1562. %88 = load i32, i32* %6, align 4
  1563. %89 = sext i32 %88 to i64
  1564. %90 = getelementptr inbounds i32*, i32** %87, i64 %89
  1565. %91 = load i32*, i32** %90, align 8
  1566. %92 = load i32, i32* %7, align 4
  1567. %93 = sext i32 %92 to i64
  1568. %94 = getelementptr inbounds i32, i32* %91, i64 %93
  1569. store i32 %84, i32* %94, align 4
  1570. %95 = call i32 @rand() #6
  1571. %96 = srem i32 %95, 10
  1572. %97 = load %struct.Matrix*, %struct.Matrix** %5, align 8
  1573. %98 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %97, i32 0, i32 0
  1574. %99 = load i32**, i32*** %98, align 8
  1575. %100 = load i32, i32* %6, align 4
  1576. %101 = sext i32 %100 to i64
  1577. %102 = getelementptr inbounds i32*, i32** %99, i64 %101
  1578. %103 = load i32*, i32** %102, align 8
  1579. %104 = load i32, i32* %7, align 4
  1580. %105 = sext i32 %104 to i64
  1581. %106 = getelementptr inbounds i32, i32* %103, i64 %105
  1582. store i32 %96, i32* %106, align 4
  1583. br label %107
  1584. 107: ; preds = %82
  1585. %108 = load i32, i32* %7, align 4
  1586. %109 = add nsw i32 %108, 1
  1587. store i32 %109, i32* %7, align 4
  1588. br label %79
  1589. 110: ; preds = %79
  1590. br label %111
  1591. 111: ; preds = %110
  1592. %112 = load i32, i32* %6, align 4
  1593. %113 = add nsw i32 %112, 1
  1594. store i32 %113, i32* %6, align 4
  1595. br label %75
  1596. 114: ; preds = %75
  1597. %115 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  1598. %116 = load %struct.Matrix*, %struct.Matrix** %5, align 8
  1599. %117 = call %struct.Matrix* @multiplyMatrices(%struct.Matrix* %115, %struct.Matrix* %116)
  1600. store %struct.Matrix* %117, %struct.Matrix** %8, align 8
  1601. %118 = load %struct.Matrix*, %struct.Matrix** %8, align 8
  1602. %119 = icmp ne %struct.Matrix* %118, null
  1603. br i1 %119, label %168, label %120
  1604. 120: ; preds = %114
  1605. %121 = call i8* @getErrorMessage()
  1606. %122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.28, i64 0, i64 0), i8* %121)
  1607. store i32 0, i32* %9, align 4
  1608. br label %123
  1609. 123: ; preds = %146, %120
  1610. %124 = load i32, i32* %9, align 4
  1611. %125 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  1612. %126 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %125, i32 0, i32 1
  1613. %127 = load i32, i32* %126, align 8
  1614. %128 = icmp slt i32 %124, %127
  1615. br i1 %128, label %129, label %149
  1616. 129: ; preds = %123
  1617. %130 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  1618. %131 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %130, i32 0, i32 0
  1619. %132 = load i32**, i32*** %131, align 8
  1620. %133 = load i32, i32* %9, align 4
  1621. %134 = sext i32 %133 to i64
  1622. %135 = getelementptr inbounds i32*, i32** %132, i64 %134
  1623. %136 = load i32*, i32** %135, align 8
  1624. %137 = bitcast i32* %136 to i8*
  1625. call void @free(i8* %137) #6
  1626. %138 = load %struct.Matrix*, %struct.Matrix** %5, align 8
  1627. %139 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %138, i32 0, i32 0
  1628. %140 = load i32**, i32*** %139, align 8
  1629. %141 = load i32, i32* %9, align 4
  1630. %142 = sext i32 %141 to i64
  1631. %143 = getelementptr inbounds i32*, i32** %140, i64 %142
  1632. %144 = load i32*, i32** %143, align 8
  1633. %145 = bitcast i32* %144 to i8*
  1634. call void @free(i8* %145) #6
  1635. br label %146
  1636. 146: ; preds = %129
  1637. %147 = load i32, i32* %9, align 4
  1638. %148 = add nsw i32 %147, 1
  1639. store i32 %148, i32* %9, align 4
  1640. br label %123
  1641. 149: ; preds = %123
  1642. %150 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  1643. %151 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %150, i32 0, i32 0
  1644. %152 = load i32**, i32*** %151, align 8
  1645. %153 = bitcast i32** %152 to i8*
  1646. call void @free(i8* %153) #6
  1647. %154 = load %struct.Matrix*, %struct.Matrix** %5, align 8
  1648. %155 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %154, i32 0, i32 0
  1649. %156 = load i32**, i32*** %155, align 8
  1650. %157 = bitcast i32** %156 to i8*
  1651. call void @free(i8* %157) #6
  1652. %158 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  1653. %159 = bitcast %struct.Matrix* %158 to i8*
  1654. call void @free(i8* %159) #6
  1655. %160 = load %struct.Matrix*, %struct.Matrix** %5, align 8
  1656. %161 = bitcast %struct.Matrix* %160 to i8*
  1657. call void @free(i8* %161) #6
  1658. %162 = load %struct.DynamicArray*, %struct.DynamicArray** %2, align 8
  1659. %163 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %162, i32 0, i32 0
  1660. %164 = load i32*, i32** %163, align 8
  1661. %165 = bitcast i32* %164 to i8*
  1662. call void @free(i8* %165) #6
  1663. %166 = load %struct.DynamicArray*, %struct.DynamicArray** %2, align 8
  1664. %167 = bitcast %struct.DynamicArray* %166 to i8*
  1665. call void @free(i8* %167) #6
  1666. store i32 -1, i32* %1, align 4
  1667. br label %322
  1668. 168: ; preds = %114
  1669. store %struct.Node* null, %struct.Node** %10, align 8
  1670. store i32 0, i32* %11, align 4
  1671. br label %169
  1672. 169: ; preds = %183, %168
  1673. %170 = load i32, i32* %11, align 4
  1674. %171 = icmp slt i32 %170, 5
  1675. br i1 %171, label %172, label %186
  1676. 172: ; preds = %169
  1677. %173 = load %struct.Node*, %struct.Node** %10, align 8
  1678. %174 = call i32 @rand() #6
  1679. %175 = srem i32 %174, 50
  1680. %176 = call %struct.Node* @insertNode(%struct.Node* %173, i32 %175)
  1681. store %struct.Node* %176, %struct.Node** %10, align 8
  1682. %177 = load i8*, i8** @globalErrorMessage, align 8
  1683. %178 = icmp ne i8* %177, null
  1684. br i1 %178, label %179, label %182
  1685. 179: ; preds = %172
  1686. %180 = call i8* @getErrorMessage()
  1687. %181 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.30, i64 0, i64 0), i8* %180)
  1688. br label %186
  1689. 182: ; preds = %172
  1690. br label %183
  1691. 183: ; preds = %182
  1692. %184 = load i32, i32* %11, align 4
  1693. %185 = add nsw i32 %184, 1
  1694. store i32 %185, i32* %11, align 4
  1695. br label %169
  1696. 186: ; preds = %179, %169
  1697. %187 = load %struct.DynamicArray*, %struct.DynamicArray** %2, align 8
  1698. %188 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %187, i32 0, i32 0
  1699. %189 = load i32*, i32** %188, align 8
  1700. %190 = bitcast i32* %189 to i8*
  1701. call void @free(i8* %190) #6
  1702. %191 = load %struct.DynamicArray*, %struct.DynamicArray** %2, align 8
  1703. %192 = bitcast %struct.DynamicArray* %191 to i8*
  1704. call void @free(i8* %192) #6
  1705. store i32 0, i32* %12, align 4
  1706. br label %193
  1707. 193: ; preds = %224, %186
  1708. %194 = load i32, i32* %12, align 4
  1709. %195 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  1710. %196 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %195, i32 0, i32 1
  1711. %197 = load i32, i32* %196, align 8
  1712. %198 = icmp slt i32 %194, %197
  1713. br i1 %198, label %199, label %227
  1714. 199: ; preds = %193
  1715. %200 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  1716. %201 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %200, i32 0, i32 0
  1717. %202 = load i32**, i32*** %201, align 8
  1718. %203 = load i32, i32* %12, align 4
  1719. %204 = sext i32 %203 to i64
  1720. %205 = getelementptr inbounds i32*, i32** %202, i64 %204
  1721. %206 = load i32*, i32** %205, align 8
  1722. %207 = bitcast i32* %206 to i8*
  1723. call void @free(i8* %207) #6
  1724. %208 = load %struct.Matrix*, %struct.Matrix** %5, align 8
  1725. %209 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %208, i32 0, i32 0
  1726. %210 = load i32**, i32*** %209, align 8
  1727. %211 = load i32, i32* %12, align 4
  1728. %212 = sext i32 %211 to i64
  1729. %213 = getelementptr inbounds i32*, i32** %210, i64 %212
  1730. %214 = load i32*, i32** %213, align 8
  1731. %215 = bitcast i32* %214 to i8*
  1732. call void @free(i8* %215) #6
  1733. %216 = load %struct.Matrix*, %struct.Matrix** %8, align 8
  1734. %217 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %216, i32 0, i32 0
  1735. %218 = load i32**, i32*** %217, align 8
  1736. %219 = load i32, i32* %12, align 4
  1737. %220 = sext i32 %219 to i64
  1738. %221 = getelementptr inbounds i32*, i32** %218, i64 %220
  1739. %222 = load i32*, i32** %221, align 8
  1740. %223 = bitcast i32* %222 to i8*
  1741. call void @free(i8* %223) #6
  1742. br label %224
  1743. 224: ; preds = %199
  1744. %225 = load i32, i32* %12, align 4
  1745. %226 = add nsw i32 %225, 1
  1746. store i32 %226, i32* %12, align 4
  1747. br label %193
  1748. 227: ; preds = %193
  1749. %228 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  1750. %229 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %228, i32 0, i32 0
  1751. %230 = load i32**, i32*** %229, align 8
  1752. %231 = bitcast i32** %230 to i8*
  1753. call void @free(i8* %231) #6
  1754. %232 = load %struct.Matrix*, %struct.Matrix** %5, align 8
  1755. %233 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %232, i32 0, i32 0
  1756. %234 = load i32**, i32*** %233, align 8
  1757. %235 = bitcast i32** %234 to i8*
  1758. call void @free(i8* %235) #6
  1759. %236 = load %struct.Matrix*, %struct.Matrix** %8, align 8
  1760. %237 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %236, i32 0, i32 0
  1761. %238 = load i32**, i32*** %237, align 8
  1762. %239 = bitcast i32** %238 to i8*
  1763. call void @free(i8* %239) #6
  1764. %240 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  1765. %241 = bitcast %struct.Matrix* %240 to i8*
  1766. call void @free(i8* %241) #6
  1767. %242 = load %struct.Matrix*, %struct.Matrix** %5, align 8
  1768. %243 = bitcast %struct.Matrix* %242 to i8*
  1769. call void @free(i8* %243) #6
  1770. %244 = load %struct.Matrix*, %struct.Matrix** %8, align 8
  1771. %245 = bitcast %struct.Matrix* %244 to i8*
  1772. call void @free(i8* %245) #6
  1773. %246 = load %struct.Node*, %struct.Node** %10, align 8
  1774. %247 = icmp ne %struct.Node* %246, null
  1775. br i1 %247, label %248, label %316
  1776. 248: ; preds = %227
  1777. %249 = load %struct.Node*, %struct.Node** %10, align 8
  1778. store %struct.Node* %249, %struct.Node** %13, align 8
  1779. %250 = load %struct.Node*, %struct.Node** %10, align 8
  1780. store %struct.Node* %250, %struct.Node** %14, align 8
  1781. store i32 0, i32* %15, align 4
  1782. br label %251
  1783. 251: ; preds = %274, %248
  1784. %252 = load %struct.Node*, %struct.Node** %14, align 8
  1785. %253 = icmp ne %struct.Node* %252, null
  1786. br i1 %253, label %254, label %259
  1787. 254: ; preds = %251
  1788. %255 = load %struct.Node*, %struct.Node** %14, align 8
  1789. %256 = getelementptr inbounds %struct.Node, %struct.Node* %255, i32 0, i32 1
  1790. %257 = load %struct.Node*, %struct.Node** %256, align 8
  1791. %258 = icmp ne %struct.Node* %257, null
  1792. br label %259
  1793. 259: ; preds = %254, %251
  1794. %260 = phi i1 [ false, %251 ], [ %258, %254 ]
  1795. br i1 %260, label %261, label %275
  1796. 261: ; preds = %259
  1797. %262 = load %struct.Node*, %struct.Node** %13, align 8
  1798. %263 = getelementptr inbounds %struct.Node, %struct.Node* %262, i32 0, i32 1
  1799. %264 = load %struct.Node*, %struct.Node** %263, align 8
  1800. store %struct.Node* %264, %struct.Node** %13, align 8
  1801. %265 = load %struct.Node*, %struct.Node** %14, align 8
  1802. %266 = getelementptr inbounds %struct.Node, %struct.Node* %265, i32 0, i32 1
  1803. %267 = load %struct.Node*, %struct.Node** %266, align 8
  1804. %268 = getelementptr inbounds %struct.Node, %struct.Node* %267, i32 0, i32 1
  1805. %269 = load %struct.Node*, %struct.Node** %268, align 8
  1806. store %struct.Node* %269, %struct.Node** %14, align 8
  1807. %270 = load %struct.Node*, %struct.Node** %13, align 8
  1808. %271 = load %struct.Node*, %struct.Node** %14, align 8
  1809. %272 = icmp eq %struct.Node* %270, %271
  1810. br i1 %272, label %273, label %274
  1811. 273: ; preds = %261
  1812. store i32 1, i32* %15, align 4
  1813. br label %275
  1814. 274: ; preds = %261
  1815. br label %251
  1816. 275: ; preds = %273, %259
  1817. %276 = load i32, i32* %15, align 4
  1818. %277 = icmp ne i32 %276, 0
  1819. br i1 %277, label %278, label %304
  1820. 278: ; preds = %275
  1821. call void @setErrorMessage(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.31, i64 0, i64 0))
  1822. %279 = load %struct.Node*, %struct.Node** %10, align 8
  1823. store %struct.Node* %279, %struct.Node** %16, align 8
  1824. store i32 1000, i32* %17, align 4
  1825. store i32 0, i32* %18, align 4
  1826. br label %280
  1827. 280: ; preds = %295, %278
  1828. %281 = load %struct.Node*, %struct.Node** %16, align 8
  1829. %282 = icmp ne %struct.Node* %281, null
  1830. br i1 %282, label %283, label %287
  1831. 283: ; preds = %280
  1832. %284 = load i32, i32* %18, align 4
  1833. %285 = load i32, i32* %17, align 4
  1834. %286 = icmp slt i32 %284, %285
  1835. br label %287
  1836. 287: ; preds = %283, %280
  1837. %288 = phi i1 [ false, %280 ], [ %286, %283 ]
  1838. br i1 %288, label %289, label %303
  1839. 289: ; preds = %287
  1840. %290 = load %struct.Node*, %struct.Node** %16, align 8
  1841. %291 = getelementptr inbounds %struct.Node, %struct.Node* %290, i32 0, i32 3
  1842. %292 = load i32, i32* %291, align 8
  1843. %293 = icmp ne i32 %292, 0
  1844. br i1 %293, label %294, label %295
  1845. 294: ; preds = %289
  1846. br label %303
  1847. 295: ; preds = %289
  1848. %296 = load %struct.Node*, %struct.Node** %16, align 8
  1849. %297 = getelementptr inbounds %struct.Node, %struct.Node* %296, i32 0, i32 3
  1850. store i32 1, i32* %297, align 8
  1851. %298 = load %struct.Node*, %struct.Node** %16, align 8
  1852. %299 = getelementptr inbounds %struct.Node, %struct.Node* %298, i32 0, i32 1
  1853. %300 = load %struct.Node*, %struct.Node** %299, align 8
  1854. store %struct.Node* %300, %struct.Node** %16, align 8
  1855. %301 = load i32, i32* %18, align 4
  1856. %302 = add nsw i32 %301, 1
  1857. store i32 %302, i32* %18, align 4
  1858. br label %280
  1859. 303: ; preds = %294, %287
  1860. br label %304
  1861. 304: ; preds = %303, %275
  1862. br label %305
  1863. 305: ; preds = %308, %304
  1864. %306 = load %struct.Node*, %struct.Node** %10, align 8
  1865. %307 = icmp ne %struct.Node* %306, null
  1866. br i1 %307, label %308, label %315
  1867. 308: ; preds = %305
  1868. %309 = load %struct.Node*, %struct.Node** %10, align 8
  1869. store %struct.Node* %309, %struct.Node** %19, align 8
  1870. %310 = load %struct.Node*, %struct.Node** %10, align 8
  1871. %311 = getelementptr inbounds %struct.Node, %struct.Node* %310, i32 0, i32 1
  1872. %312 = load %struct.Node*, %struct.Node** %311, align 8
  1873. store %struct.Node* %312, %struct.Node** %10, align 8
  1874. %313 = load %struct.Node*, %struct.Node** %19, align 8
  1875. %314 = bitcast %struct.Node* %313 to i8*
  1876. call void @free(i8* %314) #6
  1877. br label %305
  1878. 315: ; preds = %305
  1879. br label %316
  1880. 316: ; preds = %315, %227
  1881. %317 = load i8*, i8** @globalErrorMessage, align 8
  1882. %318 = icmp ne i8* %317, null
  1883. br i1 %318, label %319, label %321
  1884. 319: ; preds = %316
  1885. %320 = load i8*, i8** @globalErrorMessage, align 8
  1886. call void @free(i8* %320) #6
  1887. br label %321
  1888. 321: ; preds = %319, %316
  1889. call void @performSimpleCalculations()
  1890. store i32 0, i32* %1, align 4
  1891. br label %322
  1892. 322: ; preds = %321, %149, %67, %25
  1893. %323 = load i32, i32* %1, align 4
  1894. ret i32 %323
  1895. }
  1896. ; Function Attrs: nounwind
  1897. declare dso_local void @srand(i32) #1
  1898. ; Function Attrs: nounwind
  1899. declare dso_local i64 @time(i64*) #1
  1900. ; Function Attrs: nounwind
  1901. declare dso_local i32 @rand() #1
  1902. ; Function Attrs: noinline nounwind optnone uwtable
  1903. define dso_local double @calculateDistance(%struct.Point* byval(%struct.Point) align 8 %0, %struct.Point* byval(%struct.Point) align 8 %1, i32* %2) #0 {
  1904. %4 = alloca double, align 8
  1905. %5 = alloca i32*, align 8
  1906. %6 = alloca double, align 8
  1907. %7 = alloca double, align 8
  1908. %8 = alloca double, align 8
  1909. store i32* %2, i32** %5, align 8
  1910. %9 = load i32*, i32** %5, align 8
  1911. store i32 0, i32* %9, align 4
  1912. %10 = getelementptr inbounds %struct.Point, %struct.Point* %0, i32 0, i32 3
  1913. %11 = load double, double* %10, align 8
  1914. %12 = fcmp ole double %11, 0.000000e+00
  1915. br i1 %12, label %17, label %13
  1916. 13: ; preds = %3
  1917. %14 = getelementptr inbounds %struct.Point, %struct.Point* %1, i32 0, i32 3
  1918. %15 = load double, double* %14, align 8
  1919. %16 = fcmp ole double %15, 0.000000e+00
  1920. br i1 %16, label %17, label %19
  1921. 17: ; preds = %13, %3
  1922. %18 = load i32*, i32** %5, align 8
  1923. store i32 1, i32* %18, align 4
  1924. call void @setErrorMessage(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.32, i64 0, i64 0))
  1925. store double -1.000000e+00, double* %4, align 8
  1926. br label %101
  1927. 19: ; preds = %13
  1928. %20 = getelementptr inbounds %struct.Point, %struct.Point* %0, i32 0, i32 0
  1929. %21 = load i32, i32* %20, align 8
  1930. %22 = call i32 @abs(i32 %21) #7
  1931. %23 = icmp sgt i32 %22, 1000
  1932. br i1 %23, label %39, label %24
  1933. 24: ; preds = %19
  1934. %25 = getelementptr inbounds %struct.Point, %struct.Point* %0, i32 0, i32 1
  1935. %26 = load i32, i32* %25, align 4
  1936. %27 = call i32 @abs(i32 %26) #7
  1937. %28 = icmp sgt i32 %27, 1000
  1938. br i1 %28, label %39, label %29
  1939. 29: ; preds = %24
  1940. %30 = getelementptr inbounds %struct.Point, %struct.Point* %1, i32 0, i32 0
  1941. %31 = load i32, i32* %30, align 8
  1942. %32 = call i32 @abs(i32 %31) #7
  1943. %33 = icmp sgt i32 %32, 1000
  1944. br i1 %33, label %39, label %34
  1945. 34: ; preds = %29
  1946. %35 = getelementptr inbounds %struct.Point, %struct.Point* %1, i32 0, i32 1
  1947. %36 = load i32, i32* %35, align 4
  1948. %37 = call i32 @abs(i32 %36) #7
  1949. %38 = icmp sgt i32 %37, 1000
  1950. br i1 %38, label %39, label %41
  1951. 39: ; preds = %34, %29, %24, %19
  1952. %40 = load i32*, i32** %5, align 8
  1953. store i32 3, i32* %40, align 4
  1954. call void @setErrorMessage(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.33, i64 0, i64 0))
  1955. store double -1.000000e+00, double* %4, align 8
  1956. br label %101
  1957. 41: ; preds = %34
  1958. %42 = getelementptr inbounds %struct.Point, %struct.Point* %1, i32 0, i32 0
  1959. %43 = load i32, i32* %42, align 8
  1960. %44 = getelementptr inbounds %struct.Point, %struct.Point* %0, i32 0, i32 0
  1961. %45 = load i32, i32* %44, align 8
  1962. %46 = sub nsw i32 %43, %45
  1963. %47 = sitofp i32 %46 to double
  1964. %48 = getelementptr inbounds %struct.Point, %struct.Point* %1, i32 0, i32 3
  1965. %49 = load double, double* %48, align 8
  1966. %50 = getelementptr inbounds %struct.Point, %struct.Point* %0, i32 0, i32 3
  1967. %51 = load double, double* %50, align 8
  1968. %52 = fdiv double %49, %51
  1969. %53 = call double @sqrt(double %52) #6
  1970. %54 = fmul double %47, %53
  1971. store double %54, double* %6, align 8
  1972. %55 = getelementptr inbounds %struct.Point, %struct.Point* %1, i32 0, i32 1
  1973. %56 = load i32, i32* %55, align 4
  1974. %57 = getelementptr inbounds %struct.Point, %struct.Point* %0, i32 0, i32 1
  1975. %58 = load i32, i32* %57, align 4
  1976. %59 = sub nsw i32 %56, %58
  1977. %60 = sitofp i32 %59 to double
  1978. %61 = getelementptr inbounds %struct.Point, %struct.Point* %1, i32 0, i32 3
  1979. %62 = load double, double* %61, align 8
  1980. %63 = getelementptr inbounds %struct.Point, %struct.Point* %0, i32 0, i32 3
  1981. %64 = load double, double* %63, align 8
  1982. %65 = fdiv double %62, %64
  1983. %66 = call double @sqrt(double %65) #6
  1984. %67 = fmul double %60, %66
  1985. store double %67, double* %7, align 8
  1986. %68 = load double, double* %6, align 8
  1987. %69 = call double @llvm.fabs.f64(double %68)
  1988. %70 = fcmp ogt double %69, 1.000000e+03
  1989. br i1 %70, label %75, label %71
  1990. 71: ; preds = %41
  1991. %72 = load double, double* %7, align 8
  1992. %73 = call double @llvm.fabs.f64(double %72)
  1993. %74 = fcmp ogt double %73, 1.000000e+03
  1994. br i1 %74, label %75, label %77
  1995. 75: ; preds = %71, %41
  1996. %76 = load i32*, i32** %5, align 8
  1997. store i32 5, i32* %76, align 4
  1998. call void @setErrorMessage(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.34, i64 0, i64 0))
  1999. store double -1.000000e+00, double* %4, align 8
  2000. br label %101
  2001. 77: ; preds = %71
  2002. %78 = load double, double* %6, align 8
  2003. %79 = load double, double* %6, align 8
  2004. %80 = fmul double %78, %79
  2005. %81 = load double, double* %7, align 8
  2006. %82 = load double, double* %7, align 8
  2007. %83 = fmul double %81, %82
  2008. %84 = fadd double %80, %83
  2009. %85 = call double @sqrt(double %84) #6
  2010. store double %85, double* %8, align 8
  2011. %86 = load double, double* %8, align 8
  2012. %87 = fcmp uno double %86, %86
  2013. br i1 %87, label %97, label %88
  2014. 88: ; preds = %77
  2015. %89 = load double, double* %8, align 8
  2016. %90 = call double @llvm.fabs.f64(double %89) #8
  2017. %91 = fcmp oeq double %90, 0x7FF0000000000000
  2018. %92 = bitcast double %89 to i64
  2019. %93 = icmp slt i64 %92, 0
  2020. %94 = select i1 %93, i32 -1, i32 1
  2021. %95 = select i1 %91, i32 %94, i32 0
  2022. %96 = icmp ne i32 %95, 0
  2023. br i1 %96, label %97, label %99
  2024. 97: ; preds = %88, %77
  2025. %98 = load i32*, i32** %5, align 8
  2026. store i32 8, i32* %98, align 4
  2027. call void @setErrorMessage(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.35, i64 0, i64 0))
  2028. store double -1.000000e+00, double* %4, align 8
  2029. br label %101
  2030. 99: ; preds = %88
  2031. %100 = load double, double* %8, align 8
  2032. store double %100, double* %4, align 8
  2033. br label %101
  2034. 101: ; preds = %99, %97, %75, %39, %17
  2035. %102 = load double, double* %4, align 8
  2036. ret double %102
  2037. }
  2038. ; Function Attrs: nounwind
  2039. declare dso_local double @sqrt(double) #1
  2040. ; Function Attrs: nounwind readnone speculatable willreturn
  2041. declare double @llvm.fabs.f64(double) #4
  2042. ; Function Attrs: noinline nounwind optnone uwtable
  2043. define dso_local double @calculateCircleArea(%struct.Circle* byval(%struct.Circle) align 8 %0, i32* %1) #0 {
  2044. %3 = alloca double, align 8
  2045. %4 = alloca i32*, align 8
  2046. %5 = alloca double, align 8
  2047. store i32* %1, i32** %4, align 8
  2048. %6 = load i32*, i32** %4, align 8
  2049. store i32 0, i32* %6, align 4
  2050. %7 = getelementptr inbounds %struct.Circle, %struct.Circle* %0, i32 0, i32 2
  2051. %8 = load i32, i32* %7, align 8
  2052. %9 = icmp ne i32 %8, 0
  2053. br i1 %9, label %12, label %10
  2054. 10: ; preds = %2
  2055. %11 = load i32*, i32** %4, align 8
  2056. store i32 1, i32* %11, align 4
  2057. call void @setErrorMessage(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.36, i64 0, i64 0))
  2058. store double -1.000000e+00, double* %3, align 8
  2059. br label %85
  2060. 12: ; preds = %2
  2061. %13 = getelementptr inbounds %struct.Circle, %struct.Circle* %0, i32 0, i32 1
  2062. %14 = load double, double* %13, align 8
  2063. %15 = fcmp ole double %14, 0.000000e+00
  2064. br i1 %15, label %16, label %18
  2065. 16: ; preds = %12
  2066. %17 = load i32*, i32** %4, align 8
  2067. store i32 1, i32* %17, align 4
  2068. call void @setErrorMessage(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.37, i64 0, i64 0))
  2069. store double -1.000000e+00, double* %3, align 8
  2070. br label %85
  2071. 18: ; preds = %12
  2072. %19 = getelementptr inbounds %struct.Circle, %struct.Circle* %0, i32 0, i32 1
  2073. %20 = load double, double* %19, align 8
  2074. %21 = fcmp ogt double %20, 1.000000e+03
  2075. br i1 %21, label %22, label %24
  2076. 22: ; preds = %18
  2077. %23 = load i32*, i32** %4, align 8
  2078. store i32 3, i32* %23, align 4
  2079. call void @setErrorMessage(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.38, i64 0, i64 0))
  2080. store double -1.000000e+00, double* %3, align 8
  2081. br label %85
  2082. 24: ; preds = %18
  2083. %25 = getelementptr inbounds %struct.Circle, %struct.Circle* %0, i32 0, i32 0
  2084. %26 = getelementptr inbounds %struct.Point, %struct.Point* %25, i32 0, i32 0
  2085. %27 = load i32, i32* %26, align 8
  2086. %28 = call i32 @abs(i32 %27) #7
  2087. %29 = icmp sgt i32 %28, 1000
  2088. br i1 %29, label %36, label %30
  2089. 30: ; preds = %24
  2090. %31 = getelementptr inbounds %struct.Circle, %struct.Circle* %0, i32 0, i32 0
  2091. %32 = getelementptr inbounds %struct.Point, %struct.Point* %31, i32 0, i32 1
  2092. %33 = load i32, i32* %32, align 4
  2093. %34 = call i32 @abs(i32 %33) #7
  2094. %35 = icmp sgt i32 %34, 1000
  2095. br i1 %35, label %36, label %38
  2096. 36: ; preds = %30, %24
  2097. %37 = load i32*, i32** %4, align 8
  2098. store i32 3, i32* %37, align 4
  2099. call void @setErrorMessage(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.39, i64 0, i64 0))
  2100. store double -1.000000e+00, double* %3, align 8
  2101. br label %85
  2102. 38: ; preds = %30
  2103. %39 = getelementptr inbounds %struct.Circle, %struct.Circle* %0, i32 0, i32 1
  2104. %40 = load double, double* %39, align 8
  2105. %41 = fmul double 3.141590e+00, %40
  2106. %42 = getelementptr inbounds %struct.Circle, %struct.Circle* %0, i32 0, i32 1
  2107. %43 = load double, double* %42, align 8
  2108. %44 = fmul double %41, %43
  2109. store double %44, double* %5, align 8
  2110. %45 = load double, double* %5, align 8
  2111. %46 = fcmp uno double %45, %45
  2112. br i1 %46, label %56, label %47
  2113. 47: ; preds = %38
  2114. %48 = load double, double* %5, align 8
  2115. %49 = call double @llvm.fabs.f64(double %48) #8
  2116. %50 = fcmp oeq double %49, 0x7FF0000000000000
  2117. %51 = bitcast double %48 to i64
  2118. %52 = icmp slt i64 %51, 0
  2119. %53 = select i1 %52, i32 -1, i32 1
  2120. %54 = select i1 %50, i32 %53, i32 0
  2121. %55 = icmp ne i32 %54, 0
  2122. br i1 %55, label %56, label %58
  2123. 56: ; preds = %47, %38
  2124. %57 = load i32*, i32** %4, align 8
  2125. store i32 5, i32* %57, align 4
  2126. call void @setErrorMessage(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.40, i64 0, i64 0))
  2127. store double -1.000000e+00, double* %3, align 8
  2128. br label %85
  2129. 58: ; preds = %47
  2130. %59 = getelementptr inbounds %struct.Circle, %struct.Circle* %0, i32 0, i32 3
  2131. %60 = getelementptr inbounds [256 x i8], [256 x i8]* %59, i64 0, i64 0
  2132. %61 = call i32 @strcmp(i8* %60, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.41, i64 0, i64 0)) #9
  2133. %62 = icmp eq i32 %61, 0
  2134. br i1 %62, label %63, label %65
  2135. 63: ; preds = %58
  2136. %64 = load double, double* %5, align 8
  2137. store double %64, double* %3, align 8
  2138. br label %85
  2139. 65: ; preds = %58
  2140. %66 = getelementptr inbounds %struct.Circle, %struct.Circle* %0, i32 0, i32 3
  2141. %67 = getelementptr inbounds [256 x i8], [256 x i8]* %66, i64 0, i64 0
  2142. %68 = call i32 @strcmp(i8* %67, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.42, i64 0, i64 0)) #9
  2143. %69 = icmp eq i32 %68, 0
  2144. br i1 %69, label %70, label %83
  2145. 70: ; preds = %65
  2146. %71 = getelementptr inbounds %struct.Circle, %struct.Circle* %0, i32 0, i32 0
  2147. %72 = getelementptr inbounds %struct.Point, %struct.Point* %71, i32 0, i32 3
  2148. %73 = load double, double* %72, align 8
  2149. %74 = fcmp ole double %73, 0.000000e+00
  2150. br i1 %74, label %75, label %77
  2151. 75: ; preds = %70
  2152. %76 = load i32*, i32** %4, align 8
  2153. store i32 1, i32* %76, align 4
  2154. call void @setErrorMessage(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.43, i64 0, i64 0))
  2155. store double -1.000000e+00, double* %3, align 8
  2156. br label %85
  2157. 77: ; preds = %70
  2158. %78 = load double, double* %5, align 8
  2159. %79 = getelementptr inbounds %struct.Circle, %struct.Circle* %0, i32 0, i32 0
  2160. %80 = getelementptr inbounds %struct.Point, %struct.Point* %79, i32 0, i32 3
  2161. %81 = load double, double* %80, align 8
  2162. %82 = fmul double %78, %81
  2163. store double %82, double* %3, align 8
  2164. br label %85
  2165. 83: ; preds = %65
  2166. %84 = load i32*, i32** %4, align 8
  2167. store i32 1, i32* %84, align 4
  2168. call void @setErrorMessage(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.44, i64 0, i64 0))
  2169. store double -1.000000e+00, double* %3, align 8
  2170. br label %85
  2171. 85: ; preds = %83, %77, %75, %63, %56, %36, %22, %16, %10
  2172. %86 = load double, double* %3, align 8
  2173. ret double %86
  2174. }
  2175. ; Function Attrs: nounwind readonly
  2176. declare dso_local i32 @strcmp(i8*, i8*) #5
  2177. ; Function Attrs: noinline nounwind optnone uwtable
  2178. define dso_local i32 @validateMatrix(%struct.Matrix* %0) #0 {
  2179. %2 = alloca i32, align 4
  2180. %3 = alloca %struct.Matrix*, align 8
  2181. %4 = alloca i32, align 4
  2182. store %struct.Matrix* %0, %struct.Matrix** %3, align 8
  2183. %5 = load %struct.Matrix*, %struct.Matrix** %3, align 8
  2184. %6 = icmp ne %struct.Matrix* %5, null
  2185. br i1 %6, label %8, label %7
  2186. 7: ; preds = %1
  2187. call void @setErrorMessage(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.21, i64 0, i64 0))
  2188. store i32 7, i32* %2, align 4
  2189. br label %72
  2190. 8: ; preds = %1
  2191. %9 = load %struct.Matrix*, %struct.Matrix** %3, align 8
  2192. %10 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %9, i32 0, i32 0
  2193. %11 = load i32**, i32*** %10, align 8
  2194. %12 = icmp ne i32** %11, null
  2195. br i1 %12, label %14, label %13
  2196. 13: ; preds = %8
  2197. call void @setErrorMessage(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.45, i64 0, i64 0))
  2198. store i32 7, i32* %2, align 4
  2199. br label %72
  2200. 14: ; preds = %8
  2201. %15 = load %struct.Matrix*, %struct.Matrix** %3, align 8
  2202. %16 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %15, i32 0, i32 1
  2203. %17 = load i32, i32* %16, align 8
  2204. %18 = icmp slt i32 %17, 1
  2205. br i1 %18, label %24, label %19
  2206. 19: ; preds = %14
  2207. %20 = load %struct.Matrix*, %struct.Matrix** %3, align 8
  2208. %21 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %20, i32 0, i32 2
  2209. %22 = load i32, i32* %21, align 4
  2210. %23 = icmp slt i32 %22, 1
  2211. br i1 %23, label %24, label %25
  2212. 24: ; preds = %19, %14
  2213. call void @setErrorMessage(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.16, i64 0, i64 0))
  2214. store i32 1, i32* %2, align 4
  2215. br label %72
  2216. 25: ; preds = %19
  2217. %26 = load %struct.Matrix*, %struct.Matrix** %3, align 8
  2218. %27 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %26, i32 0, i32 1
  2219. %28 = load i32, i32* %27, align 8
  2220. %29 = icmp sgt i32 %28, 100
  2221. br i1 %29, label %35, label %30
  2222. 30: ; preds = %25
  2223. %31 = load %struct.Matrix*, %struct.Matrix** %3, align 8
  2224. %32 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %31, i32 0, i32 2
  2225. %33 = load i32, i32* %32, align 4
  2226. %34 = icmp sgt i32 %33, 100
  2227. br i1 %34, label %35, label %36
  2228. 35: ; preds = %30, %25
  2229. call void @setErrorMessage(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.46, i64 0, i64 0))
  2230. store i32 3, i32* %2, align 4
  2231. br label %72
  2232. 36: ; preds = %30
  2233. store i32 0, i32* %4, align 4
  2234. br label %37
  2235. 37: ; preds = %54, %36
  2236. %38 = load i32, i32* %4, align 4
  2237. %39 = load %struct.Matrix*, %struct.Matrix** %3, align 8
  2238. %40 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %39, i32 0, i32 1
  2239. %41 = load i32, i32* %40, align 8
  2240. %42 = icmp slt i32 %38, %41
  2241. br i1 %42, label %43, label %57
  2242. 43: ; preds = %37
  2243. %44 = load %struct.Matrix*, %struct.Matrix** %3, align 8
  2244. %45 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %44, i32 0, i32 0
  2245. %46 = load i32**, i32*** %45, align 8
  2246. %47 = load i32, i32* %4, align 4
  2247. %48 = sext i32 %47 to i64
  2248. %49 = getelementptr inbounds i32*, i32** %46, i64 %48
  2249. %50 = load i32*, i32** %49, align 8
  2250. %51 = icmp ne i32* %50, null
  2251. br i1 %51, label %53, label %52
  2252. 52: ; preds = %43
  2253. call void @setErrorMessage(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.47, i64 0, i64 0))
  2254. store i32 7, i32* %2, align 4
  2255. br label %72
  2256. 53: ; preds = %43
  2257. br label %54
  2258. 54: ; preds = %53
  2259. %55 = load i32, i32* %4, align 4
  2260. %56 = add nsw i32 %55, 1
  2261. store i32 %56, i32* %4, align 4
  2262. br label %37
  2263. 57: ; preds = %37
  2264. %58 = load %struct.Matrix*, %struct.Matrix** %3, align 8
  2265. %59 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %58, i32 0, i32 1
  2266. %60 = load i32, i32* %59, align 8
  2267. %61 = load %struct.Matrix*, %struct.Matrix** %3, align 8
  2268. %62 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %61, i32 0, i32 2
  2269. %63 = load i32, i32* %62, align 4
  2270. %64 = icmp eq i32 %60, %63
  2271. %65 = zext i1 %64 to i32
  2272. %66 = load %struct.Matrix*, %struct.Matrix** %3, align 8
  2273. %67 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %66, i32 0, i32 3
  2274. %68 = load i32, i32* %67, align 8
  2275. %69 = icmp ne i32 %65, %68
  2276. br i1 %69, label %70, label %71
  2277. 70: ; preds = %57
  2278. call void @setErrorMessage(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.48, i64 0, i64 0))
  2279. store i32 1, i32* %2, align 4
  2280. br label %72
  2281. 71: ; preds = %57
  2282. store i32 0, i32* %2, align 4
  2283. br label %72
  2284. 72: ; preds = %71, %70, %52, %35, %24, %13, %7
  2285. %73 = load i32, i32* %2, align 4
  2286. ret i32 %73
  2287. }
  2288. ; Function Attrs: noinline nounwind optnone uwtable
  2289. define dso_local void @removeDuplicates(%struct.DynamicArray* %0) #0 {
  2290. %2 = alloca %struct.DynamicArray*, align 8
  2291. %3 = alloca i32, align 4
  2292. %4 = alloca i32, align 4
  2293. %5 = alloca i32, align 4
  2294. store %struct.DynamicArray* %0, %struct.DynamicArray** %2, align 8
  2295. %6 = load %struct.DynamicArray*, %struct.DynamicArray** %2, align 8
  2296. %7 = icmp ne %struct.DynamicArray* %6, null
  2297. br i1 %7, label %8, label %13
  2298. 8: ; preds = %1
  2299. %9 = load %struct.DynamicArray*, %struct.DynamicArray** %2, align 8
  2300. %10 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %9, i32 0, i32 0
  2301. %11 = load i32*, i32** %10, align 8
  2302. %12 = icmp ne i32* %11, null
  2303. br i1 %12, label %14, label %13
  2304. 13: ; preds = %8, %1
  2305. call void @setErrorMessage(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.49, i64 0, i64 0))
  2306. br label %81
  2307. 14: ; preds = %8
  2308. %15 = load %struct.DynamicArray*, %struct.DynamicArray** %2, align 8
  2309. %16 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %15, i32 0, i32 1
  2310. %17 = load i32, i32* %16, align 8
  2311. %18 = icmp sle i32 %17, 1
  2312. br i1 %18, label %19, label %20
  2313. 19: ; preds = %14
  2314. br label %81
  2315. 20: ; preds = %14
  2316. store i32 0, i32* %3, align 4
  2317. %21 = load %struct.DynamicArray*, %struct.DynamicArray** %2, align 8
  2318. %22 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %21, i32 0, i32 0
  2319. %23 = load i32*, i32** %22, align 8
  2320. %24 = load %struct.DynamicArray*, %struct.DynamicArray** %2, align 8
  2321. %25 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %24, i32 0, i32 1
  2322. %26 = load i32, i32* %25, align 8
  2323. %27 = sub nsw i32 %26, 1
  2324. call void @quickSort(i32* %23, i32 0, i32 %27, i32* %3)
  2325. %28 = load i32, i32* %3, align 4
  2326. %29 = icmp ne i32 %28, 0
  2327. br i1 %29, label %30, label %31
  2328. 30: ; preds = %20
  2329. br label %81
  2330. 31: ; preds = %20
  2331. store i32 1, i32* %4, align 4
  2332. store i32 1, i32* %5, align 4
  2333. br label %32
  2334. 32: ; preds = %72, %31
  2335. %33 = load i32, i32* %5, align 4
  2336. %34 = load %struct.DynamicArray*, %struct.DynamicArray** %2, align 8
  2337. %35 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %34, i32 0, i32 1
  2338. %36 = load i32, i32* %35, align 8
  2339. %37 = icmp slt i32 %33, %36
  2340. br i1 %37, label %38, label %75
  2341. 38: ; preds = %32
  2342. %39 = load %struct.DynamicArray*, %struct.DynamicArray** %2, align 8
  2343. %40 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %39, i32 0, i32 0
  2344. %41 = load i32*, i32** %40, align 8
  2345. %42 = load i32, i32* %5, align 4
  2346. %43 = sext i32 %42 to i64
  2347. %44 = getelementptr inbounds i32, i32* %41, i64 %43
  2348. %45 = load i32, i32* %44, align 4
  2349. %46 = load %struct.DynamicArray*, %struct.DynamicArray** %2, align 8
  2350. %47 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %46, i32 0, i32 0
  2351. %48 = load i32*, i32** %47, align 8
  2352. %49 = load i32, i32* %5, align 4
  2353. %50 = sub nsw i32 %49, 1
  2354. %51 = sext i32 %50 to i64
  2355. %52 = getelementptr inbounds i32, i32* %48, i64 %51
  2356. %53 = load i32, i32* %52, align 4
  2357. %54 = icmp ne i32 %45, %53
  2358. br i1 %54, label %55, label %71
  2359. 55: ; preds = %38
  2360. %56 = load %struct.DynamicArray*, %struct.DynamicArray** %2, align 8
  2361. %57 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %56, i32 0, i32 0
  2362. %58 = load i32*, i32** %57, align 8
  2363. %59 = load i32, i32* %5, align 4
  2364. %60 = sext i32 %59 to i64
  2365. %61 = getelementptr inbounds i32, i32* %58, i64 %60
  2366. %62 = load i32, i32* %61, align 4
  2367. %63 = load %struct.DynamicArray*, %struct.DynamicArray** %2, align 8
  2368. %64 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %63, i32 0, i32 0
  2369. %65 = load i32*, i32** %64, align 8
  2370. %66 = load i32, i32* %4, align 4
  2371. %67 = sext i32 %66 to i64
  2372. %68 = getelementptr inbounds i32, i32* %65, i64 %67
  2373. store i32 %62, i32* %68, align 4
  2374. %69 = load i32, i32* %4, align 4
  2375. %70 = add nsw i32 %69, 1
  2376. store i32 %70, i32* %4, align 4
  2377. br label %71
  2378. 71: ; preds = %55, %38
  2379. br label %72
  2380. 72: ; preds = %71
  2381. %73 = load i32, i32* %5, align 4
  2382. %74 = add nsw i32 %73, 1
  2383. store i32 %74, i32* %5, align 4
  2384. br label %32
  2385. 75: ; preds = %32
  2386. %76 = load i32, i32* %4, align 4
  2387. %77 = load %struct.DynamicArray*, %struct.DynamicArray** %2, align 8
  2388. %78 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %77, i32 0, i32 1
  2389. store i32 %76, i32* %78, align 8
  2390. %79 = load %struct.DynamicArray*, %struct.DynamicArray** %2, align 8
  2391. %80 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %79, i32 0, i32 3
  2392. store i32 1, i32* %80, align 8
  2393. br label %81
  2394. 81: ; preds = %75, %30, %19, %13
  2395. ret void
  2396. }
  2397. ; Function Attrs: noinline nounwind optnone uwtable
  2398. define dso_local %struct.Point* @findCentroid(%struct.Point* %0, i32 %1, i32* %2) #0 {
  2399. %4 = alloca %struct.Point*, align 8
  2400. %5 = alloca %struct.Point*, align 8
  2401. %6 = alloca i32, align 4
  2402. %7 = alloca i32*, align 8
  2403. %8 = alloca %struct.Point*, align 8
  2404. %9 = alloca double, align 8
  2405. %10 = alloca double, align 8
  2406. %11 = alloca double, align 8
  2407. %12 = alloca i32, align 4
  2408. store %struct.Point* %0, %struct.Point** %5, align 8
  2409. store i32 %1, i32* %6, align 4
  2410. store i32* %2, i32** %7, align 8
  2411. %13 = load i32*, i32** %7, align 8
  2412. store i32 0, i32* %13, align 4
  2413. %14 = load %struct.Point*, %struct.Point** %5, align 8
  2414. %15 = icmp ne %struct.Point* %14, null
  2415. br i1 %15, label %16, label %19
  2416. 16: ; preds = %3
  2417. %17 = load i32, i32* %6, align 4
  2418. %18 = icmp sle i32 %17, 0
  2419. br i1 %18, label %19, label %21
  2420. 19: ; preds = %16, %3
  2421. %20 = load i32*, i32** %7, align 8
  2422. store i32 1, i32* %20, align 4
  2423. call void @setErrorMessage(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.50, i64 0, i64 0))
  2424. store %struct.Point* null, %struct.Point** %4, align 8
  2425. br label %165
  2426. 21: ; preds = %16
  2427. %22 = load i32, i32* %6, align 4
  2428. %23 = icmp sgt i32 %22, 1000
  2429. br i1 %23, label %24, label %26
  2430. 24: ; preds = %21
  2431. %25 = load i32*, i32** %7, align 8
  2432. store i32 3, i32* %25, align 4
  2433. call void @setErrorMessage(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.51, i64 0, i64 0))
  2434. store %struct.Point* null, %struct.Point** %4, align 8
  2435. br label %165
  2436. 26: ; preds = %21
  2437. %27 = call noalias i8* @malloc(i64 272) #6
  2438. %28 = bitcast i8* %27 to %struct.Point*
  2439. store %struct.Point* %28, %struct.Point** %8, align 8
  2440. %29 = load %struct.Point*, %struct.Point** %8, align 8
  2441. %30 = icmp ne %struct.Point* %29, null
  2442. br i1 %30, label %33, label %31
  2443. 31: ; preds = %26
  2444. %32 = load i32*, i32** %7, align 8
  2445. store i32 2, i32* %32, align 4
  2446. call void @setErrorMessage(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.52, i64 0, i64 0))
  2447. store %struct.Point* null, %struct.Point** %4, align 8
  2448. br label %165
  2449. 33: ; preds = %26
  2450. store double 0.000000e+00, double* %9, align 8
  2451. store double 0.000000e+00, double* %10, align 8
  2452. store double 0.000000e+00, double* %11, align 8
  2453. store i32 0, i32* %12, align 4
  2454. br label %34
  2455. 34: ; preds = %131, %33
  2456. %35 = load i32, i32* %12, align 4
  2457. %36 = load i32, i32* %6, align 4
  2458. %37 = icmp slt i32 %35, %36
  2459. br i1 %37, label %38, label %134
  2460. 38: ; preds = %34
  2461. %39 = load %struct.Point*, %struct.Point** %5, align 8
  2462. %40 = load i32, i32* %12, align 4
  2463. %41 = sext i32 %40 to i64
  2464. %42 = getelementptr inbounds %struct.Point, %struct.Point* %39, i64 %41
  2465. %43 = getelementptr inbounds %struct.Point, %struct.Point* %42, i32 0, i32 3
  2466. %44 = load double, double* %43, align 8
  2467. %45 = fcmp ole double %44, 0.000000e+00
  2468. br i1 %45, label %46, label %50
  2469. 46: ; preds = %38
  2470. %47 = load i32*, i32** %7, align 8
  2471. store i32 1, i32* %47, align 4
  2472. call void @setErrorMessage(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.53, i64 0, i64 0))
  2473. %48 = load %struct.Point*, %struct.Point** %8, align 8
  2474. %49 = bitcast %struct.Point* %48 to i8*
  2475. call void @free(i8* %49) #6
  2476. store %struct.Point* null, %struct.Point** %4, align 8
  2477. br label %165
  2478. 50: ; preds = %38
  2479. %51 = load %struct.Point*, %struct.Point** %5, align 8
  2480. %52 = load i32, i32* %12, align 4
  2481. %53 = sext i32 %52 to i64
  2482. %54 = getelementptr inbounds %struct.Point, %struct.Point* %51, i64 %53
  2483. %55 = getelementptr inbounds %struct.Point, %struct.Point* %54, i32 0, i32 3
  2484. %56 = load double, double* %55, align 8
  2485. %57 = load double, double* %9, align 8
  2486. %58 = fadd double %57, %56
  2487. store double %58, double* %9, align 8
  2488. %59 = load %struct.Point*, %struct.Point** %5, align 8
  2489. %60 = load i32, i32* %12, align 4
  2490. %61 = sext i32 %60 to i64
  2491. %62 = getelementptr inbounds %struct.Point, %struct.Point* %59, i64 %61
  2492. %63 = getelementptr inbounds %struct.Point, %struct.Point* %62, i32 0, i32 0
  2493. %64 = load i32, i32* %63, align 8
  2494. %65 = sitofp i32 %64 to double
  2495. %66 = load %struct.Point*, %struct.Point** %5, align 8
  2496. %67 = load i32, i32* %12, align 4
  2497. %68 = sext i32 %67 to i64
  2498. %69 = getelementptr inbounds %struct.Point, %struct.Point* %66, i64 %68
  2499. %70 = getelementptr inbounds %struct.Point, %struct.Point* %69, i32 0, i32 3
  2500. %71 = load double, double* %70, align 8
  2501. %72 = fmul double %65, %71
  2502. %73 = load double, double* %10, align 8
  2503. %74 = fadd double %73, %72
  2504. store double %74, double* %10, align 8
  2505. %75 = load %struct.Point*, %struct.Point** %5, align 8
  2506. %76 = load i32, i32* %12, align 4
  2507. %77 = sext i32 %76 to i64
  2508. %78 = getelementptr inbounds %struct.Point, %struct.Point* %75, i64 %77
  2509. %79 = getelementptr inbounds %struct.Point, %struct.Point* %78, i32 0, i32 1
  2510. %80 = load i32, i32* %79, align 4
  2511. %81 = sitofp i32 %80 to double
  2512. %82 = load %struct.Point*, %struct.Point** %5, align 8
  2513. %83 = load i32, i32* %12, align 4
  2514. %84 = sext i32 %83 to i64
  2515. %85 = getelementptr inbounds %struct.Point, %struct.Point* %82, i64 %84
  2516. %86 = getelementptr inbounds %struct.Point, %struct.Point* %85, i32 0, i32 3
  2517. %87 = load double, double* %86, align 8
  2518. %88 = fmul double %81, %87
  2519. %89 = load double, double* %11, align 8
  2520. %90 = fadd double %89, %88
  2521. store double %90, double* %11, align 8
  2522. %91 = load double, double* %9, align 8
  2523. %92 = fcmp uno double %91, %91
  2524. br i1 %92, label %126, label %93
  2525. 93: ; preds = %50
  2526. %94 = load double, double* %10, align 8
  2527. %95 = fcmp uno double %94, %94
  2528. br i1 %95, label %126, label %96
  2529. 96: ; preds = %93
  2530. %97 = load double, double* %11, align 8
  2531. %98 = fcmp uno double %97, %97
  2532. br i1 %98, label %126, label %99
  2533. 99: ; preds = %96
  2534. %100 = load double, double* %9, align 8
  2535. %101 = call double @llvm.fabs.f64(double %100) #8
  2536. %102 = fcmp oeq double %101, 0x7FF0000000000000
  2537. %103 = bitcast double %100 to i64
  2538. %104 = icmp slt i64 %103, 0
  2539. %105 = select i1 %104, i32 -1, i32 1
  2540. %106 = select i1 %102, i32 %105, i32 0
  2541. %107 = icmp ne i32 %106, 0
  2542. br i1 %107, label %126, label %108
  2543. 108: ; preds = %99
  2544. %109 = load double, double* %10, align 8
  2545. %110 = call double @llvm.fabs.f64(double %109) #8
  2546. %111 = fcmp oeq double %110, 0x7FF0000000000000
  2547. %112 = bitcast double %109 to i64
  2548. %113 = icmp slt i64 %112, 0
  2549. %114 = select i1 %113, i32 -1, i32 1
  2550. %115 = select i1 %111, i32 %114, i32 0
  2551. %116 = icmp ne i32 %115, 0
  2552. br i1 %116, label %126, label %117
  2553. 117: ; preds = %108
  2554. %118 = load double, double* %11, align 8
  2555. %119 = call double @llvm.fabs.f64(double %118) #8
  2556. %120 = fcmp oeq double %119, 0x7FF0000000000000
  2557. %121 = bitcast double %118 to i64
  2558. %122 = icmp slt i64 %121, 0
  2559. %123 = select i1 %122, i32 -1, i32 1
  2560. %124 = select i1 %120, i32 %123, i32 0
  2561. %125 = icmp ne i32 %124, 0
  2562. br i1 %125, label %126, label %130
  2563. 126: ; preds = %117, %108, %99, %96, %93, %50
  2564. %127 = load i32*, i32** %7, align 8
  2565. store i32 5, i32* %127, align 4
  2566. call void @setErrorMessage(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.54, i64 0, i64 0))
  2567. %128 = load %struct.Point*, %struct.Point** %8, align 8
  2568. %129 = bitcast %struct.Point* %128 to i8*
  2569. call void @free(i8* %129) #6
  2570. store %struct.Point* null, %struct.Point** %4, align 8
  2571. br label %165
  2572. 130: ; preds = %117
  2573. br label %131
  2574. 131: ; preds = %130
  2575. %132 = load i32, i32* %12, align 4
  2576. %133 = add nsw i32 %132, 1
  2577. store i32 %133, i32* %12, align 4
  2578. br label %34
  2579. 134: ; preds = %34
  2580. %135 = load double, double* %9, align 8
  2581. %136 = fcmp oeq double %135, 0.000000e+00
  2582. br i1 %136, label %137, label %141
  2583. 137: ; preds = %134
  2584. %138 = load i32*, i32** %7, align 8
  2585. store i32 1, i32* %138, align 4
  2586. call void @setErrorMessage(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.55, i64 0, i64 0))
  2587. %139 = load %struct.Point*, %struct.Point** %8, align 8
  2588. %140 = bitcast %struct.Point* %139 to i8*
  2589. call void @free(i8* %140) #6
  2590. store %struct.Point* null, %struct.Point** %4, align 8
  2591. br label %165
  2592. 141: ; preds = %134
  2593. %142 = load double, double* %10, align 8
  2594. %143 = load double, double* %9, align 8
  2595. %144 = fdiv double %142, %143
  2596. %145 = fptosi double %144 to i32
  2597. %146 = load %struct.Point*, %struct.Point** %8, align 8
  2598. %147 = getelementptr inbounds %struct.Point, %struct.Point* %146, i32 0, i32 0
  2599. store i32 %145, i32* %147, align 8
  2600. %148 = load double, double* %11, align 8
  2601. %149 = load double, double* %9, align 8
  2602. %150 = fdiv double %148, %149
  2603. %151 = fptosi double %150 to i32
  2604. %152 = load %struct.Point*, %struct.Point** %8, align 8
  2605. %153 = getelementptr inbounds %struct.Point, %struct.Point* %152, i32 0, i32 1
  2606. store i32 %151, i32* %153, align 4
  2607. %154 = load double, double* %9, align 8
  2608. %155 = load i32, i32* %6, align 4
  2609. %156 = sitofp i32 %155 to double
  2610. %157 = fdiv double %154, %156
  2611. %158 = load %struct.Point*, %struct.Point** %8, align 8
  2612. %159 = getelementptr inbounds %struct.Point, %struct.Point* %158, i32 0, i32 3
  2613. store double %157, double* %159, align 8
  2614. %160 = load %struct.Point*, %struct.Point** %8, align 8
  2615. %161 = getelementptr inbounds %struct.Point, %struct.Point* %160, i32 0, i32 2
  2616. %162 = getelementptr inbounds [256 x i8], [256 x i8]* %161, i64 0, i64 0
  2617. %163 = call i8* @strcpy(i8* %162, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.56, i64 0, i64 0)) #6
  2618. %164 = load %struct.Point*, %struct.Point** %8, align 8
  2619. store %struct.Point* %164, %struct.Point** %4, align 8
  2620. br label %165
  2621. 165: ; preds = %141, %137, %126, %46, %31, %24, %19
  2622. %166 = load %struct.Point*, %struct.Point** %4, align 8
  2623. ret %struct.Point* %166
  2624. }
  2625. ; Function Attrs: nounwind
  2626. declare dso_local i8* @strcpy(i8*, i8*) #1
  2627. attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
  2628. attributes #1 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
  2629. attributes #2 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
  2630. attributes #3 = { nounwind readnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
  2631. attributes #4 = { nounwind readnone speculatable willreturn }
  2632. attributes #5 = { nounwind readonly "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
  2633. attributes #6 = { nounwind }
  2634. attributes #7 = { nounwind readnone }
  2635. attributes #8 = { readnone }
  2636. attributes #9 = { nounwind readonly }
  2637. !llvm.module.flags = !{!0}
  2638. !llvm.ident = !{!1}
  2639. !0 = !{i32 1, !"wchar_size", i32 4}
  2640. !1 = !{!"clang version 10.0.0-4ubuntu1 "}