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

; 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.MImageCurve = type { %struct.MImagePoint, %struct.MImagePoint, i32, ptr, [16 x float] }
%struct.MImagePoint = type { float, float }
%struct.MList = type { i32, ptr }

@.str = external hidden unnamed_addr constant [85 x i8], align 1
@__FUNCTION__.mCurveInterpolation = external hidden unnamed_addr constant [20 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 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

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @CurveInterpolation4(ptr noundef, ptr noundef, i32 noundef, float noundef, float noundef, ptr noundef, ptr noundef) #2

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

24:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %25 = load i32, ptr %5, align 4, !tbaa !12
  %26 = icmp slt i32 %25, 3
  %27 = zext i1 %26 to i32
  store i32 %27, ptr %7, align 4, !tbaa !12
  %28 = load i32, ptr %7, align 4, !tbaa !12
  %29 = icmp ne i32 %28, 0
  br i1 %29, label %30, label %32

30:                                               ; preds = %24
  %31 = load i32, ptr %7, align 4, !tbaa !12
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %31, i32 noundef -1, ptr noundef @.str, i32 noundef 46, ptr noundef @__FUNCTION__.mCurveInterpolation, ptr noundef @.str.2)
  br label %32

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

33:                                               ; preds = %32
  br label %34

34:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = getelementptr inbounds ptr, ptr %35, i64 0
  %37 = load ptr, ptr %36, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.MImagePoint, ptr %37, i32 0, i32 0
  %39 = load float, ptr %38, align 4, !tbaa !14
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds ptr, ptr %40, i64 1
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.MImagePoint, ptr %42, i32 0, i32 0
  %44 = load float, ptr %43, align 4, !tbaa !14
  %45 = fcmp ogt float %39, %44
  %46 = zext i1 %45 to i32
  store i32 %46, ptr %9, align 4, !tbaa !12
  store i32 1, ptr %10, align 4, !tbaa !12
  br label %47

47:                                               ; preds = %74, %34
  %48 = load i32, ptr %10, align 4, !tbaa !12
  %49 = load i32, ptr %5, align 4, !tbaa !12
  %50 = sub nsw i32 %49, 1
  %51 = icmp slt i32 %48, %50
  br i1 %51, label %52, label %77

52:                                               ; preds = %47
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = load i32, ptr %10, align 4, !tbaa !12
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds ptr, ptr %53, i64 %55
  %57 = load ptr, ptr %56, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.MImagePoint, ptr %57, i32 0, i32 0
  %59 = load float, ptr %58, align 4, !tbaa !14
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = load i32, ptr %10, align 4, !tbaa !12
  %62 = add nsw i32 %61, 1
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds ptr, ptr %60, i64 %63
  %65 = load ptr, ptr %64, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.MImagePoint, ptr %65, i32 0, i32 0
  %67 = load float, ptr %66, align 4, !tbaa !14
  %68 = fcmp ogt float %59, %67
  %69 = zext i1 %68 to i32
  %70 = load i32, ptr %9, align 4, !tbaa !12
  %71 = icmp ne i32 %69, %70
  br i1 %71, label %72, label %73

72:                                               ; preds = %52
  br label %77

73:                                               ; preds = %52
  br label %74

74:                                               ; preds = %73
  %75 = load i32, ptr %10, align 4, !tbaa !12
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %10, align 4, !tbaa !12
  br label %47, !llvm.loop !17

77:                                               ; preds = %72, %47
  %78 = load i32, ptr %10, align 4, !tbaa !12
  %79 = load i32, ptr %5, align 4, !tbaa !12
  %80 = sub nsw i32 %79, 1
  %81 = icmp eq i32 %78, %80
  br i1 %81, label %82, label %83

82:                                               ; preds = %77
  store i32 -1, ptr %8, align 4, !tbaa !12
  br label %127

83:                                               ; preds = %77
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  %85 = getelementptr inbounds ptr, ptr %84, i64 0
  %86 = load ptr, ptr %85, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.MImagePoint, ptr %86, i32 0, i32 1
  %88 = load float, ptr %87, align 4, !tbaa !19
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = getelementptr inbounds ptr, ptr %89, i64 1
  %91 = load ptr, ptr %90, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.MImagePoint, ptr %91, i32 0, i32 1
  %93 = load float, ptr %92, align 4, !tbaa !19
  %94 = fcmp ogt float %88, %93
  %95 = zext i1 %94 to i32
  store i32 %95, ptr %9, align 4, !tbaa !12
  store i32 1, ptr %10, align 4, !tbaa !12
  br label %96

96:                                               ; preds = %123, %83
  %97 = load i32, ptr %10, align 4, !tbaa !12
  %98 = load i32, ptr %5, align 4, !tbaa !12
  %99 = sub nsw i32 %98, 1
  %100 = icmp slt i32 %97, %99
  br i1 %100, label %101, label %126

101:                                              ; preds = %96
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  %103 = load i32, ptr %10, align 4, !tbaa !12
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds ptr, ptr %102, i64 %104
  %106 = load ptr, ptr %105, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.MImagePoint, ptr %106, i32 0, i32 1
  %108 = load float, ptr %107, align 4, !tbaa !19
  %109 = load ptr, ptr %6, align 8, !tbaa !5
  %110 = load i32, ptr %10, align 4, !tbaa !12
  %111 = add nsw i32 %110, 1
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds ptr, ptr %109, i64 %112
  %114 = load ptr, ptr %113, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.MImagePoint, ptr %114, i32 0, i32 1
  %116 = load float, ptr %115, align 4, !tbaa !19
  %117 = fcmp ogt float %108, %116
  %118 = zext i1 %117 to i32
  %119 = load i32, ptr %9, align 4, !tbaa !12
  %120 = icmp ne i32 %118, %119
  br i1 %120, label %121, label %122

121:                                              ; preds = %101
  br label %126

122:                                              ; preds = %101
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %10, align 4, !tbaa !12
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %10, align 4, !tbaa !12
  br label %96, !llvm.loop !20

126:                                              ; preds = %121, %96
  br label %127

127:                                              ; preds = %126, %82
  %128 = load i32, ptr %10, align 4, !tbaa !12
  %129 = load i32, ptr %5, align 4, !tbaa !12
  %130 = sub nsw i32 %129, 1
  %131 = icmp eq i32 %128, %130
  br i1 %131, label %132, label %133

132:                                              ; preds = %127
  store i32 1, ptr %8, align 4, !tbaa !12
  br label %142

133:                                              ; preds = %127
  br label %134

134:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 1, ptr %11, align 4, !tbaa !12
  %135 = load i32, ptr %11, align 4, !tbaa !12
  %136 = icmp ne i32 %135, 0
  br i1 %136, label %137, label %139

137:                                              ; preds = %134
  %138 = load i32, ptr %11, align 4, !tbaa !12
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %138, i32 noundef -1, ptr noundef @.str, i32 noundef 50, ptr noundef @__FUNCTION__.mCurveInterpolation, ptr noundef @.str.2)
  br label %139

139:                                              ; preds = %137, %134
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %140

140:                                              ; preds = %139
  br label %141

141:                                              ; preds = %140
  br label %142

