; LLVM IR from rdguez-mariano/fast_imas_IPOL :: libSimuTilts/splines.ll (Z10finvsplineRKSt6vectorIfSaIfEEiRS1_ii)

; 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 = external hidden unnamed_addr constant [39 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: mustprogress nounwind uwtable
declare dso_local void @_Z11invspline1DPdiS_i(ptr noundef, i32 noundef, ptr noundef, i32 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z10finvsplineRKSt6vectorIfSaIfEEiRS1_ii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %3, i32 noundef %4) #2 {
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca [5 x double], align 16
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  store i32 %4, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %19 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %19, ptr %16, align 4, !tbaa !9
  %20 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %20, ptr %15, align 4, !tbaa !9
  %21 = load i32, ptr %7, align 4, !tbaa !9
  switch i32 %21, label %62 [
    i32 2, label %22
    i32 3, label %24
    i32 4, label %26
    i32 5, label %29
    i32 6, label %32
    i32 7, label %36
    i32 8, label %40
    i32 9, label %45
    i32 10, label %50
    i32 11, label %56
  ]

22:                                               ; preds = %5
  %23 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 0
  store double 0xBFC5F619A23D8217, ptr %23, align 16, !tbaa !11
  br label %64

24:                                               ; preds = %5
  %25 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 0
  store double 0xBFD126145C028A49, ptr %25, align 16, !tbaa !11
  br label %64

26:                                               ; preds = %5
  %27 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 0
  store double -3.613410e-01, ptr %27, align 16, !tbaa !11
  %28 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 1
  store double -1.372540e-02, ptr %28, align 8, !tbaa !11
  br label %64

29:                                               ; preds = %5
  %30 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 0
  store double -4.305750e-01, ptr %30, align 16, !tbaa !11
  %31 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 1
  store double -4.309630e-02, ptr %31, align 8, !tbaa !11
  br label %64

32:                                               ; preds = %5
  %33 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 0
  store double -4.882950e-01, ptr %33, align 16, !tbaa !11
  %34 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 1
  store double 0xBFB4E8EF42429AAF, ptr %34, align 8, !tbaa !11
  %35 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 2
  store double -1.414150e-03, ptr %35, align 16, !tbaa !11
  br label %64

36:                                               ; preds = %5
  %37 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 0
  store double -5.352800e-01, ptr %37, align 16, !tbaa !11
  %38 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 1
  store double -1.225550e-01, ptr %38, align 8, !tbaa !11
  %39 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 2
  store double 0xBF82BC8C62CF5817, ptr %39, align 16, !tbaa !11
  br label %64

40:                                               ; preds = %5
  %41 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 0
  store double -5.746870e-01, ptr %41, align 16, !tbaa !11
  %42 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 1
  store double -1.630350e-01, ptr %42, align 8, !tbaa !11
  %43 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 2
  store double -2.363230e-02, ptr %43, align 16, !tbaa !11
  %44 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 3
  store double -1.538210e-04, ptr %44, align 8, !tbaa !11
  br label %64

45:                                               ; preds = %5
  %46 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 0
  store double -6.079970e-01, ptr %46, align 16, !tbaa !11
  %47 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 1
  store double -2.017510e-01, ptr %47, align 8, !tbaa !11
  %48 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 2
  store double -4.322260e-02, ptr %48, align 16, !tbaa !11
  %49 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 3
  store double -2.121310e-03, ptr %49, align 8, !tbaa !11
  br label %64

50:                                               ; preds = %5
  %51 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 0
  store double -6.365510e-01, ptr %51, align 16, !tbaa !11
  %52 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 1
  store double -2.381830e-01, ptr %52, align 8, !tbaa !11
  %53 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 2
  store double 0xBFB0D37C1376D549, ptr %53, align 16, !tbaa !11
  %54 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 3
  store double 0xBF7ED5E11D91B64B, ptr %54, align 8, !tbaa !11
  %55 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 4
  store double -1.698280e-05, ptr %55, align 16, !tbaa !11
  br label %64

56:                                               ; preds = %5
  %57 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 0
  store double -6.612660e-01, ptr %57, align 16, !tbaa !11
  %58 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 1
  store double -2.721800e-01, ptr %58, align 8, !tbaa !11
  %59 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 2
  store double -8.975960e-02, ptr %59, align 16, !tbaa !11
  %60 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 3
  store double -1.666960e-02, ptr %60, align 8, !tbaa !11
  %61 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 4
  store double -5.105580e-04, ptr %61, align 16, !tbaa !11
  br label %64

62:                                               ; preds = %5
  %63 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  call void @exit(i32 noundef -1) #8
  unreachable

64:                                               ; preds = %56, %50, %45, %40, %36, %32, %29, %26, %24, %22
  %65 = load i32, ptr %7, align 4, !tbaa !9
  %66 = sdiv i32 %65, 2
  store i32 %66, ptr %14, align 4, !tbaa !9
  %67 = load i32, ptr %15, align 4, !tbaa !9
  %68 = load i32, ptr %16, align 4, !tbaa !9
  %69 = mul nsw i32 %67, %68
  %70 = sext i32 %69 to i64
  %71 = mul i64 %70, 8
  %72 = call noalias ptr @malloc(i64 noundef %71) #9
  store ptr %72, ptr %11, align 8, !tbaa !5
  %73 = load i32, ptr %15, align 4, !tbaa !9
  %74 = load i32, ptr %16, align 4, !tbaa !9
  %75 = mul nsw i32 %73, %74
  %76 = sext i32 %75 to i64
  %77 = mul i64 %76, 8
  %78 = call noalias ptr @malloc(i64 noundef %77) #9
  store ptr %78, ptr %12, align 8, !tbaa !5
  %79 = load i32, ptr %15, align 4, !tbaa !9
  %80 = load i32, ptr %16, align 4, !tbaa !9
  %81 = mul nsw i32 %79, %80
  store i32 %81, ptr %17, align 4, !tbaa !9
  br label %82

82:                                               ; preds = %86, %64
  %83 = load i32, ptr %17, align 4, !tbaa !9
  %84 = add nsw i32 %83, -1
  store i32 %84, ptr %17, align 4, !tbaa !9
  %85 = icmp ne i32 %83, 0
  br i1 %85, label %86, label %97

86:                                               ; preds = %82
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = load i32, ptr %17, align 4, !tbaa !9
  %89 = sext i32 %88 to i64
  %90 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %87, i64 noundef %89) #7
  %91 = load float, ptr %90, align 4, !tbaa !13
  %92 = fpext float %91 to double
  %93 = load ptr, ptr %11, align 8, !tbaa !5
  %94 = load i32, ptr %17, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds double, ptr %93, i64 %95
  store double %92, ptr %96, align 8, !tbaa !11
  br label %82, !llvm.loop !15

97:                                               ; preds = %82
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %98

98:                                               ; preds = %112, %97
  %99 = load i32, ptr %18, align 4, !tbaa !9
  %100 = load i32, ptr %16, align 4, !tbaa !9
  %101 = icmp slt i32 %99, %100
  br i1 %101, label %102, label %115

102:                                              ; preds = %98
  %103 = load ptr, ptr %11, align 8, !tbaa !5
  %104 = load i32, ptr %18, align 4, !tbaa !9
  %105 = load i32, ptr %15, align 4, !tbaa !9
  %106 = mul nsw i32 %104, %105
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds double, ptr %103, i64 %107
  %109 = load i32, ptr %15, align 4, !tbaa !9
  %110 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 0
  %111 = load i32, ptr %14, align 4, !tbaa !9
  call void @_Z11invspline1DPdiS_i(ptr noundef %108, i32 noundef %109, ptr noundef %110, i32 noundef %111)
  br label %112

112:                                              ; preds = %102
  %113 = load i32, ptr %18, align 4, !tbaa !9
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %18, align 4, !tbaa !9
  br label %98, !llvm.loop !17

115:                                              ; preds = %98
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %116

116:                                              ; preds = %147, %115
  %117 = load i32, ptr %17, align 4, !tbaa !9
  %118 = load i32, ptr %15, align 4, !tbaa !9
  %119 = icmp slt i32 %117, %118
  br i1 %119, label %120, label %150

120:                                              ; preds = %116
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %121

121:                                              ; preds = %143, %120
  %122 = load i32, ptr %18, align 4, !tbaa !9
  %123 = load i32, ptr %16, align 4, !tbaa !9
  %124 = icmp slt i32 %122, %123
  br i1 %124, label %125, label %146

125:                                              ; preds = %121
  %126 = load ptr, ptr %11, align 8, !tbaa !5
  %127 = load i32, ptr %18, align 4, !tbaa !9
  %128 = load i32, ptr %15, align 4, !tbaa !9
  %129 = mul nsw i32 %127, %128
  %130 = load i32, ptr %17, align 4, !tbaa !9
  %131 = add nsw i32 %129, %130
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds double, ptr %126, i64 %132
  %134 = load double, ptr %133, align 8, !tbaa !11
  %135 = load ptr, ptr %12, align 8, !tbaa !5
  %136 = load i32, ptr %17, align 4, !tbaa !9
  %137 = load i32, ptr %16, align 4, !tbaa !9
  %138 = mul nsw i32 %136, %137
  %139 = load i32, ptr %18, align 4, !tbaa !9
  %140 = add nsw i32 %138, %139
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds double, ptr %135, i64 %141
  store double %134, ptr %142, align 8, !tbaa !11
  br label %143

143:                                              ; preds = %125
  %144 = load i32, ptr %18, align 4, !tbaa !9
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %18, align 4, !tbaa !9
  br label %121, !llvm.loop !18

146:                                              ; preds = %121
  br label %147

147:                                              ; preds = %146
  %148 = load i32, ptr %17, align 4, !tbaa !9
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %17, align 4, !tbaa !9
  br label %116, !llvm.loop !19

150:                                              ; preds = %116
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %151

151:                                              ; preds = %165, %150
  %152 = load i32, ptr %17, align 4, !tbaa !9
  %153 = load i32, ptr %15, align 4, !tbaa !9
  %154 = icmp slt i32 %152, %153
  br i1 %154, label %155, label %168

155:                                              ; preds = %151
  %156 = load ptr, ptr %12, align 8, !tbaa !5
  %157 = load i32, ptr %17, align 4, !tbaa !9
  %158 = load i32, ptr %16, align 4, !tbaa !9
  %159 = mul nsw i32 %157, %158
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds double, ptr %156, i64 %160
  %162 = load i32, ptr %16, align 4, !tbaa !9
  %163 = getelementptr inbounds [5 x double], ptr %13, i64 0, i64 0
  %164 = load i32, ptr %14, align 4, !tbaa !9
  call void @_Z11invspline1DPdiS_i(ptr noundef %161, i32 noundef %162, ptr noundef %163, i32 noundef %164)
  br label %165

165:                                              ; preds = %155
  %166 = load i32, ptr %17, align 4, !tbaa !9
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %17, align 4, !tbaa !9
  br label %151, !llvm.loop !20

168:                                              ; preds = %151
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %169

169:                                              ; preds = %201, %168
  %170 = load i32, ptr %17, align 4, !tbaa !9
  %171 = load i32, ptr %15, align 4, !tbaa !9
  %172 = icmp slt i32 %170, %171
  br i1 %172, label %173, label %204

173:                                              ; preds = %169
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %174

174:                                              ; preds = %197, %173
  %175 = load i32, ptr %18, align 4, !tbaa !9
  %176 = load i32, ptr %16, align 4, !tbaa !9
  %177 = icmp slt i32 %175, %176
  br i1 %177, label %178, label %200

