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

; Function Attrs: nounwind uwtable
define dso_local void @mParabolaFitLSM(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3) #4 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  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 ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #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 8, ptr %13) #5
  br label %17

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

23:                                               ; preds = %17
  %24 = load i32, ptr %14, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %24, i32 noundef -1, ptr noundef @.str, i32 noundef 170, ptr noundef @__FUNCTION__.mParabolaFitLSM, ptr noundef @.str.5)
  br label %25

25:                                               ; preds = %23, %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %26

26:                                               ; preds = %25
  br label %27

27:                                               ; preds = %26
  br label %28

28:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = icmp eq ptr %29, null
  br i1 %30, label %44, label %31

31:                                               ; preds = %28
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = ptrtoint ptr %32 to i64
  %34 = icmp eq i64 %33, -1
  br i1 %34, label %44, label %35

35:                                               ; preds = %31
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = icmp eq ptr %36, null
  br i1 %37, label %42, label %38

38:                                               ; preds = %35
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = ptrtoint ptr %39 to i64
  %41 = icmp eq i64 %40, -1
  br label %42

42:                                               ; preds = %38, %35
  %43 = phi i1 [ true, %35 ], [ %41, %38 ]
  br label %44

44:                                               ; preds = %42, %31, %28
  %45 = phi i1 [ true, %31 ], [ true, %28 ], [ %43, %42 ]
  %46 = zext i1 %45 to i32
  store i32 %46, ptr %15, align 4, !tbaa !9
  %47 = load i32, ptr %15, align 4, !tbaa !9
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %49, label %51

49:                                               ; preds = %44
  %50 = load i32, ptr %15, 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 171, ptr noundef @__FUNCTION__.mParabolaFitLSM, ptr noundef @.str.2)
  br label %51

51:                                               ; preds = %49, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  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 %16) #5
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  %56 = icmp eq ptr %55, null
  br i1 %56, label %61, label %57

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

61:                                               ; preds = %57, %54
  %62 = phi i1 [ true, %54 ], [ %60, %57 ]
  %63 = zext i1 %62 to i32
  store i32 %63, ptr %16, align 4, !tbaa !9
  %64 = load i32, ptr %16, align 4, !tbaa !9
  %65 = icmp ne i32 %64, 0
  br i1 %65, label %66, label %68

66:                                               ; preds = %61
  %67 = load i32, ptr %16, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %67, i32 noundef -1, ptr noundef @.str, i32 noundef 172, ptr noundef @__FUNCTION__.mParabolaFitLSM, ptr noundef @.str.3)
  br label %68

68:                                               ; preds = %66, %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %69

69:                                               ; preds = %68
  br label %70

70:                                               ; preds = %69
  %71 = call ptr @MatrixCreate(i32 noundef 3, i32 noundef 4, ptr noundef null)
  store ptr %71, ptr %13, align 8, !tbaa !5
  %72 = load ptr, ptr %13, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.MMatrix, ptr %72, i32 0, i32 2
  %74 = load ptr, ptr %73, align 8, !tbaa !11
  %75 = getelementptr inbounds ptr, ptr %74, i64 0
  %76 = load ptr, ptr %75, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 4 %76, i8 0, i64 16, i1 false)
  %77 = load ptr, ptr %13, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.MMatrix, ptr %77, i32 0, i32 2
  %79 = load ptr, ptr %78, align 8, !tbaa !11
  %80 = getelementptr inbounds ptr, ptr %79, i64 1
  %81 = load ptr, ptr %80, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 4 %81, i8 0, i64 16, i1 false)
  %82 = load ptr, ptr %13, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.MMatrix, ptr %82, i32 0, i32 2
  %84 = load ptr, ptr %83, align 8, !tbaa !11
  %85 = getelementptr inbounds ptr, ptr %84, i64 2
  %86 = load ptr, ptr %85, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 4 %86, i8 0, i64 16, i1 false)
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %87

87:                                               ; preds = %224, %70
  %88 = load i32, ptr %9, align 4, !tbaa !9
  %89 = load i32, ptr %7, align 4, !tbaa !9
  %90 = icmp slt i32 %88, %89
  br i1 %90, label %91, label %227

