; LLVM IR from adamdempsey90/MultiGrid :: src (multigrid)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: nounwind uwtable
define dso_local void @multigrid(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) #0 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !9
  store i32 %5, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %21 = load i32, ptr %9, align 4, !tbaa !9
  %22 = add nsw i32 %21, 1
  store i32 %22, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %23 = load i32, ptr %16, align 4, !tbaa !9
  %24 = sext i32 %23 to i64
  %25 = mul i64 4, %24
  %26 = call noalias ptr @malloc(i64 noundef %25) #6
  store ptr %26, ptr %17, align 8, !tbaa !5
  %27 = load i32, ptr %16, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = mul i64 8, %28
  %30 = call noalias ptr @malloc(i64 noundef %29) #6
  store ptr %30, ptr %18, align 8, !tbaa !5
  %31 = load i32, ptr %16, align 4, !tbaa !9
  %32 = sext i32 %31 to i64
  %33 = mul i64 8, %32
  %34 = call noalias ptr @malloc(i64 noundef %33) #6
  store ptr %34, ptr %19, align 8, !tbaa !5
  %35 = load i32, ptr %16, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = mul i64 8, %36
  %38 = call noalias ptr @malloc(i64 noundef %37) #6
  store ptr %38, ptr %20, align 8, !tbaa !5
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %39

39:                                               ; preds = %87, %6
  %40 = load i32, ptr %13, align 4, !tbaa !9
  %41 = load i32, ptr %9, align 4, !tbaa !9
  %42 = icmp sle i32 %40, %41
  br i1 %42, label %43, label %90

43:                                               ; preds = %39
  %44 = load i32, ptr %13, align 4, !tbaa !9
  %45 = shl i32 2, %44
  %46 = add nsw i32 1, %45
  store i32 %46, ptr %15, align 4, !tbaa !9
  %47 = load i32, ptr %15, align 4, !tbaa !9
  %48 = load i32, ptr %15, align 4, !tbaa !9
  %49 = mul nsw i32 %47, %48
  %50 = load ptr, ptr %17, align 8, !tbaa !5
  %51 = load i32, ptr %13, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds i32, ptr %50, i64 %52
  store i32 %49, ptr %53, align 4, !tbaa !9
  %54 = load i32, ptr %15, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = mul i64 8, %55
  %57 = load i32, ptr %15, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = mul i64 %56, %58
  %60 = call noalias ptr @malloc(i64 noundef %59) #6
  %61 = load ptr, ptr %18, align 8, !tbaa !5
  %62 = load i32, ptr %13, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds ptr, ptr %61, i64 %63
  store ptr %60, ptr %64, align 8, !tbaa !5
  %65 = load i32, ptr %15, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = mul i64 8, %66
  %68 = load i32, ptr %15, align 4, !tbaa !9
  %69 = sext i32 %68 to i64
  %70 = mul i64 %67, %69
  %71 = call noalias ptr @malloc(i64 noundef %70) #6
  %72 = load ptr, ptr %19, align 8, !tbaa !5
  %73 = load i32, ptr %13, align 4, !tbaa !9
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds ptr, ptr %72, i64 %74
  store ptr %71, ptr %75, align 8, !tbaa !5
  %76 = load i32, ptr %15, align 4, !tbaa !9
  %77 = sext i32 %76 to i64
  %78 = mul i64 8, %77
  %79 = load i32, ptr %15, align 4, !tbaa !9
  %80 = sext i32 %79 to i64
  %81 = mul i64 %78, %80
  %82 = call noalias ptr @malloc(i64 noundef %81) #6
  %83 = load ptr, ptr %20, align 8, !tbaa !5
  %84 = load i32, ptr %13, align 4, !tbaa !9
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds ptr, ptr %83, i64 %85
  store ptr %82, ptr %86, align 8, !tbaa !5
  br label %87

87:                                               ; preds = %43
  %88 = load i32, ptr %13, align 4, !tbaa !9
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %13, align 4, !tbaa !9
  br label %39, !llvm.loop !11