178:                                              ; preds = %174
  %179 = load ptr, ptr %12, align 8, !tbaa !5
  %180 = load i32, ptr %17, align 4, !tbaa !9
  %181 = load i32, ptr %16, align 4, !tbaa !9
  %182 = mul nsw i32 %180, %181
  %183 = load i32, ptr %18, align 4, !tbaa !9
  %184 = add nsw i32 %182, %183
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds double, ptr %179, i64 %185
  %187 = load double, ptr %186, align 8, !tbaa !11
  %188 = fptrunc double %187 to float
  %189 = load ptr, ptr %8, align 8, !tbaa !5
  %190 = load i32, ptr %18, align 4, !tbaa !9
  %191 = load i32, ptr %15, align 4, !tbaa !9
  %192 = mul nsw i32 %190, %191
  %193 = load i32, ptr %17, align 4, !tbaa !9
  %194 = add nsw i32 %192, %193
  %195 = sext i32 %194 to i64
  %196 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %189, i64 noundef %195) #7
  store float %188, ptr %196, align 4, !tbaa !13
  br label %197

197:                                              ; preds = %178
  %198 = load i32, ptr %18, align 4, !tbaa !9
  %199 = add nsw i32 %198, 1
  store i32 %199, ptr %18, align 4, !tbaa !9
  br label %174, !llvm.loop !21

200:                                              ; preds = %174
  br label %201

201:                                              ; preds = %200
  %202 = load i32, ptr %17, align 4, !tbaa !9
  %203 = add nsw i32 %202, 1
  store i32 %203, ptr %17, align 4, !tbaa !9
  br label %169, !llvm.loop !22

204:                                              ; preds = %169
  %205 = load ptr, ptr %12, align 8, !tbaa !5
  call void @free(ptr noundef %205) #7
  %206 = load ptr, ptr %11, align 8, !tbaa !5
  call void @free(ptr noundef %206) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  ret void
}

declare i32 @printf(ptr noundef, ...) #3

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 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 = { noreturn 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 #5 = { 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 #6 = { 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 #7 = { nounwind }
attributes #8 = { noreturn nounwind }
attributes #9 = { 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++ 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 = distinct !{!19, !16}
!20 = distinct !{!20, !16}
!21 = distinct !{!21, !16}
!22 = distinct !{!22, !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 [39 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 willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z11invspline1DPdiS_i(ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z10finvsplineRKSt6vectorIfSaIfEEiRS1_ii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #1 {
  %6 = alloca [5 x double], align 16
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #6
  switch i32 %1, label %25 [
    i32 2, label %7
    i32 3, label %8
    i32 4, label %9
    i32 5, label %10
    i32 6, label %11
    i32 7, label %13
    i32 8, label %15
    i32 9, label %17
    i32 10, label %19
    i32 11, label %22
  ]

7:                                                ; preds = %5
  store double 0xBFC5F619A23D8217, ptr %6, align 16, !tbaa !5
  br label %27

8:                                                ; preds = %5
  store double 0xBFD126145C028A49, ptr %6, align 16, !tbaa !5
  br label %27

9:                                                ; preds = %5
  store <2 x double> <double -3.613410e-01, double -1.372540e-02>, ptr %6, align 16, !tbaa !5
  br label %27

10:                                               ; preds = %5
  store <2 x double> <double -4.305750e-01, double -4.309630e-02>, ptr %6, align 16, !tbaa !5
  br label %27

11:                                               ; preds = %5
  store <2 x double> <double -4.882950e-01, double 0xBFB4E8EF42429AAF>, ptr %6, align 16, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %6, i64 16
  store double -1.414150e-03, ptr %12, align 16, !tbaa !5
  br label %27

13:                                               ; preds = %5
  store <2 x double> <double -5.352800e-01, double -1.225550e-01>, ptr %6, align 16, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %6, i64 16
  store double 0xBF82BC8C62CF5817, ptr %14, align 16, !tbaa !5
  br label %27

15:                                               ; preds = %5
  store <2 x double> <double -5.746870e-01, double -1.630350e-01>, ptr %6, align 16, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %6, i64 16
  store <2 x double> <double -2.363230e-02, double -1.538210e-04>, ptr %16, align 16, !tbaa !5
  br label %27

17:                                               ; preds = %5
  store <2 x double> <double -6.079970e-01, double -2.017510e-01>, ptr %6, align 16, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %6, i64 16
  store <2 x double> <double -4.322260e-02, double -2.121310e-03>, ptr %18, align 16, !tbaa !5
  br label %27

19:                                               ; preds = %5
  store <2 x double> <double -6.365510e-01, double -2.381830e-01>, ptr %6, align 16, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %6, i64 16
  store <2 x double> <double 0xBFB0D37C1376D549, double 0xBF7ED5E11D91B64B>, ptr %20, align 16, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %6, i64 32
  store double -1.698280e-05, ptr %21, align 16, !tbaa !5
  br label %27

22:                                               ; preds = %5
  store <2 x double> <double -6.612660e-01, double -2.721800e-01>, ptr %6, align 16, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %6, i64 16
  store <2 x double> <double -8.975960e-02, double -1.666960e-02>, ptr %23, align 16, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %6, i64 32
  store double -5.105580e-04, ptr %24, align 16, !tbaa !5
  br label %27

25:                                               ; preds = %5
  %26 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  tail call void @exit(i32 noundef -1) #7
  unreachable

27:                                               ; preds = %22, %19, %17, %15, %13, %11, %10, %9, %8, %7
  %28 = lshr i32 %1, 1
  %29 = mul nsw i32 %4, %3
  %30 = sext i32 %29 to i64
  %31 = shl nsw i64 %30, 3
  %32 = tail call noalias ptr @malloc(i64 noundef %31) #8
  %33 = tail call noalias ptr @malloc(i64 noundef %31) #8
  %.not71 = icmp eq i32 %29, 0
  br i1 %.not71, label %.preheader70, label %.lr.ph

.preheader70:                                     ; preds = %.lr.ph, %27
  %34 = icmp sgt i32 %4, 0
  br i1 %34, label %.lr.ph74.preheader, label %.preheader69.thread

.lr.ph74.preheader:                               ; preds = %.preheader70
  %35 = sext i32 %3 to i64
  %wide.trip.count = zext nneg i32 %4 to i64
  br label %.lr.ph74

.lr.ph:                                           ; preds = %27, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %30, %27 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %36 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv.next) #6
  %37 = load float, ptr %36, align 4, !tbaa !9
  %38 = fpext float %37 to double
  %39 = getelementptr inbounds double, ptr %32, i64 %indvars.iv.next
  store double %38, ptr %39, align 8, !tbaa !5
  %.not = icmp eq i64 %indvars.iv.next, 0
  br i1 %.not, label %.preheader70, label %.lr.ph, !llvm.loop !11

.preheader69:                                     ; preds = %.lr.ph74
  %40 = icmp sgt i32 %3, 0
  br i1 %40, label %.preheader68.lr.ph, label %._crit_edge83

.preheader69.thread:                              ; preds = %.preheader70
  %41 = icmp sgt i32 %3, 0
  br i1 %41, label %.lr.ph79.preheader, label %._crit_edge83

.preheader68.lr.ph:                               ; preds = %.preheader69
  br i1 %34, label %.preheader68.us.preheader, label %.lr.ph79.preheader

.preheader68.us.preheader:                        ; preds = %.preheader68.lr.ph
  %42 = zext nneg i32 %3 to i64
  %43 = zext nneg i32 %4 to i64
  %min.iters.check = icmp ugt i32 %4, 3
  %ident.check.not = icmp eq i32 %3, 1
  %or.cond = and i1 %min.iters.check, %ident.check.not
  %n.vec = and i64 %wide.trip.count, 2147483644
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  %xtraiter = and i64 %wide.trip.count, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader68.us

.preheader68.us:                                  ; preds = %.preheader68.us.preheader, %._crit_edge.us
  %indvars.iv96 = phi i64 [ 0, %.preheader68.us.preheader ], [ %indvars.iv.next97, %._crit_edge.us ]
  %44 = mul nuw nsw i64 %indvars.iv96, %43
  %invariant.gep = getelementptr inbounds double, ptr %32, i64 %indvars.iv96
  %invariant.gep120 = getelementptr inbounds double, ptr %33, i64 %44
  br i1 %or.cond, label %vector.body, label %scalar.ph.preheader

vector.body:                                      ; preds = %.preheader68.us, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.preheader68.us ]
  %45 = getelementptr inbounds double, ptr %invariant.gep, i64 %index
  %46 = getelementptr inbounds i8, ptr %45, i64 16
  %wide.load = load <2 x double>, ptr %45, align 8, !tbaa !5
  %wide.load124 = load <2 x double>, ptr %46, align 8, !tbaa !5
  %47 = getelementptr inbounds double, ptr %invariant.gep120, i64 %index
  %48 = getelementptr inbounds i8, ptr %47, i64 16
  store <2 x double> %wide.load, ptr %47, align 8, !tbaa !5
  store <2 x double> %wide.load124, ptr %48, align 8, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %49 = icmp eq i64 %index.next, %n.vec
  br i1 %49, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge.us, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader68.us
  %indvars.iv91.ph = phi i64 [ 0, %.preheader68.us ], [ %n.vec, %middle.block ]
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader, %scalar.ph.prol
  %indvars.iv91.prol = phi i64 [ %indvars.iv.next92.prol, %scalar.ph.prol ], [ %indvars.iv91.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %50 = mul nuw nsw i64 %indvars.iv91.prol, %42
  %gep.prol = getelementptr inbounds double, ptr %invariant.gep, i64 %50
  %51 = load double, ptr %gep.prol, align 8, !tbaa !5
  %gep121.prol = getelementptr inbounds double, ptr %invariant.gep120, i64 %indvars.iv91.prol
  store double %51, ptr %gep121.prol, align 8, !tbaa !5
  %indvars.iv.next92.prol = add nuw nsw i64 %indvars.iv91.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol, !llvm.loop !16

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv91.unr = phi i64 [ %indvars.iv91.ph, %scalar.ph.preheader ], [ %indvars.iv.next92.prol, %scalar.ph.prol ]
  %52 = sub nsw i64 %indvars.iv91.ph, %wide.trip.count
  %53 = icmp ugt i64 %52, -4
  br i1 %53, label %._crit_edge.us, label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv91 = phi i64 [ %indvars.iv.next92.3, %scalar.ph ], [ %indvars.iv91.unr, %scalar.ph.prol.loopexit ]
  %54 = mul nuw nsw i64 %indvars.iv91, %42
  %gep = getelementptr inbounds double, ptr %invariant.gep, i64 %54
  %55 = load double, ptr %gep, align 8, !tbaa !5
  %gep121 = getelementptr inbounds double, ptr %invariant.gep120, i64 %indvars.iv91
  store double %55, ptr %gep121, align 8, !tbaa !5
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %56 = mul nuw nsw i64 %indvars.iv.next92, %42
  %gep.1 = getelementptr inbounds double, ptr %invariant.gep, i64 %56
  %57 = load double, ptr %gep.1, align 8, !tbaa !5
  %gep121.1 = getelementptr inbounds double, ptr %invariant.gep120, i64 %indvars.iv.next92
  store double %57, ptr %gep121.1, align 8, !tbaa !5
  %indvars.iv.next92.1 = add nuw nsw i64 %indvars.iv91, 2
  %58 = mul nuw nsw i64 %indvars.iv.next92.1, %42
  %gep.2 = getelementptr inbounds double, ptr %invariant.gep, i64 %58
  %59 = load double, ptr %gep.2, align 8, !tbaa !5
  %gep121.2 = getelementptr inbounds double, ptr %invariant.gep120, i64 %indvars.iv.next92.1
  store double %59, ptr %gep121.2, align 8, !tbaa !5
  %indvars.iv.next92.2 = add nuw nsw i64 %indvars.iv91, 3
  %60 = mul nuw nsw i64 %indvars.iv.next92.2, %42
  %gep.3 = getelementptr inbounds double, ptr %invariant.gep, i64 %60
  %61 = load double, ptr %gep.3, align 8, !tbaa !5
  %gep121.3 = getelementptr inbounds double, ptr %invariant.gep120, i64 %indvars.iv.next92.2
  store double %61, ptr %gep121.3, align 8, !tbaa !5
  %indvars.iv.next92.3 = add nuw nsw i64 %indvars.iv91, 4
  %exitcond95.not.3 = icmp eq i64 %indvars.iv.next92.3, %43
  br i1 %exitcond95.not.3, label %._crit_edge.us, label %scalar.ph, !llvm.loop !18

._crit_edge.us:                                   ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %exitcond100.not = icmp eq i64 %indvars.iv.next97, %42
  br i1 %exitcond100.not, label %.lr.ph79.preheader, label %.preheader68.us, !llvm.loop !19

.lr.ph74:                                         ; preds = %.lr.ph74.preheader, %.lr.ph74
  %indvars.iv88 = phi i64 [ 0, %.lr.ph74.preheader ], [ %indvars.iv.next89, %.lr.ph74 ]
  %62 = mul nsw i64 %indvars.iv88, %35
  %63 = getelementptr inbounds double, ptr %32, i64 %62
  call void @_Z11invspline1DPdiS_i(ptr noundef %63, i32 noundef %3, ptr noundef nonnull %6, i32 noundef %28)
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next89, %wide.trip.count
  br i1 %exitcond.not, label %.preheader69, label %.lr.ph74, !llvm.loop !20

.lr.ph79.preheader:                               ; preds = %._crit_edge.us, %.preheader69.thread, %.preheader68.lr.ph
  %64 = sext i32 %4 to i64
  %wide.trip.count104 = zext nneg i32 %3 to i64
  br label %.lr.ph79

.preheader.lr.ph:                                 ; preds = %.lr.ph79
  br i1 %34, label %.preheader.us.preheader, label %._crit_edge83

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph
  %65 = zext nneg i32 %3 to i64
  %66 = zext nneg i32 %4 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge.us84
  %indvars.iv111 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next112, %._crit_edge.us84 ]
  %67 = mul nuw nsw i64 %indvars.iv111, %66
  %invariant.gep122 = getelementptr inbounds double, ptr %33, i64 %67
  br label %68

68:                                               ; preds = %.preheader.us, %68
  %indvars.iv106 = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next107, %68 ]
  %gep123 = getelementptr inbounds double, ptr %invariant.gep122, i64 %indvars.iv106
  %69 = load double, ptr %gep123, align 8, !tbaa !5
  %70 = fptrunc double %69 to float
  %71 = mul nuw nsw i64 %indvars.iv106, %65
  %72 = add nuw nsw i64 %71, %indvars.iv111
  %73 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %72) #6
  store float %70, ptr %73, align 4, !tbaa !9
  %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
  %exitcond110.not = icmp eq i64 %indvars.iv.next107, %66
  br i1 %exitcond110.not, label %._crit_edge.us84, label %68, !llvm.loop !21

._crit_edge.us84:                                 ; preds = %68
  %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
  %exitcond115.not = icmp eq i64 %indvars.iv.next112, %65
  br i1 %exitcond115.not, label %._crit_edge83, label %.preheader.us, !llvm.loop !22

.lr.ph79:                                         ; preds = %.lr.ph79.preheader, %.lr.ph79
  %indvars.iv101 = phi i64 [ 0, %.lr.ph79.preheader ], [ %indvars.iv.next102, %.lr.ph79 ]
  %74 = mul nsw i64 %indvars.iv101, %64
  %75 = getelementptr inbounds double, ptr %33, i64 %74
  call void @_Z11invspline1DPdiS_i(ptr noundef %75, i32 noundef %4, ptr noundef nonnull %6, i32 noundef %28)
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %exitcond105.not = icmp eq i64 %indvars.iv.next102, %wide.trip.count104
  br i1 %exitcond105.not, label %.preheader.lr.ph, label %.lr.ph79, !llvm.loop !23

._crit_edge83:                                    ; preds = %._crit_edge.us84, %.preheader69, %.preheader69.thread, %.preheader.lr.ph
  call void @free(ptr noundef %33) #6
  call void @free(ptr noundef %32) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #6
  ret void
}

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { 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 #3 = { noreturn 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 #4 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(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 #5 = { 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 #6 = { nounwind }
attributes #7 = { noreturn nounwind }
attributes #8 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = distinct !{!18, !12, !14}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}


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