142:                                              ; preds = %141, %132
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %143 = call ptr @MatrixCreate(i32 noundef 4, i32 noundef 5, ptr noundef null)
  store ptr %143, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 96, ptr %13) #4
  %144 = load ptr, ptr %4, align 8, !tbaa !5
  call void @mListClear(ptr noundef %144)
  %145 = load ptr, ptr %6, align 8, !tbaa !5
  %146 = getelementptr inbounds ptr, ptr %145, i64 0
  %147 = load ptr, ptr %146, align 8, !tbaa !5
  %148 = load ptr, ptr %6, align 8, !tbaa !5
  %149 = getelementptr inbounds ptr, ptr %148, i64 1
  %150 = load ptr, ptr %149, align 8, !tbaa !5
  %151 = load ptr, ptr %6, align 8, !tbaa !5
  %152 = getelementptr inbounds ptr, ptr %151, i64 2
  %153 = load ptr, ptr %152, align 8, !tbaa !5
  %154 = load i32, ptr %8, align 4, !tbaa !12
  %155 = load ptr, ptr %12, align 8, !tbaa !5
  call void @CurveInterpolation3(ptr noundef %147, ptr noundef %150, ptr noundef %153, i32 noundef %154, ptr noundef %155, ptr noundef %13)
  %156 = load ptr, ptr %4, align 8, !tbaa !5
  %157 = call ptr @mListWrite(ptr noundef %156, i32 noundef -1, ptr noundef %13, i32 noundef 96)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %158 = getelementptr inbounds %struct.MImageCurve, ptr %13, i32 0, i32 4
  %159 = getelementptr inbounds [16 x float], ptr %158, i64 0, i64 0
  store ptr %159, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %160 = load i32, ptr %8, align 4, !tbaa !12
  %161 = icmp eq i32 %160, -1
  br i1 %161, label %162, label %168

162:                                              ; preds = %142
  %163 = load ptr, ptr %6, align 8, !tbaa !5
  %164 = getelementptr inbounds ptr, ptr %163, i64 2
  %165 = load ptr, ptr %164, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.MImagePoint, ptr %165, i32 0, i32 0
  %167 = load float, ptr %166, align 4, !tbaa !14
  br label %174

168:                                              ; preds = %142
  %169 = load ptr, ptr %6, align 8, !tbaa !5
  %170 = getelementptr inbounds ptr, ptr %169, i64 2
  %171 = load ptr, ptr %170, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.MImagePoint, ptr %171, i32 0, i32 1
  %173 = load float, ptr %172, align 4, !tbaa !19
  br label %174

174:                                              ; preds = %168, %162
  %175 = phi float [ %167, %162 ], [ %173, %168 ]
  store float %175, ptr %15, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %176 = load ptr, ptr %14, align 8, !tbaa !5
  %177 = getelementptr inbounds float, ptr %176, i64 1
  %178 = load float, ptr %177, align 4, !tbaa !21
  %179 = load ptr, ptr %14, align 8, !tbaa !5
  %180 = getelementptr inbounds float, ptr %179, i64 2
  %181 = load float, ptr %180, align 4, !tbaa !21
  %182 = fmul float 2.000000e+00, %181
  %183 = load float, ptr %15, align 4, !tbaa !21
  %184 = call float @llvm.fmuladd.f32(float %182, float %183, float %178)
  %185 = load ptr, ptr %14, align 8, !tbaa !5
  %186 = getelementptr inbounds float, ptr %185, i64 3
  %187 = load float, ptr %186, align 4, !tbaa !21
  %188 = fmul float 3.000000e+00, %187
  %189 = load float, ptr %15, align 4, !tbaa !21
  %190 = fmul float %188, %189
  %191 = load float, ptr %15, align 4, !tbaa !21
  %192 = call float @llvm.fmuladd.f32(float %190, float %191, float %184)
  store float %192, ptr %16, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %193 = load ptr, ptr %14, align 8, !tbaa !5
  %194 = getelementptr inbounds float, ptr %193, i64 2
  %195 = load float, ptr %194, align 4, !tbaa !21
  %196 = load ptr, ptr %14, align 8, !tbaa !5
  %197 = getelementptr inbounds float, ptr %196, i64 3
  %198 = load float, ptr %197, align 4, !tbaa !21
  %199 = fmul float 6.000000e+00, %198
  %200 = load float, ptr %15, align 4, !tbaa !21
  %201 = fmul float %199, %200
  %202 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %195, float %201)
  store float %202, ptr %17, align 4, !tbaa !21
  store i32 3, ptr %10, align 4, !tbaa !12
  br label %203

203:                                              ; preds = %274, %174
  %204 = load i32, ptr %10, align 4, !tbaa !12
  %205 = load i32, ptr %5, align 4, !tbaa !12
  %206 = icmp slt i32 %204, %205
  br i1 %206, label %207, label %277

207:                                              ; preds = %203
  %208 = load ptr, ptr %6, align 8, !tbaa !5
  %209 = load i32, ptr %10, align 4, !tbaa !12
  %210 = sub nsw i32 %209, 1
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds ptr, ptr %208, i64 %211
  %213 = load ptr, ptr %212, align 8, !tbaa !5
  %214 = load ptr, ptr %6, align 8, !tbaa !5
  %215 = load i32, ptr %10, align 4, !tbaa !12
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds ptr, ptr %214, i64 %216
  %218 = load ptr, ptr %217, align 8, !tbaa !5
  %219 = load i32, ptr %8, align 4, !tbaa !12
  %220 = load float, ptr %16, align 4, !tbaa !21
  %221 = load float, ptr %17, align 4, !tbaa !21
  %222 = load ptr, ptr %12, align 8, !tbaa !5
  call void @CurveInterpolation4(ptr noundef %213, ptr noundef %218, i32 noundef %219, float noundef %220, float noundef %221, ptr noundef %222, ptr noundef %13)
  %223 = load ptr, ptr %4, align 8, !tbaa !5
  %224 = call ptr @mListWrite(ptr noundef %223, i32 noundef -1, ptr noundef %13, i32 noundef 96)
  %225 = getelementptr inbounds %struct.MImageCurve, ptr %13, i32 0, i32 4
  %226 = getelementptr inbounds [16 x float], ptr %225, i64 0, i64 0
  store ptr %226, ptr %14, align 8, !tbaa !5
  %227 = load i32, ptr %8, align 4, !tbaa !12
  %228 = icmp eq i32 %227, -1
  br i1 %228, label %229, label %237

229:                                              ; preds = %207
  %230 = load ptr, ptr %6, align 8, !tbaa !5
  %231 = load i32, ptr %10, align 4, !tbaa !12
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds ptr, ptr %230, i64 %232
  %234 = load ptr, ptr %233, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.MImagePoint, ptr %234, i32 0, i32 0
  %236 = load float, ptr %235, align 4, !tbaa !14
  br label %245

237:                                              ; preds = %207
  %238 = load ptr, ptr %6, align 8, !tbaa !5
  %239 = load i32, ptr %10, align 4, !tbaa !12
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds ptr, ptr %238, i64 %240
  %242 = load ptr, ptr %241, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.MImagePoint, ptr %242, i32 0, i32 1
  %244 = load float, ptr %243, align 4, !tbaa !19
  br label %245

245:                                              ; preds = %237, %229
  %246 = phi float [ %236, %229 ], [ %244, %237 ]
  store float %246, ptr %15, align 4, !tbaa !21
  %247 = load ptr, ptr %14, align 8, !tbaa !5
  %248 = getelementptr inbounds float, ptr %247, i64 1
  %249 = load float, ptr %248, align 4, !tbaa !21
  %250 = load ptr, ptr %14, align 8, !tbaa !5
  %251 = getelementptr inbounds float, ptr %250, i64 2
  %252 = load float, ptr %251, align 4, !tbaa !21
  %253 = fmul float 2.000000e+00, %252
  %254 = load float, ptr %15, align 4, !tbaa !21
  %255 = call float @llvm.fmuladd.f32(float %253, float %254, float %249)
  %256 = load ptr, ptr %14, align 8, !tbaa !5
  %257 = getelementptr inbounds float, ptr %256, i64 3
  %258 = load float, ptr %257, align 4, !tbaa !21
  %259 = fmul float 3.000000e+00, %258
  %260 = load float, ptr %15, align 4, !tbaa !21
  %261 = fmul float %259, %260
  %262 = load float, ptr %15, align 4, !tbaa !21
  %263 = call float @llvm.fmuladd.f32(float %261, float %262, float %255)
  store float %263, ptr %16, align 4, !tbaa !21
  %264 = load ptr, ptr %14, align 8, !tbaa !5
  %265 = getelementptr inbounds float, ptr %264, i64 2
  %266 = load float, ptr %265, align 4, !tbaa !21
  %267 = load ptr, ptr %14, align 8, !tbaa !5
  %268 = getelementptr inbounds float, ptr %267, i64 3
  %269 = load float, ptr %268, align 4, !tbaa !21
  %270 = fmul float 6.000000e+00, %269
  %271 = load float, ptr %15, align 4, !tbaa !21
  %272 = fmul float %270, %271
  %273 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %266, float %272)
  store float %273, ptr %17, align 4, !tbaa !21
  br label %274

274:                                              ; preds = %245
  %275 = load i32, ptr %10, align 4, !tbaa !12
  %276 = add nsw i32 %275, 1
  store i32 %276, ptr %10, align 4, !tbaa !12
  br label %203, !llvm.loop !22

277:                                              ; preds = %203
  %278 = load ptr, ptr %12, align 8, !tbaa !5
  call void @mMatrixRelease(ptr noundef %278)
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 96, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  ret void
}

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

declare void @mListClear(ptr noundef) #3

declare ptr @mListWrite(ptr noundef, i32 noundef, ptr noundef, i32 noundef) #3

declare void @mMatrixRelease(ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #3 = { "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 }

!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, !11, i64 0}
!10 = !{!"MList", !11, i64 0, !6, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!10, !6, i64 8}
!14 = !{!15, !16, i64 0}
!15 = !{!"MImagePoint", !16, i64 0, !16, i64 4}
!16 = !{!"float", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!15, !16, i64 4}
!20 = distinct !{!20, !18}
!21 = !{!16, !16, i64 0}
!22 = distinct !{!22, !18}


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

%struct.MImageCurve = type { %struct.MImagePoint, %struct.MImagePoint, i32, ptr, [16 x float] }
%struct.MImagePoint = type { float, float }

@.str = external hidden unnamed_addr constant [85 x i8], align 1
@__FUNCTION__.mCurveInterpolation = external hidden unnamed_addr constant [20 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @CurveInterpolation4(ptr noundef, ptr noundef, i32 noundef, float noundef, float noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @mCurveInterpolation(ptr nocapture noundef readonly %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca %struct.MImageCurve, align 8
  %4 = load i32, ptr %0, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  %6 = load ptr, ptr %5, align 8, !tbaa !11
  %7 = icmp slt i32 %4, 3
  br i1 %7, label %8, label %9

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

9:                                                ; preds = %8, %2
  %10 = load ptr, ptr %6, align 8, !tbaa !12
  %11 = load float, ptr %10, align 4, !tbaa !13
  %12 = getelementptr inbounds i8, ptr %6, i64 8
  %13 = load ptr, ptr %12, align 8, !tbaa !12
  %14 = load float, ptr %13, align 4, !tbaa !13
  %15 = add nsw i32 %4, -1
  %16 = fcmp ule float %11, %14
  %smax = tail call i32 @llvm.smax.i32(i32 %15, i32 1)
  %wide.trip.count = zext nneg i32 %smax to i64
  br label %17

17:                                               ; preds = %18, %9
  %indvars.iv = phi i64 [ %indvars.iv.next, %18 ], [ 1, %9 ]
  %exitcond.not = icmp eq i64 %indvars.iv, %wide.trip.count
  br i1 %exitcond.not, label %.split.loop.exit105, label %18

18:                                               ; preds = %17
  %19 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv
  %20 = load ptr, ptr %19, align 8, !tbaa !12
  %21 = load float, ptr %20, align 4, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %22 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv.next
  %23 = load ptr, ptr %22, align 8, !tbaa !12
  %24 = load float, ptr %23, align 4, !tbaa !13
  %25 = fcmp ogt float %21, %24
  %.not = xor i1 %16, %25
  br i1 %.not, label %17, label %.split.loop.exit, !llvm.loop !16

.split.loop.exit:                                 ; preds = %18
  %26 = trunc nuw nsw i64 %indvars.iv to i32
  br label %.split.loop.exit105

.split.loop.exit105:                              ; preds = %17, %.split.loop.exit
  %.078.lcssa = phi i32 [ %26, %.split.loop.exit ], [ %smax, %17 ]
  %27 = icmp eq i32 %.078.lcssa, %15
  br i1 %27, label %.loopexit.thread, label %28

28:                                               ; preds = %.split.loop.exit105
  %29 = getelementptr inbounds i8, ptr %10, i64 4
  %30 = load float, ptr %29, align 4, !tbaa !18
  %31 = getelementptr inbounds i8, ptr %13, i64 4
  %32 = load float, ptr %31, align 4, !tbaa !18
  %33 = fcmp ule float %30, %32
  br label %34

34:                                               ; preds = %35, %28
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %35 ], [ 1, %28 ]
  %exitcond92.not = icmp eq i64 %indvars.iv88, %wide.trip.count
  br i1 %exitcond92.not, label %.loopexit, label %35

35:                                               ; preds = %34
  %36 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv88
  %37 = load ptr, ptr %36, align 8, !tbaa !12
  %38 = getelementptr inbounds i8, ptr %37, i64 4
  %39 = load float, ptr %38, align 4, !tbaa !18
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %40 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv.next89
  %41 = load ptr, ptr %40, align 8, !tbaa !12
  %42 = getelementptr inbounds i8, ptr %41, i64 4
  %43 = load float, ptr %42, align 4, !tbaa !18
  %44 = fcmp ogt float %39, %43
  %.not81 = xor i1 %33, %44
  br i1 %.not81, label %34, label %.loopexit.split.loop.exit107, !llvm.loop !19

.loopexit.split.loop.exit107:                     ; preds = %35
  %45 = trunc nuw nsw i64 %indvars.iv88 to i32
  br label %.loopexit

.loopexit:                                        ; preds = %34, %.loopexit.split.loop.exit107
  %.2 = phi i32 [ %45, %.loopexit.split.loop.exit107 ], [ %smax, %34 ]
  %46 = icmp eq i32 %.2, %15
  br i1 %46, label %.loopexit.thread, label %47

47:                                               ; preds = %.loopexit
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 50, ptr noundef nonnull @__FUNCTION__.mCurveInterpolation, ptr noundef nonnull @.str.2) #5
  br label %.loopexit.thread

.loopexit.thread:                                 ; preds = %.split.loop.exit105, %.loopexit, %47
  %.1 = phi i32 [ 0, %47 ], [ 1, %.loopexit ], [ 1, %.split.loop.exit105 ]
  %48 = tail call ptr @MatrixCreate(i32 noundef 4, i32 noundef 5, ptr noundef null) #5
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %3) #5
  tail call void @mListClear(ptr noundef %1) #5
  %49 = load ptr, ptr %6, align 8, !tbaa !12
  %50 = load ptr, ptr %12, align 8, !tbaa !12
  %51 = getelementptr inbounds i8, ptr %6, i64 16
  %52 = load ptr, ptr %51, align 8, !tbaa !12
  call void @CurveInterpolation3(ptr noundef %49, ptr noundef %50, ptr noundef %52, i32 noundef %.1, ptr noundef %48, ptr noundef nonnull %3)
  %53 = call ptr @mListWrite(ptr noundef %1, i32 noundef -1, ptr noundef nonnull %3, i32 noundef 96) #5
  %54 = getelementptr inbounds i8, ptr %3, i64 36
  %55 = getelementptr inbounds i8, ptr %3, i64 40
  %56 = getelementptr inbounds i8, ptr %3, i64 44
  %57 = icmp sgt i32 %4, 3
  br i1 %57, label %.lr.ph.split.preheader, label %._crit_edge

.lr.ph.split.preheader:                           ; preds = %.loopexit.thread
  %58 = load ptr, ptr %51, align 8, !tbaa !12
  %59 = getelementptr inbounds i8, ptr %58, i64 4
  %60 = load float, ptr %55, align 8, !tbaa !20
  %61 = load float, ptr %59, align 4, !tbaa !20
  %62 = load float, ptr %56, align 4, !tbaa !20
  %63 = fmul float %62, 6.000000e+00
  %64 = fmul float %61, %63
  %65 = fmul float %62, 3.000000e+00
  %66 = fmul float %61, %65
  %67 = fmul float %60, 2.000000e+00
  %68 = load float, ptr %54, align 4, !tbaa !20
  %69 = call float @llvm.fmuladd.f32(float %67, float %61, float %68)
  %70 = insertelement <2 x float> <float 2.000000e+00, float poison>, float %66, i64 1
  %71 = insertelement <2 x float> poison, float %60, i64 0
  %72 = insertelement <2 x float> %71, float %61, i64 1
  %73 = insertelement <2 x float> poison, float %64, i64 0
  %74 = insertelement <2 x float> %73, float %69, i64 1
  %75 = call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %70, <2 x float> %72, <2 x float> %74)
  %wide.trip.count96 = zext nneg i32 %4 to i64
  br label %.lr.ph.split

.lr.ph.split:                                     ; preds = %.lr.ph.split.preheader, %.lr.ph.split
  %indvars.iv93 = phi i64 [ 3, %.lr.ph.split.preheader ], [ %indvars.iv.next94, %.lr.ph.split ]
  %76 = phi <2 x float> [ %75, %.lr.ph.split.preheader ], [ %101, %.lr.ph.split ]
  %77 = getelementptr ptr, ptr %6, i64 %indvars.iv93
  %78 = getelementptr i8, ptr %77, i64 -8
  %79 = load ptr, ptr %78, align 8, !tbaa !12
  %80 = load ptr, ptr %77, align 8, !tbaa !12
  %81 = extractelement <2 x float> %76, i64 0
  %82 = extractelement <2 x float> %76, i64 1
  call void @CurveInterpolation4(ptr noundef %79, ptr noundef %80, i32 noundef %.1, float noundef %82, float noundef %81, ptr noundef %48, ptr noundef nonnull %3)
  %83 = call ptr @mListWrite(ptr noundef %1, i32 noundef -1, ptr noundef nonnull %3, i32 noundef 96) #5
  %84 = load ptr, ptr %77, align 8, !tbaa !12
  %85 = getelementptr inbounds i8, ptr %84, i64 4
  %86 = load float, ptr %85, align 4, !tbaa !20
  %87 = load float, ptr %54, align 4, !tbaa !20
  %88 = load float, ptr %55, align 8, !tbaa !20
  %89 = fmul float %88, 2.000000e+00
  %90 = call float @llvm.fmuladd.f32(float %89, float %86, float %87)
  %91 = load float, ptr %56, align 4, !tbaa !20
  %92 = fmul float %91, 3.000000e+00
  %93 = fmul float %86, %92
  %94 = fmul float %91, 6.000000e+00
  %95 = fmul float %86, %94
  %96 = insertelement <2 x float> <float 2.000000e+00, float poison>, float %93, i64 1
  %97 = insertelement <2 x float> poison, float %88, i64 0
  %98 = insertelement <2 x float> %97, float %86, i64 1
  %99 = insertelement <2 x float> poison, float %95, i64 0
  %100 = insertelement <2 x float> %99, float %90, i64 1
  %101 = call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %96, <2 x float> %98, <2 x float> %100)
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %exitcond97.not = icmp eq i64 %indvars.iv.next94, %wide.trip.count96
  br i1 %exitcond97.not, label %._crit_edge, label %.lr.ph.split, !llvm.loop !21

._crit_edge:                                      ; preds = %.lr.ph.split, %.loopexit.thread
  call void @mMatrixRelease(ptr noundef %48) #5
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %3) #5
  ret void
}

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

declare void @mListClear(ptr noundef) local_unnamed_addr #3

declare ptr @mListWrite(ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

declare void @mMatrixRelease(ptr noundef) local_unnamed_addr #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #3 = { "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, !7, i64 0}
!6 = !{!"MList", !7, i64 0, !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 = !{!6, !10, i64 8}
!12 = !{!10, !10, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"MImagePoint", !15, i64 0, !15, i64 4}
!15 = !{!"float", !8, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!14, !15, i64 4}
!19 = distinct !{!19, !17}
!20 = !{!15, !15, i64 0}
!21 = distinct !{!21, !17}


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