; LLVM IR from jingweizhanghuai/Morn :: src/math (morn_fit_LSM)

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

%struct.MMatrix = type { i32, i32, ptr }

@.str = external hidden unnamed_addr constant [79 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [17 x i8], align 1
@__FUNCTION__.mPolyFitWeight = external hidden unnamed_addr constant [15 x i8], align 1

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

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) #1

; 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 speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #2

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

declare ptr @MatrixCreate(i32 noundef, i32 noundef, ptr noundef) #1

declare i32 @mLinearEquation(ptr noundef, ptr noundef) #1

declare void @mMatrixRelease(ptr noundef) #1

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @mLinearFitWeight(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) #6

; Function Attrs: nounwind uwtable
declare dso_local void @mParabolaFitWeight(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) #6

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

30:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  %31 = load i32, ptr %12, align 4, !tbaa !9
  %32 = icmp eq i32 %31, 0
  %33 = zext i1 %32 to i32
  store i32 %33, ptr %24, align 4, !tbaa !9
  %34 = load i32, ptr %24, align 4, !tbaa !9
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %36, label %38

36:                                               ; preds = %30
  %37 = load i32, ptr %24, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %37, i32 noundef -1, ptr noundef @.str, i32 noundef 591, ptr noundef @__FUNCTION__.mPolyFitWeight, ptr noundef @.str.6)
  br label %38

38:                                               ; preds = %36, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %39

39:                                               ; preds = %38
  br label %40

40:                                               ; preds = %39
  br label %41

41:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  %42 = load i32, ptr %10, align 4, !tbaa !9
  %43 = load i32, ptr %12, align 4, !tbaa !9
  %44 = add nsw i32 %43, 1
  %45 = icmp slt i32 %42, %44
  %46 = zext i1 %45 to i32
  store i32 %46, ptr %25, align 4, !tbaa !9
  %47 = load i32, ptr %25, align 4, !tbaa !9
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %49, label %51

49:                                               ; preds = %41
  %50 = load i32, ptr %25, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %50, i32 noundef -1, ptr noundef @.str, i32 noundef 592, ptr noundef @__FUNCTION__.mPolyFitWeight, ptr noundef @.str.7)
  br label %51

51:                                               ; preds = %49, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %52

52:                                               ; preds = %51
  br label %53

53:                                               ; preds = %52
  br label %54

54:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = icmp eq ptr %55, null
  br i1 %56, label %70, label %57

57:                                               ; preds = %54
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = ptrtoint ptr %58 to i64
  %60 = icmp eq i64 %59, -1
  br i1 %60, label %70, label %61

61:                                               ; preds = %57
  %62 = load ptr, ptr %8, align 8, !tbaa !5
  %63 = icmp eq ptr %62, null
  br i1 %63, label %68, label %64

64:                                               ; preds = %61
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = ptrtoint ptr %65 to i64
  %67 = icmp eq i64 %66, -1
  br label %68

68:                                               ; preds = %64, %61
  %69 = phi i1 [ true, %61 ], [ %67, %64 ]
  br label %70

70:                                               ; preds = %68, %57, %54
  %71 = phi i1 [ true, %57 ], [ true, %54 ], [ %69, %68 ]
  %72 = zext i1 %71 to i32
  store i32 %72, ptr %26, align 4, !tbaa !9
  %73 = load i32, ptr %26, align 4, !tbaa !9
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %75, label %77

75:                                               ; preds = %70
  %76 = load i32, ptr %26, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %76, i32 noundef -1, ptr noundef @.str, i32 noundef 593, ptr noundef @__FUNCTION__.mPolyFitWeight, ptr noundef @.str.2)
  br label %77

77:                                               ; preds = %75, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %78

78:                                               ; preds = %77
  br label %79

79:                                               ; preds = %78
  br label %80

80:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  %81 = load ptr, ptr %11, align 8, !tbaa !5
  %82 = icmp eq ptr %81, null
  br i1 %82, label %87, label %83

83:                                               ; preds = %80
  %84 = load ptr, ptr %11, align 8, !tbaa !5
  %85 = ptrtoint ptr %84 to i64
  %86 = icmp eq i64 %85, -1
  br label %87

87:                                               ; preds = %83, %80
  %88 = phi i1 [ true, %80 ], [ %86, %83 ]
  %89 = zext i1 %88 to i32
  store i32 %89, ptr %27, align 4, !tbaa !9
  %90 = load i32, ptr %27, align 4, !tbaa !9
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %92, label %94

92:                                               ; preds = %87
  %93 = load i32, ptr %27, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %93, i32 noundef -1, ptr noundef @.str, i32 noundef 594, ptr noundef @__FUNCTION__.mPolyFitWeight, ptr noundef @.str.3)
  br label %94

94:                                               ; preds = %92, %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  br label %95

95:                                               ; preds = %94
  br label %96

96:                                               ; preds = %95
  %97 = load ptr, ptr %9, align 8, !tbaa !5
  %98 = icmp eq ptr %97, null
  br i1 %98, label %103, label %99

99:                                               ; preds = %96
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = ptrtoint ptr %100 to i64
  %102 = icmp eq i64 %101, -1
  br i1 %102, label %103, label %112

103:                                              ; preds = %99, %96
  br label %104

104:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  store i32 -1, ptr %28, align 4, !tbaa !9
  %105 = load i32, ptr %28, align 4, !tbaa !9
  %106 = icmp ne i32 %105, 0
  br i1 %106, label %107, label %109

107:                                              ; preds = %104
  %108 = load i32, ptr %28, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %108, i32 noundef -1, ptr noundef @.str, i32 noundef 596, ptr noundef @__FUNCTION__.mPolyFitWeight, ptr noundef @.str.11)
  br label %109

109:                                              ; preds = %107, %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  br label %110

110:                                              ; preds = %109
  br label %111

111:                                              ; preds = %110
  br label %112

112:                                              ; preds = %111, %99
  %113 = load i32, ptr %12, align 4, !tbaa !9
  %114 = icmp eq i32 %113, 1
  br i1 %114, label %115, label %121

115:                                              ; preds = %112
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  %117 = load ptr, ptr %8, align 8, !tbaa !5
  %118 = load ptr, ptr %9, align 8, !tbaa !5
  %119 = load i32, ptr %10, align 4, !tbaa !9
  %120 = load ptr, ptr %11, align 8, !tbaa !5
  call void @mLinearFitWeight(ptr noundef %116, ptr noundef %117, ptr noundef %118, i32 noundef %119, ptr noundef %120)
  store i32 1, ptr %29, align 4
  br label %343

121:                                              ; preds = %112
  %122 = load i32, ptr %12, align 4, !tbaa !9
  %123 = icmp eq i32 %122, 2
  br i1 %123, label %124, label %130

124:                                              ; preds = %121
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  %126 = load ptr, ptr %8, align 8, !tbaa !5
  %127 = load ptr, ptr %9, align 8, !tbaa !5
  %128 = load i32, ptr %10, align 4, !tbaa !9
  %129 = load ptr, ptr %11, align 8, !tbaa !5
  call void @mParabolaFitWeight(ptr noundef %125, ptr noundef %126, ptr noundef %127, i32 noundef %128, ptr noundef %129)
  store i32 1, ptr %29, align 4
  br label %343

130:                                              ; preds = %121
  %131 = load i32, ptr %12, align 4, !tbaa !9
  %132 = mul nsw i32 %131, 2
  %133 = sext i32 %132 to i64
  %134 = mul i64 %133, 4
  %135 = call noalias ptr @malloc(i64 noundef %134) #8
  store ptr %135, ptr %15, align 8, !tbaa !5
  %136 = load i32, ptr %12, align 4, !tbaa !9
  %137 = sext i32 %136 to i64
  %138 = mul i64 %137, 4
  %139 = call noalias ptr @malloc(i64 noundef %138) #8
  store ptr %139, ptr %16, align 8, !tbaa !5
  %140 = load i32, ptr %12, align 4, !tbaa !9
  %141 = add nsw i32 %140, 1
  %142 = add nsw i32 %141, 0
  %143 = load i32, ptr %12, align 4, !tbaa !9
  %144 = add nsw i32 %143, 2
  %145 = call ptr @MatrixCreate(i32 noundef %142, i32 noundef %144, ptr noundef null)
  store ptr %145, ptr %19, align 8, !tbaa !5
  %146 = load ptr, ptr %15, align 8, !tbaa !5
  %147 = load i32, ptr %12, align 4, !tbaa !9
  %148 = mul nsw i32 %147, 2
  %149 = sext i32 %148 to i64
  %150 = mul i64 %149, 4
  call void @llvm.memset.p0.i64(ptr align 4 %146, i8 0, i64 %150, i1 false)
  %151 = load ptr, ptr %16, align 8, !tbaa !5
  %152 = load i32, ptr %12, align 4, !tbaa !9
  %153 = sext i32 %152 to i64
  %154 = mul i64 %153, 4
  call void @llvm.memset.p0.i64(ptr align 4 %151, i8 0, i64 %154, i1 false)
  store float 0.000000e+00, ptr %17, align 4, !tbaa !11
  store float 0.000000e+00, ptr %18, align 4, !tbaa !11
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %155

155:                                              ; preds = %233, %130
  %156 = load i32, ptr %13, align 4, !tbaa !9
  %157 = load i32, ptr %10, align 4, !tbaa !9
  %158 = icmp slt i32 %156, %157
  br i1 %158, label %159, label %236

159:                                              ; preds = %155
  %160 = load ptr, ptr %7, align 8, !tbaa !5
  %161 = load i32, ptr %13, align 4, !tbaa !9
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds float, ptr %160, i64 %162
  %164 = load float, ptr %163, align 4, !tbaa !11
  store float %164, ptr %20, align 4, !tbaa !11
  %165 = load ptr, ptr %8, align 8, !tbaa !5
  %166 = load i32, ptr %13, align 4, !tbaa !9
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds float, ptr %165, i64 %167
  %169 = load float, ptr %168, align 4, !tbaa !11
  store float %169, ptr %21, align 4, !tbaa !11
  %170 = load ptr, ptr %9, align 8, !tbaa !5
  %171 = load i32, ptr %13, align 4, !tbaa !9
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds float, ptr %170, i64 %172
  %174 = load float, ptr %173, align 4, !tbaa !11
  store float %174, ptr %22, align 4, !tbaa !11
  store float 1.000000e+00, ptr %23, align 4, !tbaa !11
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %175

175:                                              ; preds = %196, %159
  %176 = load i32, ptr %14, align 4, !tbaa !9
  %177 = load i32, ptr %12, align 4, !tbaa !9
  %178 = mul nsw i32 %177, 2
  %179 = icmp slt i32 %176, %178
  br i1 %179, label %180, label %199

180:                                              ; preds = %175
  %181 = load float, ptr %23, align 4, !tbaa !11
  %182 = load float, ptr %20, align 4, !tbaa !11
  %183 = fmul float %181, %182
  store float %183, ptr %23, align 4, !tbaa !11
  %184 = load ptr, ptr %15, align 8, !tbaa !5
  %185 = load i32, ptr %14, align 4, !tbaa !9
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds float, ptr %184, i64 %186
  %188 = load float, ptr %187, align 4, !tbaa !11
  %189 = load float, ptr %22, align 4, !tbaa !11
  %190 = load float, ptr %23, align 4, !tbaa !11
  %191 = call float @llvm.fmuladd.f32(float %189, float %190, float %188)
  %192 = load ptr, ptr %15, align 8, !tbaa !5
  %193 = load i32, ptr %14, align 4, !tbaa !9
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds float, ptr %192, i64 %194
  store float %191, ptr %195, align 4, !tbaa !11
  br label %196

196:                                              ; preds = %180
  %197 = load i32, ptr %14, align 4, !tbaa !9
  %198 = add nsw i32 %197, 1
  store i32 %198, ptr %14, align 4, !tbaa !9
  br label %175, !llvm.loop !13

199:                                              ; preds = %175
  store float 1.000000e+00, ptr %23, align 4, !tbaa !11
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %200

200:                                              ; preds = %222, %199
  %201 = load i32, ptr %14, align 4, !tbaa !9
  %202 = load i32, ptr %12, align 4, !tbaa !9
  %203 = icmp slt i32 %201, %202
  br i1 %203, label %204, label %225

204:                                              ; preds = %200
  %205 = load float, ptr %23, align 4, !tbaa !11
  %206 = load float, ptr %20, align 4, !tbaa !11
  %207 = fmul float %205, %206
  store float %207, ptr %23, align 4, !tbaa !11
  %208 = load ptr, ptr %16, align 8, !tbaa !5
  %209 = load i32, ptr %14, align 4, !tbaa !9
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds float, ptr %208, i64 %210
  %212 = load float, ptr %211, align 4, !tbaa !11
  %213 = load float, ptr %22, align 4, !tbaa !11
  %214 = load float, ptr %23, align 4, !tbaa !11
  %215 = fmul float %213, %214
  %216 = load float, ptr %21, align 4, !tbaa !11
  %217 = call float @llvm.fmuladd.f32(float %215, float %216, float %212)
  %218 = load ptr, ptr %16, align 8, !tbaa !5
  %219 = load i32, ptr %14, align 4, !tbaa !9
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds float, ptr %218, i64 %220
  store float %217, ptr %221, align 4, !tbaa !11
  br label %222

222:                                              ; preds = %204
  %223 = load i32, ptr %14, align 4, !tbaa !9
  %224 = add nsw i32 %223, 1
  store i32 %224, ptr %14, align 4, !tbaa !9
  br label %200, !llvm.loop !15

225:                                              ; preds = %200
  %226 = load float, ptr %17, align 4, !tbaa !11
  %227 = load float, ptr %22, align 4, !tbaa !11
  %228 = load float, ptr %21, align 4, !tbaa !11
  %229 = call float @llvm.fmuladd.f32(float %227, float %228, float %226)
  store float %229, ptr %17, align 4, !tbaa !11
  %230 = load float, ptr %18, align 4, !tbaa !11
  %231 = load float, ptr %22, align 4, !tbaa !11
  %232 = fadd float %230, %231
  store float %232, ptr %18, align 4, !tbaa !11
  br label %233

233:                                              ; preds = %225
  %234 = load i32, ptr %13, align 4, !tbaa !9
  %235 = add nsw i32 %234, 1
  store i32 %235, ptr %13, align 4, !tbaa !9
  br label %155, !llvm.loop !16

236:                                              ; preds = %155
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %237

237:                                              ; preds = %258, %236
  %238 = load i32, ptr %13, align 4, !tbaa !9
  %239 = load i32, ptr %12, align 4, !tbaa !9
  %240 = icmp slt i32 %238, %239
  br i1 %240, label %241, label %261

241:                                              ; preds = %237
  %242 = load ptr, ptr %15, align 8, !tbaa !5
  %243 = load i32, ptr %12, align 4, !tbaa !9
  %244 = load i32, ptr %13, align 4, !tbaa !9
  %245 = sub nsw i32 %243, %244
  %246 = sub nsw i32 %245, 1
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds float, ptr %242, i64 %247
  %249 = load float, ptr %248, align 4, !tbaa !11
  %250 = load ptr, ptr %19, align 8, !tbaa !5
  %251 = getelementptr inbounds %struct.MMatrix, ptr %250, i32 0, i32 2
  %252 = load ptr, ptr %251, align 8, !tbaa !17
  %253 = getelementptr inbounds ptr, ptr %252, i64 0
  %254 = load ptr, ptr %253, align 8, !tbaa !5
  %255 = load i32, ptr %13, align 4, !tbaa !9
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds float, ptr %254, i64 %256
  store float %249, ptr %257, align 4, !tbaa !11
  br label %258

258:                                              ; preds = %241
  %259 = load i32, ptr %13, align 4, !tbaa !9
  %260 = add nsw i32 %259, 1
  store i32 %260, ptr %13, align 4, !tbaa !9
  br label %237, !llvm.loop !19

261:                                              ; preds = %237
  %262 = load float, ptr %18, align 4, !tbaa !11
  %263 = load ptr, ptr %19, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.MMatrix, ptr %263, i32 0, i32 2
  %265 = load ptr, ptr %264, align 8, !tbaa !17
  %266 = getelementptr inbounds ptr, ptr %265, i64 0
  %267 = load ptr, ptr %266, align 8, !tbaa !5
  %268 = load i32, ptr %12, align 4, !tbaa !9
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds float, ptr %267, i64 %269
  store float %262, ptr %270, align 4, !tbaa !11
  %271 = load float, ptr %17, align 4, !tbaa !11
  %272 = fsub float 0.000000e+00, %271
  %273 = load ptr, ptr %19, align 8, !tbaa !5
  %274 = getelementptr inbounds %struct.MMatrix, ptr %273, i32 0, i32 2
  %275 = load ptr, ptr %274, align 8, !tbaa !17
  %276 = getelementptr inbounds ptr, ptr %275, i64 0
  %277 = load ptr, ptr %276, align 8, !tbaa !5
  %278 = load i32, ptr %12, align 4, !tbaa !9
  %279 = add nsw i32 %278, 1
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds float, ptr %277, i64 %280
  store float %272, ptr %281, align 4, !tbaa !11
  store i32 1, ptr %14, align 4, !tbaa !9
  br label %282

282:                                              ; preds = %333, %261
  %283 = load i32, ptr %14, align 4, !tbaa !9
  %284 = load i32, ptr %12, align 4, !tbaa !9
  %285 = icmp sle i32 %283, %284
  br i1 %285, label %286, label %336

286:                                              ; preds = %282
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %287

287:                                              ; preds = %312, %286
  %288 = load i32, ptr %13, align 4, !tbaa !9
  %289 = load i32, ptr %12, align 4, !tbaa !9
  %290 = icmp sle i32 %288, %289
  br i1 %290, label %291, label %315

291:                                              ; preds = %287
  %292 = load ptr, ptr %15, align 8, !tbaa !5
  %293 = load i32, ptr %12, align 4, !tbaa !9
  %294 = load i32, ptr %14, align 4, !tbaa !9
  %295 = add nsw i32 %293, %294
  %296 = load i32, ptr %13, align 4, !tbaa !9
  %297 = sub nsw i32 %295, %296
  %298 = sub nsw i32 %297, 1
  %299 = sext i32 %298 to i64
  %300 = getelementptr inbounds float, ptr %292, i64 %299
  %301 = load float, ptr %300, align 4, !tbaa !11
  %302 = load ptr, ptr %19, align 8, !tbaa !5
  %303 = getelementptr inbounds %struct.MMatrix, ptr %302, i32 0, i32 2
  %304 = load ptr, ptr %303, align 8, !tbaa !17
  %305 = load i32, ptr %14, align 4, !tbaa !9
  %306 = sext i32 %305 to i64
  %307 = getelementptr inbounds ptr, ptr %304, i64 %306
  %308 = load ptr, ptr %307, align 8, !tbaa !5
  %309 = load i32, ptr %13, align 4, !tbaa !9
  %310 = sext i32 %309 to i64
  %311 = getelementptr inbounds float, ptr %308, i64 %310
  store float %301, ptr %311, align 4, !tbaa !11
  br label %312

312:                                              ; preds = %291
  %313 = load i32, ptr %13, align 4, !tbaa !9
  %314 = add nsw i32 %313, 1
  store i32 %314, ptr %13, align 4, !tbaa !9
  br label %287, !llvm.loop !20

315:                                              ; preds = %287
  %316 = load ptr, ptr %16, align 8, !tbaa !5
  %317 = load i32, ptr %14, align 4, !tbaa !9
  %318 = sub nsw i32 %317, 1
  %319 = sext i32 %318 to i64
  %320 = getelementptr inbounds float, ptr %316, i64 %319
  %321 = load float, ptr %320, align 4, !tbaa !11
  %322 = fsub float 0.000000e+00, %321
  %323 = load ptr, ptr %19, align 8, !tbaa !5
  %324 = getelementptr inbounds %struct.MMatrix, ptr %323, i32 0, i32 2
  %325 = load ptr, ptr %324, align 8, !tbaa !17
  %326 = load i32, ptr %14, align 4, !tbaa !9
  %327 = sext i32 %326 to i64
  %328 = getelementptr inbounds ptr, ptr %325, i64 %327
  %329 = load ptr, ptr %328, align 8, !tbaa !5
  %330 = load i32, ptr %13, align 4, !tbaa !9
  %331 = sext i32 %330 to i64
  %332 = getelementptr inbounds float, ptr %329, i64 %331
  store float %322, ptr %332, align 4, !tbaa !11
  br label %333

333:                                              ; preds = %315
  %334 = load i32, ptr %14, align 4, !tbaa !9
  %335 = add nsw i32 %334, 1
  store i32 %335, ptr %14, align 4, !tbaa !9
  br label %282, !llvm.loop !21

336:                                              ; preds = %282
  %337 = load ptr, ptr %19, align 8, !tbaa !5
  %338 = load ptr, ptr %11, align 8, !tbaa !5
  %339 = call i32 @mLinearEquation(ptr noundef %337, ptr noundef %338)
  %340 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free(ptr noundef %340) #7
  %341 = load ptr, ptr %16, align 8, !tbaa !5
  call void @free(ptr noundef %341) #7
  %342 = load ptr, ptr %19, align 8, !tbaa !5
  call void @mMatrixRelease(ptr noundef %342)
  store i32 0, ptr %29, align 4
  br label %343

343:                                              ; preds = %336, %124, %115
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  %344 = load i32, ptr %29, align 4
  switch i32 %344, label %346 [
    i32 0, label %345
    i32 1, label %345
  ]

345:                                              ; preds = %343, %343
  ret void

346:                                              ; preds = %343
  unreachable
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind 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 #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = !{!18, !6, i64 8}
!18 = !{!"MMatrix", !10, i64 0, !10, i64 4, !6, i64 8}
!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"

@.str = external hidden unnamed_addr constant [79 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [17 x i8], align 1
@__FUNCTION__.mPolyFitWeight = external hidden unnamed_addr constant [15 x i8], align 1

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #0

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

declare ptr @MatrixCreate(i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

declare i32 @mLinearEquation(ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @mMatrixRelease(ptr noundef) local_unnamed_addr #0

; 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: nounwind uwtable
declare dso_local void @mLinearFitWeight(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local void @mParabolaFitWeight(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local void @mPolyFitWeight(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4, i32 noundef %5) local_unnamed_addr #3 {
  %7 = icmp eq i32 %5, 0
  br i1 %7, label %8, label %9

8:                                                ; preds = %6
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 591, ptr noundef nonnull @__FUNCTION__.mPolyFitWeight, ptr noundef nonnull @.str.6) #6
  br label %9

9:                                                ; preds = %8, %6
  %10 = add i32 %5, 1
  %.not131 = icmp slt i32 %5, %3
  br i1 %.not131, label %12, label %11

11:                                               ; preds = %9
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 592, ptr noundef nonnull @__FUNCTION__.mPolyFitWeight, ptr noundef nonnull @.str.7) #6
  br label %12

12:                                               ; preds = %11, %9
  %magicptr = ptrtoint ptr %0 to i64
  switch i64 %magicptr, label %13 [
    i64 -1, label %.thread
    i64 0, label %.thread
  ]

13:                                               ; preds = %12
  %magicptr130 = ptrtoint ptr %1 to i64
  switch i64 %magicptr130, label %14 [
    i64 -1, label %.thread
    i64 0, label %.thread
  ]

.thread:                                          ; preds = %13, %13, %12, %12
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 593, ptr noundef nonnull @__FUNCTION__.mPolyFitWeight, ptr noundef nonnull @.str.2) #6
  br label %14

14:                                               ; preds = %13, %.thread
  %magicptr128 = ptrtoint ptr %4 to i64
  switch i64 %magicptr128, label %20 [
    i64 -1, label %15
    i64 0, label %15
  ]

15:                                               ; preds = %14, %14
  %16 = icmp eq ptr %4, null
  %17 = icmp eq ptr %4, inttoptr (i64 -1 to ptr)
  %18 = or i1 %16, %17
  %19 = zext i1 %18 to i32
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %19, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 594, ptr noundef nonnull @__FUNCTION__.mPolyFitWeight, ptr noundef nonnull @.str.3) #6
  br label %20

20:                                               ; preds = %14, %15
  %magicptr129 = ptrtoint ptr %2 to i64
  switch i64 %magicptr129, label %22 [
    i64 -1, label %21
    i64 0, label %21
  ]

21:                                               ; preds = %20, %20
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef -1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 596, ptr noundef nonnull @__FUNCTION__.mPolyFitWeight, ptr noundef nonnull @.str.11) #6
  br label %22

22:                                               ; preds = %20, %21
  switch i32 %5, label %25 [
    i32 1, label %23
    i32 2, label %24
  ]

23:                                               ; preds = %22
  tail call void @mLinearFitWeight(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4)
  br label %142

24:                                               ; preds = %22
  tail call void @mParabolaFitWeight(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4)
  br label %142

25:                                               ; preds = %22
  %26 = shl nsw i32 %5, 1
  %27 = sext i32 %26 to i64
  %28 = shl nsw i64 %27, 2
  %calloc = tail call ptr @calloc(i64 1, i64 %28)
  %29 = sext i32 %5 to i64
  %30 = shl nsw i64 %29, 2
  %calloc234 = tail call ptr @calloc(i64 1, i64 %30)
  %31 = add nsw i32 %5, 2
  %32 = tail call ptr @MatrixCreate(i32 noundef %10, i32 noundef %31, ptr noundef null) #6
  %33 = icmp sgt i32 %3, 0
  br i1 %33, label %.lr.ph143, label %.preheader132

.lr.ph143:                                        ; preds = %25
  %34 = icmp sgt i32 %5, 0
  br i1 %34, label %.lr.ph.us.us.preheader, label %.preheader133.preheader

.lr.ph.us.us.preheader:                           ; preds = %.lr.ph143
  %smax = tail call i32 @llvm.smax.i32(i32 %26, i32 1)
  %wide.trip.count214 = zext nneg i32 %3 to i64
  %wide.trip.count204 = zext nneg i32 %smax to i64
  %wide.trip.count209 = zext nneg i32 %5 to i64
  %xtraiter270 = and i64 %wide.trip.count204, 1
  %35 = icmp eq i32 %smax, 1
  %unroll_iter273 = and i64 %wide.trip.count204, 2147483646
  %lcmp.mod272.not = icmp eq i64 %xtraiter270, 0
  %xtraiter275 = and i64 %wide.trip.count209, 1
  %36 = icmp eq i32 %5, 1
  %unroll_iter278 = and i64 %wide.trip.count209, 2147483646
  %lcmp.mod277.not = icmp eq i64 %xtraiter275, 0
  br label %.lr.ph.us.us

.lr.ph.us.us:                                     ; preds = %.lr.ph.us.us.preheader, %._crit_edge.us.us
  %indvars.iv211 = phi i64 [ 0, %.lr.ph.us.us.preheader ], [ %indvars.iv.next212, %._crit_edge.us.us ]
  %.0122140.us.us = phi float [ 0.000000e+00, %.lr.ph.us.us.preheader ], [ %70, %._crit_edge.us.us ]
  %.0123139.us.us = phi float [ 0.000000e+00, %.lr.ph.us.us.preheader ], [ %71, %._crit_edge.us.us ]
  %37 = getelementptr inbounds float, ptr %0, i64 %indvars.iv211
  %38 = load float, ptr %37, align 4, !tbaa !5
  %39 = getelementptr inbounds float, ptr %1, i64 %indvars.iv211
  %40 = load float, ptr %39, align 4, !tbaa !5
  %41 = getelementptr inbounds float, ptr %2, i64 %indvars.iv211
  %42 = load float, ptr %41, align 4, !tbaa !5
  br i1 %35, label %..preheader133_crit_edge.us.us.preheader.unr-lcssa, label %.lr.ph.us.us.new

..preheader133_crit_edge.us.us:                   ; preds = %..preheader133_crit_edge.us.us.preheader, %..preheader133_crit_edge.us.us
  %indvars.iv206 = phi i64 [ %indvars.iv.next207.1, %..preheader133_crit_edge.us.us ], [ 0, %..preheader133_crit_edge.us.us.preheader ]
  %.1125136.us.us = phi float [ %48, %..preheader133_crit_edge.us.us ], [ 1.000000e+00, %..preheader133_crit_edge.us.us.preheader ]
  %niter279 = phi i64 [ %niter279.next.1, %..preheader133_crit_edge.us.us ], [ 0, %..preheader133_crit_edge.us.us.preheader ]
  %43 = fmul float %38, %.1125136.us.us
  %44 = getelementptr inbounds float, ptr %calloc234, i64 %indvars.iv206
  %45 = load float, ptr %44, align 4, !tbaa !5
  %46 = fmul float %42, %43
  %47 = tail call float @llvm.fmuladd.f32(float %46, float %40, float %45)
  store float %47, ptr %44, align 4, !tbaa !5
  %indvars.iv.next207 = or disjoint i64 %indvars.iv206, 1
  %48 = fmul float %38, %43
  %49 = getelementptr inbounds float, ptr %calloc234, i64 %indvars.iv.next207
  %50 = load float, ptr %49, align 4, !tbaa !5
  %51 = fmul float %42, %48
  %52 = tail call float @llvm.fmuladd.f32(float %51, float %40, float %50)
  store float %52, ptr %49, align 4, !tbaa !5
  %indvars.iv.next207.1 = add nuw nsw i64 %indvars.iv206, 2
  %niter279.next.1 = add i64 %niter279, 2
  %niter279.ncmp.1 = icmp eq i64 %niter279.next.1, %unroll_iter278
  br i1 %niter279.ncmp.1, label %._crit_edge.us.us.unr-lcssa, label %..preheader133_crit_edge.us.us, !llvm.loop !9

.lr.ph.us.us.new:                                 ; preds = %.lr.ph.us.us, %.lr.ph.us.us.new
  %indvars.iv201 = phi i64 [ %indvars.iv.next202.1, %.lr.ph.us.us.new ], [ 0, %.lr.ph.us.us ]
  %.0124134.us.us = phi float [ %57, %.lr.ph.us.us.new ], [ 1.000000e+00, %.lr.ph.us.us ]
  %niter274 = phi i64 [ %niter274.next.1, %.lr.ph.us.us.new ], [ 0, %.lr.ph.us.us ]
  %53 = fmul float %38, %.0124134.us.us
  %54 = getelementptr inbounds float, ptr %calloc, i64 %indvars.iv201
  %55 = load float, ptr %54, align 4, !tbaa !5
  %56 = tail call float @llvm.fmuladd.f32(float %42, float %53, float %55)
  store float %56, ptr %54, align 4, !tbaa !5
  %indvars.iv.next202 = or disjoint i64 %indvars.iv201, 1
  %57 = fmul float %38, %53
  %58 = getelementptr inbounds float, ptr %calloc, i64 %indvars.iv.next202
  %59 = load float, ptr %58, align 4, !tbaa !5
  %60 = tail call float @llvm.fmuladd.f32(float %42, float %57, float %59)
  store float %60, ptr %58, align 4, !tbaa !5
  %indvars.iv.next202.1 = add nuw nsw i64 %indvars.iv201, 2
  %niter274.next.1 = add i64 %niter274, 2
  %niter274.ncmp.1 = icmp eq i64 %niter274.next.1, %unroll_iter273
  br i1 %niter274.ncmp.1, label %..preheader133_crit_edge.us.us.preheader.unr-lcssa, label %.lr.ph.us.us.new, !llvm.loop !11

..preheader133_crit_edge.us.us.preheader.unr-lcssa: ; preds = %.lr.ph.us.us.new, %.lr.ph.us.us
  %indvars.iv201.unr = phi i64 [ 0, %.lr.ph.us.us ], [ %indvars.iv.next202.1, %.lr.ph.us.us.new ]
  %.0124134.us.us.unr = phi float [ 1.000000e+00, %.lr.ph.us.us ], [ %57, %.lr.ph.us.us.new ]
  br i1 %lcmp.mod272.not, label %..preheader133_crit_edge.us.us.preheader, label %..preheader133_crit_edge.us.us.preheader.epilog-lcssa

..preheader133_crit_edge.us.us.preheader.epilog-lcssa: ; preds = %..preheader133_crit_edge.us.us.preheader.unr-lcssa
  %61 = fmul float %38, %.0124134.us.us.unr
  %62 = getelementptr inbounds float, ptr %calloc, i64 %indvars.iv201.unr
  %63 = load float, ptr %62, align 4, !tbaa !5
  %64 = tail call float @llvm.fmuladd.f32(float %42, float %61, float %63)
  store float %64, ptr %62, align 4, !tbaa !5
  br label %..preheader133_crit_edge.us.us.preheader

..preheader133_crit_edge.us.us.preheader:         ; preds = %..preheader133_crit_edge.us.us.preheader.unr-lcssa, %..preheader133_crit_edge.us.us.preheader.epilog-lcssa
  br i1 %36, label %._crit_edge.us.us.unr-lcssa, label %..preheader133_crit_edge.us.us

._crit_edge.us.us.unr-lcssa:                      ; preds = %..preheader133_crit_edge.us.us, %..preheader133_crit_edge.us.us.preheader
  %indvars.iv206.unr = phi i64 [ 0, %..preheader133_crit_edge.us.us.preheader ], [ %indvars.iv.next207.1, %..preheader133_crit_edge.us.us ]
  %.1125136.us.us.unr = phi float [ 1.000000e+00, %..preheader133_crit_edge.us.us.preheader ], [ %48, %..preheader133_crit_edge.us.us ]
  br i1 %lcmp.mod277.not, label %._crit_edge.us.us, label %..preheader133_crit_edge.us.us.epil

..preheader133_crit_edge.us.us.epil:              ; preds = %._crit_edge.us.us.unr-lcssa
  %65 = fmul float %38, %.1125136.us.us.unr
  %66 = getelementptr inbounds float, ptr %calloc234, i64 %indvars.iv206.unr
  %67 = load float, ptr %66, align 4, !tbaa !5
  %68 = fmul float %42, %65
  %69 = tail call float @llvm.fmuladd.f32(float %68, float %40, float %67)
  store float %69, ptr %66, align 4, !tbaa !5
  br label %._crit_edge.us.us

._crit_edge.us.us:                                ; preds = %._crit_edge.us.us.unr-lcssa, %..preheader133_crit_edge.us.us.epil
  %70 = tail call float @llvm.fmuladd.f32(float %42, float %40, float %.0122140.us.us)
  %71 = fadd float %.0123139.us.us, %42
  %indvars.iv.next212 = add nuw nsw i64 %indvars.iv211, 1
  %exitcond215.not = icmp eq i64 %indvars.iv.next212, %wide.trip.count214
  br i1 %exitcond215.not, label %.preheader132, label %.lr.ph.us.us, !llvm.loop !12

.preheader133.preheader:                          ; preds = %.lr.ph143
  %wide.trip.count = zext nneg i32 %3 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %72 = icmp ult i32 %3, 4
  br i1 %72, label %.preheader132.loopexit265.unr-lcssa, label %.preheader133.preheader.new

.preheader133.preheader.new:                      ; preds = %.preheader133.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %.preheader133

.preheader132.loopexit265.unr-lcssa:              ; preds = %.preheader133, %.preheader133.preheader
  %.lcssa267.ph = phi float [ poison, %.preheader133.preheader ], [ %116, %.preheader133 ]
  %.lcssa266.ph = phi float [ poison, %.preheader133.preheader ], [ %117, %.preheader133 ]
  %indvars.iv.unr = phi i64 [ 0, %.preheader133.preheader ], [ %indvars.iv.next.3, %.preheader133 ]
  %.0122140.unr = phi float [ 0.000000e+00, %.preheader133.preheader ], [ %116, %.preheader133 ]
  %.0123139.unr = phi float [ 0.000000e+00, %.preheader133.preheader ], [ %117, %.preheader133 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader132, label %.preheader133.epil

.preheader133.epil:                               ; preds = %.preheader132.loopexit265.unr-lcssa, %.preheader133.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.preheader133.epil ], [ %indvars.iv.unr, %.preheader132.loopexit265.unr-lcssa ]
  %.0122140.epil = phi float [ %77, %.preheader133.epil ], [ %.0122140.unr, %.preheader132.loopexit265.unr-lcssa ]
  %.0123139.epil = phi float [ %78, %.preheader133.epil ], [ %.0123139.unr, %.preheader132.loopexit265.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.preheader133.epil ], [ 0, %.preheader132.loopexit265.unr-lcssa ]
  %73 = getelementptr inbounds float, ptr %1, i64 %indvars.iv.epil
  %74 = load float, ptr %73, align 4, !tbaa !5
  %75 = getelementptr inbounds float, ptr %2, i64 %indvars.iv.epil
  %76 = load float, ptr %75, align 4, !tbaa !5
  %77 = tail call float @llvm.fmuladd.f32(float %76, float %74, float %.0122140.epil)
  %78 = fadd float %.0123139.epil, %76
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader132, label %.preheader133.epil, !llvm.loop !13

.preheader132:                                    ; preds = %.preheader132.loopexit265.unr-lcssa, %.preheader133.epil, %._crit_edge.us.us, %25
  %.0123.lcssa = phi float [ 0.000000e+00, %25 ], [ %71, %._crit_edge.us.us ], [ %.lcssa266.ph, %.preheader132.loopexit265.unr-lcssa ], [ %78, %.preheader133.epil ]
  %.0122.lcssa = phi float [ 0.000000e+00, %25 ], [ %70, %._crit_edge.us.us ], [ %.lcssa267.ph, %.preheader132.loopexit265.unr-lcssa ], [ %77, %.preheader133.epil ]
  %79 = icmp sgt i32 %5, 0
  %80 = getelementptr inbounds i8, ptr %32, i64 8
  %81 = load ptr, ptr %80, align 8, !tbaa !15
  %82 = load ptr, ptr %81, align 8, !tbaa !19
  br i1 %79, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %.preheader132
  %83 = getelementptr inbounds float, ptr %82, i64 %29
  store float %.0123.lcssa, ptr %83, align 4, !tbaa !5
  %84 = fsub float 0.000000e+00, %.0122.lcssa
  %85 = sext i32 %10 to i64
  %86 = getelementptr inbounds float, ptr %82, i64 %85
  store float %84, ptr %86, align 4, !tbaa !5
  br label %._crit_edge168

.lr.ph:                                           ; preds = %.preheader132
  %wide.trip.count219 = zext nneg i32 %5 to i64
  %invariant.gep239 = getelementptr float, ptr %calloc, i64 %29
  %min.iters.check = icmp ult i32 %5, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

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

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %wide.trip.count219, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %87 = xor i64 %index, -1
  %88 = getelementptr float, ptr %invariant.gep239, i64 %87
  %89 = getelementptr i8, ptr %88, i64 -12
  %90 = getelementptr i8, ptr %88, i64 -28
  %wide.load = load <4 x float>, ptr %89, align 4, !tbaa !5
  %reverse = shufflevector <4 x float> %wide.load, <4 x float> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %wide.load247 = load <4 x float>, ptr %90, align 4, !tbaa !5
  %reverse248 = shufflevector <4 x float> %wide.load247, <4 x float> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %91 = getelementptr inbounds float, ptr %82, i64 %index
  %92 = getelementptr inbounds i8, ptr %91, i64 16
  store <4 x float> %reverse, ptr %91, align 4, !tbaa !5
  store <4 x float> %reverse248, ptr %92, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %93 = icmp eq i64 %index.next, %n.vec
  br i1 %93, label %middle.block, label %vector.body, !llvm.loop !20

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count219
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

.preheader133:                                    ; preds = %.preheader133, %.preheader133.preheader.new
  %indvars.iv = phi i64 [ 0, %.preheader133.preheader.new ], [ %indvars.iv.next.3, %.preheader133 ]
  %.0122140 = phi float [ 0.000000e+00, %.preheader133.preheader.new ], [ %116, %.preheader133 ]
  %.0123139 = phi float [ 0.000000e+00, %.preheader133.preheader.new ], [ %117, %.preheader133 ]
  %niter = phi i64 [ 0, %.preheader133.preheader.new ], [ %niter.next.3, %.preheader133 ]
  %94 = getelementptr inbounds float, ptr %1, i64 %indvars.iv
  %95 = load float, ptr %94, align 4, !tbaa !5
  %96 = getelementptr inbounds float, ptr %2, i64 %indvars.iv
  %97 = load float, ptr %96, align 4, !tbaa !5
  %98 = tail call float @llvm.fmuladd.f32(float %97, float %95, float %.0122140)
  %99 = fadd float %.0123139, %97
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %100 = getelementptr inbounds float, ptr %1, i64 %indvars.iv.next
  %101 = load float, ptr %100, align 4, !tbaa !5
  %102 = getelementptr inbounds float, ptr %2, i64 %indvars.iv.next
  %103 = load float, ptr %102, align 4, !tbaa !5
  %104 = tail call float @llvm.fmuladd.f32(float %103, float %101, float %98)
  %105 = fadd float %99, %103
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %106 = getelementptr inbounds float, ptr %1, i64 %indvars.iv.next.1
  %107 = load float, ptr %106, align 4, !tbaa !5
  %108 = getelementptr inbounds float, ptr %2, i64 %indvars.iv.next.1
  %109 = load float, ptr %108, align 4, !tbaa !5
  %110 = tail call float @llvm.fmuladd.f32(float %109, float %107, float %104)
  %111 = fadd float %105, %109
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %112 = getelementptr inbounds float, ptr %1, i64 %indvars.iv.next.2
  %113 = load float, ptr %112, align 4, !tbaa !5
  %114 = getelementptr inbounds float, ptr %2, i64 %indvars.iv.next.2
  %115 = load float, ptr %114, align 4, !tbaa !5
  %116 = tail call float @llvm.fmuladd.f32(float %115, float %113, float %110)
  %117 = fadd float %111, %115
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader132.loopexit265.unr-lcssa, label %.preheader133, !llvm.loop !12

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv216 = phi i64 [ %indvars.iv.next217, %scalar.ph ], [ %indvars.iv216.ph, %scalar.ph.preheader ]
  %118 = xor i64 %indvars.iv216, -1
  %gep240 = getelementptr float, ptr %invariant.gep239, i64 %118
  %119 = load float, ptr %gep240, align 4, !tbaa !5
  %120 = getelementptr inbounds float, ptr %82, i64 %indvars.iv216
  store float %119, ptr %120, align 4, !tbaa !5
  %indvars.iv.next217 = add nuw nsw i64 %indvars.iv216, 1
  %exitcond220.not = icmp eq i64 %indvars.iv.next217, %wide.trip.count219
  br i1 %exitcond220.not, label %._crit_edge, label %scalar.ph, !llvm.loop !23

._crit_edge:                                      ; preds = %scalar.ph, %middle.block
  %121 = getelementptr inbounds float, ptr %82, i64 %29
  store float %.0123.lcssa, ptr %121, align 4, !tbaa !5
  %122 = fsub float 0.000000e+00, %.0122.lcssa
  %123 = sext i32 %10 to i64
  %124 = getelementptr inbounds float, ptr %82, i64 %123
  store float %122, ptr %124, align 4, !tbaa !5
  %invariant.gep = getelementptr i8, ptr %calloc234, i64 -4
  %wide.trip.count229 = zext i32 %10 to i64
  %invariant.gep241 = getelementptr float, ptr %calloc, i64 %29
  %min.iters.check251 = icmp ult i32 %10, 8
  %n.vec254 = and i64 %wide.trip.count229, 4294967288
  %cmp.n263 = icmp eq i64 %n.vec254, %wide.trip.count229
  br label %.preheader

.preheader:                                       ; preds = %._crit_edge, %._crit_edge164
  %indvars.iv226 = phi i64 [ 1, %._crit_edge ], [ %indvars.iv.next227, %._crit_edge164 ]
  %125 = getelementptr inbounds ptr, ptr %81, i64 %indvars.iv226
  %126 = load ptr, ptr %125, align 8, !tbaa !19
  %gep242 = getelementptr float, ptr %invariant.gep241, i64 %indvars.iv226
  br i1 %min.iters.check251, label %scalar.ph250.preheader, label %vector.body256

vector.body256:                                   ; preds = %.preheader, %vector.body256
  %index257 = phi i64 [ %index.next262, %vector.body256 ], [ 0, %.preheader ]
  %127 = xor i64 %index257, -1
  %128 = getelementptr float, ptr %gep242, i64 %127
  %129 = getelementptr i8, ptr %128, i64 -12
  %130 = getelementptr i8, ptr %128, i64 -28
  %wide.load258 = load <4 x float>, ptr %129, align 4, !tbaa !5
  %reverse259 = shufflevector <4 x float> %wide.load258, <4 x float> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %wide.load260 = load <4 x float>, ptr %130, align 4, !tbaa !5
  %reverse261 = shufflevector <4 x float> %wide.load260, <4 x float> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %131 = getelementptr inbounds float, ptr %126, i64 %index257
  %132 = getelementptr inbounds i8, ptr %131, i64 16
  store <4 x float> %reverse259, ptr %131, align 4, !tbaa !5
  store <4 x float> %reverse261, ptr %132, align 4, !tbaa !5
  %index.next262 = add nuw i64 %index257, 8
  %133 = icmp eq i64 %index.next262, %n.vec254
  br i1 %133, label %middle.block249, label %vector.body256, !llvm.loop !24

middle.block249:                                  ; preds = %vector.body256
  br i1 %cmp.n263, label %._crit_edge164, label %scalar.ph250.preheader

scalar.ph250.preheader:                           ; preds = %middle.block249, %.preheader
  %indvars.iv221.ph = phi i64 [ 0, %.preheader ], [ %n.vec254, %middle.block249 ]
  br label %scalar.ph250

scalar.ph250:                                     ; preds = %scalar.ph250.preheader, %scalar.ph250
  %indvars.iv221 = phi i64 [ %indvars.iv.next222, %scalar.ph250 ], [ %indvars.iv221.ph, %scalar.ph250.preheader ]
  %134 = xor i64 %indvars.iv221, -1
  %135 = getelementptr float, ptr %gep242, i64 %134
  %136 = load float, ptr %135, align 4, !tbaa !5
  %137 = getelementptr inbounds float, ptr %126, i64 %indvars.iv221
  store float %136, ptr %137, align 4, !tbaa !5
  %indvars.iv.next222 = add nuw nsw i64 %indvars.iv221, 1
  %exitcond225.not = icmp eq i64 %indvars.iv.next222, %wide.trip.count229
  br i1 %exitcond225.not, label %._crit_edge164, label %scalar.ph250, !llvm.loop !25

._crit_edge164:                                   ; preds = %scalar.ph250, %middle.block249
  %gep = getelementptr float, ptr %invariant.gep, i64 %indvars.iv226
  %138 = load float, ptr %gep, align 4, !tbaa !5
  %139 = fsub float 0.000000e+00, %138
  %140 = getelementptr inbounds float, ptr %126, i64 %wide.trip.count229
  store float %139, ptr %140, align 4, !tbaa !5
  %indvars.iv.next227 = add nuw nsw i64 %indvars.iv226, 1
  %exitcond230.not = icmp eq i64 %indvars.iv.next227, %wide.trip.count229
  br i1 %exitcond230.not, label %._crit_edge168, label %.preheader, !llvm.loop !26

._crit_edge168:                                   ; preds = %._crit_edge164, %._crit_edge.thread
  %141 = tail call i32 @mLinearEquation(ptr noundef %32, ptr noundef %4) #6
  tail call void @free(ptr noundef %calloc) #6
  tail call void @free(ptr noundef %calloc234) #6
  tail call void @mMatrixRelease(ptr noundef %32) #6
  br label %142

142:                                              ; preds = %._crit_edge168, %24, %23
  ret void
}

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

; Function Attrs: nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #5

attributes #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 = { 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 = { 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 = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #6 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = !{!16, !18, i64 8}
!16 = !{!"MMatrix", !17, i64 0, !17, i64 4, !18, i64 8}
!17 = !{!"int", !7, i64 0}
!18 = !{!"any pointer", !7, i64 0}
!19 = !{!18, !18, i64 0}
!20 = distinct !{!20, !10, !21, !22}
!21 = !{!"llvm.loop.isvectorized", i32 1}
!22 = !{!"llvm.loop.unroll.runtime.disable"}
!23 = distinct !{!23, !10, !22, !21}
!24 = distinct !{!24, !10, !21, !22}
!25 = distinct !{!25, !10, !22, !21}
!26 = distinct !{!26, !10}


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