; 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.5 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [17 x i8], align 1
@__FUNCTION__.mParabolaFitWeight = external hidden unnamed_addr constant [19 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 uwtable
define dso_local void @mParabolaFitWeight(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4) #4 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, 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 8, ptr %16) #5
  br label %21

21:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %22 = load i32, ptr %9, align 4, !tbaa !9
  %23 = icmp slt i32 %22, 3
  %24 = zext i1 %23 to i32
  store i32 %24, ptr %17, align 4, !tbaa !9
  %25 = load i32, ptr %17, align 4, !tbaa !9
  %26 = icmp ne i32 %25, 0
  br i1 %26, label %27, label %29

27:                                               ; preds = %21
  %28 = load i32, ptr %17, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %28, i32 noundef -1, ptr noundef @.str, i32 noundef 472, ptr noundef @__FUNCTION__.mParabolaFitWeight, ptr noundef @.str.5)
  br label %29

29:                                               ; preds = %27, %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %30

30:                                               ; preds = %29
  br label %31

31:                                               ; preds = %30
  br label %32

32:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = icmp eq ptr %33, null
  br i1 %34, label %48, label %35

35:                                               ; preds = %32
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = ptrtoint ptr %36 to i64
  %38 = icmp eq i64 %37, -1
  br i1 %38, label %48, label %39

39:                                               ; preds = %35
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = icmp eq ptr %40, null
  br i1 %41, label %46, label %42

42:                                               ; preds = %39
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = ptrtoint ptr %43 to i64
  %45 = icmp eq i64 %44, -1
  br label %46

46:                                               ; preds = %42, %39
  %47 = phi i1 [ true, %39 ], [ %45, %42 ]
  br label %48

48:                                               ; preds = %46, %35, %32
  %49 = phi i1 [ true, %35 ], [ true, %32 ], [ %47, %46 ]
  %50 = zext i1 %49 to i32
  store i32 %50, ptr %18, align 4, !tbaa !9
  %51 = load i32, ptr %18, align 4, !tbaa !9
  %52 = icmp ne i32 %51, 0
  br i1 %52, label %53, label %55

53:                                               ; preds = %48
  %54 = load i32, ptr %18, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %54, i32 noundef -1, ptr noundef @.str, i32 noundef 473, ptr noundef @__FUNCTION__.mParabolaFitWeight, ptr noundef @.str.2)
  br label %55

55:                                               ; preds = %53, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %56

56:                                               ; preds = %55
  br label %57

57:                                               ; preds = %56
  br label %58

58:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  %60 = icmp eq ptr %59, null
  br i1 %60, label %65, label %61

61:                                               ; preds = %58
  %62 = load ptr, ptr %10, align 8, !tbaa !5
  %63 = ptrtoint ptr %62 to i64
  %64 = icmp eq i64 %63, -1
  br label %65

65:                                               ; preds = %61, %58
  %66 = phi i1 [ true, %58 ], [ %64, %61 ]
  %67 = zext i1 %66 to i32
  store i32 %67, ptr %19, align 4, !tbaa !9
  %68 = load i32, ptr %19, align 4, !tbaa !9
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %72

70:                                               ; preds = %65
  %71 = load i32, ptr %19, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %71, i32 noundef -1, ptr noundef @.str, i32 noundef 474, ptr noundef @__FUNCTION__.mParabolaFitWeight, ptr noundef @.str.3)
  br label %72

72:                                               ; preds = %70, %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %73

73:                                               ; preds = %72
  br label %74

74:                                               ; preds = %73
  %75 = load ptr, ptr %8, align 8, !tbaa !5
  %76 = icmp eq ptr %75, null
  br i1 %76, label %81, label %77

77:                                               ; preds = %74
  %78 = load ptr, ptr %8, align 8, !tbaa !5
  %79 = ptrtoint ptr %78 to i64
  %80 = icmp eq i64 %79, -1
  br i1 %80, label %81, label %90

81:                                               ; preds = %77, %74
  br label %82

82:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store i32 -1, ptr %20, align 4, !tbaa !9
  %83 = load i32, ptr %20, align 4, !tbaa !9
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %87

85:                                               ; preds = %82
  %86 = load i32, ptr %20, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %86, i32 noundef -1, ptr noundef @.str, i32 noundef 476, ptr noundef @__FUNCTION__.mParabolaFitWeight, ptr noundef @.str.11)
  br label %87

87:                                               ; preds = %85, %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %88

88:                                               ; preds = %87
  br label %89

89:                                               ; preds = %88
  br label %90

90:                                               ; preds = %89, %77
  %91 = call ptr @MatrixCreate(i32 noundef 3, i32 noundef 4, ptr noundef null)
  store ptr %91, ptr %16, align 8, !tbaa !5
  %92 = load ptr, ptr %16, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.MMatrix, ptr %92, i32 0, i32 2
  %94 = load ptr, ptr %93, align 8, !tbaa !11
  %95 = getelementptr inbounds ptr, ptr %94, i64 0
  %96 = load ptr, ptr %95, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 4 %96, i8 0, i64 16, i1 false)
  %97 = load ptr, ptr %16, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.MMatrix, ptr %97, i32 0, i32 2
  %99 = load ptr, ptr %98, align 8, !tbaa !11
  %100 = getelementptr inbounds ptr, ptr %99, i64 1
  %101 = load ptr, ptr %100, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 4 %101, i8 0, i64 16, i1 false)
  %102 = load ptr, ptr %16, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.MMatrix, ptr %102, i32 0, i32 2
  %104 = load ptr, ptr %103, align 8, !tbaa !11
  %105 = getelementptr inbounds ptr, ptr %104, i64 2
  %106 = load ptr, ptr %105, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 4 %106, i8 0, i64 16, i1 false)
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %107

107:                                              ; preds = %276, %90
  %108 = load i32, ptr %11, align 4, !tbaa !9
  %109 = load i32, ptr %9, align 4, !tbaa !9
  %110 = icmp slt i32 %108, %109
  br i1 %110, label %111, label %279

