; LLVM IR from CLASS-SZ/class_sz :: class-sz/tools (arrays)

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

@.str.30 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [27 x i8], align 1
@__func__.array_interpolate_spline_growing_hunt = external hidden unnamed_addr constant [38 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 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 double @llvm.fmuladd.f64(double, double, double) #1

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @array_interpolate_spline_growing_hunt(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, double noundef %5, ptr noundef %6, ptr noundef %7, i32 noundef %8, ptr noundef %9) #3 {
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca double, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca double, align 8
  %28 = alloca double, align 8
  %29 = alloca double, align 8
  %30 = alloca i32, align 4
  store ptr %0, ptr %12, align 8, !tbaa !5
  store i32 %1, ptr %13, align 4, !tbaa !9
  store ptr %2, ptr %14, align 8, !tbaa !5
  store ptr %3, ptr %15, align 8, !tbaa !5
  store i32 %4, ptr %16, align 4, !tbaa !9
  store double %5, ptr %17, align 8, !tbaa !11
  store ptr %6, ptr %18, align 8, !tbaa !5
  store ptr %7, ptr %19, align 8, !tbaa !5
  store i32 %8, ptr %20, align 4, !tbaa !9
  store ptr %9, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #4
  store i32 1, ptr %26, align 4, !tbaa !9
  %31 = load double, ptr %17, align 8, !tbaa !11
  %32 = load ptr, ptr %12, align 8, !tbaa !5
  %33 = load ptr, ptr %18, align 8, !tbaa !5
  %34 = load i32, ptr %33, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds double, ptr %32, i64 %35
  %37 = load double, ptr %36, align 8, !tbaa !11
  %38 = fcmp oge double %31, %37
  br i1 %38, label %39, label %122

39:                                               ; preds = %10
  %40 = load double, ptr %17, align 8, !tbaa !11
  %41 = load ptr, ptr %12, align 8, !tbaa !5
  %42 = load i32, ptr %13, align 4, !tbaa !9
  %43 = sub nsw i32 %42, 1
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds double, ptr %41, i64 %44
  %46 = load double, ptr %45, align 8, !tbaa !11
  %47 = fcmp ogt double %40, %46
  br i1 %47, label %48, label %58

48:                                               ; preds = %39
  %49 = load ptr, ptr %21, align 8, !tbaa !5
  %50 = load double, ptr %17, align 8, !tbaa !11
  %51 = load ptr, ptr %12, align 8, !tbaa !5
  %52 = load i32, ptr %13, align 4, !tbaa !9
  %53 = sub nsw i32 %52, 1
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds double, ptr %51, i64 %54
  %56 = load double, ptr %55, align 8, !tbaa !11
  %57 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %49, ptr noundef @.str.31, ptr noundef @__func__.array_interpolate_spline_growing_hunt, i32 noundef 2482, double noundef %50, double noundef %56) #4
  store i32 1, ptr %11, align 4
  store i32 1, ptr %30, align 4
  br label %299

58:                                               ; preds = %39
  %59 = load ptr, ptr %18, align 8, !tbaa !5
  %60 = load i32, ptr %59, align 4, !tbaa !9
  store i32 %60, ptr %22, align 4, !tbaa !9
  %61 = load i32, ptr %22, align 4, !tbaa !9
  %62 = load i32, ptr %26, align 4, !tbaa !9
  %63 = add nsw i32 %61, %62
  store i32 %63, ptr %23, align 4, !tbaa !9
  %64 = load double, ptr %17, align 8, !tbaa !11
  %65 = load ptr, ptr %12, align 8, !tbaa !5
  %66 = load i32, ptr %23, align 4, !tbaa !9
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds double, ptr %65, i64 %67
  %69 = load double, ptr %68, align 8, !tbaa !11
  %70 = fcmp ogt double %64, %69
  br i1 %70, label %71, label %121

71:                                               ; preds = %58
  br label %72

