; LLVM IR from rdguez-mariano/fast_imas_IPOL :: libUSAC/utils/MathFunctions.ll (ZN9MathTools6ldvmatEPdS0_i)

; 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 speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN9MathTools6ldvmatEPdS0_i(ptr noundef %0, ptr noundef %1, i32 noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  store i32 0, ptr %14, align 4, !tbaa !9
  %18 = load i32, ptr %6, align 4, !tbaa !9
  %19 = load i32, ptr %6, align 4, !tbaa !9
  %20 = mul nsw i32 %18, %19
  store i32 %20, ptr %17, align 4, !tbaa !9
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %21, ptr %10, align 8, !tbaa !5
  br label %22

22:                                               ; preds = %29, %3
  %23 = load i32, ptr %14, align 4, !tbaa !9
  %24 = load i32, ptr %17, align 4, !tbaa !9
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %26, label %32

26:                                               ; preds = %22
  %27 = load ptr, ptr %10, align 8, !tbaa !5
  %28 = getelementptr inbounds double, ptr %27, i32 1
  store ptr %28, ptr %10, align 8, !tbaa !5
  store double 0.000000e+00, ptr %27, align 8, !tbaa !11
  br label %29

29:                                               ; preds = %26
  %30 = load i32, ptr %14, align 4, !tbaa !9
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %14, align 4, !tbaa !9
  br label %22, !llvm.loop !13

32:                                               ; preds = %22
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  store double 1.000000e+00, ptr %33, align 8, !tbaa !11
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = load i32, ptr %6, align 4, !tbaa !9
  %36 = load i32, ptr %6, align 4, !tbaa !9
  %37 = mul nsw i32 %35, %36
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds double, ptr %34, i64 %38
  %40 = getelementptr inbounds double, ptr %39, i64 -1
  store ptr %40, ptr %8, align 8, !tbaa !5
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  store double 1.000000e+00, ptr %41, align 8, !tbaa !11
  %42 = load i32, ptr %6, align 4, !tbaa !9
  %43 = add nsw i32 %42, 1
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = sext i32 %43 to i64
  %46 = sub i64 0, %45
  %47 = getelementptr inbounds double, ptr %44, i64 %46
  store ptr %47, ptr %8, align 8, !tbaa !5
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = load i32, ptr %6, align 4, !tbaa !9
  %50 = load i32, ptr %6, align 4, !tbaa !9
  %51 = mul nsw i32 %49, %50
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds double, ptr %48, i64 %52
  %54 = load i32, ptr %6, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = sub i64 0, %55
  %57 = getelementptr inbounds double, ptr %53, i64 %56
  %58 = load i32, ptr %6, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = sub i64 0, %59
  %61 = getelementptr inbounds double, ptr %57, i64 %60
  %62 = getelementptr inbounds double, ptr %61, i64 -1
  store ptr %62, ptr %7, align 8, !tbaa !5
  %63 = load i32, ptr %6, align 4, !tbaa !9
  %64 = sub nsw i32 %63, 2
  store i32 %64, ptr %14, align 4, !tbaa !9
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %219, %32
  %66 = load i32, ptr %14, align 4, !tbaa !9
  %67 = icmp sgt i32 %66, 0
  br i1 %67, label %68, label %236

68:                                               ; preds = %65
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = getelementptr inbounds double, ptr %69, i64 -1
  %71 = load double, ptr %70, align 8, !tbaa !11
  %72 = fcmp une double %71, 0.000000e+00
  br i1 %72, label %73, label %194

73:                                               ; preds = %68
  store i32 0, ptr %15, align 4, !tbaa !9
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %74, ptr %9, align 8, !tbaa !5
  store double 1.000000e+00, ptr %12, align 8, !tbaa !11
  br label %75

75:                                               ; preds = %86, %73
  %76 = load i32, ptr %15, align 4, !tbaa !9
  %77 = load i32, ptr %17, align 4, !tbaa !9
  %78 = icmp slt i32 %76, %77
  br i1 %78, label %79, label %91

79:                                               ; preds = %75
  %80 = load ptr, ptr %9, align 8, !tbaa !5
  %81 = load double, ptr %80, align 8, !tbaa !11
  %82 = load ptr, ptr %9, align 8, !tbaa !5
  %83 = load double, ptr %82, align 8, !tbaa !11
  %84 = load double, ptr %12, align 8, !tbaa !11
  %85 = call double @llvm.fmuladd.f64(double %81, double %83, double %84)
  store double %85, ptr %12, align 8, !tbaa !11
  br label %86

86:                                               ; preds = %79
  %87 = load i32, ptr %15, align 4, !tbaa !9
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %15, align 4, !tbaa !9
  %89 = load ptr, ptr %9, align 8, !tbaa !5
  %90 = getelementptr inbounds double, ptr %89, i32 1
  store ptr %90, ptr %9, align 8, !tbaa !5
  br label %75, !llvm.loop !15

91:                                               ; preds = %75
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  %93 = getelementptr inbounds double, ptr %92, i64 -1
  %94 = load double, ptr %93, align 8, !tbaa !11
  store double %94, ptr %12, align 8, !tbaa !11
  %95 = load double, ptr %12, align 8, !tbaa !11
  %96 = fsub double 1.000000e+00, %95
  %97 = load ptr, ptr %8, align 8, !tbaa !5
  store double %96, ptr %97, align 8, !tbaa !11
  store i32 0, ptr %15, align 4, !tbaa !9
  %98 = load ptr, ptr %8, align 8, !tbaa !5
  %99 = load i32, ptr %6, align 4, !tbaa !9
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds double, ptr %98, i64 %100
  store ptr %101, ptr %10, align 8, !tbaa !5
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %102, ptr %9, align 8, !tbaa !5
  br label %103

103:                                              ; preds = %115, %91
  %104 = load i32, ptr %15, align 4, !tbaa !9
  %105 = load i32, ptr %17, align 4, !tbaa !9
  %106 = icmp slt i32 %104, %105
  br i1 %106, label %107, label %122

107:                                              ; preds = %103
  %108 = load double, ptr %12, align 8, !tbaa !11
  %109 = fneg double %108
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  %111 = getelementptr inbounds double, ptr %110, i32 1
  store ptr %111, ptr %9, align 8, !tbaa !5
  %112 = load double, ptr %110, align 8, !tbaa !11
  %113 = fmul double %109, %112
  %114 = load ptr, ptr %10, align 8, !tbaa !5
  store double %113, ptr %114, align 8, !tbaa !11
  br label %115

115:                                              ; preds = %107
  %116 = load i32, ptr %15, align 4, !tbaa !9
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %15, align 4, !tbaa !9
  %118 = load i32, ptr %6, align 4, !tbaa !9
  %119 = load ptr, ptr %10, align 8, !tbaa !5
  %120 = sext i32 %118 to i64
  %121 = getelementptr inbounds double, ptr %119, i64 %120
  store ptr %121, ptr %10, align 8, !tbaa !5
  br label %103, !llvm.loop !16

122:                                              ; preds = %103
  %123 = load i32, ptr %14, align 4, !tbaa !9
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %16, align 4, !tbaa !9
  %125 = load ptr, ptr %8, align 8, !tbaa !5
  %126 = getelementptr inbounds double, ptr %125, i64 1
  store ptr %126, ptr %10, align 8, !tbaa !5
  br label %127

127:                                              ; preds = %190, %122
  %128 = load i32, ptr %16, align 4, !tbaa !9
  %129 = load i32, ptr %6, align 4, !tbaa !9
  %130 = icmp slt i32 %128, %129
  br i1 %130, label %131, label %193

131:                                              ; preds = %127
  store i32 0, ptr %15, align 4, !tbaa !9
  %132 = load ptr, ptr %10, align 8, !tbaa !5
  %133 = load i32, ptr %6, align 4, !tbaa !9
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds double, ptr %132, i64 %134
  store ptr %135, ptr %11, align 8, !tbaa !5
  %136 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %136, ptr %9, align 8, !tbaa !5
  store double 0.000000e+00, ptr %13, align 8, !tbaa !11
  br label %137

137:                                              ; preds = %149, %131
  %138 = load i32, ptr %15, align 4, !tbaa !9
  %139 = load i32, ptr %17, align 4, !tbaa !9
  %140 = icmp slt i32 %138, %139
  br i1 %140, label %141, label %156

141:                                              ; preds = %137
  %142 = load ptr, ptr %11, align 8, !tbaa !5
  %143 = load double, ptr %142, align 8, !tbaa !11
  %144 = load ptr, ptr %9, align 8, !tbaa !5
  %145 = getelementptr inbounds double, ptr %144, i32 1
  store ptr %145, ptr %9, align 8, !tbaa !5
  %146 = load double, ptr %144, align 8, !tbaa !11
  %147 = load double, ptr %13, align 8, !tbaa !11
  %148 = call double @llvm.fmuladd.f64(double %143, double %146, double %147)
  store double %148, ptr %13, align 8, !tbaa !11
  br label %149

149:                                              ; preds = %141
  %150 = load i32, ptr %15, align 4, !tbaa !9
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %15, align 4, !tbaa !9
  %152 = load i32, ptr %6, align 4, !tbaa !9
  %153 = load ptr, ptr %11, align 8, !tbaa !5
  %154 = sext i32 %152 to i64
  %155 = getelementptr inbounds double, ptr %153, i64 %154
  store ptr %155, ptr %11, align 8, !tbaa !5
  br label %137, !llvm.loop !17

156:                                              ; preds = %137
  %157 = load double, ptr %12, align 8, !tbaa !11
  %158 = load double, ptr %13, align 8, !tbaa !11
  %159 = fmul double %158, %157
  store double %159, ptr %13, align 8, !tbaa !11
  store i32 0, ptr %15, align 4, !tbaa !9
  %160 = load ptr, ptr %10, align 8, !tbaa !5
  %161 = load i32, ptr %6, align 4, !tbaa !9
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds double, ptr %160, i64 %162
  store ptr %163, ptr %11, align 8, !tbaa !5
  %164 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %164, ptr %9, align 8, !tbaa !5
  br label %165

165:                                              ; preds = %178, %156
  %166 = load i32, ptr %15, align 4, !tbaa !9
  %167 = load i32, ptr %17, align 4, !tbaa !9
  %168 = icmp slt i32 %166, %167
  br i1 %168, label %169, label %185

169:                                              ; preds = %165
  %170 = load double, ptr %13, align 8, !tbaa !11
  %171 = load ptr, ptr %9, align 8, !tbaa !5
  %172 = getelementptr inbounds double, ptr %171, i32 1
  store ptr %172, ptr %9, align 8, !tbaa !5
  %173 = load double, ptr %171, align 8, !tbaa !11
  %174 = load ptr, ptr %11, align 8, !tbaa !5
  %175 = load double, ptr %174, align 8, !tbaa !11
  %176 = fneg double %170
  %177 = call double @llvm.fmuladd.f64(double %176, double %173, double %175)
  store double %177, ptr %174, align 8, !tbaa !11
  br label %178

178:                                              ; preds = %169
  %179 = load i32, ptr %15, align 4, !tbaa !9
  %180 = add nsw i32 %179, 1
  store i32 %180, ptr %15, align 4, !tbaa !9
  %181 = load i32, ptr %6, align 4, !tbaa !9
  %182 = load ptr, ptr %11, align 8, !tbaa !5
  %183 = sext i32 %181 to i64
  %184 = getelementptr inbounds double, ptr %182, i64 %183
  store ptr %184, ptr %11, align 8, !tbaa !5
  br label %165, !llvm.loop !18

185:                                              ; preds = %165
  %186 = load double, ptr %13, align 8, !tbaa !11
  %187 = fneg double %186
  %188 = load ptr, ptr %10, align 8, !tbaa !5
  %189 = getelementptr inbounds double, ptr %188, i32 1
  store ptr %189, ptr %10, align 8, !tbaa !5
  store double %187, ptr %188, align 8, !tbaa !11
  br label %190

190:                                              ; preds = %185
  %191 = load i32, ptr %16, align 4, !tbaa !9
  %192 = add nsw i32 %191, 1
  store i32 %192, ptr %16, align 4, !tbaa !9
  br label %127, !llvm.loop !19

193:                                              ; preds = %127
  br label %218

194:                                              ; preds = %68
  %195 = load ptr, ptr %8, align 8, !tbaa !5
  store double 1.000000e+00, ptr %195, align 8, !tbaa !11
  store i32 0, ptr %15, align 4, !tbaa !9
  %196 = load ptr, ptr %8, align 8, !tbaa !5
  %197 = getelementptr inbounds double, ptr %196, i64 1
  store ptr %197, ptr %9, align 8, !tbaa !5
  %198 = load ptr, ptr %8, align 8, !tbaa !5
  %199 = load i32, ptr %6, align 4, !tbaa !9
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds double, ptr %198, i64 %200
  store ptr %201, ptr %10, align 8, !tbaa !5
  br label %202

202:                                              ; preds = %210, %194
  %203 = load i32, ptr %15, align 4, !tbaa !9
  %204 = load i32, ptr %17, align 4, !tbaa !9
  %205 = icmp slt i32 %203, %204
  br i1 %205, label %206, label %217

206:                                              ; preds = %202
  %207 = load ptr, ptr %9, align 8, !tbaa !5
  %208 = getelementptr inbounds double, ptr %207, i32 1
  store ptr %208, ptr %9, align 8, !tbaa !5
  store double 0.000000e+00, ptr %207, align 8, !tbaa !11
  %209 = load ptr, ptr %10, align 8, !tbaa !5
  store double 0.000000e+00, ptr %209, align 8, !tbaa !11
  br label %210

210:                                              ; preds = %206
  %211 = load i32, ptr %15, align 4, !tbaa !9
  %212 = add nsw i32 %211, 1
  store i32 %212, ptr %15, align 4, !tbaa !9
  %213 = load i32, ptr %6, align 4, !tbaa !9
  %214 = load ptr, ptr %10, align 8, !tbaa !5
  %215 = sext i32 %213 to i64
  %216 = getelementptr inbounds double, ptr %214, i64 %215
  store ptr %216, ptr %10, align 8, !tbaa !5
  br label %202, !llvm.loop !20

217:                                              ; preds = %202
  br label %218

218:                                              ; preds = %217, %193
  br label %219

219:                                              ; preds = %218
  %220 = load i32, ptr %14, align 4, !tbaa !9
  %221 = add nsw i32 %220, -1
  store i32 %221, ptr %14, align 4, !tbaa !9
  %222 = load i32, ptr %6, align 4, !tbaa !9
  %223 = add nsw i32 %222, 1
  %224 = load ptr, ptr %7, align 8, !tbaa !5
  %225 = sext i32 %223 to i64
  %226 = sub i64 0, %225
  %227 = getelementptr inbounds double, ptr %224, i64 %226
  store ptr %227, ptr %7, align 8, !tbaa !5
  %228 = load i32, ptr %6, align 4, !tbaa !9
  %229 = add nsw i32 %228, 1
  %230 = load ptr, ptr %8, align 8, !tbaa !5
  %231 = sext i32 %229 to i64
  %232 = sub i64 0, %231
  %233 = getelementptr inbounds double, ptr %230, i64 %232
  store ptr %233, ptr %8, align 8, !tbaa !5
  %234 = load i32, ptr %17, align 4, !tbaa !9
  %235 = add nsw i32 %234, 1
  store i32 %235, ptr %17, align 4, !tbaa !9
  br label %65, !llvm.loop !21

236:                                              ; preds = %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  ret void
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { mustprogress 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 = { 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++ 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}


; 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: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #0

; Function Attrs: mustprogress nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @_ZN9MathTools6ldvmatEPdS0_i(ptr nocapture noundef readonly %0, ptr nocapture noundef %1, i32 noundef %2) local_unnamed_addr #1 {
  %4 = mul i32 %2, %2
  %.not = icmp eq i32 %2, 0
  %.pre = zext i32 %4 to i64
  br i1 %.not, label %._crit_edge.thread, label %._crit_edge

._crit_edge.thread:                               ; preds = %3
  store double 1.000000e+00, ptr %1, align 8, !tbaa !5
  %5 = getelementptr inbounds double, ptr %1, i64 %.pre
  %6 = getelementptr inbounds i8, ptr %5, i64 -8
  store double 1.000000e+00, ptr %6, align 8, !tbaa !5
  br label %._crit_edge148

._crit_edge:                                      ; preds = %3
  %umax = tail call i64 @llvm.umax.i64(i64 %.pre, i64 1)
  %7 = shl nuw nsw i64 %umax, 3
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %1, i8 0, i64 %7, i1 false), !tbaa !5
  store double 1.000000e+00, ptr %1, align 8, !tbaa !5
  %8 = getelementptr inbounds double, ptr %1, i64 %.pre
  %9 = getelementptr inbounds i8, ptr %8, i64 -8
  store double 1.000000e+00, ptr %9, align 8, !tbaa !5
  %narrow = xor i32 %2, -1
  %10 = sext i32 %narrow to i64
  %11 = sext i32 %2 to i64
  %12 = icmp sgt i32 %2, 2
  br i1 %12, label %.lr.ph147.preheader, label %._crit_edge148

.lr.ph147.preheader:                              ; preds = %._crit_edge
  %13 = add nsw i32 %2, -2
  %14 = getelementptr inbounds double, ptr %0, i64 %.pre
  %15 = sub nsw i64 0, %11
  %16 = getelementptr inbounds double, ptr %14, i64 %15
  %17 = getelementptr inbounds double, ptr %16, i64 %15
  %18 = getelementptr inbounds i8, ptr %17, i64 -8
  %19 = add nsw i32 %2, -2
  br label %.lr.ph147

.lr.ph147:                                        ; preds = %.lr.ph147.preheader, %.loopexit
  %indvar = phi i32 [ 0, %.lr.ph147.preheader ], [ %indvar.next, %.loopexit ]
  %.0108145.pn = phi ptr [ %9, %.lr.ph147.preheader ], [ %.0108145, %.loopexit ]
  %.0143 = phi i32 [ 1, %.lr.ph147.preheader ], [ %103, %.loopexit ]
  %.194142 = phi i32 [ %13, %.lr.ph147.preheader ], [ %101, %.loopexit ]
  %.0109140 = phi ptr [ %18, %.lr.ph147.preheader ], [ %102, %.loopexit ]
  %.0108145 = getelementptr inbounds double, ptr %.0108145.pn, i64 %10
  %20 = getelementptr inbounds i8, ptr %.0109140, i64 -8
  %21 = load double, ptr %20, align 8, !tbaa !5
  %22 = fcmp une double %21, 0.000000e+00
  br i1 %22, label %.preheader114.preheader, label %98

.preheader114.preheader:                          ; preds = %.lr.ph147
  %23 = fsub double 1.000000e+00, %21
  store double %23, ptr %.0108145, align 8, !tbaa !5
  %24 = fneg double %21
  %xtraiter161 = and i32 %.0143, 3
  %25 = icmp ult i32 %indvar, 3
  br i1 %25, label %.preheader.unr-lcssa, label %.preheader114.preheader.new

.preheader114.preheader.new:                      ; preds = %.preheader114.preheader
  %unroll_iter164 = and i32 %.0143, 2147483644
  br label %33

.preheader.unr-lcssa:                             ; preds = %33, %.preheader114.preheader
  %.0108.pn112125.unr = phi ptr [ %.0108145, %.preheader114.preheader ], [ %.1100.3, %33 ]
  %.1104124.unr = phi ptr [ %.0109140, %.preheader114.preheader ], [ %43, %33 ]
  %lcmp.mod163.not = icmp eq i32 %xtraiter161, 0
  br i1 %lcmp.mod163.not, label %.preheader, label %.epil.preheader160

.epil.preheader160:                               ; preds = %.preheader.unr-lcssa, %.epil.preheader160
  %.0108.pn112125.epil = phi ptr [ %.1100.epil, %.epil.preheader160 ], [ %.0108.pn112125.unr, %.preheader.unr-lcssa ]
  %.1104124.epil = phi ptr [ %26, %.epil.preheader160 ], [ %.1104124.unr, %.preheader.unr-lcssa ]
  %epil.iter162 = phi i32 [ %epil.iter162.next, %.epil.preheader160 ], [ 0, %.preheader.unr-lcssa ]
  %.1100.epil = getelementptr inbounds double, ptr %.0108.pn112125.epil, i64 %11
  %26 = getelementptr inbounds i8, ptr %.1104124.epil, i64 8
  %27 = load double, ptr %.1104124.epil, align 8, !tbaa !5
  %28 = fmul double %27, %24
  store double %28, ptr %.1100.epil, align 8, !tbaa !5
  %epil.iter162.next = add i32 %epil.iter162, 1
  %epil.iter162.cmp.not = icmp eq i32 %epil.iter162.next, %xtraiter161
  br i1 %epil.iter162.cmp.not, label %.preheader, label %.epil.preheader160, !llvm.loop !9

.preheader:                                       ; preds = %.epil.preheader160, %.preheader.unr-lcssa
  %.091135 = add nuw nsw i32 %.194142, 1
  %29 = icmp slt i32 %.091135, %2
  br i1 %29, label %.lr.ph138.preheader, label %.loopexit

.lr.ph138.preheader:                              ; preds = %.preheader
  %30 = fneg double %21
  %xtraiter167 = and i32 %.0143, 3
  %31 = icmp ult i32 %indvar, 3
  %unroll_iter171 = and i32 %.0143, 2147483644
  %lcmp.mod169.not = icmp eq i32 %xtraiter167, 0
  %xtraiter176 = and i32 %.0143, 3
  %32 = icmp ult i32 %indvar, 3
  %unroll_iter180 = and i32 %.0143, 2147483644
  %lcmp.mod178.not = icmp eq i32 %xtraiter176, 0
  br label %.lr.ph138

33:                                               ; preds = %33, %.preheader114.preheader.new
  %.0108.pn112125 = phi ptr [ %.0108145, %.preheader114.preheader.new ], [ %.1100.3, %33 ]
  %.1104124 = phi ptr [ %.0109140, %.preheader114.preheader.new ], [ %43, %33 ]
  %niter165 = phi i32 [ 0, %.preheader114.preheader.new ], [ %niter165.next.3, %33 ]
  %.1100 = getelementptr inbounds double, ptr %.0108.pn112125, i64 %11
  %34 = getelementptr inbounds i8, ptr %.1104124, i64 8
  %35 = load double, ptr %.1104124, align 8, !tbaa !5
  %36 = fmul double %35, %24
  store double %36, ptr %.1100, align 8, !tbaa !5
  %.1100.1 = getelementptr inbounds double, ptr %.1100, i64 %11
  %37 = getelementptr inbounds i8, ptr %.1104124, i64 16
  %38 = load double, ptr %34, align 8, !tbaa !5
  %39 = fmul double %38, %24
  store double %39, ptr %.1100.1, align 8, !tbaa !5
  %.1100.2 = getelementptr inbounds double, ptr %.1100.1, i64 %11
  %40 = getelementptr inbounds i8, ptr %.1104124, i64 24
  %41 = load double, ptr %37, align 8, !tbaa !5
  %42 = fmul double %41, %24
  store double %42, ptr %.1100.2, align 8, !tbaa !5
  %.1100.3 = getelementptr inbounds double, ptr %.1100.2, i64 %11
  %43 = getelementptr inbounds i8, ptr %.1104124, i64 32
  %44 = load double, ptr %40, align 8, !tbaa !5
  %45 = fmul double %44, %24
  store double %45, ptr %.1100.3, align 8, !tbaa !5
  %niter165.next.3 = add i32 %niter165, 4
  %niter165.ncmp.3 = icmp eq i32 %niter165.next.3, %unroll_iter164
  br i1 %niter165.ncmp.3, label %.preheader.unr-lcssa, label %33, !llvm.loop !11

.lr.ph138:                                        ; preds = %.lr.ph138.preheader, %.epilog-lcssa179
  %.091137 = phi i32 [ %.091, %.epilog-lcssa179 ], [ %.091135, %.lr.ph138.preheader ]
  %.2101136.pn = phi ptr [ %.2101136, %.epilog-lcssa179 ], [ %.0108145, %.lr.ph138.preheader ]
  %.2101136 = getelementptr inbounds i8, ptr %.2101136.pn, i64 8
  %46 = getelementptr inbounds double, ptr %.2101136, i64 %11
  br i1 %31, label %.unr-lcssa, label %.lr.ph138.new

.lr.ph138.new:                                    ; preds = %.lr.ph138, %.lr.ph138.new
  %.095129 = phi double [ %65, %.lr.ph138.new ], [ 0.000000e+00, %.lr.ph138 ]
  %.097128 = phi ptr [ %66, %.lr.ph138.new ], [ %46, %.lr.ph138 ]
  %.2105127 = phi ptr [ %63, %.lr.ph138.new ], [ %.0109140, %.lr.ph138 ]
  %niter172 = phi i32 [ %niter172.next.3, %.lr.ph138.new ], [ 0, %.lr.ph138 ]
  %47 = load double, ptr %.097128, align 8, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %.2105127, i64 8
  %49 = load double, ptr %.2105127, align 8, !tbaa !5
  %50 = tail call double @llvm.fmuladd.f64(double %47, double %49, double %.095129)
  %51 = getelementptr inbounds double, ptr %.097128, i64 %11
  %52 = load double, ptr %51, align 8, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %.2105127, i64 16
  %54 = load double, ptr %48, align 8, !tbaa !5
  %55 = tail call double @llvm.fmuladd.f64(double %52, double %54, double %50)
  %56 = getelementptr inbounds double, ptr %51, i64 %11
  %57 = load double, ptr %56, align 8, !tbaa !5
  %58 = getelementptr inbounds i8, ptr %.2105127, i64 24
  %59 = load double, ptr %53, align 8, !tbaa !5
  %60 = tail call double @llvm.fmuladd.f64(double %57, double %59, double %55)
  %61 = getelementptr inbounds double, ptr %56, i64 %11
  %62 = load double, ptr %61, align 8, !tbaa !5
  %63 = getelementptr inbounds i8, ptr %.2105127, i64 32
  %64 = load double, ptr %58, align 8, !tbaa !5
  %65 = tail call double @llvm.fmuladd.f64(double %62, double %64, double %60)
  %66 = getelementptr inbounds double, ptr %61, i64 %11
  %niter172.next.3 = add i32 %niter172, 4
  %niter172.ncmp.3 = icmp eq i32 %niter172.next.3, %unroll_iter171
  br i1 %niter172.ncmp.3, label %.unr-lcssa, label %.lr.ph138.new, !llvm.loop !13

.unr-lcssa:                                       ; preds = %.lr.ph138.new, %.lr.ph138
  %.lcssa.ph = phi double [ poison, %.lr.ph138 ], [ %65, %.lr.ph138.new ]
  %.095129.unr = phi double [ 0.000000e+00, %.lr.ph138 ], [ %65, %.lr.ph138.new ]
  %.097128.unr = phi ptr [ %46, %.lr.ph138 ], [ %66, %.lr.ph138.new ]
  %.2105127.unr = phi ptr [ %.0109140, %.lr.ph138 ], [ %63, %.lr.ph138.new ]
  br i1 %lcmp.mod169.not, label %.epilog-lcssa, label %.epil.preheader166

.epil.preheader166:                               ; preds = %.unr-lcssa, %.epil.preheader166
  %.095129.epil = phi double [ %70, %.epil.preheader166 ], [ %.095129.unr, %.unr-lcssa ]
  %.097128.epil = phi ptr [ %71, %.epil.preheader166 ], [ %.097128.unr, %.unr-lcssa ]
  %.2105127.epil = phi ptr [ %68, %.epil.preheader166 ], [ %.2105127.unr, %.unr-lcssa ]
  %epil.iter168 = phi i32 [ %epil.iter168.next, %.epil.preheader166 ], [ 0, %.unr-lcssa ]
  %67 = load double, ptr %.097128.epil, align 8, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %.2105127.epil, i64 8
  %69 = load double, ptr %.2105127.epil, align 8, !tbaa !5
  %70 = tail call double @llvm.fmuladd.f64(double %67, double %69, double %.095129.epil)
  %71 = getelementptr inbounds double, ptr %.097128.epil, i64 %11
  %epil.iter168.next = add i32 %epil.iter168, 1
  %epil.iter168.cmp.not = icmp eq i32 %epil.iter168.next, %xtraiter167
  br i1 %epil.iter168.cmp.not, label %.epilog-lcssa, label %.epil.preheader166, !llvm.loop !14

.epilog-lcssa:                                    ; preds = %.epil.preheader166, %.unr-lcssa
  %.lcssa = phi double [ %.lcssa.ph, %.unr-lcssa ], [ %70, %.epil.preheader166 ]
  %72 = fmul double %.lcssa, %30
  br i1 %32, label %.unr-lcssa174, label %.new173

.new173:                                          ; preds = %.epilog-lcssa, %.new173
  %.198132 = phi ptr [ %92, %.new173 ], [ %46, %.epilog-lcssa ]
  %.3106131 = phi ptr [ %88, %.new173 ], [ %.0109140, %.epilog-lcssa ]
  %niter181 = phi i32 [ %niter181.next.3, %.new173 ], [ 0, %.epilog-lcssa ]
  %73 = getelementptr inbounds i8, ptr %.3106131, i64 8
  %74 = load double, ptr %.3106131, align 8, !tbaa !5
  %75 = load double, ptr %.198132, align 8, !tbaa !5
  %76 = tail call double @llvm.fmuladd.f64(double %72, double %74, double %75)
  store double %76, ptr %.198132, align 8, !tbaa !5
  %77 = getelementptr inbounds double, ptr %.198132, i64 %11
  %78 = getelementptr inbounds i8, ptr %.3106131, i64 16
  %79 = load double, ptr %73, align 8, !tbaa !5
  %80 = load double, ptr %77, align 8, !tbaa !5
  %81 = tail call double @llvm.fmuladd.f64(double %72, double %79, double %80)
  store double %81, ptr %77, align 8, !tbaa !5
  %82 = getelementptr inbounds double, ptr %77, i64 %11
  %83 = getelementptr inbounds i8, ptr %.3106131, i64 24
  %84 = load double, ptr %78, align 8, !tbaa !5
  %85 = load double, ptr %82, align 8, !tbaa !5
  %86 = tail call double @llvm.fmuladd.f64(double %72, double %84, double %85)
  store double %86, ptr %82, align 8, !tbaa !5
  %87 = getelementptr inbounds double, ptr %82, i64 %11
  %88 = getelementptr inbounds i8, ptr %.3106131, i64 32
  %89 = load double, ptr %83, align 8, !tbaa !5
  %90 = load double, ptr %87, align 8, !tbaa !5
  %91 = tail call double @llvm.fmuladd.f64(double %72, double %89, double %90)
  store double %91, ptr %87, align 8, !tbaa !5
  %92 = getelementptr inbounds double, ptr %87, i64 %11
  %niter181.next.3 = add i32 %niter181, 4
  %niter181.ncmp.3 = icmp eq i32 %niter181.next.3, %unroll_iter180
  br i1 %niter181.ncmp.3, label %.unr-lcssa174, label %.new173, !llvm.loop !15

.unr-lcssa174:                                    ; preds = %.new173, %.epilog-lcssa
  %.198132.unr = phi ptr [ %46, %.epilog-lcssa ], [ %92, %.new173 ]
  %.3106131.unr = phi ptr [ %.0109140, %.epilog-lcssa ], [ %88, %.new173 ]
  br i1 %lcmp.mod178.not, label %.epilog-lcssa179, label %.epil.preheader175

.epil.preheader175:                               ; preds = %.unr-lcssa174, %.epil.preheader175
  %.198132.epil = phi ptr [ %97, %.epil.preheader175 ], [ %.198132.unr, %.unr-lcssa174 ]
  %.3106131.epil = phi ptr [ %93, %.epil.preheader175 ], [ %.3106131.unr, %.unr-lcssa174 ]
  %epil.iter177 = phi i32 [ %epil.iter177.next, %.epil.preheader175 ], [ 0, %.unr-lcssa174 ]
  %93 = getelementptr inbounds i8, ptr %.3106131.epil, i64 8
  %94 = load double, ptr %.3106131.epil, align 8, !tbaa !5
  %95 = load double, ptr %.198132.epil, align 8, !tbaa !5
  %96 = tail call double @llvm.fmuladd.f64(double %72, double %94, double %95)
  store double %96, ptr %.198132.epil, align 8, !tbaa !5
  %97 = getelementptr inbounds double, ptr %.198132.epil, i64 %11
  %epil.iter177.next = add i32 %epil.iter177, 1
  %epil.iter177.cmp.not = icmp eq i32 %epil.iter177.next, %xtraiter176
  br i1 %epil.iter177.cmp.not, label %.epilog-lcssa179, label %.epil.preheader175, !llvm.loop !16

.epilog-lcssa179:                                 ; preds = %.epil.preheader175, %.unr-lcssa174
  store double %72, ptr %.2101136, align 8, !tbaa !5
  %.091 = add nuw nsw i32 %.091137, 1
  %exitcond153.not = icmp eq i32 %.091, %2
  br i1 %exitcond153.not, label %.loopexit, label %.lr.ph138, !llvm.loop !17

98:                                               ; preds = %.lr.ph147
  store double 1.000000e+00, ptr %.0108145, align 8, !tbaa !5
  %xtraiter = and i32 %.0143, 3
  %99 = icmp ult i32 %indvar, 3
  br i1 %99, label %.loopexit.loopexit159.unr-lcssa, label %.new

.new:                                             ; preds = %98
  %unroll_iter = and i32 %.0143, 2147483644
  br label %100

100:                                              ; preds = %100, %.new
  %.0108.pn119 = phi ptr [ %.0108145, %.new ], [ %.3102.3, %100 ]
  %.0108.pn111118 = phi ptr [ %.0108145, %.new ], [ %.4107.3, %100 ]
  %niter = phi i32 [ 0, %.new ], [ %niter.next.3, %100 ]
  %.4107 = getelementptr inbounds i8, ptr %.0108.pn111118, i64 8
  %.3102 = getelementptr inbounds double, ptr %.0108.pn119, i64 %11
  store double 0.000000e+00, ptr %.4107, align 8, !tbaa !5
  store double 0.000000e+00, ptr %.3102, align 8, !tbaa !5
  %.4107.1 = getelementptr inbounds i8, ptr %.0108.pn111118, i64 16
  %.3102.1 = getelementptr inbounds double, ptr %.3102, i64 %11
  store double 0.000000e+00, ptr %.4107.1, align 8, !tbaa !5
  store double 0.000000e+00, ptr %.3102.1, align 8, !tbaa !5
  %.4107.2 = getelementptr inbounds i8, ptr %.0108.pn111118, i64 24
  %.3102.2 = getelementptr inbounds double, ptr %.3102.1, i64 %11
  store double 0.000000e+00, ptr %.4107.2, align 8, !tbaa !5
  store double 0.000000e+00, ptr %.3102.2, align 8, !tbaa !5
  %.4107.3 = getelementptr inbounds i8, ptr %.0108.pn111118, i64 32
  %.3102.3 = getelementptr inbounds double, ptr %.3102.2, i64 %11
  store double 0.000000e+00, ptr %.4107.3, align 8, !tbaa !5
  store double 0.000000e+00, ptr %.3102.3, align 8, !tbaa !5
  %niter.next.3 = add i32 %niter, 4
  %niter.ncmp.3 = icmp eq i32 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.loopexit.loopexit159.unr-lcssa, label %100, !llvm.loop !18

.loopexit.loopexit159.unr-lcssa:                  ; preds = %100, %98
  %.0108.pn119.unr = phi ptr [ %.0108145, %98 ], [ %.3102.3, %100 ]
  %.0108.pn111118.unr = phi ptr [ %.0108145, %98 ], [ %.4107.3, %100 ]
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.loopexit, label %.epil.preheader

.epil.preheader:                                  ; preds = %.loopexit.loopexit159.unr-lcssa, %.epil.preheader
  %.0108.pn119.epil = phi ptr [ %.3102.epil, %.epil.preheader ], [ %.0108.pn119.unr, %.loopexit.loopexit159.unr-lcssa ]
  %.0108.pn111118.epil = phi ptr [ %.4107.epil, %.epil.preheader ], [ %.0108.pn111118.unr, %.loopexit.loopexit159.unr-lcssa ]
  %epil.iter = phi i32 [ %epil.iter.next, %.epil.preheader ], [ 0, %.loopexit.loopexit159.unr-lcssa ]
  %.4107.epil = getelementptr inbounds i8, ptr %.0108.pn111118.epil, i64 8
  %.3102.epil = getelementptr inbounds double, ptr %.0108.pn119.epil, i64 %11
  store double 0.000000e+00, ptr %.4107.epil, align 8, !tbaa !5
  store double 0.000000e+00, ptr %.3102.epil, align 8, !tbaa !5
  %epil.iter.next = add i32 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.loopexit, label %.epil.preheader, !llvm.loop !19

.loopexit:                                        ; preds = %.loopexit.loopexit159.unr-lcssa, %.epil.preheader, %.epilog-lcssa179, %.preheader
  %101 = add nsw i32 %.194142, -1
  %102 = getelementptr inbounds double, ptr %.0109140, i64 %10
  %103 = add nuw nsw i32 %.0143, 1
  %exitcond154.not = icmp eq i32 %.0143, %19
  %indvar.next = add i32 %indvar, 1
  br i1 %exitcond154.not, label %._crit_edge148, label %.lr.ph147, !llvm.loop !20

._crit_edge148:                                   ; preds = %.loopexit, %._crit_edge.thread, %._crit_edge
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { mustprogress nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!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++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.unroll.disable"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !12}


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