combined.ll 143 KB

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