72:                                               ; preds = %94, %71
  %73 = load double, ptr %17, align 8, !tbaa !11
  %74 = load ptr, ptr %12, align 8, !tbaa !5
  %75 = load i32, ptr %23, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds double, ptr %74, i64 %76
  %78 = load double, ptr %77, align 8, !tbaa !11
  %79 = fcmp ogt double %73, %78
  br i1 %79, label %80, label %95

80:                                               ; preds = %72
  %81 = load i32, ptr %23, align 4, !tbaa !9
  store i32 %81, ptr %22, align 4, !tbaa !9
  %82 = load i32, ptr %26, align 4, !tbaa !9
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %26, align 4, !tbaa !9
  %84 = load i32, ptr %26, align 4, !tbaa !9
  %85 = load i32, ptr %23, align 4, !tbaa !9
  %86 = add nsw i32 %85, %84
  store i32 %86, ptr %23, align 4, !tbaa !9
  %87 = load i32, ptr %23, align 4, !tbaa !9
  %88 = load i32, ptr %13, align 4, !tbaa !9
  %89 = sub nsw i32 %88, 1
  %90 = icmp sgt i32 %87, %89
  br i1 %90, label %91, label %94

91:                                               ; preds = %80
  %92 = load i32, ptr %13, align 4, !tbaa !9
  %93 = sub nsw i32 %92, 1
  store i32 %93, ptr %23, align 4, !tbaa !9
  br label %94

94:                                               ; preds = %91, %80
  br label %72, !llvm.loop !13

95:                                               ; preds = %72
  br label %96

96:                                               ; preds = %119, %95
  %97 = load i32, ptr %23, align 4, !tbaa !9
  %98 = load i32, ptr %22, align 4, !tbaa !9
  %99 = sub nsw i32 %97, %98
  %100 = icmp sgt i32 %99, 1
  br i1 %100, label %101, label %120

101:                                              ; preds = %96
  %102 = load i32, ptr %22, align 4, !tbaa !9
  %103 = load i32, ptr %23, align 4, !tbaa !9
  %104 = add nsw i32 %102, %103
  %105 = sitofp i32 %104 to double
  %106 = fmul double 5.000000e-01, %105
  %107 = fptosi double %106 to i32
  store i32 %107, ptr %24, align 4, !tbaa !9
  %108 = load double, ptr %17, align 8, !tbaa !11
  %109 = load ptr, ptr %12, align 8, !tbaa !5
  %110 = load i32, ptr %24, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds double, ptr %109, i64 %111
  %113 = load double, ptr %112, align 8, !tbaa !11
  %114 = fcmp olt double %108, %113
  br i1 %114, label %115, label %117

115:                                              ; preds = %101
  %116 = load i32, ptr %24, align 4, !tbaa !9
  store i32 %116, ptr %23, align 4, !tbaa !9
  br label %119

117:                                              ; preds = %101
  %118 = load i32, ptr %24, align 4, !tbaa !9
  store i32 %118, ptr %22, align 4, !tbaa !9
  br label %119

119:                                              ; preds = %117, %115
  br label %96, !llvm.loop !15

120:                                              ; preds = %96
  br label %121

121:                                              ; preds = %120, %58
  br label %195

122:                                              ; preds = %10
  %123 = load double, ptr %17, align 8, !tbaa !11
  %124 = load ptr, ptr %12, align 8, !tbaa !5
  %125 = getelementptr inbounds double, ptr %124, i64 0
  %126 = load double, ptr %125, align 8, !tbaa !11
  %127 = fcmp olt double %123, %126
  br i1 %127, label %128, label %135

128:                                              ; preds = %122
  %129 = load ptr, ptr %21, align 8, !tbaa !5
  %130 = load double, ptr %17, align 8, !tbaa !11
  %131 = load ptr, ptr %12, align 8, !tbaa !5
  %132 = getelementptr inbounds double, ptr %131, i64 0
  %133 = load double, ptr %132, align 8, !tbaa !11
  %134 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %129, ptr noundef @.str.30, ptr noundef @__func__.array_interpolate_spline_growing_hunt, i32 noundef 2509, double noundef %130, double noundef %133) #4
  store i32 1, ptr %11, align 4
  store i32 1, ptr %30, align 4
  br label %299

