; 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__.mPolyFitLSM = external hidden unnamed_addr constant [12 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

; 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 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) #1

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

declare void @mMatrixRelease(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @mPolyFitLSM(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4) #3 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %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 double, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  %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
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  store i32 %4, ptr %10, align 4, !tbaa !9
  br label %29

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

35:                                               ; preds = %29
  %36 = load i32, ptr %11, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %36, i32 noundef -1, ptr noundef @.str, i32 noundef 223, ptr noundef @__FUNCTION__.mPolyFitLSM, ptr noundef @.str.6)
  br label %37

37:                                               ; preds = %35, %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %38

38:                                               ; preds = %37
  br label %39

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

47:                                               ; preds = %39
  %48 = load i32, ptr %12, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %48, i32 noundef -1, ptr noundef @.str, i32 noundef 224, ptr noundef @__FUNCTION__.mPolyFitLSM, ptr noundef @.str.7)
  br label %49

49:                                               ; preds = %47, %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %50

50:                                               ; preds = %49
  br label %51

51:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = icmp eq ptr %52, null
  br i1 %53, label %67, label %54

54:                                               ; preds = %51
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = ptrtoint ptr %55 to i64
  %57 = icmp eq i64 %56, -1
  br i1 %57, label %67, label %58

58:                                               ; preds = %54
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = icmp eq ptr %59, null
  br i1 %60, label %65, label %61

61:                                               ; preds = %58
  %62 = load ptr, ptr %7, 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 ]
  br label %67

67:                                               ; preds = %65, %54, %51
  %68 = phi i1 [ true, %54 ], [ true, %51 ], [ %66, %65 ]
  %69 = zext i1 %68 to i32
  store i32 %69, ptr %13, align 4, !tbaa !9
  %70 = load i32, ptr %13, align 4, !tbaa !9
  %71 = icmp ne i32 %70, 0
  br i1 %71, label %72, label %74

72:                                               ; preds = %67
  %73 = load i32, ptr %13, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %73, i32 noundef -1, ptr noundef @.str, i32 noundef 225, ptr noundef @__FUNCTION__.mPolyFitLSM, ptr noundef @.str.2)
  br label %74

74:                                               ; preds = %72, %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %75

75:                                               ; preds = %74
  br label %76

76:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %77 = load ptr, ptr %9, align 8, !tbaa !5
  %78 = icmp eq ptr %77, null
  br i1 %78, label %83, label %79

79:                                               ; preds = %76
  %80 = load ptr, ptr %9, align 8, !tbaa !5
  %81 = ptrtoint ptr %80 to i64
  %82 = icmp eq i64 %81, -1
  br label %83

83:                                               ; preds = %79, %76
  %84 = phi i1 [ true, %76 ], [ %82, %79 ]
  %85 = zext i1 %84 to i32
  store i32 %85, ptr %14, align 4, !tbaa !9
  %86 = load i32, ptr %14, align 4, !tbaa !9
  %87 = icmp ne i32 %86, 0
  br i1 %87, label %88, label %90

88:                                               ; preds = %83
  %89 = load i32, ptr %14, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %89, i32 noundef -1, ptr noundef @.str, i32 noundef 226, ptr noundef @__FUNCTION__.mPolyFitLSM, ptr noundef @.str.3)
  br label %90

90:                                               ; preds = %88, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %91

91:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %92 = load i32, ptr %10, align 4, !tbaa !9
  %93 = mul nsw i32 %92, 2
  %94 = sext i32 %93 to i64
  %95 = mul i64 %94, 8
  %96 = call noalias ptr @malloc(i64 noundef %95) #7
  store ptr %96, ptr %15, align 8, !tbaa !5
  %97 = load ptr, ptr %15, align 8, !tbaa !5
  %98 = load i32, ptr %10, align 4, !tbaa !9
  %99 = mul nsw i32 %98, 2
  %100 = sext i32 %99 to i64
  %101 = mul i64 %100, 8
  call void @llvm.memset.p0.i64(ptr align 8 %97, i8 0, i64 %101, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %102 = load i32, ptr %10, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = mul i64 %103, 8
  %105 = call noalias ptr @malloc(i64 noundef %104) #7
  store ptr %105, ptr %16, align 8, !tbaa !5
  %106 = load ptr, ptr %16, align 8, !tbaa !5
  %107 = load i32, ptr %10, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = mul i64 %108, 8
  call void @llvm.memset.p0.i64(ptr align 8 %106, i8 0, i64 %109, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  store double 0.000000e+00, ptr %17, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %110 = load i32, ptr %10, align 4, !tbaa !9
  %111 = add nsw i32 %110, 1
  %112 = add nsw i32 %111, 0
  %113 = load i32, ptr %10, align 4, !tbaa !9
  %114 = add nsw i32 %113, 2
  %115 = call ptr @MatrixCreate(i32 noundef %112, i32 noundef %114, ptr noundef null)
  store ptr %115, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %116

116:                                              ; preds = %187, %91
  %117 = load i32, ptr %19, align 4, !tbaa !9
  %118 = load i32, ptr %8, align 4, !tbaa !9
  %119 = icmp slt i32 %117, %118
  br i1 %119, label %121, label %120

120:                                              ; preds = %116
  store i32 10, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %190

121:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %122 = load ptr, ptr %6, align 8, !tbaa !5
  %123 = load i32, ptr %19, 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
  %127 = fpext float %126 to double
  store double %127, ptr %21, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %128 = load ptr, ptr %7, align 8, !tbaa !5
  %129 = load i32, ptr %19, align 4, !tbaa !9
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds float, ptr %128, i64 %130
  %132 = load float, ptr %131, align 4, !tbaa !13
  %133 = fpext float %132 to double
  store double %133, ptr %22, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  store double 1.000000e+00, ptr %23, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %134

134:                                              ; preds = %155, %121
  %135 = load i32, ptr %24, align 4, !tbaa !9
  %136 = load i32, ptr %10, align 4, !tbaa !9
  %137 = mul nsw i32 %136, 2
  %138 = icmp slt i32 %135, %137
  br i1 %138, label %140, label %139

139:                                              ; preds = %134
  store i32 13, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %158

140:                                              ; preds = %134
  %141 = load double, ptr %23, align 8, !tbaa !11
  %142 = load double, ptr %21, align 8, !tbaa !11
  %143 = fmul double %141, %142
  store double %143, ptr %23, align 8, !tbaa !11
  %144 = load ptr, ptr %15, align 8, !tbaa !5
  %145 = load i32, ptr %24, align 4, !tbaa !9
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds double, ptr %144, i64 %146
  %148 = load double, ptr %147, align 8, !tbaa !11
  %149 = load double, ptr %23, align 8, !tbaa !11
  %150 = fadd double %148, %149
  %151 = load ptr, ptr %15, align 8, !tbaa !5
  %152 = load i32, ptr %24, align 4, !tbaa !9
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds double, ptr %151, i64 %153
  store double %150, ptr %154, align 8, !tbaa !11
  br label %155

155:                                              ; preds = %140
  %156 = load i32, ptr %24, align 4, !tbaa !9
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %24, align 4, !tbaa !9
  br label %134, !llvm.loop !15

158:                                              ; preds = %139
  %159 = load double, ptr %22, align 8, !tbaa !11
  store double %159, ptr %23, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  store i32 0, ptr %25, align 4, !tbaa !9
  br label %160

160:                                              ; preds = %180, %158
  %161 = load i32, ptr %25, align 4, !tbaa !9
  %162 = load i32, ptr %10, align 4, !tbaa !9
  %163 = icmp slt i32 %161, %162
  br i1 %163, label %165, label %164

164:                                              ; preds = %160
  store i32 16, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  br label %183

165:                                              ; preds = %160
  %166 = load double, ptr %23, align 8, !tbaa !11
  %167 = load double, ptr %21, align 8, !tbaa !11
  %168 = fmul double %166, %167
  store double %168, ptr %23, align 8, !tbaa !11
  %169 = load ptr, ptr %16, align 8, !tbaa !5
  %170 = load i32, ptr %25, align 4, !tbaa !9
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds double, ptr %169, i64 %171
  %173 = load double, ptr %172, align 8, !tbaa !11
  %174 = load double, ptr %23, align 8, !tbaa !11
  %175 = fadd double %173, %174
  %176 = load ptr, ptr %16, align 8, !tbaa !5
  %177 = load i32, ptr %25, align 4, !tbaa !9
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds double, ptr %176, i64 %178
  store double %175, ptr %179, align 8, !tbaa !11
  br label %180

180:                                              ; preds = %165
  %181 = load i32, ptr %25, align 4, !tbaa !9
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %25, align 4, !tbaa !9
  br label %160, !llvm.loop !17

183:                                              ; preds = %164
  %184 = load double, ptr %17, align 8, !tbaa !11
  %185 = load double, ptr %22, align 8, !tbaa !11
  %186 = fadd double %184, %185
  store double %186, ptr %17, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %187

187:                                              ; preds = %183
  %188 = load i32, ptr %19, align 4, !tbaa !9
  %189 = add nsw i32 %188, 1
  store i32 %189, ptr %19, align 4, !tbaa !9
  br label %116, !llvm.loop !18

190:                                              ; preds = %120
  %191 = load i32, ptr %8, align 4, !tbaa !9
  %192 = sitofp i32 %191 to float
  %193 = load ptr, ptr %18, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.MMatrix, ptr %193, i32 0, i32 2
  %195 = load ptr, ptr %194, align 8, !tbaa !19
  %196 = getelementptr inbounds ptr, ptr %195, i64 0
  %197 = load ptr, ptr %196, align 8, !tbaa !5
  %198 = getelementptr inbounds float, ptr %197, i64 0
  store float %192, ptr %198, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  store i32 0, ptr %26, align 4, !tbaa !9
  br label %199

199:                                              ; preds = %220, %190
  %200 = load i32, ptr %26, align 4, !tbaa !9
  %201 = load i32, ptr %10, align 4, !tbaa !9
  %202 = icmp slt i32 %200, %201
  br i1 %202, label %204, label %203

203:                                              ; preds = %199
  store i32 19, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  br label %223

204:                                              ; preds = %199
  %205 = load ptr, ptr %15, align 8, !tbaa !5
  %206 = load i32, ptr %26, align 4, !tbaa !9
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds double, ptr %205, i64 %207
  %209 = load double, ptr %208, align 8, !tbaa !11
  %210 = fptrunc double %209 to float
  %211 = load ptr, ptr %18, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.MMatrix, ptr %211, i32 0, i32 2
  %213 = load ptr, ptr %212, align 8, !tbaa !19
  %214 = getelementptr inbounds ptr, ptr %213, i64 0
  %215 = load ptr, ptr %214, align 8, !tbaa !5
  %216 = load i32, ptr %26, align 4, !tbaa !9
  %217 = add nsw i32 %216, 1
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds float, ptr %215, i64 %218
  store float %210, ptr %219, align 4, !tbaa !13
  br label %220

220:                                              ; preds = %204
  %221 = load i32, ptr %26, align 4, !tbaa !9
  %222 = add nsw i32 %221, 1
  store i32 %222, ptr %26, align 4, !tbaa !9
  br label %199, !llvm.loop !21

223:                                              ; preds = %203
  %224 = load double, ptr %17, align 8, !tbaa !11
  %225 = fsub double 0.000000e+00, %224
  %226 = fptrunc double %225 to float
  %227 = load ptr, ptr %18, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.MMatrix, ptr %227, i32 0, i32 2
  %229 = load ptr, ptr %228, align 8, !tbaa !19
  %230 = getelementptr inbounds ptr, ptr %229, i64 0
  %231 = load ptr, ptr %230, align 8, !tbaa !5
  %232 = load i32, ptr %10, align 4, !tbaa !9
  %233 = add nsw i32 %232, 1
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds float, ptr %231, i64 %234
  store float %226, ptr %235, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  store i32 0, ptr %27, align 4, !tbaa !9
  br label %236

236:                                              ; preds = %290, %223
  %237 = load i32, ptr %27, align 4, !tbaa !9
  %238 = load i32, ptr %10, align 4, !tbaa !9
  %239 = icmp slt i32 %237, %238
  br i1 %239, label %241, label %240

240:                                              ; preds = %236
  store i32 22, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  br label %293

241:                                              ; preds = %236
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #6
  store i32 0, ptr %28, align 4, !tbaa !9
  br label %242

242:                                              ; preds = %267, %241
  %243 = load i32, ptr %28, align 4, !tbaa !9
  %244 = load i32, ptr %10, align 4, !tbaa !9
  %245 = icmp sle i32 %243, %244
  br i1 %245, label %247, label %246

246:                                              ; preds = %242
  store i32 25, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #6
  br label %270

247:                                              ; preds = %242
  %248 = load ptr, ptr %15, align 8, !tbaa !5
  %249 = load i32, ptr %27, align 4, !tbaa !9
  %250 = load i32, ptr %28, align 4, !tbaa !9
  %251 = add nsw i32 %249, %250
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds double, ptr %248, i64 %252
  %254 = load double, ptr %253, align 8, !tbaa !11
  %255 = fptrunc double %254 to float
  %256 = load ptr, ptr %18, align 8, !tbaa !5
  %257 = getelementptr inbounds %struct.MMatrix, ptr %256, i32 0, i32 2
  %258 = load ptr, ptr %257, align 8, !tbaa !19
  %259 = load i32, ptr %27, align 4, !tbaa !9
  %260 = add nsw i32 %259, 1
  %261 = sext i32 %260 to i64
  %262 = getelementptr inbounds ptr, ptr %258, i64 %261
  %263 = load ptr, ptr %262, align 8, !tbaa !5
  %264 = load i32, ptr %28, align 4, !tbaa !9
  %265 = sext i32 %264 to i64
  %266 = getelementptr inbounds float, ptr %263, i64 %265
  store float %255, ptr %266, align 4, !tbaa !13
  br label %267

267:                                              ; preds = %247
  %268 = load i32, ptr %28, align 4, !tbaa !9
  %269 = add nsw i32 %268, 1
  store i32 %269, ptr %28, align 4, !tbaa !9
  br label %242, !llvm.loop !22

270:                                              ; preds = %246
  %271 = load ptr, ptr %16, align 8, !tbaa !5
  %272 = load i32, ptr %27, align 4, !tbaa !9
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds double, ptr %271, i64 %273
  %275 = load double, ptr %274, align 8, !tbaa !11
  %276 = fsub double 0.000000e+00, %275
  %277 = fptrunc double %276 to float
  %278 = load ptr, ptr %18, align 8, !tbaa !5
  %279 = getelementptr inbounds %struct.MMatrix, ptr %278, i32 0, i32 2
  %280 = load ptr, ptr %279, align 8, !tbaa !19
  %281 = load i32, ptr %27, align 4, !tbaa !9
  %282 = add nsw i32 %281, 1
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds ptr, ptr %280, i64 %283
  %285 = load ptr, ptr %284, align 8, !tbaa !5
  %286 = load i32, ptr %10, align 4, !tbaa !9
  %287 = add nsw i32 %286, 1
  %288 = sext i32 %287 to i64
  %289 = getelementptr inbounds float, ptr %285, i64 %288
  store float %277, ptr %289, align 4, !tbaa !13
  br label %290

290:                                              ; preds = %270
  %291 = load i32, ptr %27, align 4, !tbaa !9
  %292 = add nsw i32 %291, 1
  store i32 %292, ptr %27, align 4, !tbaa !9
  br label %236, !llvm.loop !23

293:                                              ; preds = %240
  %294 = load ptr, ptr %18, align 8, !tbaa !5
  %295 = load ptr, ptr %9, align 8, !tbaa !5
  %296 = call i32 @mLinearEquation(ptr noundef %294, ptr noundef %295)
  %297 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free(ptr noundef %297) #6
  %298 = load ptr, ptr %16, align 8, !tbaa !5
  call void @free(ptr noundef %298) #6
  %299 = load ptr, ptr %18, align 8, !tbaa !5
  call void @mMatrixRelease(ptr noundef %299)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  ret void
}

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

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

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 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 = { 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 }
attributes #7 = { 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 = !{!"double", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = !{!20, !6, i64 8}
!20 = !{!"MMatrix", !10, i64 0, !10, i64 4, !6, i64 8}
!21 = distinct !{!21, !16}
!22 = distinct !{!22, !16}
!23 = distinct !{!23, !16}


; 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__.mPolyFitLSM = external hidden unnamed_addr constant [12 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

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

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 @mPolyFitLSM(ptr noundef %0, ptr noundef readonly %1, i32 noundef %2, ptr noundef %3, i32 noundef %4) local_unnamed_addr #1 {
  %6 = icmp eq i32 %4, 0
  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 223, ptr noundef nonnull @__FUNCTION__.mPolyFitLSM, ptr noundef nonnull @.str.6) #5
  br label %8

8:                                                ; preds = %7, %5
  %9 = add i32 %4, 1
  %.not101 = icmp slt i32 %4, %2
  br i1 %.not101, label %11, label %10

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

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

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

.thread:                                          ; preds = %12, %12, %11, %11
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 225, ptr noundef nonnull @__FUNCTION__.mPolyFitLSM, ptr noundef nonnull @.str.2) #5
  br label %13

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

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

