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

; 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: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #1

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN9MathTools6ldumatEPdS0_ii(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) #4 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca double, align 8
  %19 = alloca double, 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 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %20 = load i32, ptr %7, align 4, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = call noalias ptr @calloc(i64 noundef %21, i64 noundef 8) #6
  store ptr %22, ptr %13, align 8, !tbaa !5
  store i32 0, ptr %14, align 4, !tbaa !9
  %23 = load i32, ptr %7, align 4, !tbaa !9
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = mul nsw i32 %23, %24
  store i32 %25, ptr %17, align 4, !tbaa !9
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %26, ptr %12, align 8, !tbaa !5
  br label %27

27:                                               ; preds = %34, %4
  %28 = load i32, ptr %14, align 4, !tbaa !9
  %29 = load i32, ptr %17, align 4, !tbaa !9
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %31, label %37

31:                                               ; preds = %27
  %32 = load ptr, ptr %12, align 8, !tbaa !5
  %33 = getelementptr inbounds double, ptr %32, i32 1
  store ptr %33, ptr %12, align 8, !tbaa !5
  store double 0.000000e+00, ptr %32, align 8, !tbaa !11
  br label %34

34:                                               ; preds = %31
  %35 = load i32, ptr %14, align 4, !tbaa !9
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %14, align 4, !tbaa !9
  br label %27, !llvm.loop !13

37:                                               ; preds = %27
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = load i32, ptr %8, align 4, !tbaa !9
  %40 = load i32, ptr %8, align 4, !tbaa !9
  %41 = mul nsw i32 %39, %40
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds double, ptr %38, i64 %42
  %44 = getelementptr inbounds double, ptr %43, i64 -1
  store ptr %44, ptr %9, align 8, !tbaa !5
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = load i32, ptr %7, align 4, !tbaa !9
  %47 = load i32, ptr %7, align 4, !tbaa !9
  %48 = mul nsw i32 %46, %47
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds double, ptr %45, i64 %49
  %51 = getelementptr inbounds double, ptr %50, i64 -1
  store ptr %51, ptr %10, align 8, !tbaa !5
  %52 = load i32, ptr %7, align 4, !tbaa !9
  %53 = load i32, ptr %8, align 4, !tbaa !9
  %54 = sub nsw i32 %52, %53
  store i32 %54, ptr %17, align 4, !tbaa !9
  %55 = load i32, ptr %8, align 4, !tbaa !9
  %56 = sub nsw i32 %55, 1
  store i32 %56, ptr %14, align 4, !tbaa !9
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %57

57:                                               ; preds = %63, %37
  %58 = load i32, ptr %15, align 4, !tbaa !9
  %59 = load i32, ptr %17, align 4, !tbaa !9
  %60 = icmp slt i32 %58, %59
  br i1 %60, label %61, label %72

61:                                               ; preds = %57
  %62 = load ptr, ptr %10, align 8, !tbaa !5
  store double 1.000000e+00, ptr %62, align 8, !tbaa !11
  br label %63

63:                                               ; preds = %61
  %64 = load i32, ptr %15, align 4, !tbaa !9
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %15, align 4, !tbaa !9
  %66 = load i32, ptr %7, align 4, !tbaa !9
  %67 = add nsw i32 %66, 1
  %68 = load ptr, ptr %10, align 8, !tbaa !5
  %69 = sext i32 %67 to i64
  %70 = sub i64 0, %69
  %71 = getelementptr inbounds double, ptr %68, i64 %70
  store ptr %71, ptr %10, align 8, !tbaa !5
  br label %57, !llvm.loop !15

72:                                               ; preds = %57
  %73 = load i32, ptr %17, align 4, !tbaa !9
  %74 = icmp eq i32 %73, 0
  br i1 %74, label %75, label %93

75:                                               ; preds = %72
  %76 = load i32, ptr %8, align 4, !tbaa !9
  %77 = add nsw i32 %76, 1
  %78 = load ptr, ptr %9, align 8, !tbaa !5
  %79 = sext i32 %77 to i64
  %80 = sub i64 0, %79
  %81 = getelementptr inbounds double, ptr %78, i64 %80
  store ptr %81, ptr %9, align 8, !tbaa !5
  %82 = load ptr, ptr %10, align 8, !tbaa !5
  store double 1.000000e+00, ptr %82, align 8, !tbaa !11
  %83 = load i32, ptr %7, align 4, !tbaa !9
  %84 = add nsw i32 %83, 1
  %85 = load ptr, ptr %10, align 8, !tbaa !5
  %86 = sext i32 %84 to i64
  %87 = sub i64 0, %86
  %88 = getelementptr inbounds double, ptr %85, i64 %87
  store ptr %88, ptr %10, align 8, !tbaa !5
  %89 = load i32, ptr %14, align 4, !tbaa !9
  %90 = add nsw i32 %89, -1
  store i32 %90, ptr %14, align 4, !tbaa !9
  %91 = load i32, ptr %17, align 4, !tbaa !9
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %17, align 4, !tbaa !9
  br label %93

93:                                               ; preds = %75, %72
  br label %94

94:                                               ; preds = %250, %93
  %95 = load i32, ptr %14, align 4, !tbaa !9
  %96 = icmp sge i32 %95, 0
  br i1 %96, label %97, label %267

97:                                               ; preds = %94
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = load double, ptr %98, align 8, !tbaa !11
  %100 = fcmp une double %99, 0.000000e+00
  br i1 %100, label %101, label %225

101:                                              ; preds = %97
  store i32 0, ptr %15, align 4, !tbaa !9
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = load i32, ptr %8, align 4, !tbaa !9
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds double, ptr %102, i64 %104
  store ptr %105, ptr %11, align 8, !tbaa !5
  store double 1.000000e+00, ptr %19, align 8, !tbaa !11
  br label %106

106:                                              ; preds = %118, %101
  %107 = load i32, ptr %15, align 4, !tbaa !9
  %108 = load i32, ptr %17, align 4, !tbaa !9
  %109 = icmp slt i32 %107, %108
  br i1 %109, label %110, label %123

110:                                              ; preds = %106
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = load double, ptr %111, align 8, !tbaa !11
  %113 = load ptr, ptr %13, align 8, !tbaa !5
  %114 = load i32, ptr %15, align 4, !tbaa !9
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %15, align 4, !tbaa !9
  %116 = sext i32 %114 to i64
  %117 = getelementptr inbounds double, ptr %113, i64 %116
  store double %112, ptr %117, align 8, !tbaa !11
  br label %118

118:                                              ; preds = %110
  %119 = load i32, ptr %8, align 4, !tbaa !9
  %120 = load ptr, ptr %11, align 8, !tbaa !5
  %121 = sext i32 %119 to i64
  %122 = getelementptr inbounds double, ptr %120, i64 %121
  store ptr %122, ptr %11, align 8, !tbaa !5
  br label %106, !llvm.loop !16

123:                                              ; preds = %106
  %124 = load ptr, ptr %9, align 8, !tbaa !5
  %125 = load double, ptr %124, align 8, !tbaa !11
  store double %125, ptr %19, align 8, !tbaa !11
  %126 = load double, ptr %19, align 8, !tbaa !11
  %127 = fsub double 1.000000e+00, %126
  %128 = load ptr, ptr %10, align 8, !tbaa !5
  store double %127, ptr %128, align 8, !tbaa !11
  store i32 0, ptr %15, align 4, !tbaa !9
  %129 = load ptr, ptr %10, align 8, !tbaa !5
  %130 = load i32, ptr %7, align 4, !tbaa !9
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds double, ptr %129, i64 %131
  store ptr %132, ptr %12, align 8, !tbaa !5
  br label %133

133:                                              ; preds = %148, %123
  %134 = load i32, ptr %15, align 4, !tbaa !9
  %135 = load i32, ptr %17, align 4, !tbaa !9
  %136 = icmp slt i32 %134, %135
  br i1 %136, label %137, label %153

137:                                              ; preds = %133
  %138 = load double, ptr %19, align 8, !tbaa !11
  %139 = fneg double %138
  %140 = load ptr, ptr %13, align 8, !tbaa !5
  %141 = load i32, ptr %15, align 4, !tbaa !9
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %15, align 4, !tbaa !9
  %143 = sext i32 %141 to i64
  %144 = getelementptr inbounds double, ptr %140, i64 %143
  %145 = load double, ptr %144, align 8, !tbaa !11
  %146 = fmul double %139, %145
  %147 = load ptr, ptr %12, align 8, !tbaa !5
  store double %146, ptr %147, align 8, !tbaa !11
  br label %148

148:                                              ; preds = %137
  %149 = load i32, ptr %7, align 4, !tbaa !9
  %150 = load ptr, ptr %12, align 8, !tbaa !5
  %151 = sext i32 %149 to i64
  %152 = getelementptr inbounds double, ptr %150, i64 %151
  store ptr %152, ptr %12, align 8, !tbaa !5
  br label %133, !llvm.loop !17

153:                                              ; preds = %133
  %154 = load i32, ptr %14, align 4, !tbaa !9
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %16, align 4, !tbaa !9
  %156 = load ptr, ptr %10, align 8, !tbaa !5
  %157 = getelementptr inbounds double, ptr %156, i64 1
  store ptr %157, ptr %12, align 8, !tbaa !5
  br label %158

158:                                              ; preds = %221, %153
  %159 = load i32, ptr %16, align 4, !tbaa !9
  %160 = load i32, ptr %7, align 4, !tbaa !9
  %161 = icmp slt i32 %159, %160
  br i1 %161, label %162, label %224

162:                                              ; preds = %158
  store i32 0, ptr %15, align 4, !tbaa !9
  %163 = load ptr, ptr %12, align 8, !tbaa !5
  %164 = load i32, ptr %7, align 4, !tbaa !9
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds double, ptr %163, i64 %165
  store ptr %166, ptr %11, align 8, !tbaa !5
  store double 0.000000e+00, ptr %18, align 8, !tbaa !11
  br label %167

167:                                              ; preds = %182, %162
  %168 = load i32, ptr %15, align 4, !tbaa !9
  %169 = load i32, ptr %17, align 4, !tbaa !9
  %170 = icmp slt i32 %168, %169
  br i1 %170, label %171, label %187

171:                                              ; preds = %167
  %172 = load ptr, ptr %13, align 8, !tbaa !5
  %173 = load i32, ptr %15, align 4, !tbaa !9
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %15, align 4, !tbaa !9
  %175 = sext i32 %173 to i64
  %176 = getelementptr inbounds double, ptr %172, i64 %175
  %177 = load double, ptr %176, align 8, !tbaa !11
  %178 = load ptr, ptr %11, align 8, !tbaa !5
  %179 = load double, ptr %178, align 8, !tbaa !11
  %180 = load double, ptr %18, align 8, !tbaa !11
  %181 = call double @llvm.fmuladd.f64(double %177, double %179, double %180)
  store double %181, ptr %18, align 8, !tbaa !11
  br label %182

182:                                              ; preds = %171
  %183 = load i32, ptr %7, align 4, !tbaa !9
  %184 = load ptr, ptr %11, align 8, !tbaa !5
  %185 = sext i32 %183 to i64
  %186 = getelementptr inbounds double, ptr %184, i64 %185
  store ptr %186, ptr %11, align 8, !tbaa !5
  br label %167, !llvm.loop !18

187:                                              ; preds = %167
  %188 = load double, ptr %19, align 8, !tbaa !11
  %189 = load double, ptr %18, align 8, !tbaa !11
  %190 = fmul double %189, %188
  store double %190, ptr %18, align 8, !tbaa !11
  store i32 0, ptr %15, align 4, !tbaa !9
  %191 = load ptr, ptr %12, align 8, !tbaa !5
  %192 = load i32, ptr %7, align 4, !tbaa !9
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds double, ptr %191, i64 %193
  store ptr %194, ptr %11, align 8, !tbaa !5
  br label %195

195:                                              ; preds = %211, %187
  %196 = load i32, ptr %15, align 4, !tbaa !9
  %197 = load i32, ptr %17, align 4, !tbaa !9
  %198 = icmp slt i32 %196, %197
  br i1 %198, label %199, label %216

199:                                              ; preds = %195
  %200 = load double, ptr %18, align 8, !tbaa !11
  %201 = load ptr, ptr %13, align 8, !tbaa !5
  %202 = load i32, ptr %15, align 4, !tbaa !9
  %203 = add nsw i32 %202, 1
  store i32 %203, ptr %15, align 4, !tbaa !9
  %204 = sext i32 %202 to i64
  %205 = getelementptr inbounds double, ptr %201, i64 %204
  %206 = load double, ptr %205, align 8, !tbaa !11
  %207 = load ptr, ptr %11, align 8, !tbaa !5
  %208 = load double, ptr %207, align 8, !tbaa !11
  %209 = fneg double %200
  %210 = call double @llvm.fmuladd.f64(double %209, double %206, double %208)
  store double %210, ptr %207, align 8, !tbaa !11
  br label %211

211:                                              ; preds = %199
  %212 = load i32, ptr %7, align 4, !tbaa !9
  %213 = load ptr, ptr %11, align 8, !tbaa !5
  %214 = sext i32 %212 to i64
  %215 = getelementptr inbounds double, ptr %213, i64 %214
  store ptr %215, ptr %11, align 8, !tbaa !5
  br label %195, !llvm.loop !19

216:                                              ; preds = %195
  %217 = load double, ptr %18, align 8, !tbaa !11
  %218 = fneg double %217
  %219 = load ptr, ptr %12, align 8, !tbaa !5
  %220 = getelementptr inbounds double, ptr %219, i32 1
  store ptr %220, ptr %12, align 8, !tbaa !5
  store double %218, ptr %219, align 8, !tbaa !11
  br label %221

221:                                              ; preds = %216
  %222 = load i32, ptr %16, align 4, !tbaa !9
  %223 = add nsw i32 %222, 1
  store i32 %223, ptr %16, align 4, !tbaa !9
  br label %158, !llvm.loop !20

224:                                              ; preds = %158
  br label %249

225:                                              ; preds = %97
  %226 = load ptr, ptr %10, align 8, !tbaa !5
  store double 1.000000e+00, ptr %226, align 8, !tbaa !11
  store i32 0, ptr %15, align 4, !tbaa !9
  %227 = load ptr, ptr %10, align 8, !tbaa !5
  %228 = getelementptr inbounds double, ptr %227, i64 1
  store ptr %228, ptr %11, align 8, !tbaa !5
  %229 = load ptr, ptr %10, align 8, !tbaa !5
  %230 = load i32, ptr %7, align 4, !tbaa !9
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds double, ptr %229, i64 %231
  store ptr %232, ptr %12, align 8, !tbaa !5
  br label %233

233:                                              ; preds = %241, %225
  %234 = load i32, ptr %15, align 4, !tbaa !9
  %235 = load i32, ptr %17, align 4, !tbaa !9
  %236 = icmp slt i32 %234, %235
  br i1 %236, label %237, label %248

237:                                              ; preds = %233
  %238 = load ptr, ptr %11, align 8, !tbaa !5
  %239 = getelementptr inbounds double, ptr %238, i32 1
  store ptr %239, ptr %11, align 8, !tbaa !5
  store double 0.000000e+00, ptr %238, align 8, !tbaa !11
  %240 = load ptr, ptr %12, align 8, !tbaa !5
  store double 0.000000e+00, ptr %240, align 8, !tbaa !11
  br label %241

241:                                              ; preds = %237
  %242 = load i32, ptr %15, align 4, !tbaa !9
  %243 = add nsw i32 %242, 1
  store i32 %243, ptr %15, align 4, !tbaa !9
  %244 = load i32, ptr %7, align 4, !tbaa !9
  %245 = load ptr, ptr %12, align 8, !tbaa !5
  %246 = sext i32 %244 to i64
  %247 = getelementptr inbounds double, ptr %245, i64 %246
  store ptr %247, ptr %12, align 8, !tbaa !5
  br label %233, !llvm.loop !21

248:                                              ; preds = %233
  br label %249

249:                                              ; preds = %248, %224
  br label %250

250:                                              ; preds = %249
  %251 = load i32, ptr %14, align 4, !tbaa !9
  %252 = add nsw i32 %251, -1
  store i32 %252, ptr %14, align 4, !tbaa !9
  %253 = load i32, ptr %17, align 4, !tbaa !9
  %254 = add nsw i32 %253, 1
  store i32 %254, ptr %17, align 4, !tbaa !9
  %255 = load i32, ptr %8, align 4, !tbaa !9
  %256 = add nsw i32 %255, 1
  %257 = load ptr, ptr %9, align 8, !tbaa !5
  %258 = sext i32 %256 to i64
  %259 = sub i64 0, %258
  %260 = getelementptr inbounds double, ptr %257, i64 %259
  store ptr %260, ptr %9, align 8, !tbaa !5
  %261 = load i32, ptr %7, align 4, !tbaa !9
  %262 = add nsw i32 %261, 1
  %263 = load ptr, ptr %10, align 8, !tbaa !5
  %264 = sext i32 %262 to i64
  %265 = sub i64 0, %264
  %266 = getelementptr inbounds double, ptr %263, i64 %265
  store ptr %266, ptr %10, align 8, !tbaa !5
  br label %94, !llvm.loop !22

267:                                              ; preds = %94
  %268 = load ptr, ptr %13, align 8, !tbaa !5
  call void @free(ptr noundef %268) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind allocsize(0,1) "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 = { 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { nounwind allocsize(0,1) }

!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}
!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: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 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: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN9MathTools6ldumatEPdS0_ii(ptr nocapture noundef readonly %0, ptr nocapture noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #3 {
  %5 = sext i32 %2 to i64
  %6 = tail call noalias ptr @calloc(i64 noundef %5, i64 noundef 8) #6
  %.not = icmp eq i32 %2, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %4
  %7 = mul i32 %2, %2
  %8 = zext i32 %7 to i64
  %umax = tail call i64 @llvm.umax.i64(i64 %8, i64 1)
  %9 = shl nuw nsw i64 %umax, 3
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %1, i8 0, i64 %9, i1 false), !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %4, %.lr.ph.preheader
  %.pre-phi = phi i64 [ %8, %.lr.ph.preheader ], [ 0, %4 ]
  %10 = mul nsw i32 %3, %3
  %11 = zext nneg i32 %10 to i64
  %12 = getelementptr inbounds double, ptr %0, i64 %11
  %13 = getelementptr inbounds i8, ptr %12, i64 -8
  %14 = getelementptr inbounds double, ptr %1, i64 %.pre-phi
  %15 = getelementptr inbounds i8, ptr %14, i64 -8
  %16 = sub nsw i32 %2, %3
  %17 = add nsw i32 %3, -1
  %18 = icmp sgt i32 %16, 0
  br i1 %18, label %.lr.ph136, label %._crit_edge137

.lr.ph136:                                        ; preds = %._crit_edge
  %narrow129 = xor i32 %2, -1
  %19 = sext i32 %narrow129 to i64
  %xtraiter = and i32 %16, 7
  %20 = sub i32 %3, %2
  %21 = icmp ugt i32 %20, -8
  br i1 %21, label %._crit_edge137.thread.loopexit.unr-lcssa, label %.lr.ph136.new

.lr.ph136.new:                                    ; preds = %.lr.ph136
  %unroll_iter = and i32 %16, 2147483640
  br label %22

22:                                               ; preds = %22, %.lr.ph136.new
  %.0118133 = phi ptr [ %15, %.lr.ph136.new ], [ %30, %22 ]
  %niter = phi i32 [ 0, %.lr.ph136.new ], [ %niter.next.7, %22 ]
  store double 1.000000e+00, ptr %.0118133, align 8, !tbaa !5
  %23 = getelementptr inbounds double, ptr %.0118133, i64 %19
  store double 1.000000e+00, ptr %23, align 8, !tbaa !5
  %24 = getelementptr inbounds double, ptr %23, i64 %19
  store double 1.000000e+00, ptr %24, align 8, !tbaa !5
  %25 = getelementptr inbounds double, ptr %24, i64 %19
  store double 1.000000e+00, ptr %25, align 8, !tbaa !5
  %26 = getelementptr inbounds double, ptr %25, i64 %19
  store double 1.000000e+00, ptr %26, align 8, !tbaa !5
  %27 = getelementptr inbounds double, ptr %26, i64 %19
  store double 1.000000e+00, ptr %27, align 8, !tbaa !5
  %28 = getelementptr inbounds double, ptr %27, i64 %19
  store double 1.000000e+00, ptr %28, align 8, !tbaa !5
  %29 = getelementptr inbounds double, ptr %28, i64 %19
  store double 1.000000e+00, ptr %29, align 8, !tbaa !5
  %30 = getelementptr inbounds double, ptr %29, i64 %19
  %niter.next.7 = add i32 %niter, 8
  %niter.ncmp.7 = icmp eq i32 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %._crit_edge137.thread.loopexit.unr-lcssa, label %22, !llvm.loop !9

._crit_edge137:                                   ; preds = %._crit_edge
  %31 = icmp eq i32 %16, 0
  br i1 %31, label %32, label %._crit_edge137.thread

32:                                               ; preds = %._crit_edge137
  %narrow = xor i32 %3, -1
  %33 = sext i32 %narrow to i64
  %34 = getelementptr inbounds double, ptr %13, i64 %33
  store double 1.000000e+00, ptr %15, align 8, !tbaa !5
  %narrow123 = xor i32 %2, -1
  %35 = sext i32 %narrow123 to i64
  %36 = getelementptr inbounds double, ptr %15, i64 %35
  %37 = add nsw i32 %3, -2
  br label %._crit_edge137.thread

._crit_edge137.thread.loopexit.unr-lcssa:         ; preds = %22, %.lr.ph136
  %.lcssa208.ph = phi ptr [ poison, %.lr.ph136 ], [ %30, %22 ]
  %.0118133.unr = phi ptr [ %15, %.lr.ph136 ], [ %30, %22 ]
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge137.thread, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge137.thread.loopexit.unr-lcssa, %.epil.preheader
  %.0118133.epil = phi ptr [ %38, %.epil.preheader ], [ %.0118133.unr, %._crit_edge137.thread.loopexit.unr-lcssa ]
  %epil.iter = phi i32 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge137.thread.loopexit.unr-lcssa ]
  store double 1.000000e+00, ptr %.0118133.epil, align 8, !tbaa !5
  %38 = getelementptr inbounds double, ptr %.0118133.epil, i64 %19
  %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 %._crit_edge137.thread, label %.epil.preheader, !llvm.loop !11

._crit_edge137.thread:                            ; preds = %._crit_edge137.thread.loopexit.unr-lcssa, %.epil.preheader, %32, %._crit_edge137
  %.1119 = phi ptr [ %36, %32 ], [ %15, %._crit_edge137 ], [ %.lcssa208.ph, %._crit_edge137.thread.loopexit.unr-lcssa ], [ %38, %.epil.preheader ]
  %.0108 = phi ptr [ %34, %32 ], [ %13, %._crit_edge137 ], [ %13, %.epil.preheader ], [ %13, %._crit_edge137.thread.loopexit.unr-lcssa ]
  %.1106 = phi i32 [ %37, %32 ], [ %17, %._crit_edge137 ], [ %17, %.epil.preheader ], [ %17, %._crit_edge137.thread.loopexit.unr-lcssa ]
  %.0101 = phi i32 [ 1, %32 ], [ %16, %._crit_edge137 ], [ %16, %.epil.preheader ], [ %16, %._crit_edge137.thread.loopexit.unr-lcssa ]
  %39 = icmp sgt i32 %.1106, -1
  br i1 %39, label %.lr.ph177, label %._crit_edge178

.lr.ph177:                                        ; preds = %._crit_edge137.thread
  %40 = sext i32 %3 to i64
  %narrow126 = xor i32 %3, -1
  %41 = sext i32 %narrow126 to i64
  %narrow127 = xor i32 %2, -1
  %42 = sext i32 %narrow127 to i64
  %43 = add i32 %.0101, -1
  br label %44

44:                                               ; preds = %.lr.ph177, %.loopexit
  %indvar = phi i32 [ 0, %.lr.ph177 ], [ %indvar.next, %.loopexit ]
  %.1174 = phi i32 [ %.0101, %.lr.ph177 ], [ %149, %.loopexit ]
  %.2107173 = phi i32 [ %.1106, %.lr.ph177 ], [ %148, %.loopexit ]
  %.1109171 = phi ptr [ %.0108, %.lr.ph177 ], [ %150, %.loopexit ]
  %.2120169 = phi ptr [ %.1119, %.lr.ph177 ], [ %151, %.loopexit ]
  %45 = zext i32 %.1174 to i64
  %46 = zext i32 %.1174 to i64
  %47 = zext i32 %.1174 to i64
  %48 = zext i32 %.1174 to i64
  %49 = add i32 %43, %indvar
  %50 = load double, ptr %.1109171, align 8, !tbaa !5
  %51 = fcmp une double %50, 0.000000e+00
  br i1 %51, label %52, label %145

52:                                               ; preds = %44
  %53 = icmp sgt i32 %.1174, 0
  br i1 %53, label %.lr.ph146.preheader, label %._crit_edge147.thread

._crit_edge147.thread:                            ; preds = %52
  %54 = fsub double 1.000000e+00, %50
  store double %54, ptr %.2120169, align 8, !tbaa !5
  br label %.preheader

.lr.ph146.preheader:                              ; preds = %52
  %xtraiter215 = and i64 %48, 3
  %55 = icmp ult i32 %.1174, 4
  br i1 %55, label %._crit_edge147.unr-lcssa, label %.lr.ph146.preheader.new

.lr.ph146.preheader.new:                          ; preds = %.lr.ph146.preheader
  %unroll_iter218 = and i64 %48, 2147483644
  br label %.lr.ph146

.lr.ph146:                                        ; preds = %.lr.ph146, %.lr.ph146.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph146.preheader.new ], [ %indvars.iv.next.3, %.lr.ph146 ]
  %.1109.pn143 = phi ptr [ %.1109171, %.lr.ph146.preheader.new ], [ %.0114.3, %.lr.ph146 ]
  %niter219 = phi i64 [ 0, %.lr.ph146.preheader.new ], [ %niter219.next.3, %.lr.ph146 ]
  %.0114 = getelementptr inbounds double, ptr %.1109.pn143, i64 %40
  %56 = load double, ptr %.0114, align 8, !tbaa !5
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %57 = getelementptr inbounds double, ptr %6, i64 %indvars.iv
  store double %56, ptr %57, align 8, !tbaa !5
  %.0114.1 = getelementptr inbounds double, ptr %.0114, i64 %40
  %58 = load double, ptr %.0114.1, align 8, !tbaa !5
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %59 = getelementptr inbounds double, ptr %6, i64 %indvars.iv.next
  store double %58, ptr %59, align 8, !tbaa !5
  %.0114.2 = getelementptr inbounds double, ptr %.0114.1, i64 %40
  %60 = load double, ptr %.0114.2, align 8, !tbaa !5
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %61 = getelementptr inbounds double, ptr %6, i64 %indvars.iv.next.1
  store double %60, ptr %61, align 8, !tbaa !5
  %.0114.3 = getelementptr inbounds double, ptr %.0114.2, i64 %40
  %62 = load double, ptr %.0114.3, align 8, !tbaa !5
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %63 = getelementptr inbounds double, ptr %6, i64 %indvars.iv.next.2
  store double %62, ptr %63, align 8, !tbaa !5
  %niter219.next.3 = add i64 %niter219, 4
  %niter219.ncmp.3 = icmp eq i64 %niter219.next.3, %unroll_iter218
  br i1 %niter219.ncmp.3, label %._crit_edge147.unr-lcssa, label %.lr.ph146, !llvm.loop !13

._crit_edge147.unr-lcssa:                         ; preds = %.lr.ph146, %.lr.ph146.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph146.preheader ], [ %indvars.iv.next.3, %.lr.ph146 ]
  %.1109.pn143.unr = phi ptr [ %.1109171, %.lr.ph146.preheader ], [ %.0114.3, %.lr.ph146 ]
  %lcmp.mod217.not = icmp eq i64 %xtraiter215, 0
  br i1 %lcmp.mod217.not, label %._crit_edge147, label %.lr.ph146.epil

.lr.ph146.epil:                                   ; preds = %._crit_edge147.unr-lcssa, %.lr.ph146.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph146.epil ], [ %indvars.iv.unr, %._crit_edge147.unr-lcssa ]
  %.1109.pn143.epil = phi ptr [ %.0114.epil, %.lr.ph146.epil ], [ %.1109.pn143.unr, %._crit_edge147.unr-lcssa ]
  %epil.iter216 = phi i64 [ %epil.iter216.next, %.lr.ph146.epil ], [ 0, %._crit_edge147.unr-lcssa ]
  %.0114.epil = getelementptr inbounds double, ptr %.1109.pn143.epil, i64 %40
  %64 = load double, ptr %.0114.epil, align 8, !tbaa !5
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %65 = getelementptr inbounds double, ptr %6, i64 %indvars.iv.epil
  store double %64, ptr %65, align 8, !tbaa !5
  %epil.iter216.next = add i64 %epil.iter216, 1
  %epil.iter216.cmp.not = icmp eq i64 %epil.iter216.next, %xtraiter215
  br i1 %epil.iter216.cmp.not, label %._crit_edge147, label %.lr.ph146.epil, !llvm.loop !14

._crit_edge147:                                   ; preds = %.lr.ph146.epil, %._crit_edge147.unr-lcssa
  %66 = fsub double 1.000000e+00, %50
  store double %66, ptr %.2120169, align 8, !tbaa !5
  br i1 %53, label %.lr.ph151, label %.preheader

.lr.ph151:                                        ; preds = %._crit_edge147
  %67 = fneg double %50
  %xtraiter221 = and i64 %47, 3
  %68 = icmp ult i32 %.1174, 4
  br i1 %68, label %.preheader.loopexit.unr-lcssa, label %.lr.ph151.new

.lr.ph151.new:                                    ; preds = %.lr.ph151
  %unroll_iter224 = and i64 %47, 2147483644
  br label %76

.preheader.loopexit.unr-lcssa:                    ; preds = %76, %.lr.ph151
  %indvars.iv184.unr = phi i64 [ 0, %.lr.ph151 ], [ %indvars.iv.next185.3, %76 ]
  %.2120.pn125148.unr = phi ptr [ %.2120169, %.lr.ph151 ], [ %.1111.3, %76 ]
  %lcmp.mod223.not = icmp eq i64 %xtraiter221, 0
  br i1 %lcmp.mod223.not, label %.preheader, label %.epil.preheader220

.epil.preheader220:                               ; preds = %.preheader.loopexit.unr-lcssa, %.epil.preheader220
  %indvars.iv184.epil = phi i64 [ %indvars.iv.next185.epil, %.epil.preheader220 ], [ %indvars.iv184.unr, %.preheader.loopexit.unr-lcssa ]
  %.2120.pn125148.epil = phi ptr [ %.1111.epil, %.epil.preheader220 ], [ %.2120.pn125148.unr, %.preheader.loopexit.unr-lcssa ]
  %epil.iter222 = phi i64 [ %epil.iter222.next, %.epil.preheader220 ], [ 0, %.preheader.loopexit.unr-lcssa ]
  %.1111.epil = getelementptr inbounds double, ptr %.2120.pn125148.epil, i64 %5
  %indvars.iv.next185.epil = add nuw nsw i64 %indvars.iv184.epil, 1
  %69 = getelementptr inbounds double, ptr %6, i64 %indvars.iv184.epil
  %70 = load double, ptr %69, align 8, !tbaa !5
  %71 = fmul double %70, %67
  store double %71, ptr %.1111.epil, align 8, !tbaa !5
  %epil.iter222.next = add i64 %epil.iter222, 1
  %epil.iter222.cmp.not = icmp eq i64 %epil.iter222.next, %xtraiter221
  br i1 %epil.iter222.cmp.not, label %.preheader, label %.epil.preheader220, !llvm.loop !15

.preheader:                                       ; preds = %.preheader.loopexit.unr-lcssa, %.epil.preheader220, %._crit_edge147.thread, %._crit_edge147
  %.0102165 = add nuw nsw i32 %.2107173, 1
  %72 = icmp slt i32 %.0102165, %2
  br i1 %72, label %.lr.ph168, label %.loopexit

.lr.ph168:                                        ; preds = %.preheader
  %73 = fmul double %50, 0.000000e+00
  %xtraiter226 = and i64 %46, 3
  %74 = icmp ult i32 %.1174, 4
  %unroll_iter230 = and i64 %46, 2147483644
  %lcmp.mod228.not = icmp eq i64 %xtraiter226, 0
  %xtraiter233 = and i64 %45, 3
  %75 = icmp ult i32 %.1174, 4
  %unroll_iter236 = and i64 %45, 2147483644
  %lcmp.mod235.not = icmp eq i64 %xtraiter233, 0
  br label %89

76:                                               ; preds = %76, %.lr.ph151.new
  %indvars.iv184 = phi i64 [ 0, %.lr.ph151.new ], [ %indvars.iv.next185.3, %76 ]
  %.2120.pn125148 = phi ptr [ %.2120169, %.lr.ph151.new ], [ %.1111.3, %76 ]
  %niter225 = phi i64 [ 0, %.lr.ph151.new ], [ %niter225.next.3, %76 ]
  %.1111 = getelementptr inbounds double, ptr %.2120.pn125148, i64 %5
  %indvars.iv.next185 = or disjoint i64 %indvars.iv184, 1
  %77 = getelementptr inbounds double, ptr %6, i64 %indvars.iv184
  %78 = load double, ptr %77, align 8, !tbaa !5
  %79 = fmul double %78, %67
  store double %79, ptr %.1111, align 8, !tbaa !5
  %.1111.1 = getelementptr inbounds double, ptr %.1111, i64 %5
  %indvars.iv.next185.1 = or disjoint i64 %indvars.iv184, 2
  %80 = getelementptr inbounds double, ptr %6, i64 %indvars.iv.next185
  %81 = load double, ptr %80, align 8, !tbaa !5
  %82 = fmul double %81, %67
  store double %82, ptr %.1111.1, align 8, !tbaa !5
  %.1111.2 = getelementptr inbounds double, ptr %.1111.1, i64 %5
  %indvars.iv.next185.2 = or disjoint i64 %indvars.iv184, 3
  %83 = getelementptr inbounds double, ptr %6, i64 %indvars.iv.next185.1
  %84 = load double, ptr %83, align 8, !tbaa !5
  %85 = fmul double %84, %67
  store double %85, ptr %.1111.2, align 8, !tbaa !5
  %.1111.3 = getelementptr inbounds double, ptr %.1111.2, i64 %5
  %indvars.iv.next185.3 = add nuw nsw i64 %indvars.iv184, 4
  %86 = getelementptr inbounds double, ptr %6, i64 %indvars.iv.next185.2
  %87 = load double, ptr %86, align 8, !tbaa !5
  %88 = fmul double %87, %67
  store double %88, ptr %.1111.3, align 8, !tbaa !5
  %niter225.next.3 = add i64 %niter225, 4
  %niter225.ncmp.3 = icmp eq i64 %niter225.next.3, %unroll_iter224
  br i1 %niter225.ncmp.3, label %.preheader.loopexit.unr-lcssa, label %76, !llvm.loop !16

89:                                               ; preds = %.lr.ph168, %._crit_edge163
  %.0102167 = phi i32 [ %.0102165, %.lr.ph168 ], [ %.0102, %._crit_edge163 ]
  %.2120169.pn = phi ptr [ %.2120169, %.lr.ph168 ], [ %.2112166, %._crit_edge163 ]
  %.2112166 = getelementptr inbounds i8, ptr %.2120169.pn, i64 8
  %90 = getelementptr inbounds double, ptr %.2112166, i64 %5
  br i1 %53, label %.lr.ph156.preheader, label %._crit_edge157.._crit_edge163_crit_edge

.lr.ph156.preheader:                              ; preds = %89
  br i1 %74, label %._crit_edge157.unr-lcssa, label %.lr.ph156

.lr.ph156:                                        ; preds = %.lr.ph156.preheader, %.lr.ph156
  %indvars.iv189 = phi i64 [ %indvars.iv.next190.3, %.lr.ph156 ], [ 0, %.lr.ph156.preheader ]
  %.0154 = phi double [ %109, %.lr.ph156 ], [ 0.000000e+00, %.lr.ph156.preheader ]
  %.1115152 = phi ptr [ %110, %.lr.ph156 ], [ %90, %.lr.ph156.preheader ]
  %niter231 = phi i64 [ %niter231.next.3, %.lr.ph156 ], [ 0, %.lr.ph156.preheader ]
  %indvars.iv.next190 = or disjoint i64 %indvars.iv189, 1
  %91 = getelementptr inbounds double, ptr %6, i64 %indvars.iv189
  %92 = load double, ptr %91, align 8, !tbaa !5
  %93 = load double, ptr %.1115152, align 8, !tbaa !5
  %94 = tail call double @llvm.fmuladd.f64(double %92, double %93, double %.0154)
  %95 = getelementptr inbounds double, ptr %.1115152, i64 %5
  %indvars.iv.next190.1 = or disjoint i64 %indvars.iv189, 2
  %96 = getelementptr inbounds double, ptr %6, i64 %indvars.iv.next190
  %97 = load double, ptr %96, align 8, !tbaa !5
  %98 = load double, ptr %95, align 8, !tbaa !5
  %99 = tail call double @llvm.fmuladd.f64(double %97, double %98, double %94)
  %100 = getelementptr inbounds double, ptr %95, i64 %5
  %indvars.iv.next190.2 = or disjoint i64 %indvars.iv189, 3
  %101 = getelementptr inbounds double, ptr %6, i64 %indvars.iv.next190.1
  %102 = load double, ptr %101, align 8, !tbaa !5
  %103 = load double, ptr %100, align 8, !tbaa !5
  %104 = tail call double @llvm.fmuladd.f64(double %102, double %103, double %99)
  %105 = getelementptr inbounds double, ptr %100, i64 %5
  %indvars.iv.next190.3 = add nuw nsw i64 %indvars.iv189, 4
  %106 = getelementptr inbounds double, ptr %6, i64 %indvars.iv.next190.2
  %107 = load double, ptr %106, align 8, !tbaa !5
  %108 = load double, ptr %105, align 8, !tbaa !5
  %109 = tail call double @llvm.fmuladd.f64(double %107, double %108, double %104)
  %110 = getelementptr inbounds double, ptr %105, i64 %5
  %niter231.next.3 = add i64 %niter231, 4
  %niter231.ncmp.3 = icmp eq i64 %niter231.next.3, %unroll_iter230
  br i1 %niter231.ncmp.3, label %._crit_edge157.unr-lcssa, label %.lr.ph156, !llvm.loop !17

._crit_edge157.unr-lcssa:                         ; preds = %.lr.ph156, %.lr.ph156.preheader
  %.lcssa.ph = phi double [ poison, %.lr.ph156.preheader ], [ %109, %.lr.ph156 ]
  %indvars.iv189.unr = phi i64 [ 0, %.lr.ph156.preheader ], [ %indvars.iv.next190.3, %.lr.ph156 ]
  %.0154.unr = phi double [ 0.000000e+00, %.lr.ph156.preheader ], [ %109, %.lr.ph156 ]
  %.1115152.unr = phi ptr [ %90, %.lr.ph156.preheader ], [ %110, %.lr.ph156 ]
  br i1 %lcmp.mod228.not, label %._crit_edge157, label %.lr.ph156.epil

.lr.ph156.epil:                                   ; preds = %._crit_edge157.unr-lcssa, %.lr.ph156.epil
  %indvars.iv189.epil = phi i64 [ %indvars.iv.next190.epil, %.lr.ph156.epil ], [ %indvars.iv189.unr, %._crit_edge157.unr-lcssa ]
  %.0154.epil = phi double [ %114, %.lr.ph156.epil ], [ %.0154.unr, %._crit_edge157.unr-lcssa ]
  %.1115152.epil = phi ptr [ %115, %.lr.ph156.epil ], [ %.1115152.unr, %._crit_edge157.unr-lcssa ]
  %epil.iter227 = phi i64 [ %epil.iter227.next, %.lr.ph156.epil ], [ 0, %._crit_edge157.unr-lcssa ]
  %indvars.iv.next190.epil = add nuw nsw i64 %indvars.iv189.epil, 1
  %111 = getelementptr inbounds double, ptr %6, i64 %indvars.iv189.epil
  %112 = load double, ptr %111, align 8, !tbaa !5
  %113 = load double, ptr %.1115152.epil, align 8, !tbaa !5
  %114 = tail call double @llvm.fmuladd.f64(double %112, double %113, double %.0154.epil)
  %115 = getelementptr inbounds double, ptr %.1115152.epil, i64 %5
  %epil.iter227.next = add i64 %epil.iter227, 1
  %epil.iter227.cmp.not = icmp eq i64 %epil.iter227.next, %xtraiter226
  br i1 %epil.iter227.cmp.not, label %._crit_edge157, label %.lr.ph156.epil, !llvm.loop !18

._crit_edge157:                                   ; preds = %.lr.ph156.epil, %._crit_edge157.unr-lcssa
  %.lcssa = phi double [ %.lcssa.ph, %._crit_edge157.unr-lcssa ], [ %114, %.lr.ph156.epil ]
  %116 = fmul double %50, %.lcssa
  br i1 %53, label %.lr.ph162, label %._crit_edge157.._crit_edge163_crit_edge

._crit_edge157.._crit_edge163_crit_edge:          ; preds = %89, %._crit_edge157
  %117 = phi double [ %116, %._crit_edge157 ], [ %73, %89 ]
  %.pre199 = fneg double %117
  br label %._crit_edge163

.lr.ph162:                                        ; preds = %._crit_edge157
  %118 = fneg double %116
  br i1 %75, label %._crit_edge163.loopexit.unr-lcssa, label %.lr.ph162.new

.lr.ph162.new:                                    ; preds = %.lr.ph162, %.lr.ph162.new
  %indvars.iv194 = phi i64 [ %indvars.iv.next195.3, %.lr.ph162.new ], [ 0, %.lr.ph162 ]
  %.2116159 = phi ptr [ %138, %.lr.ph162.new ], [ %90, %.lr.ph162 ]
  %niter237 = phi i64 [ %niter237.next.3, %.lr.ph162.new ], [ 0, %.lr.ph162 ]
  %indvars.iv.next195 = or disjoint i64 %indvars.iv194, 1
  %119 = getelementptr inbounds double, ptr %6, i64 %indvars.iv194
  %120 = load double, ptr %119, align 8, !tbaa !5
  %121 = load double, ptr %.2116159, align 8, !tbaa !5
  %122 = tail call double @llvm.fmuladd.f64(double %118, double %120, double %121)
  store double %122, ptr %.2116159, align 8, !tbaa !5
  %123 = getelementptr inbounds double, ptr %.2116159, i64 %5
  %indvars.iv.next195.1 = or disjoint i64 %indvars.iv194, 2
  %124 = getelementptr inbounds double, ptr %6, i64 %indvars.iv.next195
  %125 = load double, ptr %124, align 8, !tbaa !5
  %126 = load double, ptr %123, align 8, !tbaa !5
  %127 = tail call double @llvm.fmuladd.f64(double %118, double %125, double %126)
  store double %127, ptr %123, align 8, !tbaa !5
  %128 = getelementptr inbounds double, ptr %123, i64 %5
  %indvars.iv.next195.2 = or disjoint i64 %indvars.iv194, 3
  %129 = getelementptr inbounds double, ptr %6, i64 %indvars.iv.next195.1
  %130 = load double, ptr %129, align 8, !tbaa !5
  %131 = load double, ptr %128, align 8, !tbaa !5
  %132 = tail call double @llvm.fmuladd.f64(double %118, double %130, double %131)
  store double %132, ptr %128, align 8, !tbaa !5
  %133 = getelementptr inbounds double, ptr %128, i64 %5
  %indvars.iv.next195.3 = add nuw nsw i64 %indvars.iv194, 4
  %134 = getelementptr inbounds double, ptr %6, i64 %indvars.iv.next195.2
  %135 = load double, ptr %134, align 8, !tbaa !5
  %136 = load double, ptr %133, align 8, !tbaa !5
  %137 = tail call double @llvm.fmuladd.f64(double %118, double %135, double %136)
  store double %137, ptr %133, align 8, !tbaa !5
  %138 = getelementptr inbounds double, ptr %133, i64 %5
  %niter237.next.3 = add i64 %niter237, 4
  %niter237.ncmp.3 = icmp eq i64 %niter237.next.3, %unroll_iter236
  br i1 %niter237.ncmp.3, label %._crit_edge163.loopexit.unr-lcssa, label %.lr.ph162.new, !llvm.loop !19

._crit_edge163.loopexit.unr-lcssa:                ; preds = %.lr.ph162.new, %.lr.ph162
  %indvars.iv194.unr = phi i64 [ 0, %.lr.ph162 ], [ %indvars.iv.next195.3, %.lr.ph162.new ]
  %.2116159.unr = phi ptr [ %90, %.lr.ph162 ], [ %138, %.lr.ph162.new ]
  br i1 %lcmp.mod235.not, label %._crit_edge163, label %.epil.preheader232

.epil.preheader232:                               ; preds = %._crit_edge163.loopexit.unr-lcssa, %.epil.preheader232
  %indvars.iv194.epil = phi i64 [ %indvars.iv.next195.epil, %.epil.preheader232 ], [ %indvars.iv194.unr, %._crit_edge163.loopexit.unr-lcssa ]
  %.2116159.epil = phi ptr [ %143, %.epil.preheader232 ], [ %.2116159.unr, %._crit_edge163.loopexit.unr-lcssa ]
  %epil.iter234 = phi i64 [ %epil.iter234.next, %.epil.preheader232 ], [ 0, %._crit_edge163.loopexit.unr-lcssa ]
  %indvars.iv.next195.epil = add nuw nsw i64 %indvars.iv194.epil, 1
  %139 = getelementptr inbounds double, ptr %6, i64 %indvars.iv194.epil
  %140 = load double, ptr %139, align 8, !tbaa !5
  %141 = load double, ptr %.2116159.epil, align 8, !tbaa !5
  %142 = tail call double @llvm.fmuladd.f64(double %118, double %140, double %141)
  store double %142, ptr %.2116159.epil, align 8, !tbaa !5
  %143 = getelementptr inbounds double, ptr %.2116159.epil, i64 %5
  %epil.iter234.next = add i64 %epil.iter234, 1
  %epil.iter234.cmp.not = icmp eq i64 %epil.iter234.next, %xtraiter233
  br i1 %epil.iter234.cmp.not, label %._crit_edge163, label %.epil.preheader232, !llvm.loop !20

._crit_edge163:                                   ; preds = %._crit_edge163.loopexit.unr-lcssa, %.epil.preheader232, %._crit_edge157.._crit_edge163_crit_edge
  %.pre-phi200 = phi double [ %.pre199, %._crit_edge157.._crit_edge163_crit_edge ], [ %118, %.epil.preheader232 ], [ %118, %._crit_edge163.loopexit.unr-lcssa ]
  store double %.pre-phi200, ptr %.2112166, align 8, !tbaa !5
  %.0102 = add nuw nsw i32 %.0102167, 1
  %144 = icmp slt i32 %.0102, %2
  br i1 %144, label %89, label %.loopexit, !llvm.loop !21

145:                                              ; preds = %44
  store double 1.000000e+00, ptr %.2120169, align 8, !tbaa !5
  %146 = icmp sgt i32 %.1174, 0
  br i1 %146, label %.lr.ph142.preheader, label %.loopexit

.lr.ph142.preheader:                              ; preds = %145
  %xtraiter210 = and i32 %.1174, 3
  %147 = icmp ult i32 %49, 3
  br i1 %147, label %.loopexit.loopexit207.unr-lcssa, label %.lr.ph142.preheader.new

.lr.ph142.preheader.new:                          ; preds = %.lr.ph142.preheader
  %unroll_iter213 = and i32 %.1174, 2147483644
  br label %.lr.ph142

.lr.ph142:                                        ; preds = %.lr.ph142, %.lr.ph142.preheader.new
  %.2120.pn139 = phi ptr [ %.2120169, %.lr.ph142.preheader.new ], [ %.3113.3, %.lr.ph142 ]
  %.2120.pn124138 = phi ptr [ %.2120169, %.lr.ph142.preheader.new ], [ %.3117.3, %.lr.ph142 ]
  %niter214 = phi i32 [ 0, %.lr.ph142.preheader.new ], [ %niter214.next.3, %.lr.ph142 ]
  %.3117 = getelementptr inbounds i8, ptr %.2120.pn124138, i64 8
  %.3113 = getelementptr inbounds double, ptr %.2120.pn139, i64 %5
  store double 0.000000e+00, ptr %.3117, align 8, !tbaa !5
  store double 0.000000e+00, ptr %.3113, align 8, !tbaa !5
  %.3117.1 = getelementptr inbounds i8, ptr %.2120.pn124138, i64 16
  %.3113.1 = getelementptr inbounds double, ptr %.3113, i64 %5
  store double 0.000000e+00, ptr %.3117.1, align 8, !tbaa !5
  store double 0.000000e+00, ptr %.3113.1, align 8, !tbaa !5
  %.3117.2 = getelementptr inbounds i8, ptr %.2120.pn124138, i64 24
  %.3113.2 = getelementptr inbounds double, ptr %.3113.1, i64 %5
  store double 0.000000e+00, ptr %.3117.2, align 8, !tbaa !5
  store double 0.000000e+00, ptr %.3113.2, align 8, !tbaa !5
  %.3117.3 = getelementptr inbounds i8, ptr %.2120.pn124138, i64 32
  %.3113.3 = getelementptr inbounds double, ptr %.3113.2, i64 %5
  store double 0.000000e+00, ptr %.3117.3, align 8, !tbaa !5
  store double 0.000000e+00, ptr %.3113.3, align 8, !tbaa !5
  %niter214.next.3 = add i32 %niter214, 4
  %niter214.ncmp.3 = icmp eq i32 %niter214.next.3, %unroll_iter213
  br i1 %niter214.ncmp.3, label %.loopexit.loopexit207.unr-lcssa, label %.lr.ph142, !llvm.loop !22

.loopexit.loopexit207.unr-lcssa:                  ; preds = %.lr.ph142, %.lr.ph142.preheader
  %.2120.pn139.unr = phi ptr [ %.2120169, %.lr.ph142.preheader ], [ %.3113.3, %.lr.ph142 ]
  %.2120.pn124138.unr = phi ptr [ %.2120169, %.lr.ph142.preheader ], [ %.3117.3, %.lr.ph142 ]
  %lcmp.mod212.not = icmp eq i32 %xtraiter210, 0
  br i1 %lcmp.mod212.not, label %.loopexit, label %.lr.ph142.epil

.lr.ph142.epil:                                   ; preds = %.loopexit.loopexit207.unr-lcssa, %.lr.ph142.epil
  %.2120.pn139.epil = phi ptr [ %.3113.epil, %.lr.ph142.epil ], [ %.2120.pn139.unr, %.loopexit.loopexit207.unr-lcssa ]
  %.2120.pn124138.epil = phi ptr [ %.3117.epil, %.lr.ph142.epil ], [ %.2120.pn124138.unr, %.loopexit.loopexit207.unr-lcssa ]
  %epil.iter211 = phi i32 [ %epil.iter211.next, %.lr.ph142.epil ], [ 0, %.loopexit.loopexit207.unr-lcssa ]
  %.3117.epil = getelementptr inbounds i8, ptr %.2120.pn124138.epil, i64 8
  %.3113.epil = getelementptr inbounds double, ptr %.2120.pn139.epil, i64 %5
  store double 0.000000e+00, ptr %.3117.epil, align 8, !tbaa !5
  store double 0.000000e+00, ptr %.3113.epil, align 8, !tbaa !5
  %epil.iter211.next = add i32 %epil.iter211, 1
  %epil.iter211.cmp.not = icmp eq i32 %epil.iter211.next, %xtraiter210
  br i1 %epil.iter211.cmp.not, label %.loopexit, label %.lr.ph142.epil, !llvm.loop !23

.loopexit:                                        ; preds = %.loopexit.loopexit207.unr-lcssa, %.lr.ph142.epil, %._crit_edge163, %145, %.preheader
  %148 = add nsw i32 %.2107173, -1
  %149 = add i32 %.1174, 1
  %150 = getelementptr inbounds double, ptr %.1109171, i64 %41
  %151 = getelementptr inbounds double, ptr %.2120169, i64 %42
  %152 = icmp sgt i32 %.2107173, 0
  %indvar.next = add i32 %indvar, 1
  br i1 %152, label %44, label %._crit_edge178, !llvm.loop !24

._crit_edge178:                                   ; preds = %.loopexit, %._crit_edge137.thread
  tail call void @free(ptr noundef %6) #7
  ret void
}

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

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

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) 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 #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #3 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind allocsize(0,1) }
attributes #7 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !10}


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