91:                                               ; preds = %87
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = load i32, ptr %9, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds float, ptr %92, i64 %94
  %96 = load float, ptr %95, align 4, !tbaa !13
  store float %96, ptr %10, align 4, !tbaa !13
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = load i32, ptr %9, align 4, !tbaa !9
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds float, ptr %97, i64 %99
  %101 = load float, ptr %100, align 4, !tbaa !13
  store float %101, ptr %11, align 4, !tbaa !13
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = load i32, ptr %9, align 4, !tbaa !9
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds float, ptr %102, i64 %104
  %106 = load float, ptr %105, align 4, !tbaa !13
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = load i32, ptr %9, align 4, !tbaa !9
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds float, ptr %107, i64 %109
  %111 = load float, ptr %110, align 4, !tbaa !13
  %112 = fmul float %106, %111
  store float %112, ptr %12, align 4, !tbaa !13
  %113 = load ptr, ptr %13, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.MMatrix, ptr %113, i32 0, i32 2
  %115 = load ptr, ptr %114, align 8, !tbaa !11
  %116 = getelementptr inbounds ptr, ptr %115, i64 0
  %117 = load ptr, ptr %116, align 8, !tbaa !5
  %118 = getelementptr inbounds float, ptr %117, i64 0
  %119 = load float, ptr %118, align 4, !tbaa !13
  %120 = load float, ptr %12, align 4, !tbaa !13
  %121 = load float, ptr %12, align 4, !tbaa !13
  %122 = call float @llvm.fmuladd.f32(float %120, float %121, float %119)
  %123 = load ptr, ptr %13, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.MMatrix, ptr %123, i32 0, i32 2
  %125 = load ptr, ptr %124, align 8, !tbaa !11
  %126 = getelementptr inbounds ptr, ptr %125, i64 0
  %127 = load ptr, ptr %126, align 8, !tbaa !5
  %128 = getelementptr inbounds float, ptr %127, i64 0
  store float %122, ptr %128, align 4, !tbaa !13
  %129 = load ptr, ptr %13, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.MMatrix, ptr %129, i32 0, i32 2
  %131 = load ptr, ptr %130, align 8, !tbaa !11
  %132 = getelementptr inbounds ptr, ptr %131, i64 0
  %133 = load ptr, ptr %132, align 8, !tbaa !5
  %134 = getelementptr inbounds float, ptr %133, i64 1
  %135 = load float, ptr %134, align 4, !tbaa !13
  %136 = load float, ptr %12, align 4, !tbaa !13
  %137 = load float, ptr %10, align 4, !tbaa !13
  %138 = call float @llvm.fmuladd.f32(float %136, float %137, float %135)
  %139 = load ptr, ptr %13, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.MMatrix, ptr %139, i32 0, i32 2
  %141 = load ptr, ptr %140, align 8, !tbaa !11
  %142 = getelementptr inbounds ptr, ptr %141, i64 0
  %143 = load ptr, ptr %142, align 8, !tbaa !5
  %144 = getelementptr inbounds float, ptr %143, i64 1
  store float %138, ptr %144, align 4, !tbaa !13
  %145 = load ptr, ptr %13, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.MMatrix, ptr %145, i32 0, i32 2
  %147 = load ptr, ptr %146, align 8, !tbaa !11
  %148 = getelementptr inbounds ptr, ptr %147, i64 0
  %149 = load ptr, ptr %148, align 8, !tbaa !5
  %150 = getelementptr inbounds float, ptr %149, i64 2
  %151 = load float, ptr %150, align 4, !tbaa !13
  %152 = load float, ptr %12, align 4, !tbaa !13
  %153 = fadd float %151, %152
  %154 = load ptr, ptr %13, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.MMatrix, ptr %154, i32 0, i32 2
  %156 = load ptr, ptr %155, align 8, !tbaa !11
  %157 = getelementptr inbounds ptr, ptr %156, i64 0
  %158 = load ptr, ptr %157, align 8, !tbaa !5
  %159 = getelementptr inbounds float, ptr %158, i64 2
  store float %153, ptr %159, align 4, !tbaa !13
  %160 = load ptr, ptr %13, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.MMatrix, ptr %160, i32 0, i32 2
  %162 = load ptr, ptr %161, align 8, !tbaa !11
  %163 = getelementptr inbounds ptr, ptr %162, i64 0
  %164 = load ptr, ptr %163, align 8, !tbaa !5
  %165 = getelementptr inbounds float, ptr %164, i64 3
  %166 = load float, ptr %165, align 4, !tbaa !13
  %167 = load float, ptr %12, align 4, !tbaa !13
  %168 = load float, ptr %11, align 4, !tbaa !13
  %169 = fneg float %167
  %170 = call float @llvm.fmuladd.f32(float %169, float %168, float %166)
  %171 = load ptr, ptr %13, 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 3
  store float %170, ptr %176, align 4, !tbaa !13
  %177 = load ptr, ptr %13, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.MMatrix, ptr %177, i32 0, i32 2
  %179 = load ptr, ptr %178, align 8, !tbaa !11
  %180 = getelementptr inbounds ptr, ptr %179, i64 1
  %181 = load ptr, ptr %180, align 8, !tbaa !5
  %182 = getelementptr inbounds float, ptr %181, i64 2
  %183 = load float, ptr %182, align 4, !tbaa !13
  %184 = load float, ptr %10, align 4, !tbaa !13
  %185 = fadd float %183, %184
  %186 = load ptr, ptr %13, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.MMatrix, ptr %186, i32 0, i32 2
  %188 = load ptr, ptr %187, align 8, !tbaa !11
  %189 = getelementptr inbounds ptr, ptr %188, i64 1
  %190 = load ptr, ptr %189, align 8, !tbaa !5
  %191 = getelementptr inbounds float, ptr %190, i64 2
  store float %185, ptr %191, align 4, !tbaa !13
  %192 = load ptr, ptr %13, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.MMatrix, ptr %192, i32 0, i32 2
  %194 = load ptr, ptr %193, align 8, !tbaa !11
  %195 = getelementptr inbounds ptr, ptr %194, i64 1
  %196 = load ptr, ptr %195, align 8, !tbaa !5
  %197 = getelementptr inbounds float, ptr %196, i64 3
  %198 = load float, ptr %197, align 4, !tbaa !13
  %199 = load float, ptr %10, align 4, !tbaa !13
  %200 = load float, ptr %11, align 4, !tbaa !13
  %201 = fneg float %199
  %202 = call float @llvm.fmuladd.f32(float %201, float %200, float %198)
  %203 = load ptr, ptr %13, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.MMatrix, ptr %203, i32 0, i32 2
  %205 = load ptr, ptr %204, align 8, !tbaa !11
  %206 = getelementptr inbounds ptr, ptr %205, i64 1
  %207 = load ptr, ptr %206, align 8, !tbaa !5
  %208 = getelementptr inbounds float, ptr %207, i64 3
  store float %202, ptr %208, align 4, !tbaa !13
  %209 = load ptr, ptr %13, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.MMatrix, ptr %209, i32 0, i32 2
  %211 = load ptr, ptr %210, align 8, !tbaa !11
  %212 = getelementptr inbounds ptr, ptr %211, i64 2
  %213 = load ptr, ptr %212, align 8, !tbaa !5
  %214 = getelementptr inbounds float, ptr %213, i64 3
  %215 = load float, ptr %214, align 4, !tbaa !13
  %216 = load float, ptr %11, align 4, !tbaa !13
  %217 = fsub float %215, %216
  %218 = load ptr, ptr %13, 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 2
  %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
  br label %224

