module_fusion_text.ll 71 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599
  1. ; ModuleID = 'output/module_fusion.bc'
  2. source_filename = "llvm-link"
  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. %fused_return_projectA_main_memoizedFib = type { i32, i32 }
  15. %fused_return_createDynamicArray_processMatrix = type { i32, %struct.DynamicArray* }
  16. @globalCounter = dso_local global i32 0, align 4
  17. @globalErrorMessage = dso_local global i8* null, align 8
  18. @recursionDepth = dso_local global i32 0, align 4
  19. @.str = private unnamed_addr constant [9 x i8] c"No error\00", align 1
  20. @stderr = external dso_local global %struct._IO_FILE*, align 8
  21. @.str.1 = private unnamed_addr constant [55 x i8] c"Critical: Failed to allocate memory for error message\0A\00", align 1
  22. @.str.2 = private unnamed_addr constant [33 x i8] c"Maximum recursion depth exceeded\00", align 1
  23. @.str.3 = private unnamed_addr constant [29 x i8] c"Factorial of negative number\00", align 1
  24. @.str.4 = private unnamed_addr constant [36 x i8] c"Input too large, potential overflow\00", align 1
  25. @.str.5 = private unnamed_addr constant [31 x i8] c"Factorial calculation overflow\00", align 1
  26. @.str.6 = private unnamed_addr constant [25 x i8] c"Invalid initial capacity\00", align 1
  27. @.str.7 = private unnamed_addr constant [46 x i8] c"Initial capacity exceeds maximum allowed size\00", align 1
  28. @.str.8 = private unnamed_addr constant [49 x i8] c"Memory allocation failed for DynamicArray struct\00", align 1
  29. @.str.9 = private unnamed_addr constant [35 x i8] c"Memory allocation failed for array\00", align 1
  30. @.str.10 = private unnamed_addr constant [19 x i8] c"Null array pointer\00", align 1
  31. @.str.11 = private unnamed_addr constant [25 x i8] c"Array size limit reached\00", align 1
  32. @.str.12 = private unnamed_addr constant [27 x i8] c"Memory reallocation failed\00", align 1
  33. @.str.13 = private unnamed_addr constant [46 x i8] c"Maximum recursion depth exceeded in quickSort\00", align 1
  34. @.str.14 = private unnamed_addr constant [32 x i8] c"Null array pointer in quickSort\00", align 1
  35. @.str.15 = private unnamed_addr constant [39 x i8] c"Array index out of bounds in quickSort\00", align 1
  36. @.str.16 = private unnamed_addr constant [28 x i8] c"Matrix dimensions too small\00", align 1
  37. @.str.17 = private unnamed_addr constant [46 x i8] c"Matrix dimensions exceed maximum allowed size\00", align 1
  38. @.str.18 = private unnamed_addr constant [43 x i8] c"Memory allocation failed for matrix struct\00", align 1
  39. @.str.19 = private unnamed_addr constant [41 x i8] c"Memory allocation failed for matrix rows\00", align 1
  40. @.str.20 = private unnamed_addr constant [44 x i8] c"Memory allocation failed for matrix columns\00", align 1
  41. @.str.21 = private unnamed_addr constant [20 x i8] c"Null matrix pointer\00", align 1
  42. @.str.22 = private unnamed_addr constant [20 x i8] c"Invalid matrix data\00", align 1
  43. @.str.23 = private unnamed_addr constant [45 x i8] c"Invalid matrix dimensions for multiplication\00", align 1
  44. @.str.24 = private unnamed_addr constant [42 x i8] c"Integer overflow in matrix multiplication\00", align 1
  45. @.str.25 = private unnamed_addr constant [38 x i8] c"Memory allocation failed for new node\00", align 1
  46. @insertNode.maxDepth = internal global i32 0, align 4
  47. @.str.26 = private unnamed_addr constant [34 x i8] c"List exceeds maximum allowed size\00", align 1
  48. @calculationResult = internal global i32 0, align 4
  49. @.str.27 = private unnamed_addr constant [30 x i8] c"Final calculation result: %d\0A\00", align 1
  50. @.str.28 = private unnamed_addr constant [11 x i8] c"Error: %s\0A\00", align 1
  51. @.str.29 = private unnamed_addr constant [29 x i8] c"Error during array push: %s\0A\00", align 1
  52. @.str.30 = private unnamed_addr constant [33 x i8] c"Error during list insertion: %s\0A\00", align 1
  53. @.str.31 = private unnamed_addr constant [43 x i8] c"Circular reference detected in linked list\00", align 1
  54. @.str.32 = private unnamed_addr constant [22 x i8] c"Invalid point weights\00", align 1
  55. @.str.33 = private unnamed_addr constant [31 x i8] c"Coordinates out of valid range\00", align 1
  56. @.str.34 = private unnamed_addr constant [30 x i8] c"Distance calculation overflow\00", align 1
  57. @.str.35 = private unnamed_addr constant [36 x i8] c"Invalid distance calculation result\00", align 1
  58. @.str.36 = private unnamed_addr constant [15 x i8] c"Invalid circle\00", align 1
  59. @.str.37 = private unnamed_addr constant [22 x i8] c"Invalid circle radius\00", align 1
  60. @.str.38 = private unnamed_addr constant [24 x i8] c"Circle radius too large\00", align 1
  61. @.str.39 = private unnamed_addr constant [45 x i8] c"Circle center coordinates out of valid range\00", align 1
  62. @.str.40 = private unnamed_addr constant [26 x i8] c"Area calculation overflow\00", align 1
  63. @.str.41 = private unnamed_addr constant [9 x i8] c"standard\00", align 1
  64. @.str.42 = private unnamed_addr constant [9 x i8] c"weighted\00", align 1
  65. @.str.43 = private unnamed_addr constant [35 x i8] c"Invalid weight for weighted circle\00", align 1
  66. @.str.44 = private unnamed_addr constant [20 x i8] c"Unknown circle type\00", align 1
  67. @.str.45 = private unnamed_addr constant [17 x i8] c"Null matrix data\00", align 1
  68. @.str.46 = private unnamed_addr constant [28 x i8] c"Matrix dimensions too large\00", align 1
  69. @.str.47 = private unnamed_addr constant [27 x i8] c"Invalid matrix row pointer\00", align 1
  70. @.str.48 = private unnamed_addr constant [32 x i8] c"Inconsistent square matrix flag\00", align 1
  71. @.str.49 = private unnamed_addr constant [14 x i8] c"Invalid array\00", align 1
  72. @.str.50 = private unnamed_addr constant [21 x i8] c"Invalid points array\00", align 1
  73. @.str.51 = private unnamed_addr constant [16 x i8] c"Too many points\00", align 1
  74. @.str.52 = private unnamed_addr constant [39 x i8] c"Failed to allocate memory for centroid\00", align 1
  75. @.str.53 = private unnamed_addr constant [21 x i8] c"Invalid point weight\00", align 1
  76. @.str.54 = private unnamed_addr constant [30 x i8] c"Centroid calculation overflow\00", align 1
  77. @.str.55 = private unnamed_addr constant [21 x i8] c"Total weight is zero\00", align 1
  78. @.str.56 = private unnamed_addr constant [9 x i8] c"Centroid\00", align 1
  79. @cache = internal global [100 x i32] zeroinitializer, align 16
  80. @__const.projectB_main.str = private unnamed_addr constant [14 x i8] c"Hello, World!\00", align 1
  81. @__const.projectB_main.arr = private unnamed_addr constant [8 x i32] [i32 10, i32 22, i32 9, i32 33, i32 21, i32 50, i32 41, i32 60], align 16
  82. @__const.projectB_main.matrix = private unnamed_addr constant <{ <{ i32, i32, i32, [97 x i32] }>, <{ i32, i32, i32, [97 x i32] }>, <{ i32, i32, i32, [97 x i32] }>, [97 x <{ i32, i32, i32, [97 x i32] }>] }> <{ <{ i32, i32, i32, [97 x i32] }> <{ i32 1, i32 2, i32 3, [97 x i32] zeroinitializer }>, <{ i32, i32, i32, [97 x i32] }> <{ i32 4, i32 5, i32 6, [97 x i32] zeroinitializer }>, <{ i32, i32, i32, [97 x i32] }> <{ i32 7, i32 8, i32 9, [97 x i32] zeroinitializer }>, [97 x <{ i32, i32, i32, [97 x i32] }>] zeroinitializer }>, align 16
  83. ; Function Attrs: noinline nounwind optnone uwtable
  84. define dso_local i8* @getErrorMessage() #0 !project_source !2 {
  85. %1 = load i8*, i8** @globalErrorMessage, align 8
  86. %2 = icmp ne i8* %1, null
  87. br i1 %2, label %3, label %5
  88. 3: ; preds = %0
  89. %4 = load i8*, i8** @globalErrorMessage, align 8
  90. br label %6
  91. 5: ; preds = %0
  92. br label %6
  93. 6: ; preds = %5, %3
  94. %7 = phi i8* [ %4, %3 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %5 ]
  95. ret i8* %7
  96. }
  97. ; Function Attrs: nounwind
  98. declare dso_local void @free(i8*) #1
  99. ; Function Attrs: nounwind
  100. declare dso_local noalias i8* @strdup(i8*) #1
  101. declare dso_local i32 @fprintf(%struct._IO_FILE*, i8*, ...) #2
  102. ; Function Attrs: noinline nounwind optnone uwtable
  103. define dso_local i32 @factorial(i32 %0) #0 !project_source !2 {
  104. %2 = alloca i32, align 4
  105. %3 = alloca i32, align 4
  106. %4 = alloca i32, align 4
  107. %5 = alloca i32, align 4
  108. store i32 %0, i32* %3, align 4
  109. %6 = load i32, i32* @recursionDepth, align 4
  110. %7 = add nsw i32 %6, 1
  111. store i32 %7, i32* @recursionDepth, align 4
  112. %8 = icmp sgt i32 %7, 1000
  113. br i1 %8, label %9, label %13
  114. 9: ; preds = %1
  115. %10 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
  116. %11 = load i32, i32* @recursionDepth, align 4
  117. %12 = add nsw i32 %11, -1
  118. store i32 %12, i32* @recursionDepth, align 4
  119. store i32 -1, i32* %2, align 4
  120. br label %57
  121. 13: ; preds = %1
  122. %14 = load i32, i32* %3, align 4
  123. %15 = icmp slt i32 %14, 0
  124. br i1 %15, label %16, label %20
  125. 16: ; preds = %13
  126. %17 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
  127. %18 = load i32, i32* @recursionDepth, align 4
  128. %19 = add nsw i32 %18, -1
  129. store i32 %19, i32* @recursionDepth, align 4
  130. store i32 -1, i32* %2, align 4
  131. br label %57
  132. 20: ; preds = %13
  133. %21 = load i32, i32* %3, align 4
  134. %22 = icmp sgt i32 %21, 20
  135. br i1 %22, label %23, label %27
  136. 23: ; preds = %20
  137. %24 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
  138. %25 = load i32, i32* @recursionDepth, align 4
  139. %26 = add nsw i32 %25, -1
  140. store i32 %26, i32* @recursionDepth, align 4
  141. store i32 -1, i32* %2, align 4
  142. br label %57
  143. 27: ; preds = %20
  144. %28 = load i32, i32* %3, align 4
  145. %29 = icmp sle i32 %28, 1
  146. br i1 %29, label %30, label %31
  147. 30: ; preds = %27
  148. store i32 1, i32* %4, align 4
  149. br label %53
  150. 31: ; preds = %27
  151. %32 = load i32, i32* %3, align 4
  152. %33 = sub nsw i32 %32, 1
  153. %34 = call i32 @factorial(i32 %33)
  154. store i32 %34, i32* %5, align 4
  155. %35 = load i32, i32* %5, align 4
  156. %36 = icmp eq i32 %35, -1
  157. br i1 %36, label %37, label %40
  158. 37: ; preds = %31
  159. %38 = load i32, i32* @recursionDepth, align 4
  160. %39 = add nsw i32 %38, -1
  161. store i32 %39, i32* @recursionDepth, align 4
  162. store i32 -1, i32* %2, align 4
  163. br label %57
  164. 40: ; preds = %31
  165. %41 = load i32, i32* %5, align 4
  166. %42 = load i32, i32* %3, align 4
  167. %43 = sdiv i32 2147483647, %42
  168. %44 = icmp sgt i32 %41, %43
  169. br i1 %44, label %45, label %49
  170. 45: ; preds = %40
  171. %46 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
  172. %47 = load i32, i32* @recursionDepth, align 4
  173. %48 = add nsw i32 %47, -1
  174. store i32 %48, i32* @recursionDepth, align 4
  175. store i32 -1, i32* %2, align 4
  176. br label %57
  177. 49: ; preds = %40
  178. %50 = load i32, i32* %3, align 4
  179. %51 = load i32, i32* %5, align 4
  180. %52 = mul nsw i32 %50, %51
  181. store i32 %52, i32* %4, align 4
  182. br label %53
  183. 53: ; preds = %49, %30
  184. %54 = load i32, i32* @recursionDepth, align 4
  185. %55 = add nsw i32 %54, -1
  186. store i32 %55, i32* @recursionDepth, align 4
  187. %56 = load i32, i32* %4, align 4
  188. store i32 %56, i32* %2, align 4
  189. br label %57
  190. 57: ; preds = %53, %45, %37, %23, %16, %9
  191. %58 = load i32, i32* %2, align 4
  192. ret i32 %58
  193. }
  194. ; Function Attrs: nounwind
  195. declare dso_local noalias i8* @malloc(i64) #1
  196. ; Function Attrs: noinline nounwind optnone uwtable
  197. define dso_local void @pushBack(%struct.DynamicArray* %0, i32 %1) #0 !project_source !2 {
  198. %3 = alloca %struct.DynamicArray*, align 8
  199. %4 = alloca i32, align 4
  200. %5 = alloca i32, align 4
  201. %6 = alloca i32*, align 8
  202. store %struct.DynamicArray* %0, %struct.DynamicArray** %3, align 8
  203. store i32 %1, i32* %4, align 4
  204. %7 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  205. %8 = icmp ne %struct.DynamicArray* %7, null
  206. br i1 %8, label %11, label %9
  207. 9: ; preds = %2
  208. %10 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0))
  209. br label %94
  210. 11: ; preds = %2
  211. %12 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  212. %13 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %12, i32 0, i32 1
  213. %14 = load i32, i32* %13, align 8
  214. %15 = icmp sge i32 %14, 1000
  215. br i1 %15, label %16, label %18
  216. 16: ; preds = %11
  217. %17 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.11, i64 0, i64 0))
  218. br label %94
  219. 18: ; preds = %11
  220. %19 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  221. %20 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %19, i32 0, i32 1
  222. %21 = load i32, i32* %20, align 8
  223. %22 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  224. %23 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %22, i32 0, i32 2
  225. %24 = load i32, i32* %23, align 4
  226. %25 = icmp sge i32 %21, %24
  227. br i1 %25, label %26, label %55
  228. 26: ; preds = %18
  229. %27 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  230. %28 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %27, i32 0, i32 2
  231. %29 = load i32, i32* %28, align 4
  232. %30 = mul nsw i32 %29, 2
  233. store i32 %30, i32* %5, align 4
  234. %31 = load i32, i32* %5, align 4
  235. %32 = icmp sgt i32 %31, 1000
  236. br i1 %32, label %33, label %34
  237. 33: ; preds = %26
  238. store i32 1000, i32* %5, align 4
  239. br label %34
  240. 34: ; preds = %33, %26
  241. %35 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  242. %36 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %35, i32 0, i32 0
  243. %37 = load i32*, i32** %36, align 8
  244. %38 = bitcast i32* %37 to i8*
  245. %39 = load i32, i32* %5, align 4
  246. %40 = sext i32 %39 to i64
  247. %41 = mul i64 4, %40
  248. %42 = call i8* @realloc(i8* %38, i64 %41) #7
  249. %43 = bitcast i8* %42 to i32*
  250. store i32* %43, i32** %6, align 8
  251. %44 = load i32*, i32** %6, align 8
  252. %45 = icmp ne i32* %44, null
  253. br i1 %45, label %48, label %46
  254. 46: ; preds = %34
  255. %47 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0))
  256. br label %94
  257. 48: ; preds = %34
  258. %49 = load i32*, i32** %6, align 8
  259. %50 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  260. %51 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %50, i32 0, i32 0
  261. store i32* %49, i32** %51, align 8
  262. %52 = load i32, i32* %5, align 4
  263. %53 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  264. %54 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %53, i32 0, i32 2
  265. store i32 %52, i32* %54, align 4
  266. br label %55
  267. 55: ; preds = %48, %18
  268. %56 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  269. %57 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %56, i32 0, i32 3
  270. %58 = load i32, i32* %57, align 8
  271. %59 = icmp ne i32 %58, 0
  272. br i1 %59, label %60, label %81
  273. 60: ; preds = %55
  274. %61 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  275. %62 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %61, i32 0, i32 1
  276. %63 = load i32, i32* %62, align 8
  277. %64 = icmp sgt i32 %63, 0
  278. br i1 %64, label %65, label %81
  279. 65: ; preds = %60
  280. %66 = load i32, i32* %4, align 4
  281. %67 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  282. %68 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %67, i32 0, i32 0
  283. %69 = load i32*, i32** %68, align 8
  284. %70 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  285. %71 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %70, i32 0, i32 1
  286. %72 = load i32, i32* %71, align 8
  287. %73 = sub nsw i32 %72, 1
  288. %74 = sext i32 %73 to i64
  289. %75 = getelementptr inbounds i32, i32* %69, i64 %74
  290. %76 = load i32, i32* %75, align 4
  291. %77 = icmp slt i32 %66, %76
  292. br i1 %77, label %78, label %81
  293. 78: ; preds = %65
  294. %79 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  295. %80 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %79, i32 0, i32 3
  296. store i32 0, i32* %80, align 8
  297. br label %81
  298. 81: ; preds = %78, %65, %60, %55
  299. %82 = load i32, i32* %4, align 4
  300. %83 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  301. %84 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %83, i32 0, i32 0
  302. %85 = load i32*, i32** %84, align 8
  303. %86 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  304. %87 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %86, i32 0, i32 1
  305. %88 = load i32, i32* %87, align 8
  306. %89 = add nsw i32 %88, 1
  307. store i32 %89, i32* %87, align 8
  308. %90 = sext i32 %88 to i64
  309. %91 = getelementptr inbounds i32, i32* %85, i64 %90
  310. store i32 %82, i32* %91, align 4
  311. %92 = load %struct.DynamicArray*, %struct.DynamicArray** %3, align 8
  312. %93 = getelementptr inbounds %struct.DynamicArray, %struct.DynamicArray* %92, i32 0, i32 4
  313. store i32 1, i32* %93, align 4
  314. br label %94
  315. 94: ; preds = %81, %46, %16, %9
  316. ret void
  317. }
  318. ; Function Attrs: nounwind
  319. declare dso_local i8* @realloc(i8*, i64) #1
  320. ; Function Attrs: nounwind
  321. declare dso_local noalias i8* @calloc(i64, i64) #1
  322. ; Function Attrs: noinline nounwind optnone uwtable
  323. define dso_local %struct.Matrix* @multiplyMatrices(%struct.Matrix* %0, %struct.Matrix* %1) #0 !project_source !2 {
  324. %3 = alloca %struct.Matrix*, align 8
  325. %4 = alloca %struct.Matrix*, align 8
  326. %5 = alloca %struct.Matrix*, align 8
  327. %6 = alloca %struct.Matrix*, align 8
  328. %7 = alloca i64, align 8
  329. %8 = alloca i32, align 4
  330. %9 = alloca i32, align 4
  331. %10 = alloca i64, align 8
  332. %11 = alloca i32, align 4
  333. %12 = alloca i64, align 8
  334. %13 = alloca i32, align 4
  335. store %struct.Matrix* %0, %struct.Matrix** %4, align 8
  336. store %struct.Matrix* %1, %struct.Matrix** %5, align 8
  337. %14 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  338. %15 = icmp ne %struct.Matrix* %14, null
  339. br i1 %15, label %16, label %19
  340. 16: ; preds = %2
  341. %17 = load %struct.Matrix*, %struct.Matrix** %5, align 8
  342. %18 = icmp ne %struct.Matrix* %17, null
  343. br i1 %18, label %21, label %19
  344. 19: ; preds = %16, %2
  345. %20 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.21, i64 0, i64 0))
  346. store %struct.Matrix* null, %struct.Matrix** %3, align 8
  347. br label %214
  348. 21: ; preds = %16
  349. %22 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  350. %23 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %22, i32 0, i32 0
  351. %24 = load i32**, i32*** %23, align 8
  352. %25 = icmp ne i32** %24, null
  353. br i1 %25, label %26, label %31
  354. 26: ; preds = %21
  355. %27 = load %struct.Matrix*, %struct.Matrix** %5, align 8
  356. %28 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %27, i32 0, i32 0
  357. %29 = load i32**, i32*** %28, align 8
  358. %30 = icmp ne i32** %29, null
  359. br i1 %30, label %33, label %31
  360. 31: ; preds = %26, %21
  361. %32 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.22, i64 0, i64 0))
  362. store %struct.Matrix* null, %struct.Matrix** %3, align 8
  363. br label %214
  364. 33: ; preds = %26
  365. %34 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  366. %35 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %34, i32 0, i32 2
  367. %36 = load i32, i32* %35, align 4
  368. %37 = load %struct.Matrix*, %struct.Matrix** %5, align 8
  369. %38 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %37, i32 0, i32 1
  370. %39 = load i32, i32* %38, align 8
  371. %40 = icmp ne i32 %36, %39
  372. br i1 %40, label %41, label %43
  373. 41: ; preds = %33
  374. %42 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.23, i64 0, i64 0))
  375. store %struct.Matrix* null, %struct.Matrix** %3, align 8
  376. br label %214
  377. 43: ; preds = %33
  378. %44 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  379. %45 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %44, i32 0, i32 2
  380. %46 = load i32, i32* %45, align 4
  381. %47 = icmp sgt i32 %46, 100
  382. br i1 %47, label %53, label %48
  383. 48: ; preds = %43
  384. %49 = load %struct.Matrix*, %struct.Matrix** %5, align 8
  385. %50 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %49, i32 0, i32 1
  386. %51 = load i32, i32* %50, align 8
  387. %52 = icmp sgt i32 %51, 100
  388. br i1 %52, label %53, label %55
  389. 53: ; preds = %48, %43
  390. %54 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.17, i64 0, i64 0))
  391. store %struct.Matrix* null, %struct.Matrix** %3, align 8
  392. br label %214
  393. 55: ; preds = %48
  394. %56 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  395. %57 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %56, i32 0, i32 1
  396. %58 = load i32, i32* %57, align 8
  397. %59 = load %struct.Matrix*, %struct.Matrix** %5, align 8
  398. %60 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %59, i32 0, i32 2
  399. %61 = load i32, i32* %60, align 4
  400. %62 = call %struct.Matrix* @fused_createMatrix(i1 false, i32 %58, i32 %61, i8* null)
  401. store %struct.Matrix* %62, %struct.Matrix** %6, align 8
  402. %63 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  403. %64 = icmp ne %struct.Matrix* %63, null
  404. br i1 %64, label %66, label %65
  405. 65: ; preds = %55
  406. store %struct.Matrix* null, %struct.Matrix** %3, align 8
  407. br label %214
  408. 66: ; preds = %55
  409. store i64 0, i64* %7, align 8
  410. store i32 0, i32* %8, align 4
  411. br label %67
  412. 67: ; preds = %199, %66
  413. %68 = load i32, i32* %8, align 4
  414. %69 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  415. %70 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %69, i32 0, i32 1
  416. %71 = load i32, i32* %70, align 8
  417. %72 = icmp slt i32 %68, %71
  418. br i1 %72, label %73, label %202
  419. 73: ; preds = %67
  420. store i32 0, i32* %9, align 4
  421. br label %74
  422. 74: ; preds = %195, %73
  423. %75 = load i32, i32* %9, align 4
  424. %76 = load %struct.Matrix*, %struct.Matrix** %5, align 8
  425. %77 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %76, i32 0, i32 2
  426. %78 = load i32, i32* %77, align 4
  427. %79 = icmp slt i32 %75, %78
  428. br i1 %79, label %80, label %198
  429. 80: ; preds = %74
  430. store i64 0, i64* %10, align 8
  431. store i32 0, i32* %11, align 4
  432. br label %81
  433. 81: ; preds = %149, %80
  434. %82 = load i32, i32* %11, align 4
  435. %83 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  436. %84 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %83, i32 0, i32 2
  437. %85 = load i32, i32* %84, align 4
  438. %86 = icmp slt i32 %82, %85
  439. br i1 %86, label %87, label %152
  440. 87: ; preds = %81
  441. %88 = load %struct.Matrix*, %struct.Matrix** %4, align 8
  442. %89 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %88, i32 0, i32 0
  443. %90 = load i32**, i32*** %89, align 8
  444. %91 = load i32, i32* %8, align 4
  445. %92 = sext i32 %91 to i64
  446. %93 = getelementptr inbounds i32*, i32** %90, i64 %92
  447. %94 = load i32*, i32** %93, align 8
  448. %95 = load i32, i32* %11, align 4
  449. %96 = sext i32 %95 to i64
  450. %97 = getelementptr inbounds i32, i32* %94, i64 %96
  451. %98 = load i32, i32* %97, align 4
  452. %99 = sext i32 %98 to i64
  453. %100 = load %struct.Matrix*, %struct.Matrix** %5, align 8
  454. %101 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %100, i32 0, i32 0
  455. %102 = load i32**, i32*** %101, align 8
  456. %103 = load i32, i32* %11, align 4
  457. %104 = sext i32 %103 to i64
  458. %105 = getelementptr inbounds i32*, i32** %102, i64 %104
  459. %106 = load i32*, i32** %105, align 8
  460. %107 = load i32, i32* %9, align 4
  461. %108 = sext i32 %107 to i64
  462. %109 = getelementptr inbounds i32, i32* %106, i64 %108
  463. %110 = load i32, i32* %109, align 4
  464. %111 = sext i32 %110 to i64
  465. %112 = mul nsw i64 %99, %111
  466. store i64 %112, i64* %12, align 8
  467. %113 = load i64, i64* %12, align 8
  468. %114 = load i64, i64* %10, align 8
  469. %115 = add nsw i64 %114, %113
  470. store i64 %115, i64* %10, align 8
  471. %116 = load i64, i64* %10, align 8
  472. %117 = icmp sgt i64 %116, 2147483647
  473. br i1 %117, label %121, label %118
  474. 118: ; preds = %87
  475. %119 = load i64, i64* %10, align 8
  476. %120 = icmp slt i64 %119, -2147483648
  477. br i1 %120, label %121, label %148
  478. 121: ; preds = %118, %87
  479. %122 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.24, i64 0, i64 0))
  480. store i32 0, i32* %13, align 4
  481. br label %123
  482. 123: ; preds = %138, %121
  483. %124 = load i32, i32* %13, align 4
  484. %125 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  485. %126 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %125, i32 0, i32 1
  486. %127 = load i32, i32* %126, align 8
  487. %128 = icmp slt i32 %124, %127
  488. br i1 %128, label %129, label %141
  489. 129: ; preds = %123
  490. %130 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  491. %131 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %130, i32 0, i32 0
  492. %132 = load i32**, i32*** %131, align 8
  493. %133 = load i32, i32* %13, align 4
  494. %134 = sext i32 %133 to i64
  495. %135 = getelementptr inbounds i32*, i32** %132, i64 %134
  496. %136 = load i32*, i32** %135, align 8
  497. %137 = bitcast i32* %136 to i8*
  498. call void @free(i8* %137) #7
  499. br label %138
  500. 138: ; preds = %129
  501. %139 = load i32, i32* %13, align 4
  502. %140 = add nsw i32 %139, 1
  503. store i32 %140, i32* %13, align 4
  504. br label %123
  505. 141: ; preds = %123
  506. %142 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  507. %143 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %142, i32 0, i32 0
  508. %144 = load i32**, i32*** %143, align 8
  509. %145 = bitcast i32** %144 to i8*
  510. call void @free(i8* %145) #7
  511. %146 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  512. %147 = bitcast %struct.Matrix* %146 to i8*
  513. call void @free(i8* %147) #7
  514. store %struct.Matrix* null, %struct.Matrix** %3, align 8
  515. br label %214
  516. 148: ; preds = %118
  517. br label %149
  518. 149: ; preds = %148
  519. %150 = load i32, i32* %11, align 4
  520. %151 = add nsw i32 %150, 1
  521. store i32 %151, i32* %11, align 4
  522. br label %81
  523. 152: ; preds = %81
  524. %153 = load i64, i64* %10, align 8
  525. %154 = trunc i64 %153 to i32
  526. %155 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  527. %156 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %155, i32 0, i32 0
  528. %157 = load i32**, i32*** %156, align 8
  529. %158 = load i32, i32* %8, align 4
  530. %159 = sext i32 %158 to i64
  531. %160 = getelementptr inbounds i32*, i32** %157, i64 %159
  532. %161 = load i32*, i32** %160, align 8
  533. %162 = load i32, i32* %9, align 4
  534. %163 = sext i32 %162 to i64
  535. %164 = getelementptr inbounds i32, i32* %161, i64 %163
  536. store i32 %154, i32* %164, align 4
  537. %165 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  538. %166 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %165, i32 0, i32 0
  539. %167 = load i32**, i32*** %166, align 8
  540. %168 = load i32, i32* %8, align 4
  541. %169 = sext i32 %168 to i64
  542. %170 = getelementptr inbounds i32*, i32** %167, i64 %169
  543. %171 = load i32*, i32** %170, align 8
  544. %172 = load i32, i32* %9, align 4
  545. %173 = sext i32 %172 to i64
  546. %174 = getelementptr inbounds i32, i32* %171, i64 %173
  547. %175 = load i32, i32* %174, align 4
  548. %176 = call i32 @abs(i32 %175) #8
  549. %177 = sext i32 %176 to i64
  550. %178 = load i64, i64* %7, align 8
  551. %179 = icmp sgt i64 %177, %178
  552. br i1 %179, label %180, label %194
  553. 180: ; preds = %152
  554. %181 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  555. %182 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %181, i32 0, i32 0
  556. %183 = load i32**, i32*** %182, align 8
  557. %184 = load i32, i32* %8, align 4
  558. %185 = sext i32 %184 to i64
  559. %186 = getelementptr inbounds i32*, i32** %183, i64 %185
  560. %187 = load i32*, i32** %186, align 8
  561. %188 = load i32, i32* %9, align 4
  562. %189 = sext i32 %188 to i64
  563. %190 = getelementptr inbounds i32, i32* %187, i64 %189
  564. %191 = load i32, i32* %190, align 4
  565. %192 = call i32 @abs(i32 %191) #8
  566. %193 = sext i32 %192 to i64
  567. store i64 %193, i64* %7, align 8
  568. br label %194
  569. 194: ; preds = %180, %152
  570. br label %195
  571. 195: ; preds = %194
  572. %196 = load i32, i32* %9, align 4
  573. %197 = add nsw i32 %196, 1
  574. store i32 %197, i32* %9, align 4
  575. br label %74
  576. 198: ; preds = %74
  577. br label %199
  578. 199: ; preds = %198
  579. %200 = load i32, i32* %8, align 4
  580. %201 = add nsw i32 %200, 1
  581. store i32 %201, i32* %8, align 4
  582. br label %67
  583. 202: ; preds = %67
  584. %203 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  585. %204 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %203, i32 0, i32 1
  586. %205 = load i32, i32* %204, align 8
  587. %206 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  588. %207 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %206, i32 0, i32 2
  589. %208 = load i32, i32* %207, align 4
  590. %209 = icmp eq i32 %205, %208
  591. %210 = zext i1 %209 to i32
  592. %211 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  593. %212 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %211, i32 0, i32 3
  594. store i32 %210, i32* %212, align 8
  595. %213 = load %struct.Matrix*, %struct.Matrix** %6, align 8
  596. store %struct.Matrix* %213, %struct.Matrix** %3, align 8
  597. br label %214
  598. 214: ; preds = %202, %141, %65, %53, %41, %31, %19
  599. %215 = load %struct.Matrix*, %struct.Matrix** %3, align 8
  600. ret %struct.Matrix* %215
  601. }
  602. ; Function Attrs: nounwind readnone
  603. declare dso_local i32 @abs(i32) #3
  604. ; Function Attrs: noinline nounwind optnone uwtable
  605. define dso_local %struct.Node* @insertNode(%struct.Node* %0, i32 %1) #0 !project_source !2 {
  606. %3 = alloca %struct.Node*, align 8
  607. %4 = alloca %struct.Node*, align 8
  608. %5 = alloca i32, align 4
  609. %6 = alloca %struct.Node*, align 8
  610. %7 = alloca %struct.Node*, align 8
  611. %8 = alloca %struct.Node*, align 8
  612. %9 = alloca i32, align 4
  613. store %struct.Node* %0, %struct.Node** %4, align 8
  614. store i32 %1, i32* %5, align 4
  615. %10 = call noalias i8* @malloc(i64 32) #7
  616. %11 = bitcast i8* %10 to %struct.Node*
  617. store %struct.Node* %11, %struct.Node** %6, align 8
  618. %12 = load %struct.Node*, %struct.Node** %6, align 8
  619. %13 = icmp ne %struct.Node* %12, null
  620. br i1 %13, label %17, label %14
  621. 14: ; preds = %2
  622. %15 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.25, i64 0, i64 0))
  623. %16 = load %struct.Node*, %struct.Node** %4, align 8
  624. store %struct.Node* %16, %struct.Node** %3, align 8
  625. br label %94
  626. 17: ; preds = %2
  627. %18 = load i32, i32* %5, align 4
  628. %19 = load %struct.Node*, %struct.Node** %6, align 8
  629. %20 = getelementptr inbounds %struct.Node, %struct.Node* %19, i32 0, i32 0
  630. store i32 %18, i32* %20, align 8
  631. %21 = load %struct.Node*, %struct.Node** %6, align 8
  632. %22 = getelementptr inbounds %struct.Node, %struct.Node* %21, i32 0, i32 1
  633. store %struct.Node* null, %struct.Node** %22, align 8
  634. %23 = load %struct.Node*, %struct.Node** %6, align 8
  635. %24 = getelementptr inbounds %struct.Node, %struct.Node* %23, i32 0, i32 2
  636. store %struct.Node* null, %struct.Node** %24, align 8
  637. %25 = load %struct.Node*, %struct.Node** %6, align 8
  638. %26 = getelementptr inbounds %struct.Node, %struct.Node* %25, i32 0, i32 3
  639. store i32 0, i32* %26, align 8
  640. %27 = load %struct.Node*, %struct.Node** %4, align 8
  641. %28 = icmp ne %struct.Node* %27, null
  642. br i1 %28, label %33, label %29
  643. 29: ; preds = %17
  644. %30 = load %struct.Node*, %struct.Node** %6, align 8
  645. %31 = getelementptr inbounds %struct.Node, %struct.Node* %30, i32 0, i32 4
  646. store i32 0, i32* %31, align 4
  647. store i32 0, i32* @insertNode.maxDepth, align 4
  648. %32 = load %struct.Node*, %struct.Node** %6, align 8
  649. store %struct.Node* %32, %struct.Node** %3, align 8
  650. br label %94
  651. 33: ; preds = %17
  652. %34 = load %struct.Node*, %struct.Node** %4, align 8
  653. store %struct.Node* %34, %struct.Node** %7, align 8
  654. store %struct.Node* null, %struct.Node** %8, align 8
  655. store i32 0, i32* %9, align 4
  656. br label %35
  657. 35: ; preds = %60, %33
  658. %36 = load %struct.Node*, %struct.Node** %7, align 8
  659. %37 = icmp ne %struct.Node* %36, null
  660. br i1 %37, label %38, label %44
  661. 38: ; preds = %35
  662. %39 = load %struct.Node*, %struct.Node** %7, align 8
  663. %40 = getelementptr inbounds %struct.Node, %struct.Node* %39, i32 0, i32 0
  664. %41 = load i32, i32* %40, align 8
  665. %42 = load i32, i32* %5, align 4
  666. %43 = icmp slt i32 %41, %42
  667. br label %44
  668. 44: ; preds = %38, %35
  669. %45 = phi i1 [ false, %35 ], [ %43, %38 ]
  670. br i1 %45, label %46, label %61
  671. 46: ; preds = %44
  672. %47 = load %struct.Node*, %struct.Node** %7, align 8
  673. store %struct.Node* %47, %struct.Node** %8, align 8
  674. %48 = load %struct.Node*, %struct.Node** %7, align 8
  675. %49 = getelementptr inbounds %struct.Node, %struct.Node* %48, i32 0, i32 1
  676. %50 = load %struct.Node*, %struct.Node** %49, align 8
  677. store %struct.Node* %50, %struct.Node** %7, align 8
  678. %51 = load i32, i32* %9, align 4
  679. %52 = add nsw i32 %51, 1
  680. store i32 %52, i32* %9, align 4
  681. %53 = load i32, i32* %9, align 4
  682. %54 = icmp sgt i32 %53, 1000
  683. br i1 %54, label %55, label %60
  684. 55: ; preds = %46
  685. %56 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.26, i64 0, i64 0))
  686. %57 = load %struct.Node*, %struct.Node** %6, align 8
  687. %58 = bitcast %struct.Node* %57 to i8*
  688. call void @free(i8* %58) #7
  689. %59 = load %struct.Node*, %struct.Node** %4, align 8
  690. store %struct.Node* %59, %struct.Node** %3, align 8
  691. br label %94
  692. 60: ; preds = %46
  693. br label %35
  694. 61: ; preds = %44
  695. %62 = load i32, i32* %9, align 4
  696. %63 = load i32, i32* @insertNode.maxDepth, align 4
  697. %64 = icmp sgt i32 %62, %63
  698. br i1 %64, label %65, label %67
  699. 65: ; preds = %61
  700. %66 = load i32, i32* %9, align 4
  701. store i32 %66, i32* @insertNode.maxDepth, align 4
  702. br label %67
  703. 67: ; preds = %65, %61
  704. %68 = load i32, i32* %9, align 4
  705. %69 = load %struct.Node*, %struct.Node** %6, align 8
  706. %70 = getelementptr inbounds %struct.Node, %struct.Node* %69, i32 0, i32 4
  707. store i32 %68, i32* %70, align 4
  708. %71 = load %struct.Node*, %struct.Node** %7, align 8
  709. %72 = load %struct.Node*, %struct.Node** %6, align 8
  710. %73 = getelementptr inbounds %struct.Node, %struct.Node* %72, i32 0, i32 1
  711. store %struct.Node* %71, %struct.Node** %73, align 8
  712. %74 = load %struct.Node*, %struct.Node** %8, align 8
  713. %75 = icmp ne %struct.Node* %74, null
  714. br i1 %75, label %76, label %83
  715. 76: ; preds = %67
  716. %77 = load %struct.Node*, %struct.Node** %6, align 8
  717. %78 = load %struct.Node*, %struct.Node** %8, align 8
  718. %79 = getelementptr inbounds %struct.Node, %struct.Node* %78, i32 0, i32 1
  719. store %struct.Node* %77, %struct.Node** %79, align 8
  720. %80 = load %struct.Node*, %struct.Node** %8, align 8
  721. %81 = load %struct.Node*, %struct.Node** %6, align 8
  722. %82 = getelementptr inbounds %struct.Node, %struct.Node* %81, i32 0, i32 2
  723. store %struct.Node* %80, %struct.Node** %82, align 8
  724. br label %85
  725. 83: ; preds = %67
  726. %84 = load %struct.Node*, %struct.Node** %6, align 8
  727. store %struct.Node* %84, %struct.Node** %3, align 8
  728. br label %94
  729. 85: ; preds = %76
  730. %86 = load %struct.Node*, %struct.Node** %7, align 8
  731. %87 = icmp ne %struct.Node* %86, null
  732. br i1 %87, label %88, label %92
  733. 88: ; preds = %85
  734. %89 = load %struct.Node*, %struct.Node** %6, align 8
  735. %90 = load %struct.Node*, %struct.Node** %7, align 8
  736. %91 = getelementptr inbounds %struct.Node, %struct.Node* %90, i32 0, i32 2
  737. store %struct.Node* %89, %struct.Node** %91, align 8
  738. br label %92
  739. 92: ; preds = %88, %85
  740. %93 = load %struct.Node*, %struct.Node** %4, align 8
  741. store %struct.Node* %93, %struct.Node** %3, align 8
  742. br label %94
  743. 94: ; preds = %92, %83, %55, %29, %14
  744. %95 = load %struct.Node*, %struct.Node** %3, align 8
  745. ret %struct.Node* %95
  746. }
  747. declare dso_local i32 @printf(i8*, ...) #2
  748. ; Function Attrs: nounwind
  749. declare dso_local i64 @time(i64*) #1
  750. ; Function Attrs: nounwind
  751. declare dso_local void @srand(i32) #1
  752. ; Function Attrs: nounwind
  753. declare dso_local i32 @rand() #1
  754. ; Function Attrs: noinline nounwind optnone uwtable
  755. define dso_local double @calculateDistance(%struct.Point* byval(%struct.Point) align 8 %0, %struct.Point* byval(%struct.Point) align 8 %1, i32* %2) #0 !project_source !2 {
  756. %4 = alloca double, align 8
  757. %5 = alloca i32*, align 8
  758. %6 = alloca double, align 8
  759. %7 = alloca double, align 8
  760. %8 = alloca double, align 8
  761. store i32* %2, i32** %5, align 8
  762. %9 = load i32*, i32** %5, align 8
  763. store i32 0, i32* %9, align 4
  764. %10 = getelementptr inbounds %struct.Point, %struct.Point* %0, i32 0, i32 3
  765. %11 = load double, double* %10, align 8
  766. %12 = fcmp ole double %11, 0.000000e+00
  767. br i1 %12, label %17, label %13
  768. 13: ; preds = %3
  769. %14 = getelementptr inbounds %struct.Point, %struct.Point* %1, i32 0, i32 3
  770. %15 = load double, double* %14, align 8
  771. %16 = fcmp ole double %15, 0.000000e+00
  772. br i1 %16, label %17, label %20
  773. 17: ; preds = %13, %3
  774. %18 = load i32*, i32** %5, align 8
  775. store i32 1, i32* %18, align 4
  776. %19 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.32, i64 0, i64 0))
  777. store double -1.000000e+00, double* %4, align 8
  778. br label %105
  779. 20: ; preds = %13
  780. %21 = getelementptr inbounds %struct.Point, %struct.Point* %0, i32 0, i32 0
  781. %22 = load i32, i32* %21, align 8
  782. %23 = call i32 @abs(i32 %22) #8
  783. %24 = icmp sgt i32 %23, 1000
  784. br i1 %24, label %40, label %25
  785. 25: ; preds = %20
  786. %26 = getelementptr inbounds %struct.Point, %struct.Point* %0, i32 0, i32 1
  787. %27 = load i32, i32* %26, align 4
  788. %28 = call i32 @abs(i32 %27) #8
  789. %29 = icmp sgt i32 %28, 1000
  790. br i1 %29, label %40, label %30
  791. 30: ; preds = %25
  792. %31 = getelementptr inbounds %struct.Point, %struct.Point* %1, i32 0, i32 0
  793. %32 = load i32, i32* %31, align 8
  794. %33 = call i32 @abs(i32 %32) #8
  795. %34 = icmp sgt i32 %33, 1000
  796. br i1 %34, label %40, label %35
  797. 35: ; preds = %30
  798. %36 = getelementptr inbounds %struct.Point, %struct.Point* %1, i32 0, i32 1
  799. %37 = load i32, i32* %36, align 4
  800. %38 = call i32 @abs(i32 %37) #8
  801. %39 = icmp sgt i32 %38, 1000
  802. br i1 %39, label %40, label %43
  803. 40: ; preds = %35, %30, %25, %20
  804. %41 = load i32*, i32** %5, align 8
  805. store i32 3, i32* %41, align 4
  806. %42 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.33, i64 0, i64 0))
  807. store double -1.000000e+00, double* %4, align 8
  808. br label %105
  809. 43: ; preds = %35
  810. %44 = getelementptr inbounds %struct.Point, %struct.Point* %1, i32 0, i32 0
  811. %45 = load i32, i32* %44, align 8
  812. %46 = getelementptr inbounds %struct.Point, %struct.Point* %0, i32 0, i32 0
  813. %47 = load i32, i32* %46, align 8
  814. %48 = sub nsw i32 %45, %47
  815. %49 = sitofp i32 %48 to double
  816. %50 = getelementptr inbounds %struct.Point, %struct.Point* %1, i32 0, i32 3
  817. %51 = load double, double* %50, align 8
  818. %52 = getelementptr inbounds %struct.Point, %struct.Point* %0, i32 0, i32 3
  819. %53 = load double, double* %52, align 8
  820. %54 = fdiv double %51, %53
  821. %55 = call double @sqrt(double %54) #7
  822. %56 = fmul double %49, %55
  823. store double %56, double* %6, align 8
  824. %57 = getelementptr inbounds %struct.Point, %struct.Point* %1, i32 0, i32 1
  825. %58 = load i32, i32* %57, align 4
  826. %59 = getelementptr inbounds %struct.Point, %struct.Point* %0, i32 0, i32 1
  827. %60 = load i32, i32* %59, align 4
  828. %61 = sub nsw i32 %58, %60
  829. %62 = sitofp i32 %61 to double
  830. %63 = getelementptr inbounds %struct.Point, %struct.Point* %1, i32 0, i32 3
  831. %64 = load double, double* %63, align 8
  832. %65 = getelementptr inbounds %struct.Point, %struct.Point* %0, i32 0, i32 3
  833. %66 = load double, double* %65, align 8
  834. %67 = fdiv double %64, %66
  835. %68 = call double @sqrt(double %67) #7
  836. %69 = fmul double %62, %68
  837. store double %69, double* %7, align 8
  838. %70 = load double, double* %6, align 8
  839. %71 = call double @llvm.fabs.f64(double %70)
  840. %72 = fcmp ogt double %71, 1.000000e+03
  841. br i1 %72, label %77, label %73
  842. 73: ; preds = %43
  843. %74 = load double, double* %7, align 8
  844. %75 = call double @llvm.fabs.f64(double %74)
  845. %76 = fcmp ogt double %75, 1.000000e+03
  846. br i1 %76, label %77, label %80
  847. 77: ; preds = %73, %43
  848. %78 = load i32*, i32** %5, align 8
  849. store i32 5, i32* %78, align 4
  850. %79 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.34, i64 0, i64 0))
  851. store double -1.000000e+00, double* %4, align 8
  852. br label %105
  853. 80: ; preds = %73
  854. %81 = load double, double* %6, align 8
  855. %82 = load double, double* %6, align 8
  856. %83 = fmul double %81, %82
  857. %84 = load double, double* %7, align 8
  858. %85 = load double, double* %7, align 8
  859. %86 = fmul double %84, %85
  860. %87 = fadd double %83, %86
  861. %88 = call double @sqrt(double %87) #7
  862. store double %88, double* %8, align 8
  863. %89 = load double, double* %8, align 8
  864. %90 = fcmp uno double %89, %89
  865. br i1 %90, label %100, label %91
  866. 91: ; preds = %80
  867. %92 = load double, double* %8, align 8
  868. %93 = call double @llvm.fabs.f64(double %92) #9
  869. %94 = fcmp oeq double %93, 0x7FF0000000000000
  870. %95 = bitcast double %92 to i64
  871. %96 = icmp slt i64 %95, 0
  872. %97 = select i1 %96, i32 -1, i32 1
  873. %98 = select i1 %94, i32 %97, i32 0
  874. %99 = icmp ne i32 %98, 0
  875. br i1 %99, label %100, label %103
  876. 100: ; preds = %91, %80
  877. %101 = load i32*, i32** %5, align 8
  878. store i32 8, i32* %101, align 4
  879. %102 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.35, i64 0, i64 0))
  880. store double -1.000000e+00, double* %4, align 8
  881. br label %105
  882. 103: ; preds = %91
  883. %104 = load double, double* %8, align 8
  884. store double %104, double* %4, align 8
  885. br label %105
  886. 105: ; preds = %103, %100, %77, %40, %17
  887. %106 = load double, double* %4, align 8
  888. ret double %106
  889. }
  890. ; Function Attrs: nounwind
  891. declare dso_local double @sqrt(double) #1
  892. ; Function Attrs: nounwind readnone speculatable willreturn
  893. declare double @llvm.fabs.f64(double) #4
  894. ; Function Attrs: noinline nounwind optnone uwtable
  895. define dso_local double @calculateCircleArea(%struct.Circle* byval(%struct.Circle) align 8 %0, i32* %1) #0 !project_source !2 {
  896. %3 = alloca double, align 8
  897. %4 = alloca i32*, align 8
  898. %5 = alloca double, align 8
  899. store i32* %1, i32** %4, align 8
  900. %6 = load i32*, i32** %4, align 8
  901. store i32 0, i32* %6, align 4
  902. %7 = getelementptr inbounds %struct.Circle, %struct.Circle* %0, i32 0, i32 2
  903. %8 = load i32, i32* %7, align 8
  904. %9 = icmp ne i32 %8, 0
  905. br i1 %9, label %13, label %10
  906. 10: ; preds = %2
  907. %11 = load i32*, i32** %4, align 8
  908. store i32 1, i32* %11, align 4
  909. %12 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.36, i64 0, i64 0))
  910. store double -1.000000e+00, double* %3, align 8
  911. br label %92
  912. 13: ; preds = %2
  913. %14 = getelementptr inbounds %struct.Circle, %struct.Circle* %0, i32 0, i32 1
  914. %15 = load double, double* %14, align 8
  915. %16 = fcmp ole double %15, 0.000000e+00
  916. br i1 %16, label %17, label %20
  917. 17: ; preds = %13
  918. %18 = load i32*, i32** %4, align 8
  919. store i32 1, i32* %18, align 4
  920. %19 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.37, i64 0, i64 0))
  921. store double -1.000000e+00, double* %3, align 8
  922. br label %92
  923. 20: ; preds = %13
  924. %21 = getelementptr inbounds %struct.Circle, %struct.Circle* %0, i32 0, i32 1
  925. %22 = load double, double* %21, align 8
  926. %23 = fcmp ogt double %22, 1.000000e+03
  927. br i1 %23, label %24, label %27
  928. 24: ; preds = %20
  929. %25 = load i32*, i32** %4, align 8
  930. store i32 3, i32* %25, align 4
  931. %26 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.38, i64 0, i64 0))
  932. store double -1.000000e+00, double* %3, align 8
  933. br label %92
  934. 27: ; preds = %20
  935. %28 = getelementptr inbounds %struct.Circle, %struct.Circle* %0, i32 0, i32 0
  936. %29 = getelementptr inbounds %struct.Point, %struct.Point* %28, i32 0, i32 0
  937. %30 = load i32, i32* %29, align 8
  938. %31 = call i32 @abs(i32 %30) #8
  939. %32 = icmp sgt i32 %31, 1000
  940. br i1 %32, label %39, label %33
  941. 33: ; preds = %27
  942. %34 = getelementptr inbounds %struct.Circle, %struct.Circle* %0, i32 0, i32 0
  943. %35 = getelementptr inbounds %struct.Point, %struct.Point* %34, i32 0, i32 1
  944. %36 = load i32, i32* %35, align 4
  945. %37 = call i32 @abs(i32 %36) #8
  946. %38 = icmp sgt i32 %37, 1000
  947. br i1 %38, label %39, label %42
  948. 39: ; preds = %33, %27
  949. %40 = load i32*, i32** %4, align 8
  950. store i32 3, i32* %40, align 4
  951. %41 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.39, i64 0, i64 0))
  952. store double -1.000000e+00, double* %3, align 8
  953. br label %92
  954. 42: ; preds = %33
  955. %43 = getelementptr inbounds %struct.Circle, %struct.Circle* %0, i32 0, i32 1
  956. %44 = load double, double* %43, align 8
  957. %45 = fmul double 3.141590e+00, %44
  958. %46 = getelementptr inbounds %struct.Circle, %struct.Circle* %0, i32 0, i32 1
  959. %47 = load double, double* %46, align 8
  960. %48 = fmul double %45, %47
  961. store double %48, double* %5, align 8
  962. %49 = load double, double* %5, align 8
  963. %50 = fcmp uno double %49, %49
  964. br i1 %50, label %60, label %51
  965. 51: ; preds = %42
  966. %52 = load double, double* %5, align 8
  967. %53 = call double @llvm.fabs.f64(double %52) #9
  968. %54 = fcmp oeq double %53, 0x7FF0000000000000
  969. %55 = bitcast double %52 to i64
  970. %56 = icmp slt i64 %55, 0
  971. %57 = select i1 %56, i32 -1, i32 1
  972. %58 = select i1 %54, i32 %57, i32 0
  973. %59 = icmp ne i32 %58, 0
  974. br i1 %59, label %60, label %63
  975. 60: ; preds = %51, %42
  976. %61 = load i32*, i32** %4, align 8
  977. store i32 5, i32* %61, align 4
  978. %62 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.40, i64 0, i64 0))
  979. store double -1.000000e+00, double* %3, align 8
  980. br label %92
  981. 63: ; preds = %51
  982. %64 = getelementptr inbounds %struct.Circle, %struct.Circle* %0, i32 0, i32 3
  983. %65 = getelementptr inbounds [256 x i8], [256 x i8]* %64, i64 0, i64 0
  984. %66 = call i32 @strcmp(i8* %65, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.41, i64 0, i64 0)) #10
  985. %67 = icmp eq i32 %66, 0
  986. br i1 %67, label %68, label %70
  987. 68: ; preds = %63
  988. %69 = load double, double* %5, align 8
  989. store double %69, double* %3, align 8
  990. br label %92
  991. 70: ; preds = %63
  992. %71 = getelementptr inbounds %struct.Circle, %struct.Circle* %0, i32 0, i32 3
  993. %72 = getelementptr inbounds [256 x i8], [256 x i8]* %71, i64 0, i64 0
  994. %73 = call i32 @strcmp(i8* %72, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.42, i64 0, i64 0)) #10
  995. %74 = icmp eq i32 %73, 0
  996. br i1 %74, label %75, label %89
  997. 75: ; preds = %70
  998. %76 = getelementptr inbounds %struct.Circle, %struct.Circle* %0, i32 0, i32 0
  999. %77 = getelementptr inbounds %struct.Point, %struct.Point* %76, i32 0, i32 3
  1000. %78 = load double, double* %77, align 8
  1001. %79 = fcmp ole double %78, 0.000000e+00
  1002. br i1 %79, label %80, label %83
  1003. 80: ; preds = %75
  1004. %81 = load i32*, i32** %4, align 8
  1005. store i32 1, i32* %81, align 4
  1006. %82 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.43, i64 0, i64 0))
  1007. store double -1.000000e+00, double* %3, align 8
  1008. br label %92
  1009. 83: ; preds = %75
  1010. %84 = load double, double* %5, align 8
  1011. %85 = getelementptr inbounds %struct.Circle, %struct.Circle* %0, i32 0, i32 0
  1012. %86 = getelementptr inbounds %struct.Point, %struct.Point* %85, i32 0, i32 3
  1013. %87 = load double, double* %86, align 8
  1014. %88 = fmul double %84, %87
  1015. store double %88, double* %3, align 8
  1016. br label %92
  1017. 89: ; preds = %70
  1018. %90 = load i32*, i32** %4, align 8
  1019. store i32 1, i32* %90, align 4
  1020. %91 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.44, i64 0, i64 0))
  1021. store double -1.000000e+00, double* %3, align 8
  1022. br label %92
  1023. 92: ; preds = %89, %83, %80, %68, %60, %39, %24, %17, %10
  1024. %93 = load double, double* %3, align 8
  1025. ret double %93
  1026. }
  1027. ; Function Attrs: nounwind readonly
  1028. declare dso_local i32 @strcmp(i8*, i8*) #5
  1029. ; Function Attrs: noinline nounwind optnone uwtable
  1030. define dso_local i32 @validateMatrix(%struct.Matrix* %0) #0 !project_source !2 {
  1031. %2 = alloca i32, align 4
  1032. %3 = alloca %struct.Matrix*, align 8
  1033. %4 = alloca i32, align 4
  1034. store %struct.Matrix* %0, %struct.Matrix** %3, align 8
  1035. %5 = load %struct.Matrix*, %struct.Matrix** %3, align 8
  1036. %6 = icmp ne %struct.Matrix* %5, null
  1037. br i1 %6, label %9, label %7
  1038. 7: ; preds = %1
  1039. %8 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.21, i64 0, i64 0))
  1040. store i32 7, i32* %2, align 4
  1041. br label %78
  1042. 9: ; preds = %1
  1043. %10 = load %struct.Matrix*, %struct.Matrix** %3, align 8
  1044. %11 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %10, i32 0, i32 0
  1045. %12 = load i32**, i32*** %11, align 8
  1046. %13 = icmp ne i32** %12, null
  1047. br i1 %13, label %16, label %14
  1048. 14: ; preds = %9
  1049. %15 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.45, i64 0, i64 0))
  1050. store i32 7, i32* %2, align 4
  1051. br label %78
  1052. 16: ; preds = %9
  1053. %17 = load %struct.Matrix*, %struct.Matrix** %3, align 8
  1054. %18 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %17, i32 0, i32 1
  1055. %19 = load i32, i32* %18, align 8
  1056. %20 = icmp slt i32 %19, 1
  1057. br i1 %20, label %26, label %21
  1058. 21: ; preds = %16
  1059. %22 = load %struct.Matrix*, %struct.Matrix** %3, align 8
  1060. %23 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %22, i32 0, i32 2
  1061. %24 = load i32, i32* %23, align 4
  1062. %25 = icmp slt i32 %24, 1
  1063. br i1 %25, label %26, label %28
  1064. 26: ; preds = %21, %16
  1065. %27 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.16, i64 0, i64 0))
  1066. store i32 1, i32* %2, align 4
  1067. br label %78
  1068. 28: ; preds = %21
  1069. %29 = load %struct.Matrix*, %struct.Matrix** %3, align 8
  1070. %30 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %29, i32 0, i32 1
  1071. %31 = load i32, i32* %30, align 8
  1072. %32 = icmp sgt i32 %31, 100
  1073. br i1 %32, label %38, label %33
  1074. 33: ; preds = %28
  1075. %34 = load %struct.Matrix*, %struct.Matrix** %3, align 8
  1076. %35 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %34, i32 0, i32 2
  1077. %36 = load i32, i32* %35, align 4
  1078. %37 = icmp sgt i32 %36, 100
  1079. br i1 %37, label %38, label %40
  1080. 38: ; preds = %33, %28
  1081. %39 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.46, i64 0, i64 0))
  1082. store i32 3, i32* %2, align 4
  1083. br label %78
  1084. 40: ; preds = %33
  1085. store i32 0, i32* %4, align 4
  1086. br label %41
  1087. 41: ; preds = %59, %40
  1088. %42 = load i32, i32* %4, align 4
  1089. %43 = load %struct.Matrix*, %struct.Matrix** %3, align 8
  1090. %44 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %43, i32 0, i32 1
  1091. %45 = load i32, i32* %44, align 8
  1092. %46 = icmp slt i32 %42, %45
  1093. br i1 %46, label %47, label %62
  1094. 47: ; preds = %41
  1095. %48 = load %struct.Matrix*, %struct.Matrix** %3, align 8
  1096. %49 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %48, i32 0, i32 0
  1097. %50 = load i32**, i32*** %49, align 8
  1098. %51 = load i32, i32* %4, align 4
  1099. %52 = sext i32 %51 to i64
  1100. %53 = getelementptr inbounds i32*, i32** %50, i64 %52
  1101. %54 = load i32*, i32** %53, align 8
  1102. %55 = icmp ne i32* %54, null
  1103. br i1 %55, label %58, label %56
  1104. 56: ; preds = %47
  1105. %57 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.47, i64 0, i64 0))
  1106. store i32 7, i32* %2, align 4
  1107. br label %78
  1108. 58: ; preds = %47
  1109. br label %59
  1110. 59: ; preds = %58
  1111. %60 = load i32, i32* %4, align 4
  1112. %61 = add nsw i32 %60, 1
  1113. store i32 %61, i32* %4, align 4
  1114. br label %41
  1115. 62: ; preds = %41
  1116. %63 = load %struct.Matrix*, %struct.Matrix** %3, align 8
  1117. %64 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %63, i32 0, i32 1
  1118. %65 = load i32, i32* %64, align 8
  1119. %66 = load %struct.Matrix*, %struct.Matrix** %3, align 8
  1120. %67 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %66, i32 0, i32 2
  1121. %68 = load i32, i32* %67, align 4
  1122. %69 = icmp eq i32 %65, %68
  1123. %70 = zext i1 %69 to i32
  1124. %71 = load %struct.Matrix*, %struct.Matrix** %3, align 8
  1125. %72 = getelementptr inbounds %struct.Matrix, %struct.Matrix* %71, i32 0, i32 3
  1126. %73 = load i32, i32* %72, align 8
  1127. %74 = icmp ne i32 %70, %73
  1128. br i1 %74, label %75, label %77
  1129. 75: ; preds = %62
  1130. %76 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.48, i64 0, i64 0))
  1131. store i32 1, i32* %2, align 4
  1132. br label %78
  1133. 77: ; preds = %62
  1134. store i32 0, i32* %2, align 4
  1135. br label %78
  1136. 78: ; preds = %77, %75, %56, %38, %26, %14, %7
  1137. %79 = load i32, i32* %2, align 4
  1138. ret i32 %79
  1139. }
  1140. ; Function Attrs: noinline nounwind optnone uwtable
  1141. define dso_local %struct.Point* @findCentroid(%struct.Point* %0, i32 %1, i32* %2) #0 !project_source !2 {
  1142. %4 = alloca %struct.Point*, align 8
  1143. %5 = alloca %struct.Point*, align 8
  1144. %6 = alloca i32, align 4
  1145. %7 = alloca i32*, align 8
  1146. %8 = alloca %struct.Point*, align 8
  1147. %9 = alloca double, align 8
  1148. %10 = alloca double, align 8
  1149. %11 = alloca double, align 8
  1150. %12 = alloca i32, align 4
  1151. store %struct.Point* %0, %struct.Point** %5, align 8
  1152. store i32 %1, i32* %6, align 4
  1153. store i32* %2, i32** %7, align 8
  1154. %13 = load i32*, i32** %7, align 8
  1155. store i32 0, i32* %13, align 4
  1156. %14 = load %struct.Point*, %struct.Point** %5, align 8
  1157. %15 = icmp ne %struct.Point* %14, null
  1158. br i1 %15, label %16, label %19
  1159. 16: ; preds = %3
  1160. %17 = load i32, i32* %6, align 4
  1161. %18 = icmp sle i32 %17, 0
  1162. br i1 %18, label %19, label %22
  1163. 19: ; preds = %16, %3
  1164. %20 = load i32*, i32** %7, align 8
  1165. store i32 1, i32* %20, align 4
  1166. %21 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.50, i64 0, i64 0))
  1167. store %struct.Point* null, %struct.Point** %4, align 8
  1168. br label %171
  1169. 22: ; preds = %16
  1170. %23 = load i32, i32* %6, align 4
  1171. %24 = icmp sgt i32 %23, 1000
  1172. br i1 %24, label %25, label %28
  1173. 25: ; preds = %22
  1174. %26 = load i32*, i32** %7, align 8
  1175. store i32 3, i32* %26, align 4
  1176. %27 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.51, i64 0, i64 0))
  1177. store %struct.Point* null, %struct.Point** %4, align 8
  1178. br label %171
  1179. 28: ; preds = %22
  1180. %29 = call noalias i8* @malloc(i64 272) #7
  1181. %30 = bitcast i8* %29 to %struct.Point*
  1182. store %struct.Point* %30, %struct.Point** %8, align 8
  1183. %31 = load %struct.Point*, %struct.Point** %8, align 8
  1184. %32 = icmp ne %struct.Point* %31, null
  1185. br i1 %32, label %36, label %33
  1186. 33: ; preds = %28
  1187. %34 = load i32*, i32** %7, align 8
  1188. store i32 2, i32* %34, align 4
  1189. %35 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.52, i64 0, i64 0))
  1190. store %struct.Point* null, %struct.Point** %4, align 8
  1191. br label %171
  1192. 36: ; preds = %28
  1193. store double 0.000000e+00, double* %9, align 8
  1194. store double 0.000000e+00, double* %10, align 8
  1195. store double 0.000000e+00, double* %11, align 8
  1196. store i32 0, i32* %12, align 4
  1197. br label %37
  1198. 37: ; preds = %136, %36
  1199. %38 = load i32, i32* %12, align 4
  1200. %39 = load i32, i32* %6, align 4
  1201. %40 = icmp slt i32 %38, %39
  1202. br i1 %40, label %41, label %139
  1203. 41: ; preds = %37
  1204. %42 = load %struct.Point*, %struct.Point** %5, align 8
  1205. %43 = load i32, i32* %12, align 4
  1206. %44 = sext i32 %43 to i64
  1207. %45 = getelementptr inbounds %struct.Point, %struct.Point* %42, i64 %44
  1208. %46 = getelementptr inbounds %struct.Point, %struct.Point* %45, i32 0, i32 3
  1209. %47 = load double, double* %46, align 8
  1210. %48 = fcmp ole double %47, 0.000000e+00
  1211. br i1 %48, label %49, label %54
  1212. 49: ; preds = %41
  1213. %50 = load i32*, i32** %7, align 8
  1214. store i32 1, i32* %50, align 4
  1215. %51 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.53, i64 0, i64 0))
  1216. %52 = load %struct.Point*, %struct.Point** %8, align 8
  1217. %53 = bitcast %struct.Point* %52 to i8*
  1218. call void @free(i8* %53) #7
  1219. store %struct.Point* null, %struct.Point** %4, align 8
  1220. br label %171
  1221. 54: ; preds = %41
  1222. %55 = load %struct.Point*, %struct.Point** %5, align 8
  1223. %56 = load i32, i32* %12, align 4
  1224. %57 = sext i32 %56 to i64
  1225. %58 = getelementptr inbounds %struct.Point, %struct.Point* %55, i64 %57
  1226. %59 = getelementptr inbounds %struct.Point, %struct.Point* %58, i32 0, i32 3
  1227. %60 = load double, double* %59, align 8
  1228. %61 = load double, double* %9, align 8
  1229. %62 = fadd double %61, %60
  1230. store double %62, double* %9, align 8
  1231. %63 = load %struct.Point*, %struct.Point** %5, align 8
  1232. %64 = load i32, i32* %12, align 4
  1233. %65 = sext i32 %64 to i64
  1234. %66 = getelementptr inbounds %struct.Point, %struct.Point* %63, i64 %65
  1235. %67 = getelementptr inbounds %struct.Point, %struct.Point* %66, i32 0, i32 0
  1236. %68 = load i32, i32* %67, align 8
  1237. %69 = sitofp i32 %68 to double
  1238. %70 = load %struct.Point*, %struct.Point** %5, align 8
  1239. %71 = load i32, i32* %12, align 4
  1240. %72 = sext i32 %71 to i64
  1241. %73 = getelementptr inbounds %struct.Point, %struct.Point* %70, i64 %72
  1242. %74 = getelementptr inbounds %struct.Point, %struct.Point* %73, i32 0, i32 3
  1243. %75 = load double, double* %74, align 8
  1244. %76 = fmul double %69, %75
  1245. %77 = load double, double* %10, align 8
  1246. %78 = fadd double %77, %76
  1247. store double %78, double* %10, align 8
  1248. %79 = load %struct.Point*, %struct.Point** %5, align 8
  1249. %80 = load i32, i32* %12, align 4
  1250. %81 = sext i32 %80 to i64
  1251. %82 = getelementptr inbounds %struct.Point, %struct.Point* %79, i64 %81
  1252. %83 = getelementptr inbounds %struct.Point, %struct.Point* %82, i32 0, i32 1
  1253. %84 = load i32, i32* %83, align 4
  1254. %85 = sitofp i32 %84 to double
  1255. %86 = load %struct.Point*, %struct.Point** %5, align 8
  1256. %87 = load i32, i32* %12, align 4
  1257. %88 = sext i32 %87 to i64
  1258. %89 = getelementptr inbounds %struct.Point, %struct.Point* %86, i64 %88
  1259. %90 = getelementptr inbounds %struct.Point, %struct.Point* %89, i32 0, i32 3
  1260. %91 = load double, double* %90, align 8
  1261. %92 = fmul double %85, %91
  1262. %93 = load double, double* %11, align 8
  1263. %94 = fadd double %93, %92
  1264. store double %94, double* %11, align 8
  1265. %95 = load double, double* %9, align 8
  1266. %96 = fcmp uno double %95, %95
  1267. br i1 %96, label %130, label %97
  1268. 97: ; preds = %54
  1269. %98 = load double, double* %10, align 8
  1270. %99 = fcmp uno double %98, %98
  1271. br i1 %99, label %130, label %100
  1272. 100: ; preds = %97
  1273. %101 = load double, double* %11, align 8
  1274. %102 = fcmp uno double %101, %101
  1275. br i1 %102, label %130, label %103
  1276. 103: ; preds = %100
  1277. %104 = load double, double* %9, align 8
  1278. %105 = call double @llvm.fabs.f64(double %104) #9
  1279. %106 = fcmp oeq double %105, 0x7FF0000000000000
  1280. %107 = bitcast double %104 to i64
  1281. %108 = icmp slt i64 %107, 0
  1282. %109 = select i1 %108, i32 -1, i32 1
  1283. %110 = select i1 %106, i32 %109, i32 0
  1284. %111 = icmp ne i32 %110, 0
  1285. br i1 %111, label %130, label %112
  1286. 112: ; preds = %103
  1287. %113 = load double, double* %10, align 8
  1288. %114 = call double @llvm.fabs.f64(double %113) #9
  1289. %115 = fcmp oeq double %114, 0x7FF0000000000000
  1290. %116 = bitcast double %113 to i64
  1291. %117 = icmp slt i64 %116, 0
  1292. %118 = select i1 %117, i32 -1, i32 1
  1293. %119 = select i1 %115, i32 %118, i32 0
  1294. %120 = icmp ne i32 %119, 0
  1295. br i1 %120, label %130, label %121
  1296. 121: ; preds = %112
  1297. %122 = load double, double* %11, align 8
  1298. %123 = call double @llvm.fabs.f64(double %122) #9
  1299. %124 = fcmp oeq double %123, 0x7FF0000000000000
  1300. %125 = bitcast double %122 to i64
  1301. %126 = icmp slt i64 %125, 0
  1302. %127 = select i1 %126, i32 -1, i32 1
  1303. %128 = select i1 %124, i32 %127, i32 0
  1304. %129 = icmp ne i32 %128, 0
  1305. br i1 %129, label %130, label %135
  1306. 130: ; preds = %121, %112, %103, %100, %97, %54
  1307. %131 = load i32*, i32** %7, align 8
  1308. store i32 5, i32* %131, align 4
  1309. %132 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.54, i64 0, i64 0))
  1310. %133 = load %struct.Point*, %struct.Point** %8, align 8
  1311. %134 = bitcast %struct.Point* %133 to i8*
  1312. call void @free(i8* %134) #7
  1313. store %struct.Point* null, %struct.Point** %4, align 8
  1314. br label %171
  1315. 135: ; preds = %121
  1316. br label %136
  1317. 136: ; preds = %135
  1318. %137 = load i32, i32* %12, align 4
  1319. %138 = add nsw i32 %137, 1
  1320. store i32 %138, i32* %12, align 4
  1321. br label %37
  1322. 139: ; preds = %37
  1323. %140 = load double, double* %9, align 8
  1324. %141 = fcmp oeq double %140, 0.000000e+00
  1325. br i1 %141, label %142, label %147
  1326. 142: ; preds = %139
  1327. %143 = load i32*, i32** %7, align 8
  1328. store i32 1, i32* %143, align 4
  1329. %144 = call i32 @fused_setErrorMessage(i1 false, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.55, i64 0, i64 0))
  1330. %145 = load %struct.Point*, %struct.Point** %8, align 8
  1331. %146 = bitcast %struct.Point* %145 to i8*
  1332. call void @free(i8* %146) #7
  1333. store %struct.Point* null, %struct.Point** %4, align 8
  1334. br label %171
  1335. 147: ; preds = %139
  1336. %148 = load double, double* %10, align 8
  1337. %149 = load double, double* %9, align 8
  1338. %150 = fdiv double %148, %149
  1339. %151 = fptosi double %150 to i32
  1340. %152 = load %struct.Point*, %struct.Point** %8, align 8
  1341. %153 = getelementptr inbounds %struct.Point, %struct.Point* %152, i32 0, i32 0
  1342. store i32 %151, i32* %153, align 8
  1343. %154 = load double, double* %11, align 8
  1344. %155 = load double, double* %9, align 8
  1345. %156 = fdiv double %154, %155
  1346. %157 = fptosi double %156 to i32
  1347. %158 = load %struct.Point*, %struct.Point** %8, align 8
  1348. %159 = getelementptr inbounds %struct.Point, %struct.Point* %158, i32 0, i32 1
  1349. store i32 %157, i32* %159, align 4
  1350. %160 = load double, double* %9, align 8
  1351. %161 = load i32, i32* %6, align 4
  1352. %162 = sitofp i32 %161 to double
  1353. %163 = fdiv double %160, %162
  1354. %164 = load %struct.Point*, %struct.Point** %8, align 8
  1355. %165 = getelementptr inbounds %struct.Point, %struct.Point* %164, i32 0, i32 3
  1356. store double %163, double* %165, align 8
  1357. %166 = load %struct.Point*, %struct.Point** %8, align 8
  1358. %167 = getelementptr inbounds %struct.Point, %struct.Point* %166, i32 0, i32 2
  1359. %168 = getelementptr inbounds [256 x i8], [256 x i8]* %167, i64 0, i64 0
  1360. %169 = call i8* @strcpy(i8* %168, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.56, i64 0, i64 0)) #7
  1361. %170 = load %struct.Point*, %struct.Point** %8, align 8
  1362. store %struct.Point* %170, %struct.Point** %4, align 8
  1363. br label %171
  1364. 171: ; preds = %147, %142, %130, %49, %33, %25, %19
  1365. %172 = load %struct.Point*, %struct.Point** %4, align 8
  1366. ret %struct.Point* %172
  1367. }
  1368. ; Function Attrs: nounwind
  1369. declare dso_local i8* @strcpy(i8*, i8*) #1
  1370. ; Function Attrs: nounwind readonly
  1371. declare dso_local i64 @strlen(i8*) #5
  1372. ; Function Attrs: argmemonly nounwind willreturn
  1373. declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #6
  1374. ; Function Attrs: argmemonly nounwind willreturn
  1375. declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #6
  1376. declare i32 @fused_quickSort(i1, i32*, i32, i32, i32*, i32)
  1377. declare i32 @fused_performSimpleCalculations(i1, i32*, i32)
  1378. declare %fused_return_projectA_main_memoizedFib @fused_projectA_main(i1, i32)
  1379. declare %fused_return_createDynamicArray_processMatrix @fused_createDynamicArray(i1, i32, [100 x i32]*, i32)
  1380. declare i32 @fused_setErrorMessage(i1, i8*)
  1381. declare %struct.Matrix* @fused_createMatrix(i1, i32, i32, i8*)
  1382. declare i32 @fused_removeDuplicates(i1, %struct.DynamicArray*, i32)
  1383. 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" }
  1384. 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" }
  1385. 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" }
  1386. 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" }
  1387. attributes #4 = { nounwind readnone speculatable willreturn }
  1388. 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" }
  1389. attributes #6 = { argmemonly nounwind willreturn }
  1390. attributes #7 = { nounwind }
  1391. attributes #8 = { nounwind readnone }
  1392. attributes #9 = { readnone }
  1393. attributes #10 = { nounwind readonly }
  1394. !llvm.ident = !{!0, !0}
  1395. !llvm.module.flags = !{!1}
  1396. !0 = !{!"clang version 10.0.0-4ubuntu1 "}
  1397. !1 = !{i32 1, !"wchar_size", i32 4}
  1398. !2 = !{!"Bunker"}