111:                                              ; preds = %107
  %112 = load ptr, ptr %8, align 8, !tbaa !5
  %113 = load i32, ptr %11, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds float, ptr %112, i64 %114
  %116 = load float, ptr %115, align 4, !tbaa !13
  store float %116, ptr %15, align 4, !tbaa !13
  %117 = load ptr, ptr %6, align 8, !tbaa !5
  %118 = load i32, ptr %11, align 4, !tbaa !9
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds float, ptr %117, i64 %119
  %121 = load float, ptr %120, align 4, !tbaa !13
  store float %121, ptr %12, align 4, !tbaa !13
  %122 = load ptr, ptr %7, align 8, !tbaa !5
  %123 = load i32, ptr %11, align 4, !tbaa !9
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds float, ptr %122, i64 %124
  %126 = load float, ptr %125, align 4, !tbaa !13
  store float %126, ptr %13, align 4, !tbaa !13
  %127 = load ptr, ptr %6, align 8, !tbaa !5
  %128 = load i32, ptr %11, align 4, !tbaa !9
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds float, ptr %127, i64 %129
  %131 = load float, ptr %130, align 4, !tbaa !13
  %132 = load ptr, ptr %6, align 8, !tbaa !5
  %133 = load i32, ptr %11, align 4, !tbaa !9
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds float, ptr %132, i64 %134
  %136 = load float, ptr %135, align 4, !tbaa !13
  %137 = fmul float %131, %136
  store float %137, ptr %14, align 4, !tbaa !13
  %138 = load ptr, ptr %16, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.MMatrix, ptr %138, i32 0, i32 2
  %140 = load ptr, ptr %139, align 8, !tbaa !11
  %141 = getelementptr inbounds ptr, ptr %140, i64 2
  %142 = load ptr, ptr %141, align 8, !tbaa !5
  %143 = getelementptr inbounds float, ptr %142, i64 2
  %144 = load float, ptr %143, align 4, !tbaa !13
  %145 = load float, ptr %15, align 4, !tbaa !13
  %146 = fadd float %144, %145
  %147 = load ptr, ptr %16, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.MMatrix, ptr %147, i32 0, i32 2
  %149 = load ptr, ptr %148, align 8, !tbaa !11
  %150 = getelementptr inbounds ptr, ptr %149, i64 2
  %151 = load ptr, ptr %150, align 8, !tbaa !5
  %152 = getelementptr inbounds float, ptr %151, i64 2
  store float %146, ptr %152, align 4, !tbaa !13
  %153 = load ptr, ptr %16, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.MMatrix, ptr %153, i32 0, i32 2
  %155 = load ptr, ptr %154, align 8, !tbaa !11
  %156 = getelementptr inbounds ptr, ptr %155, i64 0
  %157 = load ptr, ptr %156, align 8, !tbaa !5
  %158 = getelementptr inbounds float, ptr %157, i64 0
  %159 = load float, ptr %158, align 4, !tbaa !13
  %160 = load float, ptr %15, align 4, !tbaa !13
  %161 = load float, ptr %14, align 4, !tbaa !13
  %162 = fmul float %160, %161
  %163 = load float, ptr %14, align 4, !tbaa !13
  %164 = call float @llvm.fmuladd.f32(float %162, float %163, float %159)
  %165 = load ptr, ptr %16, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.MMatrix, ptr %165, i32 0, i32 2
  %167 = load ptr, ptr %166, align 8, !tbaa !11
  %168 = getelementptr inbounds ptr, ptr %167, i64 0
  %169 = load ptr, ptr %168, align 8, !tbaa !5
  %170 = getelementptr inbounds float, ptr %169, i64 0
  store float %164, ptr %170, align 4, !tbaa !13
  %171 = load ptr, ptr %16, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.MMatrix, ptr %171, i32 0, i32 2
  %173 = load ptr, ptr %172, align 8, !tbaa !11
  %174 = getelementptr inbounds ptr, ptr %173, i64 0
  %175 = load ptr, ptr %174, align 8, !tbaa !5
  %176 = getelementptr inbounds float, ptr %175, i64 1
  %177 = load float, ptr %176, align 4, !tbaa !13
  %178 = load float, ptr %15, align 4, !tbaa !13
  %179 = load float, ptr %14, align 4, !tbaa !13
  %180 = fmul float %178, %179
  %181 = load float, ptr %12, align 4, !tbaa !13
  %182 = call float @llvm.fmuladd.f32(float %180, float %181, float %177)
  %183 = load ptr, ptr %16, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.MMatrix, ptr %183, i32 0, i32 2
  %185 = load ptr, ptr %184, align 8, !tbaa !11
  %186 = getelementptr inbounds ptr, ptr %185, i64 0
  %187 = load ptr, ptr %186, align 8, !tbaa !5
  %188 = getelementptr inbounds float, ptr %187, i64 1
  store float %182, ptr %188, align 4, !tbaa !13
  %189 = load ptr, ptr %16, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.MMatrix, ptr %189, i32 0, i32 2
  %191 = load ptr, ptr %190, align 8, !tbaa !11
  %192 = getelementptr inbounds ptr, ptr %191, i64 0
  %193 = load ptr, ptr %192, align 8, !tbaa !5
  %194 = getelementptr inbounds float, ptr %193, i64 2
  %195 = load float, ptr %194, align 4, !tbaa !13
  %196 = load float, ptr %15, align 4, !tbaa !13
  %197 = load float, ptr %14, align 4, !tbaa !13
  %198 = call float @llvm.fmuladd.f32(float %196, float %197, float %195)
  %199 = load ptr, ptr %16, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.MMatrix, ptr %199, i32 0, i32 2
  %201 = load ptr, ptr %200, align 8, !tbaa !11
  %202 = getelementptr inbounds ptr, ptr %201, i64 0
  %203 = load ptr, ptr %202, align 8, !tbaa !5
  %204 = getelementptr inbounds float, ptr %203, i64 2
  store float %198, ptr %204, align 4, !tbaa !13
  %205 = load ptr, ptr %16, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.MMatrix, ptr %205, i32 0, i32 2
  %207 = load ptr, ptr %206, align 8, !tbaa !11
  %208 = getelementptr inbounds ptr, ptr %207, i64 0
  %209 = load ptr, ptr %208, align 8, !tbaa !5
  %210 = getelementptr inbounds float, ptr %209, i64 3
  %211 = load float, ptr %210, align 4, !tbaa !13
  %212 = load float, ptr %15, align 4, !tbaa !13
  %213 = load float, ptr %14, align 4, !tbaa !13
  %214 = fmul float %212, %213
  %215 = load float, ptr %13, align 4, !tbaa !13
  %216 = fneg float %214
  %217 = call float @llvm.fmuladd.f32(float %216, float %215, float %211)
  %218 = load ptr, ptr %16, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.MMatrix, ptr %218, i32 0, i32 2
  %220 = load ptr, ptr %219, align 8, !tbaa !11
  %221 = getelementptr inbounds ptr, ptr %220, i64 0
  %222 = load ptr, ptr %221, align 8, !tbaa !5
  %223 = getelementptr inbounds float, ptr %222, i64 3
  store float %217, ptr %223, align 4, !tbaa !13
  %224 = load ptr, ptr %16, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.MMatrix, ptr %224, i32 0, i32 2
  %226 = load ptr, ptr %225, align 8, !tbaa !11
  %227 = getelementptr inbounds ptr, ptr %226, i64 1
  %228 = load ptr, ptr %227, align 8, !tbaa !5
  %229 = getelementptr inbounds float, ptr %228, i64 2
  %230 = load float, ptr %229, align 4, !tbaa !13
  %231 = load float, ptr %15, align 4, !tbaa !13
  %232 = load float, ptr %12, align 4, !tbaa !13
  %233 = call float @llvm.fmuladd.f32(float %231, float %232, float %230)
  %234 = load ptr, ptr %16, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.MMatrix, ptr %234, i32 0, i32 2
  %236 = load ptr, ptr %235, align 8, !tbaa !11
  %237 = getelementptr inbounds ptr, ptr %236, i64 1
  %238 = load ptr, ptr %237, align 8, !tbaa !5
  %239 = getelementptr inbounds float, ptr %238, i64 2
  store float %233, ptr %239, align 4, !tbaa !13
  %240 = load ptr, ptr %16, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.MMatrix, ptr %240, i32 0, i32 2
  %242 = load ptr, ptr %241, align 8, !tbaa !11
  %243 = getelementptr inbounds ptr, ptr %242, i64 1
  %244 = load ptr, ptr %243, align 8, !tbaa !5
  %245 = getelementptr inbounds float, ptr %244, i64 3
  %246 = load float, ptr %245, align 4, !tbaa !13
  %247 = load float, ptr %15, align 4, !tbaa !13
  %248 = load float, ptr %12, align 4, !tbaa !13
  %249 = fmul float %247, %248
  %250 = load float, ptr %13, align 4, !tbaa !13
  %251 = fneg float %249
  %252 = call float @llvm.fmuladd.f32(float %251, float %250, float %246)
  %253 = load ptr, ptr %16, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct.MMatrix, ptr %253, i32 0, i32 2
  %255 = load ptr, ptr %254, align 8, !tbaa !11
  %256 = getelementptr inbounds ptr, ptr %255, i64 1
  %257 = load ptr, ptr %256, align 8, !tbaa !5
  %258 = getelementptr inbounds float, ptr %257, i64 3
  store float %252, ptr %258, align 4, !tbaa !13
  %259 = load ptr, ptr %16, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct.MMatrix, ptr %259, i32 0, i32 2
  %261 = load ptr, ptr %260, align 8, !tbaa !11
  %262 = getelementptr inbounds ptr, ptr %261, i64 2
  %263 = load ptr, ptr %262, align 8, !tbaa !5
  %264 = getelementptr inbounds float, ptr %263, i64 3
  %265 = load float, ptr %264, align 4, !tbaa !13
  %266 = load float, ptr %15, align 4, !tbaa !13
  %267 = load float, ptr %13, align 4, !tbaa !13
  %268 = fneg float %266
  %269 = call float @llvm.fmuladd.f32(float %268, float %267, float %265)
  %270 = load ptr, ptr %16, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct.MMatrix, ptr %270, i32 0, i32 2
  %272 = load ptr, ptr %271, align 8, !tbaa !11
  %273 = getelementptr inbounds ptr, ptr %272, i64 2
  %274 = load ptr, ptr %273, align 8, !tbaa !5
  %275 = getelementptr inbounds float, ptr %274, i64 3
  store float %269, ptr %275, align 4, !tbaa !13
  br label %276

276:                                              ; preds = %111
  %277 = load i32, ptr %11, align 4, !tbaa !9
  %278 = add nsw i32 %277, 1
  store i32 %278, ptr %11, align 4, !tbaa !9
  br label %107, !llvm.loop !15

279:                                              ; preds = %107
  %280 = load ptr, ptr %16, align 8, !tbaa !5
  %281 = getelementptr inbounds %struct.MMatrix, ptr %280, i32 0, i32 2
  %282 = load ptr, ptr %281, align 8, !tbaa !11
  %283 = getelementptr inbounds ptr, ptr %282, i64 0
  %284 = load ptr, ptr %283, align 8, !tbaa !5
  %285 = getelementptr inbounds float, ptr %284, i64 1
  %286 = load float, ptr %285, align 4, !tbaa !13
  %287 = load ptr, ptr %16, align 8, !tbaa !5
  %288 = getelementptr inbounds %struct.MMatrix, ptr %287, i32 0, i32 2
  %289 = load ptr, ptr %288, align 8, !tbaa !11
  %290 = getelementptr inbounds ptr, ptr %289, i64 1
  %291 = load ptr, ptr %290, align 8, !tbaa !5
  %292 = getelementptr inbounds float, ptr %291, i64 0
  store float %286, ptr %292, align 4, !tbaa !13
  %293 = load ptr, ptr %16, align 8, !tbaa !5
  %294 = getelementptr inbounds %struct.MMatrix, ptr %293, i32 0, i32 2
  %295 = load ptr, ptr %294, align 8, !tbaa !11
  %296 = getelementptr inbounds ptr, ptr %295, i64 0
  %297 = load ptr, ptr %296, align 8, !tbaa !5
  %298 = getelementptr inbounds float, ptr %297, i64 2
  %299 = load float, ptr %298, align 4, !tbaa !13
  %300 = load ptr, ptr %16, align 8, !tbaa !5
  %301 = getelementptr inbounds %struct.MMatrix, ptr %300, i32 0, i32 2
  %302 = load ptr, ptr %301, align 8, !tbaa !11
  %303 = getelementptr inbounds ptr, ptr %302, i64 1
  %304 = load ptr, ptr %303, align 8, !tbaa !5
  %305 = getelementptr inbounds float, ptr %304, i64 1
  store float %299, ptr %305, align 4, !tbaa !13
  %306 = load ptr, ptr %16, align 8, !tbaa !5
  %307 = getelementptr inbounds %struct.MMatrix, ptr %306, i32 0, i32 2
  %308 = load ptr, ptr %307, align 8, !tbaa !11
  %309 = getelementptr inbounds ptr, ptr %308, i64 0
  %310 = load ptr, ptr %309, align 8, !tbaa !5
  %311 = getelementptr inbounds float, ptr %310, i64 2
  %312 = load float, ptr %311, align 4, !tbaa !13
  %313 = load ptr, ptr %16, align 8, !tbaa !5
  %314 = getelementptr inbounds %struct.MMatrix, ptr %313, i32 0, i32 2
  %315 = load ptr, ptr %314, align 8, !tbaa !11
  %316 = getelementptr inbounds ptr, ptr %315, i64 2
  %317 = load ptr, ptr %316, align 8, !tbaa !5
  %318 = getelementptr inbounds float, ptr %317, i64 0
  store float %312, ptr %318, align 4, !tbaa !13
  %319 = load ptr, ptr %16, align 8, !tbaa !5
  %320 = getelementptr inbounds %struct.MMatrix, ptr %319, i32 0, i32 2
  %321 = load ptr, ptr %320, align 8, !tbaa !11
  %322 = getelementptr inbounds ptr, ptr %321, i64 1
  %323 = load ptr, ptr %322, align 8, !tbaa !5
  %324 = getelementptr inbounds float, ptr %323, i64 2
  %325 = load float, ptr %324, align 4, !tbaa !13
  %326 = load ptr, ptr %16, align 8, !tbaa !5
  %327 = getelementptr inbounds %struct.MMatrix, ptr %326, i32 0, i32 2
  %328 = load ptr, ptr %327, align 8, !tbaa !11
  %329 = getelementptr inbounds ptr, ptr %328, i64 2
  %330 = load ptr, ptr %329, align 8, !tbaa !5
  %331 = getelementptr inbounds float, ptr %330, i64 1
  store float %325, ptr %331, align 4, !tbaa !13
  %332 = load ptr, ptr %16, align 8, !tbaa !5
  %333 = load ptr, ptr %10, align 8, !tbaa !5
  %334 = call i32 @mLinearEquation(ptr noundef %332, ptr noundef %333)
  %335 = load ptr, ptr %16, align 8, !tbaa !5
  call void @mMatrixRelease(ptr noundef %335)
  call void @llvm.lifetime.end.p0(i64 8, 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 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  ret void
}

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 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 }

!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, !6, i64 8}
!12 = !{!"MMatrix", !10, i64 0, !10, i64 4, !6, i64 8}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


; 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.5 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [17 x i8], align 1
@__FUNCTION__.mParabolaFitWeight = external hidden unnamed_addr constant [19 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

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

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: nounwind uwtable
define dso_local void @mParabolaFitWeight(ptr noundef %0, ptr noundef readonly %1, ptr noundef %2, i32 noundef %3, ptr noundef %4) local_unnamed_addr #3 {
  %6 = icmp slt i32 %3, 3
  br i1 %6, label %7, label %8

7:                                                ; preds = %5
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 472, ptr noundef nonnull @__FUNCTION__.mParabolaFitWeight, ptr noundef nonnull @.str.5) #5
  br label %8

8:                                                ; preds = %7, %5
  %magicptr = ptrtoint ptr %0 to i64
  switch i64 %magicptr, label %9 [
    i64 -1, label %.thread
    i64 0, label %.thread
  ]

9:                                                ; preds = %8
  %magicptr85 = ptrtoint ptr %1 to i64
  switch i64 %magicptr85, label %10 [
    i64 -1, label %.thread
    i64 0, label %.thread
  ]

.thread:                                          ; preds = %9, %9, %8, %8
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 473, ptr noundef nonnull @__FUNCTION__.mParabolaFitWeight, ptr noundef nonnull @.str.2) #5
  br label %10

10:                                               ; preds = %9, %.thread
  %magicptr83 = ptrtoint ptr %4 to i64
  switch i64 %magicptr83, label %16 [
    i64 -1, label %11
    i64 0, label %11
  ]

11:                                               ; preds = %10, %10
  %12 = icmp eq ptr %4, null
  %13 = icmp eq ptr %4, inttoptr (i64 -1 to ptr)
  %14 = or i1 %12, %13
  %15 = zext i1 %14 to i32
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %15, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 474, ptr noundef nonnull @__FUNCTION__.mParabolaFitWeight, ptr noundef nonnull @.str.3) #5
  br label %16

16:                                               ; preds = %10, %11
  %magicptr84 = ptrtoint ptr %2 to i64
  switch i64 %magicptr84, label %18 [
    i64 -1, label %17
    i64 0, label %17
  ]

17:                                               ; preds = %16, %16
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef -1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 476, ptr noundef nonnull @__FUNCTION__.mParabolaFitWeight, ptr noundef nonnull @.str.11) #5
  br label %18

18:                                               ; preds = %16, %17
  %19 = tail call ptr @MatrixCreate(i32 noundef 3, i32 noundef 4, ptr noundef null) #5
  %20 = getelementptr inbounds i8, ptr %19, i64 8
  %21 = load ptr, ptr %20, align 8, !tbaa !5
  %22 = load ptr, ptr %21, align 8, !tbaa !11
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %22, i8 0, i64 16, i1 false)
  %23 = load ptr, ptr %20, align 8, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %23, i64 8
  %25 = load ptr, ptr %24, align 8, !tbaa !11
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %25, i8 0, i64 16, i1 false)
  %26 = load ptr, ptr %20, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %26, i64 16
  %28 = load ptr, ptr %27, align 8, !tbaa !11
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %28, i8 0, i64 16, i1 false)
  %29 = icmp sgt i32 %3, 0
  %.pre = load ptr, ptr %20, align 8, !tbaa !5
  %.pre88 = load ptr, ptr %.pre, align 8, !tbaa !11
  br i1 %29, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %18
  %.phi.trans.insert = getelementptr inbounds i8, ptr %.pre, i64 8
  %.pre89 = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !11
  %.phi.trans.insert90 = getelementptr inbounds i8, ptr %.pre, i64 16
  %.pre91 = load ptr, ptr %.phi.trans.insert90, align 8, !tbaa !11
  br label %._crit_edge

.lr.ph:                                           ; preds = %18
  %30 = getelementptr inbounds i8, ptr %.pre, i64 16
  %31 = load ptr, ptr %30, align 8, !tbaa !11
  %32 = getelementptr inbounds i8, ptr %31, i64 8
  %33 = getelementptr inbounds i8, ptr %.pre, i64 8
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  %35 = getelementptr inbounds i8, ptr %34, i64 8
  %36 = getelementptr inbounds i8, ptr %31, i64 12
  %wide.trip.count = zext nneg i32 %3 to i64
  br label %37

37:                                               ; preds = %.lr.ph, %37
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %37 ]
  %38 = getelementptr inbounds float, ptr %2, i64 %indvars.iv
  %39 = load float, ptr %38, align 4, !tbaa !12
  %40 = getelementptr inbounds float, ptr %0, i64 %indvars.iv
  %41 = load float, ptr %40, align 4, !tbaa !12
  %42 = getelementptr inbounds float, ptr %1, i64 %indvars.iv
  %43 = load float, ptr %42, align 4, !tbaa !12
  %44 = fmul float %41, %41
  %45 = load float, ptr %32, align 4, !tbaa !12
  %46 = fadd float %39, %45
  store float %46, ptr %32, align 4, !tbaa !12
  %47 = fmul float %39, %44
  %48 = fneg float %47
  %49 = load <4 x float>, ptr %.pre88, align 4, !tbaa !12
  %50 = insertelement <4 x float> poison, float %44, i64 0
  %51 = insertelement <4 x float> %50, float %47, i64 1
  %52 = insertelement <4 x float> %51, float %48, i64 3
  %53 = shufflevector <4 x float> %52, <4 x float> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 3>
  %54 = insertelement <4 x float> poison, float %47, i64 0
  %55 = insertelement <4 x float> %54, float %41, i64 1
  %56 = insertelement <4 x float> %55, float %39, i64 2
  %57 = insertelement <4 x float> %56, float %43, i64 3
  %58 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %53, <4 x float> %57, <4 x float> %49)
  store <4 x float> %58, ptr %.pre88, align 4, !tbaa !12
  %59 = fneg float %39
  %60 = fmul float %41, %59
  %61 = load <2 x float>, ptr %35, align 4, !tbaa !12
  %62 = insertelement <2 x float> poison, float %39, i64 0
  %63 = insertelement <2 x float> %62, float %60, i64 1
  %64 = insertelement <2 x float> poison, float %41, i64 0
  %65 = insertelement <2 x float> %64, float %43, i64 1
  %66 = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %63, <2 x float> %65, <2 x float> %61)
  store <2 x float> %66, ptr %35, align 4, !tbaa !12
  %67 = load float, ptr %36, align 4, !tbaa !12
  %68 = tail call float @llvm.fmuladd.f32(float %59, float %43, float %67)
  store float %68, ptr %36, align 4, !tbaa !12
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %37, !llvm.loop !14

._crit_edge:                                      ; preds = %37, %.._crit_edge_crit_edge
  %69 = phi ptr [ %.pre91, %.._crit_edge_crit_edge ], [ %31, %37 ]
  %70 = phi ptr [ %.pre89, %.._crit_edge_crit_edge ], [ %34, %37 ]
  %71 = getelementptr inbounds i8, ptr %.pre88, i64 4
  %72 = load float, ptr %71, align 4, !tbaa !12
  store float %72, ptr %70, align 4, !tbaa !12
  %73 = getelementptr inbounds i8, ptr %.pre88, i64 8
  %74 = load float, ptr %73, align 4, !tbaa !12
  %75 = getelementptr inbounds i8, ptr %70, i64 4
  store float %74, ptr %75, align 4, !tbaa !12
  store float %74, ptr %69, align 4, !tbaa !12
  %76 = getelementptr inbounds i8, ptr %70, i64 8
  %77 = load float, ptr %76, align 4, !tbaa !12
  %78 = getelementptr inbounds i8, ptr %69, i64 4
  store float %77, ptr %78, align 4, !tbaa !12
  %79 = tail call i32 @mLinearEquation(ptr noundef nonnull %19, ptr noundef %4) #5
  tail call void @mMatrixRelease(ptr noundef nonnull %19) #5
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x float> @llvm.fmuladd.v4f32(<4 x float>, <4 x float>, <4 x float>) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x float> @llvm.fmuladd.v2f32(<2 x float>, <2 x float>, <2 x float>) #4

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 nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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, !10, i64 8}
!6 = !{!"MMatrix", !7, i64 0, !7, i64 4, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!10, !10, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"float", !8, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


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