19:                                               ; preds = %13, %14
  %20 = shl nsw i32 %4, 1
  %21 = sext i32 %20 to i64
  %22 = shl nsw i64 %21, 3
  %calloc = tail call ptr @calloc(i64 1, i64 %22)
  %23 = sext i32 %4 to i64
  %24 = shl nsw i64 %23, 3
  %calloc188 = tail call ptr @calloc(i64 1, i64 %24)
  %25 = add nsw i32 %4, 2
  %26 = tail call ptr @MatrixCreate(i32 noundef %9, i32 noundef %25, ptr noundef null) #5
  %27 = icmp sgt i32 %2, 0
  br i1 %27, label %.lr.ph111, label %._crit_edge112

.lr.ph111:                                        ; preds = %19
  %28 = icmp sgt i32 %4, 0
  br i1 %28, label %.lr.ph.us.us.preheader, label %.preheader102.preheader

.lr.ph.us.us.preheader:                           ; preds = %.lr.ph111
  %smax160 = tail call i32 @llvm.smax.i32(i32 %20, i32 1)
  %wide.trip.count171 = zext nneg i32 %2 to i64
  %wide.trip.count161 = zext nneg i32 %smax160 to i64
  %wide.trip.count166 = zext nneg i32 %4 to i64
  %xtraiter213 = and i64 %wide.trip.count161, 3
  %29 = icmp eq i32 %4, 1
  %unroll_iter216 = and i64 %wide.trip.count161, 2147483644
  %lcmp.mod215.not = icmp eq i64 %xtraiter213, 0
  %xtraiter218 = and i64 %wide.trip.count166, 3
  %30 = icmp ult i32 %4, 4
  %unroll_iter221 = and i64 %wide.trip.count166, 2147483644
  %lcmp.mod220.not = icmp eq i64 %xtraiter218, 0
  br label %.lr.ph.us.us

.lr.ph.us.us:                                     ; preds = %.lr.ph.us.us.preheader, %._crit_edge.us.us
  %indvars.iv168 = phi i64 [ 0, %.lr.ph.us.us.preheader ], [ %indvars.iv.next169, %._crit_edge.us.us ]
  %.095109.us.us = phi double [ 0.000000e+00, %.lr.ph.us.us.preheader ], [ %77, %._crit_edge.us.us ]
  %31 = getelementptr inbounds float, ptr %0, i64 %indvars.iv168
  %32 = load float, ptr %31, align 4, !tbaa !5
  %33 = fpext float %32 to double
  %34 = getelementptr inbounds float, ptr %1, i64 %indvars.iv168
  %35 = load float, ptr %34, align 4, !tbaa !5
  br i1 %29, label %..preheader102_crit_edge.us.us.preheader.unr-lcssa, label %.lr.ph.us.us.new

..preheader102_crit_edge.us.us:                   ; preds = %..preheader102_crit_edge.us.us.preheader, %..preheader102_crit_edge.us.us
  %indvars.iv163 = phi i64 [ %indvars.iv.next164.3, %..preheader102_crit_edge.us.us ], [ 0, %..preheader102_crit_edge.us.us.preheader ]
  %.1105.us.us = phi double [ %48, %..preheader102_crit_edge.us.us ], [ %72, %..preheader102_crit_edge.us.us.preheader ]
  %niter222 = phi i64 [ %niter222.next.3, %..preheader102_crit_edge.us.us ], [ 0, %..preheader102_crit_edge.us.us.preheader ]
  %36 = fmul double %.1105.us.us, %33
  %37 = getelementptr inbounds double, ptr %calloc188, i64 %indvars.iv163
  %38 = load double, ptr %37, align 8, !tbaa !9
  %39 = fadd double %36, %38
  store double %39, ptr %37, align 8, !tbaa !9
  %indvars.iv.next164 = or disjoint i64 %indvars.iv163, 1
  %40 = fmul double %36, %33
  %41 = getelementptr inbounds double, ptr %calloc188, i64 %indvars.iv.next164
  %42 = load double, ptr %41, align 8, !tbaa !9
  %43 = fadd double %40, %42
  store double %43, ptr %41, align 8, !tbaa !9
  %indvars.iv.next164.1 = or disjoint i64 %indvars.iv163, 2
  %44 = fmul double %40, %33
  %45 = getelementptr inbounds double, ptr %calloc188, i64 %indvars.iv.next164.1
  %46 = load double, ptr %45, align 8, !tbaa !9
  %47 = fadd double %44, %46
  store double %47, ptr %45, align 8, !tbaa !9
  %indvars.iv.next164.2 = or disjoint i64 %indvars.iv163, 3
  %48 = fmul double %44, %33
  %49 = getelementptr inbounds double, ptr %calloc188, i64 %indvars.iv.next164.2
  %50 = load double, ptr %49, align 8, !tbaa !9
  %51 = fadd double %48, %50
  store double %51, ptr %49, align 8, !tbaa !9
  %indvars.iv.next164.3 = add nuw nsw i64 %indvars.iv163, 4
  %niter222.next.3 = add i64 %niter222, 4
  %niter222.ncmp.3 = icmp eq i64 %niter222.next.3, %unroll_iter221
  br i1 %niter222.ncmp.3, label %._crit_edge.us.us.unr-lcssa, label %..preheader102_crit_edge.us.us, !llvm.loop !11

.lr.ph.us.us.new:                                 ; preds = %.lr.ph.us.us, %.lr.ph.us.us.new
  %indvars.iv157 = phi i64 [ %indvars.iv.next158.3, %.lr.ph.us.us.new ], [ 0, %.lr.ph.us.us ]
  %.094103.us.us = phi double [ %64, %.lr.ph.us.us.new ], [ 1.000000e+00, %.lr.ph.us.us ]
  %niter217 = phi i64 [ %niter217.next.3, %.lr.ph.us.us.new ], [ 0, %.lr.ph.us.us ]
  %52 = fmul double %.094103.us.us, %33
  %53 = getelementptr inbounds double, ptr %calloc, i64 %indvars.iv157
  %54 = load double, ptr %53, align 8, !tbaa !9
  %55 = fadd double %52, %54
  store double %55, ptr %53, align 8, !tbaa !9
  %indvars.iv.next158 = or disjoint i64 %indvars.iv157, 1
  %56 = fmul double %52, %33
  %57 = getelementptr inbounds double, ptr %calloc, i64 %indvars.iv.next158
  %58 = load double, ptr %57, align 8, !tbaa !9
  %59 = fadd double %56, %58
  store double %59, ptr %57, align 8, !tbaa !9
  %indvars.iv.next158.1 = or disjoint i64 %indvars.iv157, 2
  %60 = fmul double %56, %33
  %61 = getelementptr inbounds double, ptr %calloc, i64 %indvars.iv.next158.1
  %62 = load double, ptr %61, align 8, !tbaa !9
  %63 = fadd double %60, %62
  store double %63, ptr %61, align 8, !tbaa !9
  %indvars.iv.next158.2 = or disjoint i64 %indvars.iv157, 3
  %64 = fmul double %60, %33
  %65 = getelementptr inbounds double, ptr %calloc, i64 %indvars.iv.next158.2
  %66 = load double, ptr %65, align 8, !tbaa !9
  %67 = fadd double %64, %66
  store double %67, ptr %65, align 8, !tbaa !9
  %indvars.iv.next158.3 = add nuw nsw i64 %indvars.iv157, 4
  %niter217.next.3 = add i64 %niter217, 4
  %niter217.ncmp.3 = icmp eq i64 %niter217.next.3, %unroll_iter216
  br i1 %niter217.ncmp.3, label %..preheader102_crit_edge.us.us.preheader.unr-lcssa, label %.lr.ph.us.us.new, !llvm.loop !13

..preheader102_crit_edge.us.us.preheader.unr-lcssa: ; preds = %.lr.ph.us.us.new, %.lr.ph.us.us
  %indvars.iv157.unr = phi i64 [ 0, %.lr.ph.us.us ], [ %indvars.iv.next158.3, %.lr.ph.us.us.new ]
  %.094103.us.us.unr = phi double [ 1.000000e+00, %.lr.ph.us.us ], [ %64, %.lr.ph.us.us.new ]
  br i1 %lcmp.mod215.not, label %..preheader102_crit_edge.us.us.preheader, label %.epil.preheader

.epil.preheader:                                  ; preds = %..preheader102_crit_edge.us.us.preheader.unr-lcssa, %.epil.preheader
  %indvars.iv157.epil = phi i64 [ %indvars.iv.next158.epil, %.epil.preheader ], [ %indvars.iv157.unr, %..preheader102_crit_edge.us.us.preheader.unr-lcssa ]
  %.094103.us.us.epil = phi double [ %68, %.epil.preheader ], [ %.094103.us.us.unr, %..preheader102_crit_edge.us.us.preheader.unr-lcssa ]
  %epil.iter214 = phi i64 [ %epil.iter214.next, %.epil.preheader ], [ 0, %..preheader102_crit_edge.us.us.preheader.unr-lcssa ]
  %68 = fmul double %.094103.us.us.epil, %33
  %69 = getelementptr inbounds double, ptr %calloc, i64 %indvars.iv157.epil
  %70 = load double, ptr %69, align 8, !tbaa !9
  %71 = fadd double %68, %70
  store double %71, ptr %69, align 8, !tbaa !9
  %indvars.iv.next158.epil = add nuw nsw i64 %indvars.iv157.epil, 1
  %epil.iter214.next = add i64 %epil.iter214, 1
  %epil.iter214.cmp.not = icmp eq i64 %epil.iter214.next, %xtraiter213
  br i1 %epil.iter214.cmp.not, label %..preheader102_crit_edge.us.us.preheader, label %.epil.preheader, !llvm.loop !14

..preheader102_crit_edge.us.us.preheader:         ; preds = %.epil.preheader, %..preheader102_crit_edge.us.us.preheader.unr-lcssa
  %72 = fpext float %35 to double
  br i1 %30, label %._crit_edge.us.us.unr-lcssa, label %..preheader102_crit_edge.us.us

._crit_edge.us.us.unr-lcssa:                      ; preds = %..preheader102_crit_edge.us.us, %..preheader102_crit_edge.us.us.preheader
  %indvars.iv163.unr = phi i64 [ 0, %..preheader102_crit_edge.us.us.preheader ], [ %indvars.iv.next164.3, %..preheader102_crit_edge.us.us ]
  %.1105.us.us.unr = phi double [ %72, %..preheader102_crit_edge.us.us.preheader ], [ %48, %..preheader102_crit_edge.us.us ]
  br i1 %lcmp.mod220.not, label %._crit_edge.us.us, label %..preheader102_crit_edge.us.us.epil

..preheader102_crit_edge.us.us.epil:              ; preds = %._crit_edge.us.us.unr-lcssa, %..preheader102_crit_edge.us.us.epil
  %indvars.iv163.epil = phi i64 [ %indvars.iv.next164.epil, %..preheader102_crit_edge.us.us.epil ], [ %indvars.iv163.unr, %._crit_edge.us.us.unr-lcssa ]
  %.1105.us.us.epil = phi double [ %73, %..preheader102_crit_edge.us.us.epil ], [ %.1105.us.us.unr, %._crit_edge.us.us.unr-lcssa ]
  %epil.iter219 = phi i64 [ %epil.iter219.next, %..preheader102_crit_edge.us.us.epil ], [ 0, %._crit_edge.us.us.unr-lcssa ]
  %73 = fmul double %.1105.us.us.epil, %33
  %74 = getelementptr inbounds double, ptr %calloc188, i64 %indvars.iv163.epil
  %75 = load double, ptr %74, align 8, !tbaa !9
  %76 = fadd double %73, %75
  store double %76, ptr %74, align 8, !tbaa !9
  %indvars.iv.next164.epil = add nuw nsw i64 %indvars.iv163.epil, 1
  %epil.iter219.next = add i64 %epil.iter219, 1
  %epil.iter219.cmp.not = icmp eq i64 %epil.iter219.next, %xtraiter218
  br i1 %epil.iter219.cmp.not, label %._crit_edge.us.us, label %..preheader102_crit_edge.us.us.epil, !llvm.loop !16

._crit_edge.us.us:                                ; preds = %..preheader102_crit_edge.us.us.epil, %._crit_edge.us.us.unr-lcssa
  %77 = fadd double %.095109.us.us, %72
  %indvars.iv.next169 = add nuw nsw i64 %indvars.iv168, 1
  %exitcond172.not = icmp eq i64 %indvars.iv.next169, %wide.trip.count171
  br i1 %exitcond172.not, label %._crit_edge112, label %.lr.ph.us.us, !llvm.loop !17

.preheader102.preheader:                          ; preds = %.lr.ph111
  %wide.trip.count = zext nneg i32 %2 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %78 = icmp ult i32 %2, 4
  br i1 %78, label %._crit_edge112.loopexit210.unr-lcssa, label %.preheader102.preheader.new

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

._crit_edge112.loopexit210.unr-lcssa:             ; preds = %.preheader102, %.preheader102.preheader
  %.lcssa211.ph = phi double [ poison, %.preheader102.preheader ], [ %115, %.preheader102 ]
  %indvars.iv.unr = phi i64 [ 0, %.preheader102.preheader ], [ %indvars.iv.next.3, %.preheader102 ]
  %.095109.unr = phi double [ 0.000000e+00, %.preheader102.preheader ], [ %115, %.preheader102 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge112, label %.preheader102.epil

.preheader102.epil:                               ; preds = %._crit_edge112.loopexit210.unr-lcssa, %.preheader102.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.preheader102.epil ], [ %indvars.iv.unr, %._crit_edge112.loopexit210.unr-lcssa ]
  %.095109.epil = phi double [ %82, %.preheader102.epil ], [ %.095109.unr, %._crit_edge112.loopexit210.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.preheader102.epil ], [ 0, %._crit_edge112.loopexit210.unr-lcssa ]
  %79 = getelementptr inbounds float, ptr %1, i64 %indvars.iv.epil
  %80 = load float, ptr %79, align 4, !tbaa !5
  %81 = fpext float %80 to double
  %82 = fadd double %.095109.epil, %81
  %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 %._crit_edge112, label %.preheader102.epil, !llvm.loop !18

._crit_edge112:                                   ; preds = %._crit_edge112.loopexit210.unr-lcssa, %.preheader102.epil, %._crit_edge.us.us, %19
  %.095.lcssa = phi double [ 0.000000e+00, %19 ], [ %77, %._crit_edge.us.us ], [ %.lcssa211.ph, %._crit_edge112.loopexit210.unr-lcssa ], [ %82, %.preheader102.epil ]
  %83 = sitofp i32 %2 to float
  %84 = getelementptr inbounds i8, ptr %26, i64 8
  %85 = load ptr, ptr %84, align 8, !tbaa !19
  %86 = load ptr, ptr %85, align 8, !tbaa !23
  store float %83, ptr %86, align 4, !tbaa !5
  %87 = icmp sgt i32 %4, 0
  br i1 %87, label %.lr.ph.preheader, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %._crit_edge112
  %88 = fsub double 0.000000e+00, %.095.lcssa
  %89 = fptrunc double %88 to float
  %90 = sext i32 %9 to i64
  %91 = getelementptr inbounds float, ptr %86, i64 %90
  store float %89, ptr %91, align 4, !tbaa !5
  br label %._crit_edge129

.lr.ph.preheader:                                 ; preds = %._crit_edge112
  %wide.trip.count176 = zext nneg i32 %4 to i64
  %min.iters.check = icmp ult i32 %4, 4
  br i1 %min.iters.check, label %.lr.ph.preheader209, label %vector.ph

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

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %wide.trip.count176, 2147483644
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %92 = getelementptr inbounds double, ptr %calloc, i64 %index
  %93 = getelementptr inbounds i8, ptr %92, i64 16
  %wide.load = load <2 x double>, ptr %92, align 8, !tbaa !9
  %wide.load195 = load <2 x double>, ptr %93, align 8, !tbaa !9
  %94 = fptrunc <2 x double> %wide.load to <2 x float>
  %95 = fptrunc <2 x double> %wide.load195 to <2 x float>
  %96 = or disjoint i64 %index, 1
  %97 = getelementptr inbounds float, ptr %86, i64 %96
  %98 = getelementptr inbounds i8, ptr %97, i64 8
  store <2 x float> %94, ptr %97, align 4, !tbaa !5
  store <2 x float> %95, ptr %98, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %99 = icmp eq i64 %index.next, %n.vec
  br i1 %99, label %middle.block, label %vector.body, !llvm.loop !24

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

.preheader102:                                    ; preds = %.preheader102, %.preheader102.preheader.new
  %indvars.iv = phi i64 [ 0, %.preheader102.preheader.new ], [ %indvars.iv.next.3, %.preheader102 ]
  %.095109 = phi double [ 0.000000e+00, %.preheader102.preheader.new ], [ %115, %.preheader102 ]
  %niter = phi i64 [ 0, %.preheader102.preheader.new ], [ %niter.next.3, %.preheader102 ]
  %100 = getelementptr inbounds float, ptr %1, i64 %indvars.iv
  %101 = load float, ptr %100, align 4, !tbaa !5
  %102 = fpext float %101 to double
  %103 = fadd double %.095109, %102
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %104 = getelementptr inbounds float, ptr %1, i64 %indvars.iv.next
  %105 = load float, ptr %104, align 4, !tbaa !5
  %106 = fpext float %105 to double
  %107 = fadd double %103, %106
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %108 = getelementptr inbounds float, ptr %1, i64 %indvars.iv.next.1
  %109 = load float, ptr %108, align 4, !tbaa !5
  %110 = fpext float %109 to double
  %111 = fadd double %107, %110
  %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 = fpext float %113 to double
  %115 = fadd double %111, %114
  %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 %._crit_edge112.loopexit210.unr-lcssa, label %.preheader102, !llvm.loop !17

._crit_edge:                                      ; preds = %.lr.ph, %middle.block
  %116 = fsub double 0.000000e+00, %.095.lcssa
  %117 = fptrunc double %116 to float
  %118 = sext i32 %9 to i64
  %119 = getelementptr inbounds float, ptr %86, i64 %118
  store float %117, ptr %119, align 4, !tbaa !5
  br i1 %87, label %.preheader.lr.ph, label %._crit_edge129

.preheader.lr.ph:                                 ; preds = %._crit_edge
  %invariant.gep = getelementptr inbounds i8, ptr %85, i64 8
  %wide.trip.count186 = zext nneg i32 %4 to i64
  %wide.trip.count181 = zext i32 %9 to i64
  %min.iters.check198 = icmp ult i32 %9, 4
  %n.vec201 = and i64 %wide.trip.count181, 4294967292
  %cmp.n208 = icmp eq i64 %n.vec201, %wide.trip.count181
  br label %.preheader

.lr.ph:                                           ; preds = %.lr.ph.preheader209, %.lr.ph
  %indvars.iv173 = phi i64 [ %indvars.iv.next174, %.lr.ph ], [ %indvars.iv173.ph, %.lr.ph.preheader209 ]
  %120 = getelementptr inbounds double, ptr %calloc, i64 %indvars.iv173
  %121 = load double, ptr %120, align 8, !tbaa !9
  %122 = fptrunc double %121 to float
  %indvars.iv.next174 = add nuw nsw i64 %indvars.iv173, 1
  %123 = getelementptr inbounds float, ptr %86, i64 %indvars.iv.next174
  store float %122, ptr %123, align 4, !tbaa !5
  %exitcond177.not = icmp eq i64 %indvars.iv.next174, %wide.trip.count176
  br i1 %exitcond177.not, label %._crit_edge, label %.lr.ph, !llvm.loop !27

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge127
  %indvars.iv183 = phi i64 [ 0, %.preheader.lr.ph ], [ %indvars.iv.next184, %._crit_edge127 ]
  %gep = getelementptr inbounds ptr, ptr %invariant.gep, i64 %indvars.iv183
  %124 = load ptr, ptr %gep, align 8, !tbaa !23
  %invariant.gep191 = getelementptr inbounds double, ptr %calloc, i64 %indvars.iv183
  br i1 %min.iters.check198, label %scalar.ph197.preheader, label %vector.body203

scalar.ph197.preheader:                           ; preds = %middle.block196, %.preheader
  %indvars.iv178.ph = phi i64 [ 0, %.preheader ], [ %n.vec201, %middle.block196 ]
  br label %scalar.ph197

vector.body203:                                   ; preds = %.preheader, %vector.body203
  %index204 = phi i64 [ %index.next207, %vector.body203 ], [ 0, %.preheader ]
  %125 = getelementptr inbounds double, ptr %invariant.gep191, i64 %index204
  %126 = getelementptr inbounds i8, ptr %125, i64 16
  %wide.load205 = load <2 x double>, ptr %125, align 8, !tbaa !9
  %wide.load206 = load <2 x double>, ptr %126, align 8, !tbaa !9
  %127 = fptrunc <2 x double> %wide.load205 to <2 x float>
  %128 = fptrunc <2 x double> %wide.load206 to <2 x float>
  %129 = getelementptr inbounds float, ptr %124, i64 %index204
  %130 = getelementptr inbounds i8, ptr %129, i64 8
  store <2 x float> %127, ptr %129, align 4, !tbaa !5
  store <2 x float> %128, ptr %130, align 4, !tbaa !5
  %index.next207 = add nuw i64 %index204, 4
  %131 = icmp eq i64 %index.next207, %n.vec201
  br i1 %131, label %middle.block196, label %vector.body203, !llvm.loop !28

middle.block196:                                  ; preds = %vector.body203
  br i1 %cmp.n208, label %._crit_edge127, label %scalar.ph197.preheader

._crit_edge129:                                   ; preds = %._crit_edge127, %._crit_edge.thread, %._crit_edge
  %132 = tail call i32 @mLinearEquation(ptr noundef %26, ptr noundef %3) #5
  tail call void @free(ptr noundef %calloc) #5
  tail call void @free(ptr noundef %calloc188) #5
  tail call void @mMatrixRelease(ptr noundef %26) #5
  ret void

._crit_edge127:                                   ; preds = %scalar.ph197, %middle.block196
  %133 = getelementptr inbounds double, ptr %calloc188, i64 %indvars.iv183
  %134 = load double, ptr %133, align 8, !tbaa !9
  %135 = fsub double 0.000000e+00, %134
  %136 = fptrunc double %135 to float
  %indvars.iv.next184 = add nuw nsw i64 %indvars.iv183, 1
  %137 = getelementptr inbounds float, ptr %124, i64 %118
  store float %136, ptr %137, align 4, !tbaa !5
  %exitcond187.not = icmp eq i64 %indvars.iv.next184, %wide.trip.count186
  br i1 %exitcond187.not, label %._crit_edge129, label %.preheader, !llvm.loop !29

scalar.ph197:                                     ; preds = %scalar.ph197.preheader, %scalar.ph197
  %indvars.iv178 = phi i64 [ %indvars.iv.next179, %scalar.ph197 ], [ %indvars.iv178.ph, %scalar.ph197.preheader ]
  %gep192 = getelementptr inbounds double, ptr %invariant.gep191, i64 %indvars.iv178
  %138 = load double, ptr %gep192, align 8, !tbaa !9
  %139 = fptrunc double %138 to float
  %140 = getelementptr inbounds float, ptr %124, i64 %indvars.iv178
  store float %139, ptr %140, align 4, !tbaa !5
  %indvars.iv.next179 = add nuw nsw i64 %indvars.iv178, 1
  %exitcond182.not = icmp eq i64 %indvars.iv.next179, %wide.trip.count181
  br i1 %exitcond182.not, label %._crit_edge127, label %scalar.ph197, !llvm.loop !30
}

; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3

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


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