135:                                              ; preds = %122
  %136 = load ptr, ptr %18, align 8, !tbaa !5
  %137 = load i32, ptr %136, align 4, !tbaa !9
  store i32 %137, ptr %23, align 4, !tbaa !9
  %138 = load i32, ptr %23, align 4, !tbaa !9
  %139 = load i32, ptr %26, align 4, !tbaa !9
  %140 = sub nsw i32 %138, %139
  store i32 %140, ptr %22, align 4, !tbaa !9
  %141 = load double, ptr %17, align 8, !tbaa !11
  %142 = load ptr, ptr %12, align 8, !tbaa !5
  %143 = load i32, ptr %22, align 4, !tbaa !9
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds double, ptr %142, i64 %144
  %146 = load double, ptr %145, align 8, !tbaa !11
  %147 = fcmp olt double %141, %146
  br i1 %147, label %148, label %194

148:                                              ; preds = %135
  br label %149

149:                                              ; preds = %167, %148
  %150 = load double, ptr %17, align 8, !tbaa !11
  %151 = load ptr, ptr %12, align 8, !tbaa !5
  %152 = load i32, ptr %22, align 4, !tbaa !9
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds double, ptr %151, i64 %153
  %155 = load double, ptr %154, align 8, !tbaa !11
  %156 = fcmp olt double %150, %155
  br i1 %156, label %157, label %168

157:                                              ; preds = %149
  %158 = load i32, ptr %22, align 4, !tbaa !9
  store i32 %158, ptr %23, align 4, !tbaa !9
  %159 = load i32, ptr %26, align 4, !tbaa !9
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %26, align 4, !tbaa !9
  %161 = load i32, ptr %26, align 4, !tbaa !9
  %162 = load i32, ptr %22, align 4, !tbaa !9
  %163 = sub nsw i32 %162, %161
  store i32 %163, ptr %22, align 4, !tbaa !9
  %164 = load i32, ptr %22, align 4, !tbaa !9
  %165 = icmp slt i32 %164, 0
  br i1 %165, label %166, label %167

166:                                              ; preds = %157
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %167

167:                                              ; preds = %166, %157
  br label %149, !llvm.loop !16

168:                                              ; preds = %149
  br label %169

169:                                              ; preds = %192, %168
  %170 = load i32, ptr %23, align 4, !tbaa !9
  %171 = load i32, ptr %22, align 4, !tbaa !9
  %172 = sub nsw i32 %170, %171
  %173 = icmp sgt i32 %172, 1
  br i1 %173, label %174, label %193

174:                                              ; preds = %169
  %175 = load i32, ptr %22, align 4, !tbaa !9
  %176 = load i32, ptr %23, align 4, !tbaa !9
  %177 = add nsw i32 %175, %176
  %178 = sitofp i32 %177 to double
  %179 = fmul double 5.000000e-01, %178
  %180 = fptosi double %179 to i32
  store i32 %180, ptr %24, align 4, !tbaa !9
  %181 = load double, ptr %17, align 8, !tbaa !11
  %182 = load ptr, ptr %12, align 8, !tbaa !5
  %183 = load i32, ptr %24, align 4, !tbaa !9
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds double, ptr %182, i64 %184
  %186 = load double, ptr %185, align 8, !tbaa !11
  %187 = fcmp olt double %181, %186
  br i1 %187, label %188, label %190

188:                                              ; preds = %174
  %189 = load i32, ptr %24, align 4, !tbaa !9
  store i32 %189, ptr %23, align 4, !tbaa !9
  br label %192

190:                                              ; preds = %174
  %191 = load i32, ptr %24, align 4, !tbaa !9
  store i32 %191, ptr %22, align 4, !tbaa !9
  br label %192

192:                                              ; preds = %190, %188
  br label %169, !llvm.loop !17

193:                                              ; preds = %169
  br label %194

194:                                              ; preds = %193, %135
  br label %195

195:                                              ; preds = %194, %121
  %196 = load i32, ptr %22, align 4, !tbaa !9
  %197 = load ptr, ptr %18, align 8, !tbaa !5
  store i32 %196, ptr %197, align 4, !tbaa !9
  %198 = load ptr, ptr %12, align 8, !tbaa !5
  %199 = load i32, ptr %23, align 4, !tbaa !9
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds double, ptr %198, i64 %200
  %202 = load double, ptr %201, align 8, !tbaa !11
  %203 = load ptr, ptr %12, align 8, !tbaa !5
  %204 = load i32, ptr %22, align 4, !tbaa !9
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds double, ptr %203, i64 %205
  %207 = load double, ptr %206, align 8, !tbaa !11
  %208 = fsub double %202, %207
  store double %208, ptr %27, align 8, !tbaa !11
  %209 = load double, ptr %17, align 8, !tbaa !11
  %210 = load ptr, ptr %12, align 8, !tbaa !5
  %211 = load i32, ptr %22, align 4, !tbaa !9
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds double, ptr %210, i64 %212
  %214 = load double, ptr %213, align 8, !tbaa !11
  %215 = fsub double %209, %214
  %216 = load double, ptr %27, align 8, !tbaa !11
  %217 = fdiv double %215, %216
  store double %217, ptr %29, align 8, !tbaa !11
  %218 = load double, ptr %29, align 8, !tbaa !11
  %219 = fsub double 1.000000e+00, %218
  store double %219, ptr %28, align 8, !tbaa !11
  store i32 0, ptr %25, align 4, !tbaa !9
  br label %220

220:                                              ; preds = %295, %195
  %221 = load i32, ptr %25, align 4, !tbaa !9
  %222 = load i32, ptr %20, align 4, !tbaa !9
  %223 = icmp slt i32 %221, %222
  br i1 %223, label %224, label %298

224:                                              ; preds = %220
  %225 = load double, ptr %28, align 8, !tbaa !11
  %226 = load ptr, ptr %14, align 8, !tbaa !5
  %227 = load i32, ptr %22, align 4, !tbaa !9
  %228 = load i32, ptr %16, align 4, !tbaa !9
  %229 = mul nsw i32 %227, %228
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds double, ptr %226, i64 %230
  %232 = load i32, ptr %25, align 4, !tbaa !9
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds double, ptr %231, i64 %233
  %235 = load double, ptr %234, align 8, !tbaa !11
  %236 = load double, ptr %29, align 8, !tbaa !11
  %237 = load ptr, ptr %14, align 8, !tbaa !5
  %238 = load i32, ptr %23, align 4, !tbaa !9
  %239 = load i32, ptr %16, align 4, !tbaa !9
  %240 = mul nsw i32 %238, %239
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds double, ptr %237, i64 %241
  %243 = load i32, ptr %25, align 4, !tbaa !9
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds double, ptr %242, i64 %244
  %246 = load double, ptr %245, align 8, !tbaa !11
  %247 = fmul double %236, %246
  %248 = call double @llvm.fmuladd.f64(double %225, double %235, double %247)
  %249 = load double, ptr %28, align 8, !tbaa !11
  %250 = load double, ptr %28, align 8, !tbaa !11
  %251 = fmul double %249, %250
  %252 = load double, ptr %28, align 8, !tbaa !11
  %253 = load double, ptr %28, align 8, !tbaa !11
  %254 = fneg double %253
  %255 = call double @llvm.fmuladd.f64(double %251, double %252, double %254)
  %256 = load ptr, ptr %15, align 8, !tbaa !5
  %257 = load i32, ptr %22, align 4, !tbaa !9
  %258 = load i32, ptr %16, align 4, !tbaa !9
  %259 = mul nsw i32 %257, %258
  %260 = sext i32 %259 to i64
  %261 = getelementptr inbounds double, ptr %256, i64 %260
  %262 = load i32, ptr %25, align 4, !tbaa !9
  %263 = sext i32 %262 to i64
  %264 = getelementptr inbounds double, ptr %261, i64 %263
  %265 = load double, ptr %264, align 8, !tbaa !11
  %266 = load double, ptr %29, align 8, !tbaa !11
  %267 = load double, ptr %29, align 8, !tbaa !11
  %268 = fmul double %266, %267
  %269 = load double, ptr %29, align 8, !tbaa !11
  %270 = load double, ptr %29, align 8, !tbaa !11
  %271 = fneg double %270
  %272 = call double @llvm.fmuladd.f64(double %268, double %269, double %271)
  %273 = load ptr, ptr %15, align 8, !tbaa !5
  %274 = load i32, ptr %23, align 4, !tbaa !9
  %275 = load i32, ptr %16, align 4, !tbaa !9
  %276 = mul nsw i32 %274, %275
  %277 = sext i32 %276 to i64
  %278 = getelementptr inbounds double, ptr %273, i64 %277
  %279 = load i32, ptr %25, align 4, !tbaa !9
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds double, ptr %278, i64 %280
  %282 = load double, ptr %281, align 8, !tbaa !11
  %283 = fmul double %272, %282
  %284 = call double @llvm.fmuladd.f64(double %255, double %265, double %283)
  %285 = load double, ptr %27, align 8, !tbaa !11
  %286 = fmul double %284, %285
  %287 = load double, ptr %27, align 8, !tbaa !11
  %288 = fmul double %286, %287
  %289 = fdiv double %288, 6.000000e+00
  %290 = fadd double %248, %289
  %291 = load ptr, ptr %19, align 8, !tbaa !5
  %292 = load i32, ptr %25, align 4, !tbaa !9
  %293 = sext i32 %292 to i64
  %294 = getelementptr inbounds double, ptr %291, i64 %293
  store double %290, ptr %294, align 8, !tbaa !11
  br label %295

295:                                              ; preds = %224
  %296 = load i32, ptr %25, align 4, !tbaa !9
  %297 = add nsw i32 %296, 1
  store i32 %297, ptr %25, align 4, !tbaa !9
  br label %220, !llvm.loop !18

298:                                              ; preds = %220
  store i32 0, ptr %11, align 4
  store i32 1, ptr %30, align 4
  br label %299

299:                                              ; preds = %298, %128, %48
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  %300 = load i32, ptr %11, align 4
  ret i32 %300
}

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

!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 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str.30 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [27 x i8], align 1
@__func__.array_interpolate_spline_growing_hunt = external hidden unnamed_addr constant [38 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #0

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: nofree nounwind uwtable
define dso_local range(i32 0, 2) i32 @array_interpolate_spline_growing_hunt(ptr nocapture noundef readonly %0, i32 noundef %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3, i32 noundef %4, double noundef %5, ptr nocapture noundef %6, ptr nocapture noundef writeonly %7, i32 noundef %8, ptr nocapture noundef writeonly %9) local_unnamed_addr #2 {
  %11 = ptrtoint ptr %3 to i64
  %12 = ptrtoint ptr %2 to i64
  %13 = ptrtoint ptr %7 to i64
  %14 = load i32, ptr %6, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds double, ptr %0, i64 %15
  %17 = load double, ptr %16, align 8, !tbaa !9
  %18 = fcmp ugt double %17, %5
  br i1 %18, label %51, label %19

19:                                               ; preds = %10
  %20 = add nsw i32 %1, -1
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds double, ptr %0, i64 %21
  %23 = load double, ptr %22, align 8, !tbaa !9
  %24 = fcmp olt double %23, %5
  br i1 %24, label %25, label %27

25:                                               ; preds = %19
  %26 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %9, ptr noundef nonnull dereferenceable(1) @.str.31, ptr noundef nonnull @__func__.array_interpolate_spline_growing_hunt, i32 noundef 2482, double noundef %5, double noundef %23) #4
  br label %.loopexit

27:                                               ; preds = %19
  %28 = add nsw i32 %14, 1
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds double, ptr %0, i64 %29
  %31 = load double, ptr %30, align 8, !tbaa !9
  %32 = fcmp olt double %31, %5
  br i1 %32, label %.lr.ph, label %.loopexit124

.preheader126:                                    ; preds = %.lr.ph
  %33 = sub nsw i32 %spec.select, %.0108130
  %34 = icmp sgt i32 %33, 1
  br i1 %34, label %.lr.ph134, label %.loopexit124

.lr.ph:                                           ; preds = %27, %.lr.ph
  %.0108130 = phi i32 [ %spec.select, %.lr.ph ], [ %28, %27 ]
  %.0115129 = phi i32 [ %35, %.lr.ph ], [ 1, %27 ]
  %35 = add nuw nsw i32 %.0115129, 1
  %36 = add nsw i32 %.0108130, %35
  %.not = icmp slt i32 %36, %1
  %spec.select = select i1 %.not, i32 %36, i32 %20
  %37 = sext i32 %spec.select to i64
  %38 = getelementptr inbounds double, ptr %0, i64 %37
  %39 = load double, ptr %38, align 8, !tbaa !9
  %40 = fcmp olt double %39, %5
  br i1 %40, label %.lr.ph, label %.preheader126, !llvm.loop !11

.lr.ph134:                                        ; preds = %.preheader126, %.lr.ph134
  %.1133 = phi i32 [ %.1., %.lr.ph134 ], [ %.0108130, %.preheader126 ]
  %.2110132 = phi i32 [ %..2110, %.lr.ph134 ], [ %spec.select, %.preheader126 ]
  %41 = add nsw i32 %.1133, %.2110132
  %42 = sitofp i32 %41 to double
  %43 = fmul double %42, 5.000000e-01
  %44 = fptosi double %43 to i32
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds double, ptr %0, i64 %45
  %47 = load double, ptr %46, align 8, !tbaa !9
  %48 = fcmp ogt double %47, %5
  %..2110 = select i1 %48, i32 %44, i32 %.2110132
  %.1. = select i1 %48, i32 %.1133, i32 %44
  %49 = sub nsw i32 %..2110, %.1.
  %50 = icmp sgt i32 %49, 1
  br i1 %50, label %.lr.ph134, label %.loopexit124, !llvm.loop !13

51:                                               ; preds = %10
  %52 = load double, ptr %0, align 8, !tbaa !9
  %53 = fcmp ogt double %52, %5
  br i1 %53, label %54, label %56

54:                                               ; preds = %51
  %55 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %9, ptr noundef nonnull dereferenceable(1) @.str.30, ptr noundef nonnull @__func__.array_interpolate_spline_growing_hunt, i32 noundef 2509, double noundef %5, double noundef %52) #4
  br label %.loopexit

56:                                               ; preds = %51
  %57 = add nsw i32 %14, -1
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds double, ptr %0, i64 %58
  %60 = load double, ptr %59, align 8, !tbaa !9
  %61 = fcmp ogt double %60, %5
  br i1 %61, label %.lr.ph139, label %.loopexit124

.preheader:                                       ; preds = %.lr.ph139
  %62 = icmp sgt i32 %.3138, 1
  br i1 %62, label %.lr.ph144, label %.loopexit124

.lr.ph139:                                        ; preds = %56, %.lr.ph139
  %.3138 = phi i32 [ %spec.store.select, %.lr.ph139 ], [ %57, %56 ]
  %.1116137 = phi i32 [ %63, %.lr.ph139 ], [ 1, %56 ]
  %63 = add nuw nsw i32 %.1116137, 1
  %64 = sub nsw i32 %.3138, %63
  %spec.store.select = tail call i32 @llvm.smax.i32(i32 %64, i32 0)
  %65 = zext nneg i32 %spec.store.select to i64
  %66 = getelementptr inbounds double, ptr %0, i64 %65
  %67 = load double, ptr %66, align 8, !tbaa !9
  %68 = fcmp ogt double %67, %5
  br i1 %68, label %.lr.ph139, label %.preheader, !llvm.loop !14

.lr.ph144:                                        ; preds = %.preheader, %.lr.ph144
  %.4143 = phi i32 [ %.4., %.lr.ph144 ], [ %spec.store.select, %.preheader ]
  %.5113142 = phi i32 [ %..5113, %.lr.ph144 ], [ %.3138, %.preheader ]
  %69 = add nsw i32 %.4143, %.5113142
  %70 = sitofp i32 %69 to double
  %71 = fmul double %70, 5.000000e-01
  %72 = fptosi double %71 to i32
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds double, ptr %0, i64 %73
  %75 = load double, ptr %74, align 8, !tbaa !9
  %76 = fcmp ogt double %75, %5
  %..5113 = select i1 %76, i32 %72, i32 %.5113142
  %.4. = select i1 %76, i32 %.4143, i32 %72
  %77 = sub nsw i32 %..5113, %.4.
  %78 = icmp sgt i32 %77, 1
  br i1 %78, label %.lr.ph144, label %.loopexit124, !llvm.loop !15

.loopexit124:                                     ; preds = %.lr.ph134, %.lr.ph144, %.preheader126, %.preheader, %56, %27
  %.7 = phi i32 [ %28, %27 ], [ %14, %56 ], [ %.3138, %.preheader ], [ %spec.select, %.preheader126 ], [ %..5113, %.lr.ph144 ], [ %..2110, %.lr.ph134 ]
  %.6 = phi i32 [ %14, %27 ], [ %57, %56 ], [ %spec.store.select, %.preheader ], [ %.0108130, %.preheader126 ], [ %.4., %.lr.ph144 ], [ %.1., %.lr.ph134 ]
  store i32 %.6, ptr %6, align 4, !tbaa !5
  %79 = sext i32 %.7 to i64
  %80 = getelementptr inbounds double, ptr %0, i64 %79
  %81 = load double, ptr %80, align 8, !tbaa !9
  %82 = sext i32 %.6 to i64
  %83 = getelementptr inbounds double, ptr %0, i64 %82
  %84 = load double, ptr %83, align 8, !tbaa !9
  %85 = fsub double %81, %84
  %86 = fsub double %5, %84
  %87 = fdiv double %86, %85
  %88 = fsub double 1.000000e+00, %87
  %89 = icmp sgt i32 %8, 0
  br i1 %89, label %.lr.ph148, label %.loopexit

.lr.ph148:                                        ; preds = %.loopexit124
  %90 = mul nsw i32 %.6, %4
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds double, ptr %2, i64 %91
  %93 = mul nsw i32 %.7, %4
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds double, ptr %2, i64 %94
  %96 = fmul double %88, %88
  %97 = fneg double %88
  %98 = tail call double @llvm.fmuladd.f64(double %96, double %88, double %97)
  %99 = getelementptr inbounds double, ptr %3, i64 %91
  %100 = fmul double %87, %87
  %101 = fneg double %87
  %102 = tail call double @llvm.fmuladd.f64(double %100, double %87, double %101)
  %103 = getelementptr inbounds double, ptr %3, i64 %94
  %wide.trip.count = zext nneg i32 %8 to i64
  %min.iters.check = icmp ult i32 %8, 4
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %.lr.ph148
  %104 = sub i64 %13, %12
  %105 = shl nsw i64 %94, 3
  %106 = sub i64 %104, %105
  %diff.check = icmp ult i64 %106, 16
  %107 = shl nsw i64 %91, 3
  %108 = sub i64 %104, %107
  %diff.check153 = icmp ult i64 %108, 16
  %conflict.rdx = or i1 %diff.check, %diff.check153
  %109 = sub i64 %13, %11
  %110 = sub i64 %109, %105
  %diff.check154 = icmp ult i64 %110, 16
  %conflict.rdx155 = or i1 %conflict.rdx, %diff.check154
  %111 = sub i64 %109, %107
  %diff.check156 = icmp ult i64 %111, 16
  %conflict.rdx157 = or i1 %conflict.rdx155, %diff.check156
  br i1 %conflict.rdx157, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %wide.trip.count, 2147483646
  %broadcast.splatinsert = insertelement <2 x double> poison, double %87, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  %broadcast.splatinsert159 = insertelement <2 x double> poison, double %88, i64 0
  %broadcast.splat160 = shufflevector <2 x double> %broadcast.splatinsert159, <2 x double> poison, <2 x i32> zeroinitializer
  %broadcast.splatinsert163 = insertelement <2 x double> poison, double %102, i64 0
  %broadcast.splat164 = shufflevector <2 x double> %broadcast.splatinsert163, <2 x double> poison, <2 x i32> zeroinitializer
  %broadcast.splatinsert165 = insertelement <2 x double> poison, double %98, i64 0
  %broadcast.splat166 = shufflevector <2 x double> %broadcast.splatinsert165, <2 x double> poison, <2 x i32> zeroinitializer
  %broadcast.splatinsert167 = insertelement <2 x double> poison, double %85, i64 0
  %broadcast.splat168 = shufflevector <2 x double> %broadcast.splatinsert167, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %112 = getelementptr inbounds double, ptr %92, i64 %index
  %wide.load = load <2 x double>, ptr %112, align 8, !tbaa !9
  %113 = getelementptr inbounds double, ptr %95, i64 %index
  %wide.load158 = load <2 x double>, ptr %113, align 8, !tbaa !9
  %114 = fmul <2 x double> %broadcast.splat, %wide.load158
  %115 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat160, <2 x double> %wide.load, <2 x double> %114)
  %116 = getelementptr inbounds double, ptr %99, i64 %index
  %wide.load161 = load <2 x double>, ptr %116, align 8, !tbaa !9
  %117 = getelementptr inbounds double, ptr %103, i64 %index
  %wide.load162 = load <2 x double>, ptr %117, align 8, !tbaa !9
  %118 = fmul <2 x double> %broadcast.splat164, %wide.load162
  %119 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat166, <2 x double> %wide.load161, <2 x double> %118)
  %120 = fmul <2 x double> %broadcast.splat168, %119
  %121 = fmul <2 x double> %broadcast.splat168, %120
  %122 = fdiv <2 x double> %121, <double 6.000000e+00, double 6.000000e+00>
  %123 = fadd <2 x double> %115, %122
  %124 = getelementptr inbounds double, ptr %7, i64 %index
  store <2 x double> %123, ptr %124, align 8, !tbaa !9
  %index.next = add nuw i64 %index, 2
  %125 = icmp eq i64 %index.next, %n.vec
  br i1 %125, label %middle.block, label %vector.body, !llvm.loop !16

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

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

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %126 = getelementptr inbounds double, ptr %92, i64 %indvars.iv
  %127 = load double, ptr %126, align 8, !tbaa !9
  %128 = getelementptr inbounds double, ptr %95, i64 %indvars.iv
  %129 = load double, ptr %128, align 8, !tbaa !9
  %130 = fmul double %87, %129
  %131 = tail call double @llvm.fmuladd.f64(double %88, double %127, double %130)
  %132 = getelementptr inbounds double, ptr %99, i64 %indvars.iv
  %133 = load double, ptr %132, align 8, !tbaa !9
  %134 = getelementptr inbounds double, ptr %103, i64 %indvars.iv
  %135 = load double, ptr %134, align 8, !tbaa !9
  %136 = fmul double %102, %135
  %137 = tail call double @llvm.fmuladd.f64(double %98, double %133, double %136)
  %138 = fmul double %85, %137
  %139 = fmul double %85, %138
  %140 = fdiv double %139, 6.000000e+00
  %141 = fadd double %131, %140
  %142 = getelementptr inbounds double, ptr %7, i64 %indvars.iv
  store double %141, ptr %142, align 8, !tbaa !9
  %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 %.loopexit, label %scalar.ph, !llvm.loop !19

.loopexit:                                        ; preds = %scalar.ph, %middle.block, %.loopexit124, %54, %25
  %.0 = phi i32 [ 1, %25 ], [ 1, %54 ], [ 0, %.loopexit124 ], [ 0, %middle.block ], [ 0, %scalar.ph ]
  ret i32 %.0
}

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { nofree 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 #2 = { nofree 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"int", !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, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12, !17, !18}
!17 = !{!"llvm.loop.isvectorized", i32 1}
!18 = !{!"llvm.loop.unroll.runtime.disable"}
!19 = distinct !{!19, !12, !17}


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