224:                                              ; preds = %91
  %225 = load i32, ptr %9, align 4, !tbaa !9
  %226 = add nsw i32 %225, 1
  store i32 %226, ptr %9, align 4, !tbaa !9
  br label %87, !llvm.loop !15

227:                                              ; preds = %87
  %228 = load ptr, ptr %13, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.MMatrix, ptr %228, i32 0, i32 2
  %230 = load ptr, ptr %229, align 8, !tbaa !11
  %231 = getelementptr inbounds ptr, ptr %230, i64 0
  %232 = load ptr, ptr %231, align 8, !tbaa !5
  %233 = getelementptr inbounds float, ptr %232, i64 1
  %234 = load float, ptr %233, align 4, !tbaa !13
  %235 = load ptr, ptr %13, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.MMatrix, ptr %235, i32 0, i32 2
  %237 = load ptr, ptr %236, align 8, !tbaa !11
  %238 = getelementptr inbounds ptr, ptr %237, i64 1
  %239 = load ptr, ptr %238, align 8, !tbaa !5
  %240 = getelementptr inbounds float, ptr %239, i64 0
  store float %234, ptr %240, align 4, !tbaa !13
  %241 = load ptr, ptr %13, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.MMatrix, ptr %241, i32 0, i32 2
  %243 = load ptr, ptr %242, align 8, !tbaa !11
  %244 = getelementptr inbounds ptr, ptr %243, i64 0
  %245 = load ptr, ptr %244, align 8, !tbaa !5
  %246 = getelementptr inbounds float, ptr %245, i64 2
  %247 = load float, ptr %246, align 4, !tbaa !13
  %248 = load ptr, ptr %13, align 8, !tbaa !5
  %249 = getelementptr inbounds %struct.MMatrix, ptr %248, i32 0, i32 2
  %250 = load ptr, ptr %249, align 8, !tbaa !11
  %251 = getelementptr inbounds ptr, ptr %250, i64 1
  %252 = load ptr, ptr %251, align 8, !tbaa !5
  %253 = getelementptr inbounds float, ptr %252, i64 1
  store float %247, ptr %253, align 4, !tbaa !13
  %254 = load ptr, ptr %13, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct.MMatrix, ptr %254, i32 0, i32 2
  %256 = load ptr, ptr %255, align 8, !tbaa !11
  %257 = getelementptr inbounds ptr, ptr %256, i64 0
  %258 = load ptr, ptr %257, align 8, !tbaa !5
  %259 = getelementptr inbounds float, ptr %258, i64 2
  %260 = load float, ptr %259, align 4, !tbaa !13
  %261 = load ptr, ptr %13, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct.MMatrix, ptr %261, i32 0, i32 2
  %263 = load ptr, ptr %262, align 8, !tbaa !11
  %264 = getelementptr inbounds ptr, ptr %263, i64 2
  %265 = load ptr, ptr %264, align 8, !tbaa !5
  %266 = getelementptr inbounds float, ptr %265, i64 0
  store float %260, ptr %266, align 4, !tbaa !13
  %267 = load ptr, ptr %13, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct.MMatrix, ptr %267, i32 0, i32 2
  %269 = load ptr, ptr %268, align 8, !tbaa !11
  %270 = getelementptr inbounds ptr, ptr %269, i64 1
  %271 = load ptr, ptr %270, align 8, !tbaa !5
  %272 = getelementptr inbounds float, ptr %271, i64 2
  %273 = load float, ptr %272, align 4, !tbaa !13
  %274 = load ptr, ptr %13, align 8, !tbaa !5
  %275 = getelementptr inbounds %struct.MMatrix, ptr %274, i32 0, i32 2
  %276 = load ptr, ptr %275, align 8, !tbaa !11
  %277 = getelementptr inbounds ptr, ptr %276, i64 2
  %278 = load ptr, ptr %277, align 8, !tbaa !5
  %279 = getelementptr inbounds float, ptr %278, i64 1
  store float %273, ptr %279, align 4, !tbaa !13
  %280 = load i32, ptr %7, align 4, !tbaa !9
  %281 = sitofp i32 %280 to float
  %282 = load ptr, ptr %13, align 8, !tbaa !5
  %283 = getelementptr inbounds %struct.MMatrix, ptr %282, i32 0, i32 2
  %284 = load ptr, ptr %283, align 8, !tbaa !11
  %285 = getelementptr inbounds ptr, ptr %284, i64 2
  %286 = load ptr, ptr %285, align 8, !tbaa !5
  %287 = getelementptr inbounds float, ptr %286, i64 2
  store float %281, ptr %287, align 4, !tbaa !13
  %288 = load ptr, ptr %13, align 8, !tbaa !5
  %289 = load ptr, ptr %8, align 8, !tbaa !5
  %290 = call i32 @mLinearEquation(ptr noundef %288, ptr noundef %289)
  %291 = load ptr, ptr %13, align 8, !tbaa !5
  call void @mMatrixRelease(ptr noundef %291)
  call void @llvm.lifetime.end.p0(i64 8, 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
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  ret void
}

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

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

declare void @mMatrixRelease(ptr noundef) #1

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
@__FUNCTION__.mParabolaFitLSM = external hidden unnamed_addr constant [16 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [40 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

; Function Attrs: nounwind uwtable
define dso_local void @mParabolaFitLSM(ptr noundef %0, ptr noundef readonly %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #3 {
  %5 = icmp slt i32 %2, 3
  br i1 %5, label %6, label %7

6:                                                ; preds = %4
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 170, ptr noundef nonnull @__FUNCTION__.mParabolaFitLSM, ptr noundef nonnull @.str.5) #5
  br label %7

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

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

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

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

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

15:                                               ; preds = %9, %10
  %16 = tail call ptr @MatrixCreate(i32 noundef 3, i32 noundef 4, ptr noundef null) #5
  %17 = getelementptr inbounds i8, ptr %16, i64 8
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  %19 = load ptr, ptr %18, align 8, !tbaa !11
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %19, i8 0, i64 16, i1 false)
  %20 = load ptr, ptr %17, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %20, i64 8
  %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 %17, align 8, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %23, i64 16
  %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 = icmp sgt i32 %2, 0
  %.pre = load ptr, ptr %17, align 8, !tbaa !5
  %.pre71 = load ptr, ptr %.pre, align 8, !tbaa !11
  br i1 %26, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %15
  %.phi.trans.insert = getelementptr inbounds i8, ptr %.pre, i64 8
  %.pre72 = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !11
  %.phi.trans.insert73 = getelementptr inbounds i8, ptr %.pre, i64 16
  %.pre74 = load ptr, ptr %.phi.trans.insert73, align 8, !tbaa !11
  br label %._crit_edge

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

36:                                               ; preds = %.lr.ph, %36
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %36 ]
  %37 = getelementptr inbounds float, ptr %0, i64 %indvars.iv
  %38 = load float, ptr %37, align 4, !tbaa !12
  %39 = getelementptr inbounds float, ptr %1, i64 %indvars.iv
  %40 = load float, ptr %39, align 4, !tbaa !12
  %41 = fmul float %38, %38
  %42 = load <2 x float>, ptr %.pre71, align 4, !tbaa !12
  %43 = insertelement <2 x float> poison, float %41, i64 0
  %44 = shufflevector <2 x float> %43, <2 x float> poison, <2 x i32> zeroinitializer
  %45 = insertelement <2 x float> %44, float %38, i64 1
  %46 = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %44, <2 x float> %45, <2 x float> %42)
  store <2 x float> %46, ptr %.pre71, align 4, !tbaa !12
  %47 = load float, ptr %27, align 4, !tbaa !12
  %48 = fadd float %41, %47
  store float %48, ptr %27, align 4, !tbaa !12
  %49 = load float, ptr %28, align 4, !tbaa !12
  %50 = fneg float %41
  %51 = tail call float @llvm.fmuladd.f32(float %50, float %40, float %49)
  store float %51, ptr %28, align 4, !tbaa !12
  %52 = load float, ptr %31, align 4, !tbaa !12
  %53 = fadd float %38, %52
  store float %53, ptr %31, align 4, !tbaa !12
  %54 = load float, ptr %32, align 4, !tbaa !12
  %55 = fneg float %38
  %56 = tail call float @llvm.fmuladd.f32(float %55, float %40, float %54)
  store float %56, ptr %32, align 4, !tbaa !12
  %57 = load float, ptr %35, align 4, !tbaa !12
  %58 = fsub float %57, %40
  store float %58, ptr %35, 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 %36, !llvm.loop !14

._crit_edge:                                      ; preds = %36, %.._crit_edge_crit_edge
  %59 = phi ptr [ %.pre74, %.._crit_edge_crit_edge ], [ %34, %36 ]
  %60 = phi ptr [ %.pre72, %.._crit_edge_crit_edge ], [ %30, %36 ]
  %61 = getelementptr inbounds i8, ptr %.pre71, i64 4
  %62 = load float, ptr %61, align 4, !tbaa !12
  store float %62, ptr %60, align 4, !tbaa !12
  %63 = getelementptr inbounds i8, ptr %.pre71, i64 8
  %64 = load float, ptr %63, align 4, !tbaa !12
  %65 = getelementptr inbounds i8, ptr %60, i64 4
  store float %64, ptr %65, align 4, !tbaa !12
  store float %64, ptr %59, align 4, !tbaa !12
  %66 = getelementptr inbounds i8, ptr %60, i64 8
  %67 = load float, ptr %66, align 4, !tbaa !12
  %68 = getelementptr inbounds i8, ptr %59, i64 4
  store float %67, ptr %68, align 4, !tbaa !12
  %69 = sitofp i32 %2 to float
  %70 = getelementptr inbounds i8, ptr %59, i64 8
  store float %69, ptr %70, align 4, !tbaa !12
  %71 = tail call i32 @mLinearEquation(ptr noundef nonnull %16, ptr noundef %3) #5
  tail call void @mMatrixRelease(ptr noundef nonnull %16) #5
  ret void
}

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: 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,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass