; LLVM IR from adamdempsey90/MultiGrid :: tests/test_multigrid (main)

; 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"

@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [15 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local double @source(double noundef, double noundef) #0

; Function Attrs: nounwind
declare double @pow(double noundef, double noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca double, align 8
  %21 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %22 = load ptr, ptr %5, align 8, !tbaa !9
  %23 = getelementptr inbounds ptr, ptr %22, i64 1
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  %25 = call i32 @atoi(ptr noundef %24) #7
  store i32 %25, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %26 = load ptr, ptr %5, align 8, !tbaa !9
  %27 = getelementptr inbounds ptr, ptr %26, i64 2
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = call i32 @atoi(ptr noundef %28) #7
  store i32 %29, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %30 = load i32, ptr %6, align 4, !tbaa !5
  %31 = shl i32 2, %30
  %32 = add nsw i32 1, %31
  store i32 %32, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %33 = load i32, ptr %8, align 4, !tbaa !5
  %34 = load i32, ptr %8, align 4, !tbaa !5
  %35 = mul nsw i32 %33, %34
  store i32 %35, ptr %9, align 4, !tbaa !5
  %36 = load i32, ptr %8, align 4, !tbaa !5
  %37 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %36)
  %38 = load i32, ptr %7, align 4, !tbaa !5
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %38)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %40 = load i32, ptr %8, align 4, !tbaa !5
  %41 = sub nsw i32 %40, 1
  %42 = sitofp i32 %41 to double
  %43 = fdiv double 1.000000e+00, %42
  store double %43, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %44 = load i32, ptr %8, align 4, !tbaa !5
  %45 = sub nsw i32 %44, 1
  %46 = sitofp i32 %45 to double
  %47 = fdiv double 1.000000e+00, %46
  store double %47, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %48 = load i32, ptr %9, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = mul i64 8, %49
  %51 = call noalias ptr @malloc(i64 noundef %50) #8
  store ptr %51, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %52 = load i32, ptr %9, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = mul i64 8, %53
  %55 = call noalias ptr @malloc(i64 noundef %54) #8
  store ptr %55, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %56 = load i32, ptr %9, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = mul i64 8, %57
  %59 = call noalias ptr @malloc(i64 noundef %58) #8
  store ptr %59, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %60 = load i32, ptr %8, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = mul i64 8, %61
  %63 = call noalias ptr @malloc(i64 noundef %62) #8
  store ptr %63, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %64 = load i32, ptr %8, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = mul i64 8, %65
  %67 = call noalias ptr @malloc(i64 noundef %66) #8
  store ptr %67, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %89, %2
  %69 = load i32, ptr %17, align 4, !tbaa !5
  %70 = load i32, ptr %8, align 4, !tbaa !5
  %71 = icmp slt i32 %69, %70
  br i1 %71, label %72, label %92

72:                                               ; preds = %68
  %73 = load i32, ptr %17, align 4, !tbaa !5
  %74 = sitofp i32 %73 to double
  %75 = load double, ptr %10, align 8, !tbaa !11
  %76 = fmul double %74, %75
  %77 = load ptr, ptr %15, align 8, !tbaa !9
  %78 = load i32, ptr %17, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds double, ptr %77, i64 %79
  store double %76, ptr %80, align 8, !tbaa !11
  %81 = load i32, ptr %17, align 4, !tbaa !5
  %82 = sitofp i32 %81 to double
  %83 = load double, ptr %11, align 8, !tbaa !11
  %84 = fmul double %82, %83
  %85 = load ptr, ptr %16, align 8, !tbaa !9
  %86 = load i32, ptr %17, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds double, ptr %85, i64 %87
  store double %84, ptr %88, align 8, !tbaa !11
  br label %89

89:                                               ; preds = %72
  %90 = load i32, ptr %17, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %17, align 4, !tbaa !5
  br label %68, !llvm.loop !13

92:                                               ; preds = %68
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %142, %92
  %94 = load i32, ptr %17, align 4, !tbaa !5
  %95 = load i32, ptr %8, align 4, !tbaa !5
  %96 = icmp slt i32 %94, %95
  br i1 %96, label %97, label %145

97:                                               ; preds = %93
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %138, %97
  %99 = load i32, ptr %18, align 4, !tbaa !5
  %100 = load i32, ptr %8, align 4, !tbaa !5
  %101 = icmp slt i32 %99, %100
  br i1 %101, label %102, label %141

102:                                              ; preds = %98
  %103 = load ptr, ptr %15, align 8, !tbaa !9
  %104 = load i32, ptr %17, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds double, ptr %103, i64 %105
  %107 = load double, ptr %106, align 8, !tbaa !11
  %108 = load ptr, ptr %16, align 8, !tbaa !9
  %109 = load i32, ptr %18, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds double, ptr %108, i64 %110
  %112 = load double, ptr %111, align 8, !tbaa !11
  %113 = call double @source(double noundef %107, double noundef %112)
  %114 = load ptr, ptr %12, align 8, !tbaa !9
  %115 = load i32, ptr %18, align 4, !tbaa !5
  %116 = load i32, ptr %17, align 4, !tbaa !5
  %117 = load i32, ptr %8, align 4, !tbaa !5
  %118 = mul nsw i32 %116, %117
  %119 = add nsw i32 %115, %118
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds double, ptr %114, i64 %120
  store double %113, ptr %121, align 8, !tbaa !11
  %122 = load ptr, ptr %13, align 8, !tbaa !9
  %123 = load i32, ptr %18, align 4, !tbaa !5
  %124 = load i32, ptr %17, align 4, !tbaa !5
  %125 = load i32, ptr %8, align 4, !tbaa !5
  %126 = mul nsw i32 %124, %125
  %127 = add nsw i32 %123, %126
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds double, ptr %122, i64 %128
  store double 0.000000e+00, ptr %129, align 8, !tbaa !11
  %130 = load ptr, ptr %14, align 8, !tbaa !9
  %131 = load i32, ptr %18, align 4, !tbaa !5
  %132 = load i32, ptr %17, align 4, !tbaa !5
  %133 = load i32, ptr %8, align 4, !tbaa !5
  %134 = mul nsw i32 %132, %133
  %135 = add nsw i32 %131, %134
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds double, ptr %130, i64 %136
  store double 0.000000e+00, ptr %137, align 8, !tbaa !11
  br label %138

138:                                              ; preds = %102
  %139 = load i32, ptr %18, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %18, align 4, !tbaa !5
  br label %98, !llvm.loop !15

141:                                              ; preds = %98
  br label %142

142:                                              ; preds = %141
  %143 = load i32, ptr %17, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %17, align 4, !tbaa !5
  br label %93, !llvm.loop !16

145:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %146 = call noalias ptr @fopen(ptr noundef @.str.2, ptr noundef @.str.3)
  store ptr %146, ptr %19, align 8, !tbaa !9
  %147 = load ptr, ptr %15, align 8, !tbaa !9
  %148 = load i32, ptr %8, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = load ptr, ptr %19, align 8, !tbaa !9
  %151 = call i64 @fwrite(ptr noundef %147, i64 noundef 8, i64 noundef %149, ptr noundef %150)
  %152 = load ptr, ptr %16, align 8, !tbaa !9
  %153 = load i32, ptr %8, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = load ptr, ptr %19, align 8, !tbaa !9
  %156 = call i64 @fwrite(ptr noundef %152, i64 noundef 8, i64 noundef %154, ptr noundef %155)
  %157 = load ptr, ptr %19, align 8, !tbaa !9
  %158 = call i32 @fclose(ptr noundef %157)
  %159 = call noalias ptr @fopen(ptr noundef @.str.4, ptr noundef @.str.3)
  store ptr %159, ptr %19, align 8, !tbaa !9
  %160 = load ptr, ptr %12, align 8, !tbaa !9
  %161 = load i32, ptr %9, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = load ptr, ptr %19, align 8, !tbaa !9
  %164 = call i64 @fwrite(ptr noundef %160, i64 noundef 8, i64 noundef %162, ptr noundef %163)
  %165 = load ptr, ptr %19, align 8, !tbaa !9
  %166 = call i32 @fclose(ptr noundef %165)
  %167 = call noalias ptr @fopen(ptr noundef @.str.5, ptr noundef @.str.3)
  store ptr %167, ptr %19, align 8, !tbaa !9
  %168 = load ptr, ptr %13, align 8, !tbaa !9
  %169 = load i32, ptr %9, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = load ptr, ptr %19, align 8, !tbaa !9
  %172 = call i64 @fwrite(ptr noundef %168, i64 noundef 8, i64 noundef %170, ptr noundef %171)
  %173 = load ptr, ptr %19, align 8, !tbaa !9
  %174 = call i32 @fclose(ptr noundef %173)
  %175 = load ptr, ptr %13, align 8, !tbaa !9
  %176 = load ptr, ptr %12, align 8, !tbaa !9
  %177 = load i32, ptr %6, align 4, !tbaa !5
  %178 = load i32, ptr %7, align 4, !tbaa !5
  %179 = load i32, ptr %7, align 4, !tbaa !5
  call void @multigrid(ptr noundef %175, ptr noundef %176, i32 noundef %177, i32 noundef 1, i32 noundef %178, i32 noundef %179)
  %180 = call noalias ptr @fopen(ptr noundef @.str.6, ptr noundef @.str.3)
  store ptr %180, ptr %19, align 8, !tbaa !9
  %181 = load ptr, ptr %13, align 8, !tbaa !9
  %182 = load i32, ptr %9, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = load ptr, ptr %19, align 8, !tbaa !9
  %185 = call i64 @fwrite(ptr noundef %181, i64 noundef 8, i64 noundef %183, ptr noundef %184)
  %186 = load ptr, ptr %19, align 8, !tbaa !9
  %187 = call i32 @fclose(ptr noundef %186)
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  store double 0.000000e+00, ptr %20, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %188

188:                                              ; preds = %209, %145
  %189 = load i32, ptr %17, align 4, !tbaa !5
  %190 = load i32, ptr %8, align 4, !tbaa !5
  %191 = load i32, ptr %8, align 4, !tbaa !5
  %192 = mul nsw i32 %190, %191
  %193 = icmp slt i32 %189, %192
  br i1 %193, label %194, label %212

194:                                              ; preds = %188
  %195 = load ptr, ptr %14, align 8, !tbaa !9
  %196 = load i32, ptr %17, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds double, ptr %195, i64 %197
  %199 = load double, ptr %198, align 8, !tbaa !11
  %200 = load ptr, ptr %13, align 8, !tbaa !9
  %201 = load i32, ptr %17, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds double, ptr %200, i64 %202
  %204 = load double, ptr %203, align 8, !tbaa !11
  %205 = fsub double %199, %204
  %206 = call double @pow(double noundef %205, double noundef 2.000000e+00) #6
  %207 = load double, ptr %20, align 8, !tbaa !11
  %208 = fadd double %207, %206
  store double %208, ptr %20, align 8, !tbaa !11
  br label %209

209:                                              ; preds = %194
  %210 = load i32, ptr %17, align 4, !tbaa !5
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %17, align 4, !tbaa !5
  br label %188, !llvm.loop !17

212:                                              ; preds = %188
  %213 = load double, ptr %20, align 8, !tbaa !11
  %214 = load i32, ptr %8, align 4, !tbaa !5
  %215 = load i32, ptr %8, align 4, !tbaa !5
  %216 = mul nsw i32 %214, %215
  %217 = sitofp i32 %216 to double
  %218 = fdiv double %213, %217
  %219 = call double @sqrt(double noundef %218) #6
  store double %219, ptr %20, align 8, !tbaa !11
  %220 = load double, ptr %20, align 8, !tbaa !11
  %221 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, double noundef %220)
  %222 = load ptr, ptr %12, align 8, !tbaa !9
  call void @free(ptr noundef %222) #6
  %223 = load ptr, ptr %13, align 8, !tbaa !9
  call void @free(ptr noundef %223) #6
  %224 = load ptr, ptr %15, align 8, !tbaa !9
  call void @free(ptr noundef %224) #6
  %225 = load ptr, ptr %16, align 8, !tbaa !9
  call void @free(ptr noundef %225) #6
  %226 = load ptr, ptr %14, align 8, !tbaa !9
  call void @free(ptr noundef %226) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %227 = load i32, ptr %3, align 4
  ret i32 %227
}

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

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #3

declare i32 @printf(ptr noundef, ...) #4

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

declare noalias ptr @fopen(ptr noundef, ptr noundef) #4

declare i64 @fwrite(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #4

declare i32 @fclose(ptr noundef) #4

declare void @multigrid(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #4

; Function Attrs: nounwind
declare double @sqrt(double noundef) #1

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

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

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 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint nounwind willreturn memory(read) 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 #4 = { "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 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 #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
attributes #8 = { 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 = !{!"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 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}


; 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"

@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [15 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local double @source(double noundef, double noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %1, i64 8
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = tail call i32 @atoi(ptr nocapture noundef %4) #7
  %6 = getelementptr inbounds i8, ptr %1, i64 16
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = tail call i32 @atoi(ptr nocapture noundef %7) #7
  %9 = shl i32 2, %5
  %10 = or disjoint i32 %9, 1
  %11 = mul i32 %10, %10
  %12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %10)
  %13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8)
  %14 = sitofp i32 %9 to double
  %15 = fdiv double 1.000000e+00, %14
  %16 = zext nneg i32 %11 to i64
  %17 = shl nuw nsw i64 %16, 3
  %18 = tail call noalias ptr @malloc(i64 noundef %17) #8
  %19 = tail call noalias ptr @malloc(i64 noundef %17) #8
  %20 = tail call noalias ptr @malloc(i64 noundef %17) #8
  %21 = sext i32 %10 to i64
  %22 = shl nsw i64 %21, 3
  %23 = tail call noalias ptr @malloc(i64 noundef %22) #8
  %24 = tail call noalias ptr @malloc(i64 noundef %22) #8
  %.not96 = icmp slt i32 %9, 0
  br i1 %.not96, label %._crit_edge103, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %2
  %25 = or disjoint i32 %9, 1
  %wide.trip.count = zext nneg i32 %25 to i64
  %min.iters.check = icmp ult i32 %9, 4
  br i1 %min.iters.check, label %.lr.ph.preheader123, label %vector.ph

.lr.ph.preheader123:                              ; preds = %vector.body, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %vector.body ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %wide.trip.count, 2147483644
  %broadcast.splatinsert = insertelement <2 x double> poison, double %15, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <2 x i32> [ <i32 0, i32 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <2 x i32> %vec.ind, <i32 2, i32 2>
  %26 = uitofp <2 x i32> %vec.ind to <2 x double>
  %27 = uitofp <2 x i32> %step.add to <2 x double>
  %28 = fmul <2 x double> %broadcast.splat, %26
  %29 = fmul <2 x double> %broadcast.splat, %27
  %30 = getelementptr inbounds double, ptr %23, i64 %index
  %31 = getelementptr inbounds i8, ptr %30, i64 16
  store <2 x double> %28, ptr %30, align 8, !tbaa !9
  store <2 x double> %29, ptr %31, align 8, !tbaa !9
  %32 = getelementptr inbounds double, ptr %24, i64 %index
  %33 = getelementptr inbounds i8, ptr %32, i64 16
  store <2 x double> %28, ptr %32, align 8, !tbaa !9
  store <2 x double> %29, ptr %33, align 8, !tbaa !9
  %index.next = add nuw i64 %index, 4
  %vec.ind.next = add <2 x i32> %vec.ind, <i32 4, i32 4>
  %34 = icmp eq i64 %index.next, %n.vec
  br i1 %34, label %.lr.ph.preheader123, label %vector.body, !llvm.loop !11

.preheader95:                                     ; preds = %.lr.ph
  br i1 %.not96, label %._crit_edge103, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader95
  %35 = zext nneg i32 %10 to i64
  br label %.preheader

.lr.ph:                                           ; preds = %.lr.ph.preheader123, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader123 ]
  %36 = trunc nuw nsw i64 %indvars.iv to i32
  %37 = uitofp nneg i32 %36 to double
  %38 = fmul double %15, %37
  %39 = getelementptr inbounds double, ptr %23, i64 %indvars.iv
  store double %38, ptr %39, align 8, !tbaa !9
  %40 = getelementptr inbounds double, ptr %24, i64 %indvars.iv
  store double %38, ptr %40, 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 %.preheader95, label %.lr.ph, !llvm.loop !15

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge
  %indvars.iv112 = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next113, %._crit_edge ]
  %41 = getelementptr inbounds double, ptr %23, i64 %indvars.iv112
  %42 = load double, ptr %41, align 8, !tbaa !9
  %43 = mul nuw nsw i64 %indvars.iv112, %35
  br label %44

44:                                               ; preds = %.preheader, %44
  %indvars.iv107 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next108, %44 ]
  %45 = getelementptr inbounds double, ptr %24, i64 %indvars.iv107
  %46 = load double, ptr %45, align 8, !tbaa !9
  %47 = tail call double @source(double noundef %42, double noundef %46)
  %48 = add nuw nsw i64 %indvars.iv107, %43
  %49 = getelementptr inbounds double, ptr %18, i64 %48
  store double %47, ptr %49, align 8, !tbaa !9
  %50 = getelementptr inbounds double, ptr %19, i64 %48
  store double 0.000000e+00, ptr %50, align 8, !tbaa !9
  %51 = getelementptr inbounds double, ptr %20, i64 %48
  store double 0.000000e+00, ptr %51, align 8, !tbaa !9
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %exitcond111.not = icmp eq i64 %indvars.iv.next108, %35
  br i1 %exitcond111.not, label %._crit_edge, label %44, !llvm.loop !16

._crit_edge:                                      ; preds = %44
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %exitcond116.not = icmp eq i64 %indvars.iv.next113, %35
  br i1 %exitcond116.not, label %._crit_edge103, label %.preheader, !llvm.loop !17

._crit_edge103:                                   ; preds = %._crit_edge, %2, %.preheader95
  %52 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3)
  %53 = tail call i64 @fwrite(ptr noundef %23, i64 noundef 8, i64 noundef %21, ptr noundef %52)
  %54 = tail call i64 @fwrite(ptr noundef %24, i64 noundef 8, i64 noundef %21, ptr noundef %52)
  %55 = tail call i32 @fclose(ptr noundef %52)
  %56 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.3)
  %57 = tail call i64 @fwrite(ptr noundef %18, i64 noundef 8, i64 noundef %16, ptr noundef %56)
  %58 = tail call i32 @fclose(ptr noundef %56)
  %59 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3)
  %60 = tail call i64 @fwrite(ptr noundef %19, i64 noundef 8, i64 noundef %16, ptr noundef %59)
  %61 = tail call i32 @fclose(ptr noundef %59)
  tail call void @multigrid(ptr noundef %19, ptr noundef %18, i32 noundef %5, i32 noundef 1, i32 noundef %8, i32 noundef %8) #9
  %62 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.3)
  %63 = tail call i64 @fwrite(ptr noundef %19, i64 noundef 8, i64 noundef %16, ptr noundef %62)
  %64 = tail call i32 @fclose(ptr noundef %62)
  %65 = icmp eq i32 %11, 1
  br i1 %65, label %.epil.preheader, label %._crit_edge103.new

._crit_edge103.new:                               ; preds = %._crit_edge103
  %wide.trip.count120 = zext i32 %11 to i64
  %66 = add nsw i64 %wide.trip.count120, -5
  br label %67

67:                                               ; preds = %67, %._crit_edge103.new
  %indvars.iv117 = phi i64 [ 0, %._crit_edge103.new ], [ %indvars.iv.next118.3, %67 ]
  %.089104 = phi double [ 0.000000e+00, %._crit_edge103.new ], [ %91, %67 ]
  %niter = phi i64 [ 0, %._crit_edge103.new ], [ %niter.next.3, %67 ]
  %68 = getelementptr inbounds double, ptr %20, i64 %indvars.iv117
  %69 = load double, ptr %68, align 8, !tbaa !9
  %70 = getelementptr inbounds double, ptr %19, i64 %indvars.iv117
  %71 = load double, ptr %70, align 8, !tbaa !9
  %72 = fsub double %69, %71
  %square = fmul double %72, %72
  %73 = fadd double %.089104, %square
  %indvars.iv.next118 = or disjoint i64 %indvars.iv117, 1
  %74 = getelementptr inbounds double, ptr %20, i64 %indvars.iv.next118
  %75 = load double, ptr %74, align 8, !tbaa !9
  %76 = getelementptr inbounds double, ptr %19, i64 %indvars.iv.next118
  %77 = load double, ptr %76, align 8, !tbaa !9
  %78 = fsub double %75, %77
  %square.1 = fmul double %78, %78
  %79 = fadd double %73, %square.1
  %indvars.iv.next118.1 = or disjoint i64 %indvars.iv117, 2
  %80 = getelementptr inbounds double, ptr %20, i64 %indvars.iv.next118.1
  %81 = load double, ptr %80, align 8, !tbaa !9
  %82 = getelementptr inbounds double, ptr %19, i64 %indvars.iv.next118.1
  %83 = load double, ptr %82, align 8, !tbaa !9
  %84 = fsub double %81, %83
  %square.2 = fmul double %84, %84
  %85 = fadd double %79, %square.2
  %indvars.iv.next118.2 = or disjoint i64 %indvars.iv117, 3
  %86 = getelementptr inbounds double, ptr %20, i64 %indvars.iv.next118.2
  %87 = load double, ptr %86, align 8, !tbaa !9
  %88 = getelementptr inbounds double, ptr %19, i64 %indvars.iv.next118.2
  %89 = load double, ptr %88, align 8, !tbaa !9
  %90 = fsub double %87, %89
  %square.3 = fmul double %90, %90
  %91 = fadd double %85, %square.3
  %indvars.iv.next118.3 = add nuw nsw i64 %indvars.iv117, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter, %66
  br i1 %niter.ncmp.3, label %.epil.preheader, label %67, !llvm.loop !18

.epil.preheader:                                  ; preds = %._crit_edge103, %67
  %indvars.iv117.unr = phi i64 [ 0, %._crit_edge103 ], [ %indvars.iv.next118.3, %67 ]
  %.089104.unr = phi double [ 0.000000e+00, %._crit_edge103 ], [ %91, %67 ]
  br label %92

92:                                               ; preds = %92, %.epil.preheader
  %indvars.iv117.epil = phi i64 [ %indvars.iv117.unr, %.epil.preheader ], [ %indvars.iv.next118.epil, %92 ]
  %.089104.epil = phi double [ %.089104.unr, %.epil.preheader ], [ %98, %92 ]
  %epil.iter = phi i64 [ 0, %.epil.preheader ], [ %epil.iter.next, %92 ]
  %93 = getelementptr inbounds double, ptr %20, i64 %indvars.iv117.epil
  %94 = load double, ptr %93, align 8, !tbaa !9
  %95 = getelementptr inbounds double, ptr %19, i64 %indvars.iv117.epil
  %96 = load double, ptr %95, align 8, !tbaa !9
  %97 = fsub double %94, %96
  %square.epil = fmul double %97, %97
  %98 = fadd double %.089104.epil, %square.epil
  %indvars.iv.next118.epil = add nuw nsw i64 %indvars.iv117.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter, 0
  br i1 %epil.iter.cmp.not, label %.epilog-lcssa, label %92, !llvm.loop !19

.epilog-lcssa:                                    ; preds = %92
  %99 = uitofp nneg i32 %11 to double
  %100 = fdiv double %98, %99
  %101 = tail call double @sqrt(double noundef %100) #9
  %102 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, double noundef %101)
  tail call void @free(ptr noundef %18) #9
  tail call void @free(ptr noundef nonnull %19) #9
  tail call void @free(ptr noundef %23) #9
  tail call void @free(ptr noundef %24) #9
  tail call void @free(ptr noundef nonnull %20) #9
  ret i32 0
}

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i64 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #2

declare void @multigrid(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #5

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

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 = { inlinehint mustprogress nofree nounwind willreturn memory(read) 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 #2 = { nofree 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 #3 = { 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 #4 = { "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 = { mustprogress nofree nounwind willreturn memory(write) "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 #6 = { 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 #7 = { nounwind willreturn memory(read) }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12, !14, !13}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.unroll.disable"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass