; LLVM IR from adamdempsey90/MultiGrid :: src (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 [16 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [18 x i8], align 1

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

; 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
  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
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 6, ptr %6, align 4, !tbaa !5
  store i32 2, ptr %7, align 4, !tbaa !5
  %20 = load i32, ptr %4, align 4, !tbaa !5
  %21 = icmp sgt i32 %20, 1
  br i1 %21, label %22, label %27

22:                                               ; preds = %2
  %23 = load ptr, ptr %5, align 8, !tbaa !9
  %24 = getelementptr inbounds ptr, ptr %23, i64 1
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  %26 = call i32 @atoi(ptr noundef %25) #7
  store i32 %26, ptr %6, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %22, %2
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = icmp sgt i32 %28, 2
  br i1 %29, label %30, label %35

30:                                               ; preds = %27
  %31 = load ptr, ptr %5, align 8, !tbaa !9
  %32 = getelementptr inbounds ptr, ptr %31, i64 2
  %33 = load ptr, ptr %32, align 8, !tbaa !9
  %34 = call i32 @atoi(ptr noundef %33) #7
  store i32 %34, ptr %7, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %30, %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %36 = load i32, ptr %6, align 4, !tbaa !5
  %37 = shl i32 2, %36
  %38 = add nsw i32 1, %37
  store i32 %38, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %39 = load i32, ptr %8, align 4, !tbaa !5
  %40 = load i32, ptr %8, align 4, !tbaa !5
  %41 = mul nsw i32 %39, %40
  store i32 %41, ptr %9, align 4, !tbaa !5
  %42 = load i32, ptr %8, align 4, !tbaa !5
  %43 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %42)
  %44 = load i32, ptr %7, align 4, !tbaa !5
  %45 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %44)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %46 = load i32, ptr %8, align 4, !tbaa !5
  %47 = sub nsw i32 %46, 1
  %48 = sitofp i32 %47 to double
  %49 = fdiv double 1.000000e+00, %48
  store double %49, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %50 = load i32, ptr %8, align 4, !tbaa !5
  %51 = sub nsw i32 %50, 1
  %52 = sitofp i32 %51 to double
  %53 = fdiv double 1.000000e+00, %52
  store double %53, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %54 = load i32, ptr %9, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = mul i64 8, %55
  %57 = call noalias ptr @malloc(i64 noundef %56) #8
  store ptr %57, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %58 = load i32, ptr %9, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = mul i64 8, %59
  %61 = call noalias ptr @malloc(i64 noundef %60) #8
  store ptr %61, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %62 = load i32, ptr %9, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = mul i64 8, %63
  %65 = call noalias ptr @malloc(i64 noundef %64) #8
  store ptr %65, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %66 = load i32, ptr %8, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = mul i64 8, %67
  %69 = call noalias ptr @malloc(i64 noundef %68) #8
  store ptr %69, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %70 = load i32, ptr %8, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = mul i64 8, %71
  %73 = call noalias ptr @malloc(i64 noundef %72) #8
  store ptr %73, 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 %74

74:                                               ; preds = %95, %35
  %75 = load i32, ptr %17, align 4, !tbaa !5
  %76 = load i32, ptr %8, align 4, !tbaa !5
  %77 = icmp slt i32 %75, %76
  br i1 %77, label %78, label %98

78:                                               ; preds = %74
  %79 = load i32, ptr %17, align 4, !tbaa !5
  %80 = sitofp i32 %79 to double
  %81 = load double, ptr %10, align 8, !tbaa !11
  %82 = fmul double %80, %81
  %83 = load ptr, ptr %15, align 8, !tbaa !9
  %84 = load i32, ptr %17, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds double, ptr %83, i64 %85
  store double %82, ptr %86, align 8, !tbaa !11
  %87 = load i32, ptr %17, align 4, !tbaa !5
  %88 = sitofp i32 %87 to double
  %89 = load double, ptr %11, align 8, !tbaa !11
  %90 = fmul double %88, %89
  %91 = load ptr, ptr %16, align 8, !tbaa !9
  %92 = load i32, ptr %17, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds double, ptr %91, i64 %93
  store double %90, ptr %94, align 8, !tbaa !11
  br label %95

95:                                               ; preds = %78
  %96 = load i32, ptr %17, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %17, align 4, !tbaa !5
  br label %74, !llvm.loop !13

98:                                               ; preds = %74
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %148, %98
  %100 = load i32, ptr %17, align 4, !tbaa !5
  %101 = load i32, ptr %8, align 4, !tbaa !5
  %102 = icmp slt i32 %100, %101
  br i1 %102, label %103, label %151

103:                                              ; preds = %99
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %144, %103
  %105 = load i32, ptr %18, align 4, !tbaa !5
  %106 = load i32, ptr %8, align 4, !tbaa !5
  %107 = icmp slt i32 %105, %106
  br i1 %107, label %108, label %147

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

144:                                              ; preds = %108
  %145 = load i32, ptr %18, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %18, align 4, !tbaa !5
  br label %104, !llvm.loop !15

147:                                              ; preds = %104
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %17, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %17, align 4, !tbaa !5
  br label %99, !llvm.loop !16

151:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %152 = call noalias ptr @fopen(ptr noundef @.str.2, ptr noundef @.str.3)
  store ptr %152, ptr %19, align 8, !tbaa !9
  %153 = load ptr, ptr %15, align 8, !tbaa !9
  %154 = load i32, ptr %8, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = load ptr, ptr %19, align 8, !tbaa !9
  %157 = call i64 @fwrite(ptr noundef %153, i64 noundef 8, i64 noundef %155, ptr noundef %156)
  %158 = load ptr, ptr %16, align 8, !tbaa !9
  %159 = load i32, ptr %8, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = load ptr, ptr %19, align 8, !tbaa !9
  %162 = call i64 @fwrite(ptr noundef %158, i64 noundef 8, i64 noundef %160, ptr noundef %161)
  %163 = load ptr, ptr %19, align 8, !tbaa !9
  %164 = call i32 @fclose(ptr noundef %163)
  %165 = call noalias ptr @fopen(ptr noundef @.str.4, ptr noundef @.str.3)
  store ptr %165, ptr %19, align 8, !tbaa !9
  %166 = load ptr, ptr %12, align 8, !tbaa !9
  %167 = load i32, ptr %9, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = load ptr, ptr %19, align 8, !tbaa !9
  %170 = call i64 @fwrite(ptr noundef %166, i64 noundef 8, i64 noundef %168, ptr noundef %169)
  %171 = load ptr, ptr %19, align 8, !tbaa !9
  %172 = call i32 @fclose(ptr noundef %171)
  %173 = call noalias ptr @fopen(ptr noundef @.str.5, ptr noundef @.str.3)
  store ptr %173, ptr %19, align 8, !tbaa !9
  %174 = load ptr, ptr %13, align 8, !tbaa !9
  %175 = load i32, ptr %9, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = load ptr, ptr %19, align 8, !tbaa !9
  %178 = call i64 @fwrite(ptr noundef %174, i64 noundef 8, i64 noundef %176, ptr noundef %177)
  %179 = load ptr, ptr %19, align 8, !tbaa !9
  %180 = call i32 @fclose(ptr noundef %179)
  %181 = load ptr, ptr %13, align 8, !tbaa !9
  %182 = load ptr, ptr %12, align 8, !tbaa !9
  %183 = load i32, ptr %6, align 4, !tbaa !5
  %184 = load i32, ptr %7, align 4, !tbaa !5
  %185 = load i32, ptr %7, align 4, !tbaa !5
  call void @multigrid(ptr noundef %181, ptr noundef %182, i32 noundef %183, i32 noundef 1, i32 noundef %184, i32 noundef %185)
  %186 = call noalias ptr @fopen(ptr noundef @.str.6, ptr noundef @.str.3)
  store ptr %186, ptr %19, align 8, !tbaa !9
  %187 = load ptr, ptr %13, align 8, !tbaa !9
  %188 = load i32, ptr %9, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = load ptr, ptr %19, align 8, !tbaa !9
  %191 = call i64 @fwrite(ptr noundef %187, i64 noundef 8, i64 noundef %189, ptr noundef %190)
  %192 = load ptr, ptr %19, align 8, !tbaa !9
  %193 = call i32 @fclose(ptr noundef %192)
  %194 = load ptr, ptr %12, align 8, !tbaa !9
  call void @free(ptr noundef %194) #6
  %195 = load ptr, ptr %13, align 8, !tbaa !9
  call void @free(ptr noundef %195) #6
  %196 = load ptr, ptr %15, align 8, !tbaa !9
  call void @free(ptr noundef %196) #6
  %197 = load ptr, ptr %16, align 8, !tbaa !9
  call void @free(ptr noundef %197) #6
  %198 = load ptr, ptr %14, align 8, !tbaa !9
  call void @free(ptr noundef %198) #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
  ret i32 1
}

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

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

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

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

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

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

declare i32 @fclose(ptr noundef) #3

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

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

; 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 = { 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 #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 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 #5 = { 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 #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}


; 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 [16 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [18 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 = icmp sgt i32 %0, 1
  br i1 %3, label %4, label %.thread

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %1, i64 8
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = tail call i32 @atoi(ptr nocapture noundef %6) #6
  %.not85 = icmp eq i32 %0, 2
  br i1 %.not85, label %.thread, label %8

8:                                                ; preds = %4
  %9 = getelementptr inbounds i8, ptr %1, i64 16
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = tail call i32 @atoi(ptr nocapture noundef %10) #6
  br label %.thread

.thread:                                          ; preds = %2, %8, %4
  %.084 = phi i32 [ %7, %8 ], [ %7, %4 ], [ 6, %2 ]
  %.079 = phi i32 [ %11, %8 ], [ 2, %4 ], [ 2, %2 ]
  %12 = shl i32 2, %.084
  %13 = or disjoint i32 %12, 1
  %14 = mul nsw i32 %13, %13
  %15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %13)
  %16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.079)
  %17 = sitofp i32 %12 to double
  %18 = fdiv double 1.000000e+00, %17
  %19 = zext nneg i32 %14 to i64
  %20 = shl nuw nsw i64 %19, 3
  %21 = tail call noalias ptr @malloc(i64 noundef %20) #7
  %22 = tail call noalias ptr @malloc(i64 noundef %20) #7
  %23 = sext i32 %13 to i64
  %24 = shl nsw i64 %23, 3
  %25 = tail call noalias ptr @malloc(i64 noundef %24) #7
  %26 = tail call noalias ptr @malloc(i64 noundef %24) #7
  %.not87 = icmp slt i32 %12, 0
  br i1 %.not87, label %._crit_edge94, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.thread
  %27 = or disjoint i32 %12, 1
  %wide.trip.count = zext nneg i32 %27 to i64
  %min.iters.check = icmp ult i32 %12, 4
  br i1 %min.iters.check, label %.lr.ph.preheader107, label %vector.ph

.lr.ph.preheader107:                              ; 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 %18, 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>
  %28 = uitofp <2 x i32> %vec.ind to <2 x double>
  %29 = uitofp <2 x i32> %step.add to <2 x double>
  %30 = fmul <2 x double> %broadcast.splat, %28
  %31 = fmul <2 x double> %broadcast.splat, %29
  %32 = getelementptr inbounds double, ptr %25, i64 %index
  %33 = getelementptr inbounds i8, ptr %32, i64 16
  store <2 x double> %30, ptr %32, align 8, !tbaa !9
  store <2 x double> %31, ptr %33, align 8, !tbaa !9
  %34 = getelementptr inbounds double, ptr %26, i64 %index
  %35 = getelementptr inbounds i8, ptr %34, i64 16
  store <2 x double> %30, ptr %34, align 8, !tbaa !9
  store <2 x double> %31, ptr %35, align 8, !tbaa !9
  %index.next = add nuw i64 %index, 4
  %vec.ind.next = add <2 x i32> %vec.ind, <i32 4, i32 4>
  %36 = icmp eq i64 %index.next, %n.vec
  br i1 %36, label %.lr.ph.preheader107, label %vector.body, !llvm.loop !11

.preheader86:                                     ; preds = %.lr.ph
  br i1 %.not87, label %._crit_edge94, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader86
  %37 = zext nneg i32 %13 to i64
  br label %.preheader

.lr.ph:                                           ; preds = %.lr.ph.preheader107, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader107 ]
  %38 = trunc nuw nsw i64 %indvars.iv to i32
  %39 = uitofp nneg i32 %38 to double
  %40 = fmul double %18, %39
  %41 = getelementptr inbounds double, ptr %25, i64 %indvars.iv
  store double %40, ptr %41, align 8, !tbaa !9
  %42 = getelementptr inbounds double, ptr %26, i64 %indvars.iv
  store double %40, ptr %42, 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 %.preheader86, label %.lr.ph, !llvm.loop !15

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge
  %indvars.iv101 = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next102, %._crit_edge ]
  %43 = getelementptr inbounds double, ptr %25, i64 %indvars.iv101
  %44 = load double, ptr %43, align 8, !tbaa !9
  %45 = mul nuw nsw i64 %indvars.iv101, %37
  br label %46

46:                                               ; preds = %.preheader, %46
  %indvars.iv96 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next97, %46 ]
  %47 = getelementptr inbounds double, ptr %26, i64 %indvars.iv96
  %48 = load double, ptr %47, align 8, !tbaa !9
  %49 = tail call double @source(double noundef %44, double noundef %48)
  %50 = add nuw nsw i64 %indvars.iv96, %45
  %51 = getelementptr inbounds double, ptr %21, i64 %50
  store double %49, ptr %51, align 8, !tbaa !9
  %52 = getelementptr inbounds double, ptr %22, i64 %50
  store double 0.000000e+00, ptr %52, align 8, !tbaa !9
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %exitcond100.not = icmp eq i64 %indvars.iv.next97, %37
  br i1 %exitcond100.not, label %._crit_edge, label %46, !llvm.loop !16

._crit_edge:                                      ; preds = %46
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %exitcond105.not = icmp eq i64 %indvars.iv.next102, %37
  br i1 %exitcond105.not, label %._crit_edge94, label %.preheader, !llvm.loop !17

._crit_edge94:                                    ; preds = %._crit_edge, %.thread, %.preheader86
  %53 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3)
  %54 = tail call i64 @fwrite(ptr noundef %25, i64 noundef 8, i64 noundef %23, ptr noundef %53)
  %55 = tail call i64 @fwrite(ptr noundef %26, i64 noundef 8, i64 noundef %23, ptr noundef %53)
  %56 = tail call i32 @fclose(ptr noundef %53)
  %57 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.3)
  %58 = tail call i64 @fwrite(ptr noundef %21, i64 noundef 8, i64 noundef %19, ptr noundef %57)
  %59 = tail call i32 @fclose(ptr noundef %57)
  %60 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3)
  %61 = tail call i64 @fwrite(ptr noundef %22, i64 noundef 8, i64 noundef %19, ptr noundef %60)
  %62 = tail call i32 @fclose(ptr noundef %60)
  tail call void @multigrid(ptr noundef %22, ptr noundef %21, i32 noundef %.084, i32 noundef 1, i32 noundef %.079, i32 noundef %.079) #8
  %63 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.3)
  %64 = tail call i64 @fwrite(ptr noundef %22, i64 noundef 8, i64 noundef %19, ptr noundef %63)
  %65 = tail call i32 @fclose(ptr noundef %63)
  tail call void @free(ptr noundef %21) #8
  tail call void @free(ptr noundef %22) #8
  tail call void @free(ptr noundef %25) #8
  tail call void @free(ptr noundef %26) #8
  ret i32 1
}

; 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 nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5

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 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 #6 = { nounwind willreturn memory(read) }
attributes #7 = { nounwind allocsize(0) }
attributes #8 = { 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}


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