90:                                               ; preds = %39
  %91 = load ptr, ptr %18, align 8, !tbaa !5
  %92 = load i32, ptr %9, align 4, !tbaa !9
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds ptr, ptr %91, i64 %93
  %95 = load ptr, ptr %94, align 8, !tbaa !5
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = load ptr, ptr %17, align 8, !tbaa !5
  %98 = load i32, ptr %9, align 4, !tbaa !9
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds i32, ptr %97, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !9
  call void @matfill(ptr noundef %95, ptr noundef %96, i32 noundef %101)
  %102 = load ptr, ptr %19, align 8, !tbaa !5
  %103 = load i32, ptr %9, align 4, !tbaa !9
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds ptr, ptr %102, i64 %104
  %106 = load ptr, ptr %105, align 8, !tbaa !5
  %107 = load ptr, ptr %8, align 8, !tbaa !5
  %108 = load ptr, ptr %17, align 8, !tbaa !5
  %109 = load i32, ptr %9, align 4, !tbaa !9
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds i32, ptr %108, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !9
  call void @matfill(ptr noundef %106, ptr noundef %107, i32 noundef %112)
  %113 = load ptr, ptr %20, align 8, !tbaa !5
  %114 = load i32, ptr %9, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds ptr, ptr %113, i64 %115
  %117 = load ptr, ptr %116, align 8, !tbaa !5
  %118 = load ptr, ptr %17, align 8, !tbaa !5
  %119 = load i32, ptr %9, align 4, !tbaa !9
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds i32, ptr %118, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !9
  call void @matfill(ptr noundef %117, ptr noundef null, i32 noundef %122)
  %123 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %123, ptr %13, align 4, !tbaa !9
  br label %124

124:                                              ; preds = %164, %90
  %125 = load i32, ptr %13, align 4, !tbaa !9
  %126 = icmp sgt i32 %125, 0
  br i1 %126, label %127, label %167

127:                                              ; preds = %124
  %128 = load ptr, ptr %18, align 8, !tbaa !5
  %129 = load i32, ptr %13, align 4, !tbaa !9
  %130 = sub nsw i32 %129, 1
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds ptr, ptr %128, i64 %131
  %133 = load ptr, ptr %132, align 8, !tbaa !5
  %134 = load ptr, ptr %18, align 8, !tbaa !5
  %135 = load i32, ptr %13, align 4, !tbaa !9
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds ptr, ptr %134, i64 %136
  %138 = load ptr, ptr %137, align 8, !tbaa !5
  %139 = load i32, ptr %13, align 4, !tbaa !9
  %140 = sub nsw i32 %139, 1
  call void @restrict2D(ptr noundef %133, ptr noundef %138, i32 noundef %140)
  %141 = load ptr, ptr %19, align 8, !tbaa !5
  %142 = load i32, ptr %13, align 4, !tbaa !9
  %143 = sub nsw i32 %142, 1
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds ptr, ptr %141, i64 %144
  %146 = load ptr, ptr %145, align 8, !tbaa !5
  %147 = load ptr, ptr %19, align 8, !tbaa !5
  %148 = load i32, ptr %13, align 4, !tbaa !9
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds ptr, ptr %147, i64 %149
  %151 = load ptr, ptr %150, align 8, !tbaa !5
  %152 = load i32, ptr %13, align 4, !tbaa !9
  %153 = sub nsw i32 %152, 1
  call void @restrict2D(ptr noundef %146, ptr noundef %151, i32 noundef %153)
  %154 = load ptr, ptr %20, align 8, !tbaa !5
  %155 = load i32, ptr %13, align 4, !tbaa !9
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds ptr, ptr %154, i64 %156
  %158 = load ptr, ptr %157, align 8, !tbaa !5
  %159 = load ptr, ptr %17, align 8, !tbaa !5
  %160 = load i32, ptr %13, align 4, !tbaa !9
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds i32, ptr %159, i64 %161
  %163 = load i32, ptr %162, align 4, !tbaa !9
  call void @matfill(ptr noundef %158, ptr noundef null, i32 noundef %163)
  br label %164

164:                                              ; preds = %127
  %165 = load i32, ptr %13, align 4, !tbaa !9
  %166 = add nsw i32 %165, -1
  store i32 %166, ptr %13, align 4, !tbaa !9
  br label %124, !llvm.loop !13

167:                                              ; preds = %124
  %168 = load ptr, ptr %18, align 8, !tbaa !5
  %169 = getelementptr inbounds ptr, ptr %168, i64 0
  %170 = load ptr, ptr %169, align 8, !tbaa !5
  %171 = load ptr, ptr %19, align 8, !tbaa !5
  %172 = getelementptr inbounds ptr, ptr %171, i64 0
  %173 = load ptr, ptr %172, align 8, !tbaa !5
  call void @solve(ptr noundef %170, ptr noundef %173)
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %174

174:                                              ; preds = %211, %167
  %175 = load i32, ptr %14, align 4, !tbaa !9
  %176 = load i32, ptr %9, align 4, !tbaa !9
  %177 = icmp slt i32 %175, %176
  br i1 %177, label %178, label %214

178:                                              ; preds = %174
  %179 = load ptr, ptr %18, align 8, !tbaa !5
  %180 = load i32, ptr %14, align 4, !tbaa !9
  %181 = add nsw i32 %180, 1
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds ptr, ptr %179, i64 %182
  %184 = load ptr, ptr %183, align 8, !tbaa !5
  %185 = load ptr, ptr %18, align 8, !tbaa !5
  %186 = load i32, ptr %14, align 4, !tbaa !9
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds ptr, ptr %185, i64 %187
  %189 = load ptr, ptr %188, align 8, !tbaa !5
  %190 = load i32, ptr %14, align 4, !tbaa !9
  call void @prolongate2D(ptr noundef %184, ptr noundef %189, i32 noundef %190)
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %191

191:                                              ; preds = %207, %178
  %192 = load i32, ptr %13, align 4, !tbaa !9
  %193 = load i32, ptr %10, align 4, !tbaa !9
  %194 = icmp slt i32 %192, %193
  br i1 %194, label %195, label %210

195:                                              ; preds = %191
  %196 = load ptr, ptr %18, align 8, !tbaa !5
  %197 = load ptr, ptr %19, align 8, !tbaa !5
  %198 = load i32, ptr %14, align 4, !tbaa !9
  %199 = add nsw i32 %198, 1
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds ptr, ptr %197, i64 %200
  %202 = load ptr, ptr %201, align 8, !tbaa !5
  %203 = load i32, ptr %14, align 4, !tbaa !9
  %204 = add nsw i32 %203, 1
  %205 = load i32, ptr %11, align 4, !tbaa !9
  %206 = load i32, ptr %12, align 4, !tbaa !9
  call void @vcycle(ptr noundef %196, ptr noundef %202, i32 noundef %204, i32 noundef %205, i32 noundef %206)
  br label %207

207:                                              ; preds = %195
  %208 = load i32, ptr %13, align 4, !tbaa !9
  %209 = add nsw i32 %208, 1
  store i32 %209, ptr %13, align 4, !tbaa !9
  br label %191, !llvm.loop !14

210:                                              ; preds = %191
  br label %211

211:                                              ; preds = %210
  %212 = load i32, ptr %14, align 4, !tbaa !9
  %213 = add nsw i32 %212, 1
  store i32 %213, ptr %14, align 4, !tbaa !9
  br label %174, !llvm.loop !15

214:                                              ; preds = %174
  %215 = load ptr, ptr %7, align 8, !tbaa !5
  %216 = load ptr, ptr %18, align 8, !tbaa !5
  %217 = load i32, ptr %9, align 4, !tbaa !9
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds ptr, ptr %216, i64 %218
  %220 = load ptr, ptr %219, align 8, !tbaa !5
  %221 = load ptr, ptr %17, align 8, !tbaa !5
  %222 = load i32, ptr %9, align 4, !tbaa !9
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds i32, ptr %221, i64 %223
  %225 = load i32, ptr %224, align 4, !tbaa !9
  call void @matfill(ptr noundef %215, ptr noundef %220, i32 noundef %225)
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %226

226:                                              ; preds = %246, %214
  %227 = load i32, ptr %13, align 4, !tbaa !9
  %228 = load i32, ptr %9, align 4, !tbaa !9
  %229 = icmp sle i32 %227, %228
  br i1 %229, label %230, label %249

230:                                              ; preds = %226
  %231 = load ptr, ptr %18, align 8, !tbaa !5
  %232 = load i32, ptr %13, align 4, !tbaa !9
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds ptr, ptr %231, i64 %233
  %235 = load ptr, ptr %234, align 8, !tbaa !5
  call void @free(ptr noundef %235) #5
  %236 = load ptr, ptr %19, align 8, !tbaa !5
  %237 = load i32, ptr %13, align 4, !tbaa !9
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds ptr, ptr %236, i64 %238
  %240 = load ptr, ptr %239, align 8, !tbaa !5
  call void @free(ptr noundef %240) #5
  %241 = load ptr, ptr %20, align 8, !tbaa !5
  %242 = load i32, ptr %13, align 4, !tbaa !9
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds ptr, ptr %241, i64 %243
  %245 = load ptr, ptr %244, align 8, !tbaa !5
  call void @free(ptr noundef %245) #5
  br label %246

246:                                              ; preds = %230
  %247 = load i32, ptr %13, align 4, !tbaa !9
  %248 = add nsw i32 %247, 1
  store i32 %248, ptr %13, align 4, !tbaa !9
  br label %226, !llvm.loop !16

249:                                              ; preds = %226
  %250 = load ptr, ptr %18, align 8, !tbaa !5
  call void @free(ptr noundef %250) #5
  %251 = load ptr, ptr %19, align 8, !tbaa !5
  call void @free(ptr noundef %251) #5
  %252 = load ptr, ptr %20, align 8, !tbaa !5
  call void @free(ptr noundef %252) #5
  %253 = load ptr, ptr %17, align 8, !tbaa !5
  call void @free(ptr noundef %253) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #2

declare void @matfill(ptr noundef, ptr noundef, i32 noundef) #3

declare void @restrict2D(ptr noundef, ptr noundef, i32 noundef) #3

declare void @solve(ptr noundef, ptr noundef) #3

declare void @prolongate2D(ptr noundef, ptr noundef, i32 noundef) #3

declare void @vcycle(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) #3

; Function Attrs: nounwind
declare void @free(ptr noundef) #4

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: nounwind uwtable
define dso_local void @multigrid(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) local_unnamed_addr #0 {
.lr.ph.preheader:
  %6 = add nuw i32 %2, 1
  %7 = sext i32 %6 to i64
  %8 = shl nsw i64 %7, 2
  %9 = tail call noalias ptr @malloc(i64 noundef %8) #5
  %10 = shl nsw i64 %7, 3
  %11 = tail call noalias ptr @malloc(i64 noundef %10) #5
  %12 = tail call noalias ptr @malloc(i64 noundef %10) #5
  %13 = tail call noalias ptr @malloc(i64 noundef %10) #5
  %.not95 = icmp sgt i32 %2, -1
  tail call void @llvm.assume(i1 %.not95)
  %wide.trip.count = zext i32 %6 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %14 = trunc nuw nsw i64 %indvars.iv to i32
  %15 = shl i32 2, %14
  %16 = or disjoint i32 %15, 1
  %17 = mul nsw i32 %16, %16
  %18 = getelementptr inbounds i32, ptr %9, i64 %indvars.iv
  store i32 %17, ptr %18, align 4, !tbaa !5
  %19 = sext i32 %16 to i64
  %20 = shl nsw i64 %19, 3
  %21 = mul i64 %20, %19
  %22 = tail call noalias ptr @malloc(i64 noundef %21) #5
  %23 = getelementptr inbounds ptr, ptr %11, i64 %indvars.iv
  store ptr %22, ptr %23, align 8, !tbaa !9
  %24 = tail call noalias ptr @malloc(i64 noundef %21) #5
  %25 = getelementptr inbounds ptr, ptr %12, i64 %indvars.iv
  store ptr %24, ptr %25, align 8, !tbaa !9
  %26 = tail call noalias ptr @malloc(i64 noundef %21) #5
  %27 = getelementptr inbounds ptr, ptr %13, i64 %indvars.iv
  store ptr %26, ptr %27, align 8, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %.lr.ph, !llvm.loop !11

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.phi.trans.insert = zext nneg i32 %2 to i64
  %.phi.trans.insert134 = getelementptr inbounds ptr, ptr %11, i64 %.phi.trans.insert
  %.pre = load ptr, ptr %.phi.trans.insert134, align 8, !tbaa !9
  %.phi.trans.insert136 = getelementptr inbounds i32, ptr %9, i64 %.phi.trans.insert
  %.pre137 = load i32, ptr %.phi.trans.insert136, align 4, !tbaa !5
  %28 = getelementptr inbounds ptr, ptr %11, i64 %.phi.trans.insert
  tail call void @matfill(ptr noundef %.pre, ptr noundef %0, i32 noundef %.pre137) #6
  %29 = getelementptr inbounds ptr, ptr %12, i64 %.phi.trans.insert
  %30 = load ptr, ptr %29, align 8, !tbaa !9
  tail call void @matfill(ptr noundef %30, ptr noundef %1, i32 noundef %.pre137) #6
  %31 = getelementptr inbounds ptr, ptr %13, i64 %.phi.trans.insert
  %32 = load ptr, ptr %31, align 8, !tbaa !9
  tail call void @matfill(ptr noundef %32, ptr noundef null, i32 noundef %.pre137) #6
  %.not = icmp eq i32 %2, 0
  br i1 %.not, label %._crit_edge100.thread, label %.lr.ph99.preheader

._crit_edge100.thread:                            ; preds = %._crit_edge.loopexit
  %33 = load ptr, ptr %11, align 8, !tbaa !9
  %34 = load ptr, ptr %12, align 8, !tbaa !9
  tail call void @solve(ptr noundef %33, ptr noundef %34) #6
  br label %._crit_edge107

.lr.ph99.preheader:                               ; preds = %._crit_edge.loopexit
  %35 = zext nneg i32 %2 to i64
  %.phi.trans.insert138 = getelementptr inbounds ptr, ptr %11, i64 %35
  %.pre139 = load ptr, ptr %.phi.trans.insert138, align 8, !tbaa !9
  br label %.lr.ph99

.lr.ph99:                                         ; preds = %.lr.ph99.preheader, %.lr.ph99
  %36 = phi ptr [ %.pre139, %.lr.ph99.preheader ], [ %38, %.lr.ph99 ]
  %indvars.iv115 = phi i64 [ %35, %.lr.ph99.preheader ], [ %indvars.iv.next116, %.lr.ph99 ]
  %indvars.iv.next116 = add nsw i64 %indvars.iv115, -1
  %37 = getelementptr inbounds ptr, ptr %11, i64 %indvars.iv.next116
  %38 = load ptr, ptr %37, align 8, !tbaa !9
  %39 = trunc nuw nsw i64 %indvars.iv.next116 to i32
  tail call void @restrict2D(ptr noundef %38, ptr noundef %36, i32 noundef %39) #6
  %40 = getelementptr inbounds ptr, ptr %12, i64 %indvars.iv.next116
  %41 = load ptr, ptr %40, align 8, !tbaa !9
  %42 = getelementptr inbounds ptr, ptr %12, i64 %indvars.iv115
  %43 = load ptr, ptr %42, align 8, !tbaa !9
  tail call void @restrict2D(ptr noundef %41, ptr noundef %43, i32 noundef %39) #6
  %44 = getelementptr inbounds ptr, ptr %13, i64 %indvars.iv115
  %45 = load ptr, ptr %44, align 8, !tbaa !9
  %46 = getelementptr inbounds i32, ptr %9, i64 %indvars.iv115
  %47 = load i32, ptr %46, align 4, !tbaa !5
  tail call void @matfill(ptr noundef %45, ptr noundef null, i32 noundef %47) #6
  %48 = icmp ugt i64 %indvars.iv115, 1
  br i1 %48, label %.lr.ph99, label %._crit_edge100, !llvm.loop !13

._crit_edge100:                                   ; preds = %.lr.ph99
  %49 = load ptr, ptr %11, align 8, !tbaa !9
  %50 = load ptr, ptr %12, align 8, !tbaa !9
  tail call void @solve(ptr noundef %49, ptr noundef %50) #6
  br i1 %.not, label %._crit_edge107, label %.lr.ph106

.lr.ph106:                                        ; preds = %._crit_edge100
  %51 = icmp sgt i32 %3, 0
  %wide.trip.count127 = zext nneg i32 %2 to i64
  br i1 %51, label %.lr.ph103.us, label %.loopexit

.lr.ph103.us:                                     ; preds = %.lr.ph106, %..loopexit_crit_edge.us
  %indvars.iv124 = phi i64 [ %indvars.iv.next125, %..loopexit_crit_edge.us ], [ 0, %.lr.ph106 ]
  %indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1
  %52 = getelementptr inbounds ptr, ptr %11, i64 %indvars.iv.next125
  %53 = load ptr, ptr %52, align 8, !tbaa !9
  %54 = getelementptr inbounds ptr, ptr %11, i64 %indvars.iv124
  %55 = load ptr, ptr %54, align 8, !tbaa !9
  %56 = trunc nuw nsw i64 %indvars.iv124 to i32
  tail call void @prolongate2D(ptr noundef %53, ptr noundef %55, i32 noundef %56) #6
  %57 = getelementptr inbounds ptr, ptr %12, i64 %indvars.iv.next125
  %58 = load ptr, ptr %57, align 8, !tbaa !9
  %59 = trunc nuw nsw i64 %indvars.iv.next125 to i32
  br label %60

60:                                               ; preds = %.lr.ph103.us, %60
  %.2101.us = phi i32 [ 0, %.lr.ph103.us ], [ %61, %60 ]
  tail call void @vcycle(ptr noundef nonnull %11, ptr noundef %58, i32 noundef %59, i32 noundef %4, i32 noundef %5) #6
  %61 = add nuw nsw i32 %.2101.us, 1
  %exitcond123.not = icmp eq i32 %61, %3
  br i1 %exitcond123.not, label %..loopexit_crit_edge.us, label %60, !llvm.loop !14

..loopexit_crit_edge.us:                          ; preds = %60
  %exitcond128.not = icmp eq i64 %indvars.iv.next125, %wide.trip.count127
  br i1 %exitcond128.not, label %._crit_edge107, label %.lr.ph103.us, !llvm.loop !15

.loopexit:                                        ; preds = %.lr.ph106, %.loopexit
  %62 = phi ptr [ %64, %.loopexit ], [ %49, %.lr.ph106 ]
  %indvars.iv118 = phi i64 [ %indvars.iv.next119, %.loopexit ], [ 0, %.lr.ph106 ]
  %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
  %63 = getelementptr inbounds ptr, ptr %11, i64 %indvars.iv.next119
  %64 = load ptr, ptr %63, align 8, !tbaa !9
  %65 = trunc nuw nsw i64 %indvars.iv118 to i32
  tail call void @prolongate2D(ptr noundef %64, ptr noundef %62, i32 noundef %65) #6
  %exitcond122.not = icmp eq i64 %indvars.iv.next119, %wide.trip.count127
  br i1 %exitcond122.not, label %._crit_edge107, label %.loopexit, !llvm.loop !15

._crit_edge107:                                   ; preds = %.loopexit, %..loopexit_crit_edge.us, %._crit_edge100.thread, %._crit_edge100
  %66 = load ptr, ptr %28, align 8, !tbaa !9
  tail call void @matfill(ptr noundef %0, ptr noundef %66, i32 noundef %.pre137) #6
  br i1 %.not95, label %.lr.ph111.preheader, label %._crit_edge112

.lr.ph111.preheader:                              ; preds = %._crit_edge107
  %wide.trip.count132 = zext i32 %6 to i64
  br label %.lr.ph111

.lr.ph111:                                        ; preds = %.lr.ph111.preheader, %.lr.ph111
  %indvars.iv129 = phi i64 [ 0, %.lr.ph111.preheader ], [ %indvars.iv.next130, %.lr.ph111 ]
  %67 = getelementptr inbounds ptr, ptr %11, i64 %indvars.iv129
  %68 = load ptr, ptr %67, align 8, !tbaa !9
  tail call void @free(ptr noundef %68) #6
  %69 = getelementptr inbounds ptr, ptr %12, i64 %indvars.iv129
  %70 = load ptr, ptr %69, align 8, !tbaa !9
  tail call void @free(ptr noundef %70) #6
  %71 = getelementptr inbounds ptr, ptr %13, i64 %indvars.iv129
  %72 = load ptr, ptr %71, align 8, !tbaa !9
  tail call void @free(ptr noundef %72) #6
  %indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
  %exitcond133.not = icmp eq i64 %indvars.iv.next130, %wide.trip.count132
  br i1 %exitcond133.not, label %._crit_edge112, label %.lr.ph111, !llvm.loop !16

._crit_edge112:                                   ; preds = %.lr.ph111, %._crit_edge107
  tail call void @free(ptr noundef nonnull %11) #6
  tail call void @free(ptr noundef %12) #6
  tail call void @free(ptr noundef %13) #6
  tail call void @free(ptr noundef %9) #6
  ret void
}

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1

declare void @matfill(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @restrict2D(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @solve(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @prolongate2D(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @vcycle(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #4

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #5 = { nounwind allocsize(0) }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass