; LLVM IR from bonamarton/phys_num :: euler_RK4_moon (RK4_moon)

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #1

; Function Attrs: nounwind uwtable
define dso_local void @RK4Step(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %16 = load i32, ptr %7, align 4, !tbaa !9
  %17 = zext i32 %16 to i64
  %18 = call ptr @llvm.stacksave.p0()
  store ptr %18, ptr %10, align 8
  %19 = alloca double, i64 %17, align 16
  store i64 %17, ptr %11, align 8
  %20 = load i32, ptr %7, align 4, !tbaa !9
  %21 = zext i32 %20 to i64
  %22 = alloca double, i64 %21, align 16
  store i64 %21, ptr %12, align 8
  %23 = load i32, ptr %7, align 4, !tbaa !9
  %24 = zext i32 %23 to i64
  %25 = alloca double, i64 %24, align 16
  store i64 %24, ptr %13, align 8
  %26 = load i32, ptr %7, align 4, !tbaa !9
  %27 = zext i32 %26 to i64
  %28 = alloca double, i64 %27, align 16
  store i64 %27, ptr %14, align 8
  %29 = load i32, ptr %7, align 4, !tbaa !9
  %30 = zext i32 %29 to i64
  %31 = alloca double, i64 %30, align 16
  store i64 %30, ptr %15, align 8
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %32

32:                                               ; preds = %47, %4
  %33 = load i32, ptr %9, align 4, !tbaa !9
  %34 = load i32, ptr %7, align 4, !tbaa !9
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %36, label %50

36:                                               ; preds = %32
  %37 = load i32, ptr %8, align 4, !tbaa !9
  %38 = sitofp i32 %37 to double
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = load i32, ptr %9, align 4, !tbaa !9
  %42 = call double @df(ptr noundef %39, ptr noundef %40, i32 noundef %41)
  %43 = fmul double %38, %42
  %44 = load i32, ptr %9, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds double, ptr %19, i64 %45
  store double %43, ptr %46, align 8, !tbaa !11
  br label %47

47:                                               ; preds = %36
  %48 = load i32, ptr %9, align 4, !tbaa !9
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %9, align 4, !tbaa !9
  br label %32, !llvm.loop !13

50:                                               ; preds = %32
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %51

51:                                               ; preds = %69, %50
  %52 = load i32, ptr %9, align 4, !tbaa !9
  %53 = load i32, ptr %7, align 4, !tbaa !9
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %55, label %72

55:                                               ; preds = %51
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = load i32, ptr %9, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds double, ptr %56, i64 %58
  %60 = load double, ptr %59, align 8, !tbaa !11
  %61 = load i32, ptr %9, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds double, ptr %19, i64 %62
  %64 = load double, ptr %63, align 8, !tbaa !11
  %65 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %64, double %60)
  %66 = load i32, ptr %9, align 4, !tbaa !9
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds double, ptr %31, i64 %67
  store double %65, ptr %68, align 8, !tbaa !11
  br label %69

69:                                               ; preds = %55
  %70 = load i32, ptr %9, align 4, !tbaa !9
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %9, align 4, !tbaa !9
  br label %51, !llvm.loop !15

72:                                               ; preds = %51
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %73

73:                                               ; preds = %87, %72
  %74 = load i32, ptr %9, align 4, !tbaa !9
  %75 = load i32, ptr %7, align 4, !tbaa !9
  %76 = icmp slt i32 %74, %75
  br i1 %76, label %77, label %90

77:                                               ; preds = %73
  %78 = load i32, ptr %8, align 4, !tbaa !9
  %79 = sitofp i32 %78 to double
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = load i32, ptr %9, align 4, !tbaa !9
  %82 = call double @df(ptr noundef %80, ptr noundef %31, i32 noundef %81)
  %83 = fmul double %79, %82
  %84 = load i32, ptr %9, align 4, !tbaa !9
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds double, ptr %22, i64 %85
  store double %83, ptr %86, align 8, !tbaa !11
  br label %87

87:                                               ; preds = %77
  %88 = load i32, ptr %9, align 4, !tbaa !9
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %9, align 4, !tbaa !9
  br label %73, !llvm.loop !16

90:                                               ; preds = %73
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %91

91:                                               ; preds = %109, %90
  %92 = load i32, ptr %9, align 4, !tbaa !9
  %93 = load i32, ptr %7, align 4, !tbaa !9
  %94 = icmp slt i32 %92, %93
  br i1 %94, label %95, label %112

95:                                               ; preds = %91
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  %97 = load i32, ptr %9, align 4, !tbaa !9
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds double, ptr %96, i64 %98
  %100 = load double, ptr %99, align 8, !tbaa !11
  %101 = load i32, ptr %9, align 4, !tbaa !9
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds double, ptr %22, i64 %102
  %104 = load double, ptr %103, align 8, !tbaa !11
  %105 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %104, double %100)
  %106 = load i32, ptr %9, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds double, ptr %31, i64 %107
  store double %105, ptr %108, align 8, !tbaa !11
  br label %109

109:                                              ; preds = %95
  %110 = load i32, ptr %9, align 4, !tbaa !9
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %9, align 4, !tbaa !9
  br label %91, !llvm.loop !17

112:                                              ; preds = %91
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %113

113:                                              ; preds = %127, %112
  %114 = load i32, ptr %9, align 4, !tbaa !9
  %115 = load i32, ptr %7, align 4, !tbaa !9
  %116 = icmp slt i32 %114, %115
  br i1 %116, label %117, label %130

117:                                              ; preds = %113
  %118 = load i32, ptr %8, align 4, !tbaa !9
  %119 = sitofp i32 %118 to double
  %120 = load ptr, ptr %5, align 8, !tbaa !5
  %121 = load i32, ptr %9, align 4, !tbaa !9
  %122 = call double @df(ptr noundef %120, ptr noundef %31, i32 noundef %121)
  %123 = fmul double %119, %122
  %124 = load i32, ptr %9, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds double, ptr %25, i64 %125
  store double %123, ptr %126, align 8, !tbaa !11
  br label %127

127:                                              ; preds = %117
  %128 = load i32, ptr %9, align 4, !tbaa !9
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %9, align 4, !tbaa !9
  br label %113, !llvm.loop !18

130:                                              ; preds = %113
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %131

131:                                              ; preds = %149, %130
  %132 = load i32, ptr %9, align 4, !tbaa !9
  %133 = load i32, ptr %7, align 4, !tbaa !9
  %134 = icmp slt i32 %132, %133
  br i1 %134, label %135, label %152

135:                                              ; preds = %131
  %136 = load ptr, ptr %6, align 8, !tbaa !5
  %137 = load i32, ptr %9, align 4, !tbaa !9
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds double, ptr %136, i64 %138
  %140 = load double, ptr %139, align 8, !tbaa !11
  %141 = load i32, ptr %9, align 4, !tbaa !9
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds double, ptr %25, i64 %142
  %144 = load double, ptr %143, align 8, !tbaa !11
  %145 = fadd double %140, %144
  %146 = load i32, ptr %9, align 4, !tbaa !9
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds double, ptr %31, i64 %147
  store double %145, ptr %148, align 8, !tbaa !11
  br label %149

149:                                              ; preds = %135
  %150 = load i32, ptr %9, align 4, !tbaa !9
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %9, align 4, !tbaa !9
  br label %131, !llvm.loop !19

152:                                              ; preds = %131
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %153

153:                                              ; preds = %167, %152
  %154 = load i32, ptr %9, align 4, !tbaa !9
  %155 = load i32, ptr %7, align 4, !tbaa !9
  %156 = icmp slt i32 %154, %155
  br i1 %156, label %157, label %170

157:                                              ; preds = %153
  %158 = load i32, ptr %8, align 4, !tbaa !9
  %159 = sitofp i32 %158 to double
  %160 = load ptr, ptr %5, align 8, !tbaa !5
  %161 = load i32, ptr %9, align 4, !tbaa !9
  %162 = call double @df(ptr noundef %160, ptr noundef %31, i32 noundef %161)
  %163 = fmul double %159, %162
  %164 = load i32, ptr %9, align 4, !tbaa !9
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds double, ptr %28, i64 %165
  store double %163, ptr %166, align 8, !tbaa !11
  br label %167

167:                                              ; preds = %157
  %168 = load i32, ptr %9, align 4, !tbaa !9
  %169 = add nsw i32 %168, 1
  store i32 %169, ptr %9, align 4, !tbaa !9
  br label %153, !llvm.loop !20

170:                                              ; preds = %153
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %171

171:                                              ; preds = %208, %170
  %172 = load i32, ptr %9, align 4, !tbaa !9
  %173 = load i32, ptr %7, align 4, !tbaa !9
  %174 = icmp slt i32 %172, %173
  br i1 %174, label %175, label %211

175:                                              ; preds = %171
  %176 = load ptr, ptr %6, align 8, !tbaa !5
  %177 = load i32, ptr %9, align 4, !tbaa !9
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds double, ptr %176, i64 %178
  %180 = load double, ptr %179, align 8, !tbaa !11
  %181 = load i32, ptr %9, align 4, !tbaa !9
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds double, ptr %19, i64 %182
  %184 = load double, ptr %183, align 8, !tbaa !11
  %185 = load i32, ptr %9, align 4, !tbaa !9
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds double, ptr %22, i64 %186
  %188 = load double, ptr %187, align 8, !tbaa !11
  %189 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %188, double %184)
  %190 = load i32, ptr %9, align 4, !tbaa !9
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds double, ptr %25, i64 %191
  %193 = load double, ptr %192, align 8, !tbaa !11
  %194 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %193, double %189)
  %195 = load i32, ptr %9, align 4, !tbaa !9
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds double, ptr %28, i64 %196
  %198 = load double, ptr %197, align 8, !tbaa !11
  %199 = fadd double %194, %198
  %200 = fdiv double %199, 6.000000e+00
  %201 = fadd double %180, %200
  %202 = load ptr, ptr %6, align 8, !tbaa !5
  %203 = load i32, ptr %9, align 4, !tbaa !9
  %204 = load i32, ptr %7, align 4, !tbaa !9
  %205 = add nsw i32 %203, %204
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds double, ptr %202, i64 %206
  store double %201, ptr %207, align 8, !tbaa !11
  br label %208

208:                                              ; preds = %175
  %209 = load i32, ptr %9, align 4, !tbaa !9
  %210 = add nsw i32 %209, 1
  store i32 %210, ptr %9, align 4, !tbaa !9
  br label %171, !llvm.loop !21

211:                                              ; preds = %171
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %212

212:                                              ; preds = %228, %211
  %213 = load i32, ptr %9, align 4, !tbaa !9
  %214 = load i32, ptr %7, align 4, !tbaa !9
  %215 = icmp slt i32 %213, %214
  br i1 %215, label %216, label %231

216:                                              ; preds = %212
  %217 = load ptr, ptr %6, align 8, !tbaa !5
  %218 = load i32, ptr %9, align 4, !tbaa !9
  %219 = load i32, ptr %7, align 4, !tbaa !9
  %220 = add nsw i32 %218, %219
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds double, ptr %217, i64 %221
  %223 = load double, ptr %222, align 8, !tbaa !11
  %224 = load ptr, ptr %6, align 8, !tbaa !5
  %225 = load i32, ptr %9, align 4, !tbaa !9
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds double, ptr %224, i64 %226
  store double %223, ptr %227, align 8, !tbaa !11
  br label %228

228:                                              ; preds = %216
  %229 = load i32, ptr %9, align 4, !tbaa !9
  %230 = add nsw i32 %229, 1
  store i32 %230, ptr %9, align 4, !tbaa !9
  br label %212, !llvm.loop !22

231:                                              ; preds = %212
  %232 = load ptr, ptr %10, align 8
  call void @llvm.stackrestore.p0(ptr %232)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  ret void
}

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #1

; Function Attrs: nounwind uwtable
declare dso_local double @df(ptr noundef, ptr noundef, i32 noundef) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn }
attributes #2 = { 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 #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 = !{!"int", !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}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !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"

; Function Attrs: nounwind uwtable
define dso_local void @RK4Step(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #0 {
  %5 = zext i32 %2 to i64
  %6 = alloca double, i64 %5, align 16
  %7 = alloca double, i64 %5, align 16
  %8 = alloca double, i64 %5, align 16
  %9 = alloca double, i64 %5, align 16
  %10 = alloca double, i64 %5, align 16
  %11 = icmp sgt i32 %2, 0
  br i1 %11, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %4
  %12 = sitofp i32 %3 to double
  br label %22

.preheader82:                                     ; preds = %22
  br i1 %11, label %.lr.ph85.preheader, label %._crit_edge

.lr.ph85.preheader:                               ; preds = %.preheader82
  %min.iters.check = icmp ult i32 %2, 4
  br i1 %min.iters.check, label %.lr.ph85.preheader209, label %vector.ph

.lr.ph85.preheader209:                            ; preds = %middle.block, %.lr.ph85.preheader
  %indvars.iv101.ph = phi i64 [ 0, %.lr.ph85.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph85

vector.ph:                                        ; preds = %.lr.ph85.preheader
  %n.vec = and i64 %5, 2147483644
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %13 = getelementptr inbounds double, ptr %1, i64 %index
  %14 = getelementptr inbounds i8, ptr %13, i64 16
  %wide.load = load <2 x double>, ptr %13, align 8, !tbaa !5
  %wide.load143 = load <2 x double>, ptr %14, align 8, !tbaa !5
  %15 = getelementptr inbounds double, ptr %6, i64 %index
  %16 = getelementptr inbounds i8, ptr %15, i64 16
  %wide.load144 = load <2 x double>, ptr %15, align 16, !tbaa !5
  %wide.load145 = load <2 x double>, ptr %16, align 16, !tbaa !5
  %17 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %wide.load144, <2 x double> <double 5.000000e-01, double 5.000000e-01>, <2 x double> %wide.load)
  %18 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %wide.load145, <2 x double> <double 5.000000e-01, double 5.000000e-01>, <2 x double> %wide.load143)
  %19 = getelementptr inbounds double, ptr %10, i64 %index
  %20 = getelementptr inbounds i8, ptr %19, i64 16
  store <2 x double> %17, ptr %19, align 16, !tbaa !5
  store <2 x double> %18, ptr %20, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %21 = icmp eq i64 %index.next, %n.vec
  br i1 %21, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %5
  br i1 %cmp.n, label %.preheader81, label %.lr.ph85.preheader209

22:                                               ; preds = %.lr.ph, %22
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %22 ]
  %23 = trunc nuw nsw i64 %indvars.iv to i32
  %24 = tail call double @df(ptr noundef %0, ptr noundef %1, i32 noundef %23)
  %25 = fmul double %24, %12
  %26 = getelementptr inbounds double, ptr %6, i64 %indvars.iv
  store double %25, ptr %26, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %5
  br i1 %exitcond.not, label %.preheader82, label %22, !llvm.loop !13

.preheader81:                                     ; preds = %.lr.ph85, %middle.block
  br i1 %11, label %.lr.ph87, label %._crit_edge

.lr.ph87:                                         ; preds = %.preheader81
  %27 = sitofp i32 %3 to double
  br label %43

.lr.ph85:                                         ; preds = %.lr.ph85.preheader209, %.lr.ph85
  %indvars.iv101 = phi i64 [ %indvars.iv.next102, %.lr.ph85 ], [ %indvars.iv101.ph, %.lr.ph85.preheader209 ]
  %28 = getelementptr inbounds double, ptr %1, i64 %indvars.iv101
  %29 = load double, ptr %28, align 8, !tbaa !5
  %30 = getelementptr inbounds double, ptr %6, i64 %indvars.iv101
  %31 = load double, ptr %30, align 8, !tbaa !5
  %32 = tail call double @llvm.fmuladd.f64(double %31, double 5.000000e-01, double %29)
  %33 = getelementptr inbounds double, ptr %10, i64 %indvars.iv101
  store double %32, ptr %33, align 8, !tbaa !5
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %exitcond105.not = icmp eq i64 %indvars.iv.next102, %5
  br i1 %exitcond105.not, label %.preheader81, label %.lr.ph85, !llvm.loop !14

.preheader80:                                     ; preds = %43
  br i1 %11, label %.lr.ph89.preheader, label %._crit_edge

.lr.ph89.preheader:                               ; preds = %.preheader80
  %min.iters.check148 = icmp ult i32 %2, 4
  br i1 %min.iters.check148, label %.lr.ph89.preheader208, label %vector.ph149

.lr.ph89.preheader208:                            ; preds = %middle.block146, %.lr.ph89.preheader
  %indvars.iv111.ph = phi i64 [ 0, %.lr.ph89.preheader ], [ %n.vec151, %middle.block146 ]
  br label %.lr.ph89

vector.ph149:                                     ; preds = %.lr.ph89.preheader
  %n.vec151 = and i64 %5, 2147483644
  br label %vector.body153

vector.body153:                                   ; preds = %vector.body153, %vector.ph149
  %index154 = phi i64 [ 0, %vector.ph149 ], [ %index.next159, %vector.body153 ]
  %34 = getelementptr inbounds double, ptr %1, i64 %index154
  %35 = getelementptr inbounds i8, ptr %34, i64 16
  %wide.load155 = load <2 x double>, ptr %34, align 8, !tbaa !5
  %wide.load156 = load <2 x double>, ptr %35, align 8, !tbaa !5
  %36 = getelementptr inbounds double, ptr %7, i64 %index154
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  %wide.load157 = load <2 x double>, ptr %36, align 16, !tbaa !5
  %wide.load158 = load <2 x double>, ptr %37, align 16, !tbaa !5
  %38 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %wide.load157, <2 x double> <double 5.000000e-01, double 5.000000e-01>, <2 x double> %wide.load155)
  %39 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %wide.load158, <2 x double> <double 5.000000e-01, double 5.000000e-01>, <2 x double> %wide.load156)
  %40 = getelementptr inbounds double, ptr %10, i64 %index154
  %41 = getelementptr inbounds i8, ptr %40, i64 16
  store <2 x double> %38, ptr %40, align 16, !tbaa !5
  store <2 x double> %39, ptr %41, align 16, !tbaa !5
  %index.next159 = add nuw i64 %index154, 4
  %42 = icmp eq i64 %index.next159, %n.vec151
  br i1 %42, label %middle.block146, label %vector.body153, !llvm.loop !15

middle.block146:                                  ; preds = %vector.body153
  %cmp.n160 = icmp eq i64 %n.vec151, %5
  br i1 %cmp.n160, label %.preheader79, label %.lr.ph89.preheader208

43:                                               ; preds = %.lr.ph87, %43
  %indvars.iv106 = phi i64 [ 0, %.lr.ph87 ], [ %indvars.iv.next107, %43 ]
  %44 = trunc nuw nsw i64 %indvars.iv106 to i32
  %45 = call double @df(ptr noundef %0, ptr noundef nonnull %10, i32 noundef %44)
  %46 = fmul double %45, %27
  %47 = getelementptr inbounds double, ptr %7, i64 %indvars.iv106
  store double %46, ptr %47, align 8, !tbaa !5
  %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
  %exitcond110.not = icmp eq i64 %indvars.iv.next107, %5
  br i1 %exitcond110.not, label %.preheader80, label %43, !llvm.loop !16

.preheader79:                                     ; preds = %.lr.ph89, %middle.block146
  br i1 %11, label %.lr.ph91, label %._crit_edge

.lr.ph91:                                         ; preds = %.preheader79
  %48 = sitofp i32 %3 to double
  br label %64

.lr.ph89:                                         ; preds = %.lr.ph89.preheader208, %.lr.ph89
  %indvars.iv111 = phi i64 [ %indvars.iv.next112, %.lr.ph89 ], [ %indvars.iv111.ph, %.lr.ph89.preheader208 ]
  %49 = getelementptr inbounds double, ptr %1, i64 %indvars.iv111
  %50 = load double, ptr %49, align 8, !tbaa !5
  %51 = getelementptr inbounds double, ptr %7, i64 %indvars.iv111
  %52 = load double, ptr %51, align 8, !tbaa !5
  %53 = call double @llvm.fmuladd.f64(double %52, double 5.000000e-01, double %50)
  %54 = getelementptr inbounds double, ptr %10, i64 %indvars.iv111
  store double %53, ptr %54, align 8, !tbaa !5
  %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
  %exitcond115.not = icmp eq i64 %indvars.iv.next112, %5
  br i1 %exitcond115.not, label %.preheader79, label %.lr.ph89, !llvm.loop !17

.preheader78:                                     ; preds = %64
  br i1 %11, label %.lr.ph93.preheader, label %._crit_edge

.lr.ph93.preheader:                               ; preds = %.preheader78
  %min.iters.check163 = icmp ult i32 %2, 4
  br i1 %min.iters.check163, label %.lr.ph93.preheader207, label %vector.ph164

.lr.ph93.preheader207:                            ; preds = %middle.block161, %.lr.ph93.preheader
  %indvars.iv121.ph = phi i64 [ 0, %.lr.ph93.preheader ], [ %n.vec166, %middle.block161 ]
  br label %.lr.ph93

vector.ph164:                                     ; preds = %.lr.ph93.preheader
  %n.vec166 = and i64 %5, 2147483644
  br label %vector.body168

vector.body168:                                   ; preds = %vector.body168, %vector.ph164
  %index169 = phi i64 [ 0, %vector.ph164 ], [ %index.next174, %vector.body168 ]
  %55 = getelementptr inbounds double, ptr %1, i64 %index169
  %56 = getelementptr inbounds i8, ptr %55, i64 16
  %wide.load170 = load <2 x double>, ptr %55, align 8, !tbaa !5
  %wide.load171 = load <2 x double>, ptr %56, align 8, !tbaa !5
  %57 = getelementptr inbounds double, ptr %8, i64 %index169
  %58 = getelementptr inbounds i8, ptr %57, i64 16
  %wide.load172 = load <2 x double>, ptr %57, align 16, !tbaa !5
  %wide.load173 = load <2 x double>, ptr %58, align 16, !tbaa !5
  %59 = fadd <2 x double> %wide.load170, %wide.load172
  %60 = fadd <2 x double> %wide.load171, %wide.load173
  %61 = getelementptr inbounds double, ptr %10, i64 %index169
  %62 = getelementptr inbounds i8, ptr %61, i64 16
  store <2 x double> %59, ptr %61, align 16, !tbaa !5
  store <2 x double> %60, ptr %62, align 16, !tbaa !5
  %index.next174 = add nuw i64 %index169, 4
  %63 = icmp eq i64 %index.next174, %n.vec166
  br i1 %63, label %middle.block161, label %vector.body168, !llvm.loop !18

middle.block161:                                  ; preds = %vector.body168
  %cmp.n175 = icmp eq i64 %n.vec166, %5
  br i1 %cmp.n175, label %.preheader77, label %.lr.ph93.preheader207

64:                                               ; preds = %.lr.ph91, %64
  %indvars.iv116 = phi i64 [ 0, %.lr.ph91 ], [ %indvars.iv.next117, %64 ]
  %65 = trunc nuw nsw i64 %indvars.iv116 to i32
  %66 = call double @df(ptr noundef %0, ptr noundef nonnull %10, i32 noundef %65)
  %67 = fmul double %66, %48
  %68 = getelementptr inbounds double, ptr %8, i64 %indvars.iv116
  store double %67, ptr %68, align 8, !tbaa !5
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
  %exitcond120.not = icmp eq i64 %indvars.iv.next117, %5
  br i1 %exitcond120.not, label %.preheader78, label %64, !llvm.loop !19

.preheader77:                                     ; preds = %.lr.ph93, %middle.block161
  br i1 %11, label %.lr.ph95, label %._crit_edge

.lr.ph95:                                         ; preds = %.preheader77
  %69 = sitofp i32 %3 to double
  br label %88

.lr.ph93:                                         ; preds = %.lr.ph93.preheader207, %.lr.ph93
  %indvars.iv121 = phi i64 [ %indvars.iv.next122, %.lr.ph93 ], [ %indvars.iv121.ph, %.lr.ph93.preheader207 ]
  %70 = getelementptr inbounds double, ptr %1, i64 %indvars.iv121
  %71 = load double, ptr %70, align 8, !tbaa !5
  %72 = getelementptr inbounds double, ptr %8, i64 %indvars.iv121
  %73 = load double, ptr %72, align 8, !tbaa !5
  %74 = fadd double %71, %73
  %75 = getelementptr inbounds double, ptr %10, i64 %indvars.iv121
  store double %74, ptr %75, align 8, !tbaa !5
  %indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1
  %exitcond125.not = icmp eq i64 %indvars.iv.next122, %5
  br i1 %exitcond125.not, label %.preheader77, label %.lr.ph93, !llvm.loop !20

.preheader76:                                     ; preds = %88
  br i1 %11, label %.lr.ph97.preheader, label %._crit_edge

.lr.ph97.preheader:                               ; preds = %.preheader76
  %invariant.gep = getelementptr inbounds double, ptr %1, i64 %5
  %min.iters.check178 = icmp eq i32 %2, 1
  br i1 %min.iters.check178, label %.lr.ph97.preheader206, label %vector.ph179

.lr.ph97.preheader206:                            ; preds = %middle.block176, %.lr.ph97.preheader
  %indvars.iv131.ph = phi i64 [ 0, %.lr.ph97.preheader ], [ %n.vec181, %middle.block176 ]
  br label %.lr.ph97

vector.ph179:                                     ; preds = %.lr.ph97.preheader
  %n.vec181 = and i64 %5, 2147483646
  br label %vector.body183

vector.body183:                                   ; preds = %vector.body183, %vector.ph179
  %index184 = phi i64 [ 0, %vector.ph179 ], [ %index.next190, %vector.body183 ]
  %76 = getelementptr inbounds double, ptr %1, i64 %index184
  %wide.load185 = load <2 x double>, ptr %76, align 8, !tbaa !5
  %77 = getelementptr inbounds double, ptr %6, i64 %index184
  %wide.load186 = load <2 x double>, ptr %77, align 16, !tbaa !5
  %78 = getelementptr inbounds double, ptr %7, i64 %index184
  %wide.load187 = load <2 x double>, ptr %78, align 16, !tbaa !5
  %79 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %wide.load187, <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double> %wide.load186)
  %80 = getelementptr inbounds double, ptr %8, i64 %index184
  %wide.load188 = load <2 x double>, ptr %80, align 16, !tbaa !5
  %81 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %wide.load188, <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double> %79)
  %82 = getelementptr inbounds double, ptr %9, i64 %index184
  %wide.load189 = load <2 x double>, ptr %82, align 16, !tbaa !5
  %83 = fadd <2 x double> %81, %wide.load189
  %84 = fdiv <2 x double> %83, <double 6.000000e+00, double 6.000000e+00>
  %85 = fadd <2 x double> %wide.load185, %84
  %86 = getelementptr inbounds double, ptr %invariant.gep, i64 %index184
  store <2 x double> %85, ptr %86, align 8, !tbaa !5
  %index.next190 = add nuw i64 %index184, 2
  %87 = icmp eq i64 %index.next190, %n.vec181
  br i1 %87, label %middle.block176, label %vector.body183, !llvm.loop !21

middle.block176:                                  ; preds = %vector.body183
  %cmp.n191 = icmp eq i64 %n.vec181, %5
  br i1 %cmp.n191, label %.preheader, label %.lr.ph97.preheader206

88:                                               ; preds = %.lr.ph95, %88
  %indvars.iv126 = phi i64 [ 0, %.lr.ph95 ], [ %indvars.iv.next127, %88 ]
  %89 = trunc nuw nsw i64 %indvars.iv126 to i32
  %90 = call double @df(ptr noundef %0, ptr noundef nonnull %10, i32 noundef %89)
  %91 = fmul double %90, %69
  %92 = getelementptr inbounds double, ptr %9, i64 %indvars.iv126
  store double %91, ptr %92, align 8, !tbaa !5
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %exitcond130.not = icmp eq i64 %indvars.iv.next127, %5
  br i1 %exitcond130.not, label %.preheader76, label %88, !llvm.loop !22

.preheader:                                       ; preds = %.lr.ph97, %middle.block176
  br i1 %11, label %.lr.ph99.preheader, label %._crit_edge

.lr.ph99.preheader:                               ; preds = %.preheader
  %invariant.gep141 = getelementptr inbounds double, ptr %1, i64 %5
  %min.iters.check194 = icmp ult i32 %2, 4
  br i1 %min.iters.check194, label %.lr.ph99.preheader205, label %vector.ph195

.lr.ph99.preheader205:                            ; preds = %middle.block192, %.lr.ph99.preheader
  %indvars.iv136.ph = phi i64 [ 0, %.lr.ph99.preheader ], [ %n.vec197, %middle.block192 ]
  br label %.lr.ph99

vector.ph195:                                     ; preds = %.lr.ph99.preheader
  %n.vec197 = and i64 %5, 2147483644
  br label %vector.body199

vector.body199:                                   ; preds = %vector.body199, %vector.ph195
  %index200 = phi i64 [ 0, %vector.ph195 ], [ %index.next203, %vector.body199 ]
  %93 = getelementptr inbounds double, ptr %invariant.gep141, i64 %index200
  %94 = getelementptr inbounds i8, ptr %93, i64 16
  %wide.load201 = load <2 x double>, ptr %93, align 8, !tbaa !5
  %wide.load202 = load <2 x double>, ptr %94, align 8, !tbaa !5
  %95 = getelementptr inbounds double, ptr %1, i64 %index200
  %96 = getelementptr inbounds i8, ptr %95, i64 16
  store <2 x double> %wide.load201, ptr %95, align 8, !tbaa !5
  store <2 x double> %wide.load202, ptr %96, align 8, !tbaa !5
  %index.next203 = add nuw i64 %index200, 4
  %97 = icmp eq i64 %index.next203, %n.vec197
  br i1 %97, label %middle.block192, label %vector.body199, !llvm.loop !23

middle.block192:                                  ; preds = %vector.body199
  %cmp.n204 = icmp eq i64 %n.vec197, %5
  br i1 %cmp.n204, label %._crit_edge, label %.lr.ph99.preheader205

.lr.ph97:                                         ; preds = %.lr.ph97.preheader206, %.lr.ph97
  %indvars.iv131 = phi i64 [ %indvars.iv.next132, %.lr.ph97 ], [ %indvars.iv131.ph, %.lr.ph97.preheader206 ]
  %98 = getelementptr inbounds double, ptr %1, i64 %indvars.iv131
  %99 = load double, ptr %98, align 8, !tbaa !5
  %100 = getelementptr inbounds double, ptr %6, i64 %indvars.iv131
  %101 = load double, ptr %100, align 8, !tbaa !5
  %102 = getelementptr inbounds double, ptr %7, i64 %indvars.iv131
  %103 = load double, ptr %102, align 8, !tbaa !5
  %104 = call double @llvm.fmuladd.f64(double %103, double 2.000000e+00, double %101)
  %105 = getelementptr inbounds double, ptr %8, i64 %indvars.iv131
  %106 = load double, ptr %105, align 8, !tbaa !5
  %107 = call double @llvm.fmuladd.f64(double %106, double 2.000000e+00, double %104)
  %108 = getelementptr inbounds double, ptr %9, i64 %indvars.iv131
  %109 = load double, ptr %108, align 8, !tbaa !5
  %110 = fadd double %107, %109
  %111 = fdiv double %110, 6.000000e+00
  %112 = fadd double %99, %111
  %gep = getelementptr inbounds double, ptr %invariant.gep, i64 %indvars.iv131
  store double %112, ptr %gep, align 8, !tbaa !5
  %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
  %exitcond135.not = icmp eq i64 %indvars.iv.next132, %5
  br i1 %exitcond135.not, label %.preheader, label %.lr.ph97, !llvm.loop !24

.lr.ph99:                                         ; preds = %.lr.ph99.preheader205, %.lr.ph99
  %indvars.iv136 = phi i64 [ %indvars.iv.next137, %.lr.ph99 ], [ %indvars.iv136.ph, %.lr.ph99.preheader205 ]
  %gep142 = getelementptr inbounds double, ptr %invariant.gep141, i64 %indvars.iv136
  %113 = load double, ptr %gep142, align 8, !tbaa !5
  %114 = getelementptr inbounds double, ptr %1, i64 %indvars.iv136
  store double %113, ptr %114, align 8, !tbaa !5
  %indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1
  %exitcond140.not = icmp eq i64 %indvars.iv.next137, %5
  br i1 %exitcond140.not, label %._crit_edge, label %.lr.ph99, !llvm.loop !25

._crit_edge:                                      ; preds = %.lr.ph99, %middle.block192, %4, %.preheader82, %.preheader81, %.preheader80, %.preheader79, %.preheader78, %.preheader77, %.preheader76, %.preheader
  ret void
}

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !10, !11, !12}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !12, !11}
!18 = distinct !{!18, !10, !11, !12}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10, !12, !11}
!21 = distinct !{!21, !10, !11, !12}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10, !11, !12}
!24 = distinct !{!24, !10, !12, !11}
!25 = distinct !{!25, !10, !12, !11}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass