; LLVM IR from bjack205/altro :: src/linesearch (linesearch)

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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%struct.CubicSpline = type { double, double, double, double, double }
%"class.linesearch::CubicLineSearch" = type <{ i32, [4 x i8], double, double, double, double, i8, i8, [2 x i8], i32, double, double, i32, [4 x i8], double, double, double, double, double, double, double, double, i8, i8, i8, [5 x i8] }>

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [19 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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8), double noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNKSt8functionIFvdPdS0_EEclEdS0_S0_(ptr noundef nonnull align 8 dereferenceable(32), double noundef, ptr noundef, ptr noundef) #2 align 2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEb(ptr noundef nonnull align 8 dereferenceable(8), i1 noundef zeroext) #2 align 2

declare void @CubicSpline_From2Points(ptr dead_on_unwind writable sret(%struct.CubicSpline) align 8, double noundef, double noundef, double noundef, double noundef, double noundef, double noundef, ptr noundef) #4

declare double @CubicSpline_ArgMin(ptr noundef, ptr noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSt8isfinited(double noundef) #5

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN10linesearch15CubicLineSearch4ZoomESt8functionIFvdPdS2_EEdd(ptr noundef nonnull align 8 dereferenceable(139) %0, ptr noundef %1, double noundef %2, double noundef %3) #2 align 2 {
  %5 = alloca double, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  %25 = alloca i32, align 4
  %26 = alloca %struct.CubicSpline, align 8
  %27 = alloca i8, align 1
  %28 = alloca i8, align 1
  %29 = alloca i8, align 1
  %30 = alloca i8, align 1
  %31 = alloca i8, align 1
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store double %2, ptr %8, align 8, !tbaa !9
  store double %3, ptr %9, align 8, !tbaa !9
  %32 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %33 = load double, ptr %8, align 8, !tbaa !9
  store double %33, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %34 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 15
  store ptr %34, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %35 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 19
  store ptr %35, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %36 = load double, ptr %8, align 8, !tbaa !9
  %37 = call noundef zeroext i1 @_ZSt8isfinited(double noundef %36)
  br i1 %37, label %38, label %41

38:                                               ; preds = %4
  %39 = load double, ptr %9, align 8, !tbaa !9
  %40 = call noundef zeroext i1 @_ZSt8isfinited(double noundef %39)
  br i1 %40, label %43, label %41

41:                                               ; preds = %38, %4
  %42 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 9
  store i32 5, ptr %42, align 4, !tbaa !11
  store double 0.000000e+00, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %330

43:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %44 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 10
  %45 = load double, ptr %44, align 8, !tbaa !16
  store double %45, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %46 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 11
  %47 = load double, ptr %46, align 8, !tbaa !17
  store double %47, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %48 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 14
  %49 = load double, ptr %48, align 8, !tbaa !18
  store double %49, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %50 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 18
  %51 = load double, ptr %50, align 8, !tbaa !19
  store double %51, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %52 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 16
  %53 = load double, ptr %52, align 8, !tbaa !20
  store double %53, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %54 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 17
  %55 = load double, ptr %54, align 8, !tbaa !21
  store double %55, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %56 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 20
  %57 = load double, ptr %56, align 8, !tbaa !22
  store double %57, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %58 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 21
  %59 = load double, ptr %58, align 8, !tbaa !23
  store double %59, ptr %24, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  %60 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 12
  %61 = load i32, ptr %60, align 8, !tbaa !24
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %25, align 4, !tbaa !25
  br label %63

63:                                               ; preds = %321, %43
  %64 = load i32, ptr %25, align 4, !tbaa !25
  %65 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 0
  %66 = load i32, ptr %65, align 8, !tbaa !26
  %67 = icmp slt i32 %64, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %63
  store i32 2, ptr %16, align 4
  br label %324

69:                                               ; preds = %63
  %70 = load double, ptr %8, align 8, !tbaa !9
  %71 = load double, ptr %9, align 8, !tbaa !9
  %72 = fsub double %70, %71
  %73 = call double @llvm.fabs.f64(double %72)
  %74 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 5
  %75 = load double, ptr %74, align 8, !tbaa !27
  %76 = fcmp olt double %73, %75
  br i1 %76, label %77, label %134

77:                                               ; preds = %69
  %78 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 24
  %79 = load i8, ptr %78, align 2, !tbaa !28, !range !29, !noundef !30
  %80 = trunc i8 %79 to i1
  br i1 %80, label %81, label %89

81:                                               ; preds = %77
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.18)
  %83 = load double, ptr %8, align 8, !tbaa !9
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %82, double noundef %83)
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %84, ptr noundef @.str.19)
  %86 = load double, ptr %9, align 8, !tbaa !9
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %85, double noundef %86)
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %87, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %89

89:                                               ; preds = %81, %77
  %90 = load double, ptr %8, align 8, !tbaa !9
  %91 = load double, ptr %9, align 8, !tbaa !9
  %92 = fadd double %90, %91
  %93 = fdiv double %92, 2.000000e+00
  store double %93, ptr %12, align 8, !tbaa !9
  %94 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 12
  %95 = load i32, ptr %94, align 8, !tbaa !24
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %94, align 8, !tbaa !24
  %97 = load double, ptr %12, align 8, !tbaa !9
  %98 = load ptr, ptr %13, align 8, !tbaa !5
  %99 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZNKSt8functionIFvdPdS0_EEclEdS0_S0_(ptr noundef nonnull align 8 dereferenceable(32) %1, double noundef %97, ptr noundef %98, ptr noundef %99)
  %100 = load ptr, ptr %13, align 8, !tbaa !5
  %101 = load double, ptr %100, align 8, !tbaa !9
  %102 = load double, ptr %19, align 8, !tbaa !9
  %103 = load double, ptr %17, align 8, !tbaa !9
  %104 = load double, ptr %12, align 8, !tbaa !9
  %105 = fmul double %103, %104
  %106 = load double, ptr %20, align 8, !tbaa !9
  %107 = call double @llvm.fmuladd.f64(double %105, double %106, double %102)
  %108 = fcmp ole double %101, %107
  %109 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 22
  %110 = zext i1 %108 to i8
  store i8 %110, ptr %109, align 8, !tbaa !31
  %111 = load ptr, ptr %14, align 8, !tbaa !5
  %112 = load double, ptr %111, align 8, !tbaa !9
  %113 = call double @llvm.fabs.f64(double %112)
  %114 = load double, ptr %18, align 8, !tbaa !9
  %115 = fneg double %114
  %116 = load double, ptr %20, align 8, !tbaa !9
  %117 = fmul double %115, %116
  %118 = fcmp ole double %113, %117
  %119 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 23
  %120 = zext i1 %118 to i8
  store i8 %120, ptr %119, align 1, !tbaa !32
  %121 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 22
  %122 = load i8, ptr %121, align 8, !tbaa !31, !range !29, !noundef !30
  %123 = trunc i8 %122 to i1
  br i1 %123, label %124, label %130

124:                                              ; preds = %89
  %125 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 23
  %126 = load i8, ptr %125, align 1, !tbaa !32, !range !29, !noundef !30
  %127 = trunc i8 %126 to i1
  br i1 %127, label %128, label %130

128:                                              ; preds = %124
  %129 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 9
  store i32 1, ptr %129, align 4, !tbaa !11
  br label %132

130:                                              ; preds = %124, %89
  %131 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 9
  store i32 4, ptr %131, align 4, !tbaa !11
  br label %132

132:                                              ; preds = %130, %128
  %133 = load double, ptr %12, align 8, !tbaa !9
  store double %133, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %324

134:                                              ; preds = %69
  %135 = load double, ptr %8, align 8, !tbaa !9
  %136 = load double, ptr %9, align 8, !tbaa !9
  %137 = fcmp olt double %135, %136
  br i1 %137, label %138, label %141

138:                                              ; preds = %134
  %139 = load double, ptr %8, align 8, !tbaa !9
  store double %139, ptr %11, align 8, !tbaa !9
  %140 = load double, ptr %9, align 8, !tbaa !9
  store double %140, ptr %10, align 8, !tbaa !9
  br label %144

141:                                              ; preds = %134
  %142 = load double, ptr %9, align 8, !tbaa !9
  store double %142, ptr %11, align 8, !tbaa !9
  %143 = load double, ptr %8, align 8, !tbaa !9
  store double %143, ptr %10, align 8, !tbaa !9
  br label %144

144:                                              ; preds = %141, %138
  call void @llvm.lifetime.start.p0(i64 40, ptr %26) #6
  %145 = load double, ptr %8, align 8, !tbaa !9
  %146 = load double, ptr %21, align 8, !tbaa !9
  %147 = load double, ptr %23, align 8, !tbaa !9
  %148 = load double, ptr %9, align 8, !tbaa !9
  %149 = load double, ptr %22, align 8, !tbaa !9
  %150 = load double, ptr %24, align 8, !tbaa !9
  call void @CubicSpline_From2Points(ptr dead_on_unwind writable sret(%struct.CubicSpline) align 8 %26, double noundef %145, double noundef %146, double noundef %147, double noundef %148, double noundef %149, double noundef %150, ptr noundef %15)
  call void @llvm.lifetime.start.p0(i64 1, ptr %27) #6
  store i8 1, ptr %27, align 1, !tbaa !33
  %151 = load i32, ptr %15, align 4, !tbaa !34
  %152 = icmp eq i32 %151, 0
  br i1 %152, label %153, label %177

153:                                              ; preds = %144
  %154 = call double @CubicSpline_ArgMin(ptr noundef %26, ptr noundef %15)
  store double %154, ptr %12, align 8, !tbaa !9
  %155 = load i32, ptr %15, align 4, !tbaa !34
  %156 = icmp eq i32 %155, 1
  br i1 %156, label %157, label %176

157:                                              ; preds = %153
  %158 = load double, ptr %12, align 8, !tbaa !9
  %159 = call noundef zeroext i1 @_ZSt8isfinited(double noundef %158)
  br i1 %159, label %160, label %176

160:                                              ; preds = %157
  %161 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 24
  %162 = load i8, ptr %161, align 2, !tbaa !28, !range !29, !noundef !30
  %163 = trunc i8 %162 to i1
  br i1 %163, label %164, label %175

164:                                              ; preds = %160
  %165 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.20)
  %166 = load double, ptr %11, align 8, !tbaa !9
  %167 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %165, double noundef %166)
  %168 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %167, ptr noundef @.str.15)
  %169 = load double, ptr %10, align 8, !tbaa !9
  %170 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %168, double noundef %169)
  %171 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %170, ptr noundef @.str.10)
  %172 = load double, ptr %12, align 8, !tbaa !9
  %173 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %171, double noundef %172)
  %174 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %173, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %175

175:                                              ; preds = %164, %160
  store i8 0, ptr %27, align 1, !tbaa !33
  br label %176

176:                                              ; preds = %175, %157, %153
  br label %177

177:                                              ; preds = %176, %144
  %178 = load i8, ptr %27, align 1, !tbaa !33, !range !29, !noundef !30
  %179 = trunc i8 %178 to i1
  br i1 %179, label %180, label %191

180:                                              ; preds = %177
  %181 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 24
  %182 = load i8, ptr %181, align 2, !tbaa !28, !range !29, !noundef !30
  %183 = trunc i8 %182 to i1
  br i1 %183, label %184, label %186

184:                                              ; preds = %180
  %185 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.21)
  br label %186

186:                                              ; preds = %184, %180
  %187 = load double, ptr %8, align 8, !tbaa !9
  %188 = load double, ptr %9, align 8, !tbaa !9
  %189 = fadd double %187, %188
  %190 = fdiv double %189, 2.000000e+00
  store double %190, ptr %12, align 8, !tbaa !9
  br label %191

191:                                              ; preds = %186, %177
  %192 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 12
  %193 = load i32, ptr %192, align 8, !tbaa !24
  %194 = add nsw i32 %193, 1
  store i32 %194, ptr %192, align 8, !tbaa !24
  %195 = load double, ptr %12, align 8, !tbaa !9
  %196 = load ptr, ptr %13, align 8, !tbaa !5
  %197 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZNKSt8functionIFvdPdS0_EEclEdS0_S0_(ptr noundef nonnull align 8 dereferenceable(32) %1, double noundef %195, ptr noundef %196, ptr noundef %197)
  call void @llvm.lifetime.start.p0(i64 1, ptr %28) #6
  %198 = load ptr, ptr %13, align 8, !tbaa !5
  %199 = load double, ptr %198, align 8, !tbaa !9
  %200 = load double, ptr %19, align 8, !tbaa !9
  %201 = load double, ptr %17, align 8, !tbaa !9
  %202 = load double, ptr %12, align 8, !tbaa !9
  %203 = fmul double %201, %202
  %204 = load double, ptr %20, align 8, !tbaa !9
  %205 = call double @llvm.fmuladd.f64(double %203, double %204, double %200)
  %206 = fcmp ole double %199, %205
  %207 = zext i1 %206 to i8
  store i8 %207, ptr %28, align 1, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 1, ptr %29) #6
  %208 = load ptr, ptr %13, align 8, !tbaa !5
  %209 = load double, ptr %208, align 8, !tbaa !9
  %210 = load double, ptr %21, align 8, !tbaa !9
  %211 = fcmp ogt double %209, %210
  %212 = zext i1 %211 to i8
  store i8 %212, ptr %29, align 1, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 1, ptr %30) #6
  %213 = load ptr, ptr %14, align 8, !tbaa !5
  %214 = load double, ptr %213, align 8, !tbaa !9
  %215 = call double @llvm.fabs.f64(double %214)
  %216 = load double, ptr %18, align 8, !tbaa !9
  %217 = fneg double %216
  %218 = load double, ptr %20, align 8, !tbaa !9
  %219 = fmul double %217, %218
  %220 = fcmp ole double %215, %219
  %221 = zext i1 %220 to i8
  store i8 %221, ptr %30, align 1, !tbaa !33
  %222 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 24
  %223 = load i8, ptr %222, align 2, !tbaa !28, !range !29, !noundef !30
  %224 = trunc i8 %223 to i1
  br i1 %224, label %225, label %249

225:                                              ; preds = %191
  %226 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.22)
  %227 = load i32, ptr %25, align 4, !tbaa !25
  %228 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %226, i32 noundef %227)
  %229 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %228, ptr noundef @.str.3)
  %230 = load double, ptr %12, align 8, !tbaa !9
  %231 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %229, double noundef %230)
  %232 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %231, ptr noundef @.str.4)
  %233 = load ptr, ptr %13, align 8, !tbaa !5
  %234 = load double, ptr %233, align 8, !tbaa !9
  %235 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %232, double noundef %234)
  %236 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %235, ptr noundef @.str.5)
  %237 = load ptr, ptr %14, align 8, !tbaa !5
  %238 = load double, ptr %237, align 8, !tbaa !9
  %239 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %236, double noundef %238)
  %240 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %239, ptr noundef @.str.6)
  %241 = load i8, ptr %28, align 1, !tbaa !33, !range !29, !noundef !30
  %242 = trunc i8 %241 to i1
  %243 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEb(ptr noundef nonnull align 8 dereferenceable(8) %240, i1 noundef zeroext %242)
  %244 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %243, ptr noundef @.str.7)
  %245 = load i8, ptr %30, align 1, !tbaa !33, !range !29, !noundef !30
  %246 = trunc i8 %245 to i1
  %247 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEb(ptr noundef nonnull align 8 dereferenceable(8) %244, i1 noundef zeroext %246)
  %248 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %247, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %249

249:                                              ; preds = %225, %191
  %250 = load i8, ptr %28, align 1, !tbaa !33, !range !29, !noundef !30
  %251 = trunc i8 %250 to i1
  br i1 %251, label %252, label %266

252:                                              ; preds = %249
  %253 = load i8, ptr %30, align 1, !tbaa !33, !range !29, !noundef !30
  %254 = trunc i8 %253 to i1
  br i1 %254, label %255, label %266

255:                                              ; preds = %252
  %256 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 24
  %257 = load i8, ptr %256, align 2, !tbaa !28, !range !29, !noundef !30
  %258 = trunc i8 %257 to i1
  br i1 %258, label %259, label %261

259:                                              ; preds = %255
  %260 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.8)
  br label %261

261:                                              ; preds = %259, %255
  %262 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 22
  store i8 1, ptr %262, align 8, !tbaa !31
  %263 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 23
  store i8 1, ptr %263, align 1, !tbaa !32
  %264 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 9
  store i32 1, ptr %264, align 4, !tbaa !11
  %265 = load double, ptr %12, align 8, !tbaa !9
  store double %265, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %318

266:                                              ; preds = %252, %249
  %267 = load i8, ptr %28, align 1, !tbaa !33, !range !29, !noundef !30
  %268 = trunc i8 %267 to i1
  br i1 %268, label %269, label %272

269:                                              ; preds = %266
  %270 = load i8, ptr %29, align 1, !tbaa !33, !range !29, !noundef !30
  %271 = trunc i8 %270 to i1
  br i1 %271, label %272, label %284

272:                                              ; preds = %269, %266
  %273 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 24
  %274 = load i8, ptr %273, align 2, !tbaa !28, !range !29, !noundef !30
  %275 = trunc i8 %274 to i1
  br i1 %275, label %276, label %278

276:                                              ; preds = %272
  %277 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.23)
  br label %278

278:                                              ; preds = %276, %272
  %279 = load double, ptr %12, align 8, !tbaa !9
  store double %279, ptr %9, align 8, !tbaa !9
  %280 = load ptr, ptr %13, align 8, !tbaa !5
  %281 = load double, ptr %280, align 8, !tbaa !9
  store double %281, ptr %22, align 8, !tbaa !9
  %282 = load ptr, ptr %14, align 8, !tbaa !5
  %283 = load double, ptr %282, align 8, !tbaa !9
  store double %283, ptr %24, align 8, !tbaa !9
  br label %317

284:                                              ; preds = %269
  call void @llvm.lifetime.start.p0(i64 1, ptr %31) #6
  %285 = load ptr, ptr %14, align 8, !tbaa !5
  %286 = load double, ptr %285, align 8, !tbaa !9
  %287 = load double, ptr %9, align 8, !tbaa !9
  %288 = load double, ptr %8, align 8, !tbaa !9
  %289 = fsub double %287, %288
  %290 = fmul double %286, %289
  %291 = fcmp ole double %290, 0.000000e+00
  %292 = zext i1 %291 to i8
  store i8 %292, ptr %31, align 1, !tbaa !33
  %293 = load i8, ptr %31, align 1, !tbaa !33, !range !29, !noundef !30
  %294 = trunc i8 %293 to i1
  br i1 %294, label %295, label %305

295:                                              ; preds = %284
  %296 = load double, ptr %8, align 8, !tbaa !9
  store double %296, ptr %9, align 8, !tbaa !9
  %297 = load double, ptr %21, align 8, !tbaa !9
  store double %297, ptr %22, align 8, !tbaa !9
  %298 = load double, ptr %23, align 8, !tbaa !9
  store double %298, ptr %24, align 8, !tbaa !9
  %299 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 24
  %300 = load i8, ptr %299, align 2, !tbaa !28, !range !29, !noundef !30
  %301 = trunc i8 %300 to i1
  br i1 %301, label %302, label %304

302:                                              ; preds = %295
  %303 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.24)
  br label %304

304:                                              ; preds = %302, %295
  br label %305

305:                                              ; preds = %304, %284
  %306 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 24
  %307 = load i8, ptr %306, align 2, !tbaa !28, !range !29, !noundef !30
  %308 = trunc i8 %307 to i1
  br i1 %308, label %309, label %311

309:                                              ; preds = %305
  %310 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.25)
  br label %311

311:                                              ; preds = %309, %305
  %312 = load double, ptr %12, align 8, !tbaa !9
  store double %312, ptr %8, align 8, !tbaa !9
  %313 = load ptr, ptr %13, align 8, !tbaa !5
  %314 = load double, ptr %313, align 8, !tbaa !9
  store double %314, ptr %21, align 8, !tbaa !9
  %315 = load ptr, ptr %14, align 8, !tbaa !5
  %316 = load double, ptr %315, align 8, !tbaa !9
  store double %316, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr %31) #6
  br label %317

317:                                              ; preds = %311, %278
  store i32 0, ptr %16, align 4
  br label %318

318:                                              ; preds = %317, %261
  call void @llvm.lifetime.end.p0(i64 1, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %26) #6
  %319 = load i32, ptr %16, align 4
  switch i32 %319, label %324 [
    i32 0, label %320
  ]

320:                                              ; preds = %318
  br label %321

321:                                              ; preds = %320
  %322 = load i32, ptr %25, align 4, !tbaa !25
  %323 = add nsw i32 %322, 1
  store i32 %323, ptr %25, align 4, !tbaa !25
  br label %63, !llvm.loop !36

324:                                              ; preds = %318, %132, %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  %325 = load i32, ptr %16, align 4
  switch i32 %325, label %329 [
    i32 2, label %326
  ]

326:                                              ; preds = %324
  %327 = getelementptr inbounds %"class.linesearch::CubicLineSearch", ptr %32, i32 0, i32 9
  store i32 6, ptr %327, align 4, !tbaa !11
  %328 = load double, ptr %12, align 8, !tbaa !9
  store double %328, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %329

329:                                              ; preds = %326, %324
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %330

330:                                              ; preds = %329, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  %331 = load double, ptr %5, align 8
  ret double %331
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { "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 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 #6 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !15, i64 44}
!12 = !{!"_ZTSN10linesearch15CubicLineSearchE", !13, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !14, i64 40, !14, i64 41, !15, i64 44, !10, i64 48, !10, i64 56, !13, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !14, i64 136, !14, i64 137, !14, i64 138}
!13 = !{!"int", !7, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!"_ZTSN10linesearch15CubicLineSearch11ReturnCodesE", !7, i64 0}
!16 = !{!12, !10, i64 48}
!17 = !{!12, !10, i64 56}
!18 = !{!12, !10, i64 72}
!19 = !{!12, !10, i64 104}
!20 = !{!12, !10, i64 88}
!21 = !{!12, !10, i64 96}
!22 = !{!12, !10, i64 120}
!23 = !{!12, !10, i64 128}
!24 = !{!12, !13, i64 64}
!25 = !{!13, !13, i64 0}
!26 = !{!12, !13, i64 0}
!27 = !{!12, !10, i64 32}
!28 = !{!12, !14, i64 138}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = !{!12, !14, i64 136}
!32 = !{!12, !14, i64 137}
!33 = !{!14, !14, i64 0}
!34 = !{!35, !35, i64 0}
!35 = !{!"_ZTS22CubicSplineReturnCodes", !7, i64 0}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}


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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%struct.CubicSpline = type { double, double, double, double, double }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [19 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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8), double noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNKSt8functionIFvdPdS0_EEclEdS0_S0_(ptr noundef nonnull align 8 dereferenceable(32), double noundef, ptr noundef, ptr noundef) local_unnamed_addr #2 align 2

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEb(ptr noundef nonnull align 8 dereferenceable(8), i1 noundef zeroext) local_unnamed_addr #2 align 2

declare void @CubicSpline_From2Points(ptr dead_on_unwind writable sret(%struct.CubicSpline) align 8, double noundef, double noundef, double noundef, double noundef, double noundef, double noundef, ptr noundef) local_unnamed_addr #4

declare double @CubicSpline_ArgMin(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSt8isfinited(double noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN10linesearch15CubicLineSearch4ZoomESt8functionIFvdPdS2_EEdd(ptr noundef nonnull align 8 dereferenceable(139) %0, ptr noundef %1, double noundef %2, double noundef %3) local_unnamed_addr #2 align 2 {
  %5 = alloca i32, align 4
  %6 = alloca %struct.CubicSpline, align 8
  %7 = getelementptr inbounds i8, ptr %0, i64 80
  %8 = getelementptr inbounds i8, ptr %0, i64 112
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %9 = tail call noundef zeroext i1 @_ZSt8isfinited(double noundef %2)
  br i1 %9, label %10, label %12

10:                                               ; preds = %4
  %11 = tail call noundef zeroext i1 @_ZSt8isfinited(double noundef %3)
  br i1 %11, label %14, label %12

12:                                               ; preds = %10, %4
  %13 = getelementptr inbounds i8, ptr %0, i64 44
  store i32 5, ptr %13, align 4, !tbaa !5
  br label %.thread134

14:                                               ; preds = %10
  %15 = getelementptr inbounds i8, ptr %0, i64 48
  %16 = load double, ptr %15, align 8, !tbaa !13
  %17 = getelementptr inbounds i8, ptr %0, i64 72
  %18 = load double, ptr %17, align 8, !tbaa !14
  %19 = getelementptr inbounds i8, ptr %0, i64 104
  %20 = load double, ptr %19, align 8, !tbaa !15
  %21 = getelementptr inbounds i8, ptr %0, i64 64
  %22 = load i32, ptr %21, align 8, !tbaa !16
  %.093144 = add nsw i32 %22, 1
  %23 = load i32, ptr %0, align 8, !tbaa !17
  %.not145 = icmp slt i32 %.093144, %23
  br i1 %.not145, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %14
  %24 = getelementptr inbounds i8, ptr %0, i64 56
  %25 = load double, ptr %24, align 8, !tbaa !18
  %26 = getelementptr inbounds i8, ptr %0, i64 128
  %27 = load double, ptr %26, align 8, !tbaa !19
  %28 = getelementptr inbounds i8, ptr %0, i64 120
  %29 = load double, ptr %28, align 8, !tbaa !20
  %30 = getelementptr inbounds i8, ptr %0, i64 96
  %31 = load double, ptr %30, align 8, !tbaa !21
  %32 = getelementptr inbounds i8, ptr %0, i64 88
  %33 = load double, ptr %32, align 8, !tbaa !22
  %34 = getelementptr inbounds i8, ptr %0, i64 32
  %35 = getelementptr inbounds i8, ptr %0, i64 138
  %36 = fneg double %25
  %37 = fmul double %20, %36
  br label %38

38:                                               ; preds = %.lr.ph, %166
  %.093152 = phi i32 [ %.093144, %.lr.ph ], [ %.093, %166 ]
  %.084151 = phi double [ %2, %.lr.ph ], [ %.286, %166 ]
  %.087150 = phi double [ %3, %.lr.ph ], [ %.390, %166 ]
  %.094149 = phi double [ %27, %.lr.ph ], [ %.397, %166 ]
  %.098148 = phi double [ %29, %.lr.ph ], [ %.2100, %166 ]
  %.0101147 = phi double [ %31, %.lr.ph ], [ %.3104, %166 ]
  %.0105146 = phi double [ %33, %.lr.ph ], [ %.2107, %166 ]
  %39 = fsub double %.084151, %.087150
  %40 = call double @llvm.fabs.f64(double %39)
  %41 = load double, ptr %34, align 8, !tbaa !23
  %42 = fcmp olt double %40, %41
  br i1 %42, label %43, label %72

43:                                               ; preds = %38
  %44 = load i8, ptr %35, align 2, !tbaa !24, !range !25, !noundef !26
  %45 = trunc nuw i8 %44 to i1
  br i1 %45, label %46, label %52

46:                                               ; preds = %43
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.18)
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %47, double noundef %.084151)
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef nonnull @.str.19)
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %49, double noundef %.087150)
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %50, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %52

52:                                               ; preds = %46, %43
  %53 = fadd double %.087150, %.084151
  %54 = fmul double %53, 5.000000e-01
  %55 = load i32, ptr %21, align 8, !tbaa !16
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %21, align 8, !tbaa !16
  call void @_ZNKSt8functionIFvdPdS0_EEclEdS0_S0_(ptr noundef nonnull align 8 dereferenceable(32) %1, double noundef %54, ptr noundef nonnull %7, ptr noundef nonnull %8)
  %57 = load double, ptr %7, align 8, !tbaa !27
  %58 = fmul double %16, %54
  %59 = call double @llvm.fmuladd.f64(double %58, double %20, double %18)
  %60 = fcmp ole double %57, %59
  %61 = getelementptr inbounds i8, ptr %0, i64 136
  %62 = zext i1 %60 to i8
  store i8 %62, ptr %61, align 8, !tbaa !28
  %63 = load double, ptr %8, align 8, !tbaa !27
  %64 = call double @llvm.fabs.f64(double %63)
  %65 = fcmp ole double %64, %37
  %66 = getelementptr inbounds i8, ptr %0, i64 137
  %67 = zext i1 %65 to i8
  store i8 %67, ptr %66, align 1, !tbaa !29
  %68 = select i1 %60, i1 %65, i1 false
  %69 = getelementptr inbounds i8, ptr %0, i64 44
  br i1 %68, label %70, label %71

70:                                               ; preds = %52
  store i32 1, ptr %69, align 4, !tbaa !5
  br label %.thread134

71:                                               ; preds = %52
  store i32 4, ptr %69, align 4, !tbaa !5
  br label %.thread134

72:                                               ; preds = %38
  %73 = fcmp olt double %.084151, %.087150
  %.084..087 = select i1 %73, double %.084151, double %.087150
  %.087..084 = select i1 %73, double %.087150, double %.084151
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #6
  call void @CubicSpline_From2Points(ptr dead_on_unwind nonnull writable sret(%struct.CubicSpline) align 8 %6, double noundef %.084151, double noundef %.0105146, double noundef %.098148, double noundef %.087150, double noundef %.0101147, double noundef %.094149, ptr noundef nonnull %5)
  %74 = load i32, ptr %5, align 4, !tbaa !30
  %75 = icmp eq i32 %74, 0
  br i1 %75, label %76, label %93

76:                                               ; preds = %72
  %77 = call double @CubicSpline_ArgMin(ptr noundef nonnull %6, ptr noundef nonnull %5)
  %78 = load i32, ptr %5, align 4, !tbaa !30
  %79 = icmp eq i32 %78, 1
  br i1 %79, label %80, label %93

80:                                               ; preds = %76
  %81 = call noundef zeroext i1 @_ZSt8isfinited(double noundef %77)
  br i1 %81, label %82, label %93

82:                                               ; preds = %80
  %83 = load i8, ptr %35, align 2, !tbaa !24, !range !25, !noundef !26
  %84 = trunc nuw i8 %83 to i1
  br i1 %84, label %85, label %101

85:                                               ; preds = %82
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.20)
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %86, double noundef %.084..087)
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %87, ptr noundef nonnull @.str.15)
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %88, double noundef %.087..084)
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %89, ptr noundef nonnull @.str.10)
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %90, double noundef %77)
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %91, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %101

93:                                               ; preds = %80, %76, %72
  %94 = load i8, ptr %35, align 2, !tbaa !24, !range !25, !noundef !26
  %95 = trunc nuw i8 %94 to i1
  br i1 %95, label %96, label %98

96:                                               ; preds = %93
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.21)
  br label %98

98:                                               ; preds = %96, %93
  %99 = fadd double %.087150, %.084151
  %100 = fmul double %99, 5.000000e-01
  br label %101

101:                                              ; preds = %85, %82, %98
  %.2111 = phi double [ %100, %98 ], [ %77, %85 ], [ %77, %82 ]
  %102 = load i32, ptr %21, align 8, !tbaa !16
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %21, align 8, !tbaa !16
  call void @_ZNKSt8functionIFvdPdS0_EEclEdS0_S0_(ptr noundef nonnull align 8 dereferenceable(32) %1, double noundef %.2111, ptr noundef nonnull %7, ptr noundef nonnull %8)
  %104 = load double, ptr %7, align 8, !tbaa !27
  %105 = fmul double %16, %.2111
  %106 = call double @llvm.fmuladd.f64(double %105, double %20, double %18)
  %107 = fcmp ole double %104, %106
  %108 = fcmp ule double %104, %.0105146
  %109 = load double, ptr %8, align 8, !tbaa !27
  %110 = call double @llvm.fabs.f64(double %109)
  %111 = fcmp ole double %110, %37
  %112 = load i8, ptr %35, align 2, !tbaa !24, !range !25, !noundef !26
  %113 = trunc nuw i8 %112 to i1
  br i1 %113, label %114, label %130

114:                                              ; preds = %101
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.22)
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %115, i32 noundef %.093152)
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %116, ptr noundef nonnull @.str.3)
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %117, double noundef %.2111)
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %118, ptr noundef nonnull @.str.4)
  %120 = load double, ptr %7, align 8, !tbaa !27
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %119, double noundef %120)
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %121, ptr noundef nonnull @.str.5)
  %123 = load double, ptr %8, align 8, !tbaa !27
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %122, double noundef %123)
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %124, ptr noundef nonnull @.str.6)
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEb(ptr noundef nonnull align 8 dereferenceable(8) %125, i1 noundef zeroext %107)
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %126, ptr noundef nonnull @.str.7)
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEb(ptr noundef nonnull align 8 dereferenceable(8) %127, i1 noundef zeroext %111)
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %128, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %130

130:                                              ; preds = %114, %101
  %131 = select i1 %107, i1 %111, i1 false
  br i1 %131, label %132, label %140

132:                                              ; preds = %130
  %133 = load i8, ptr %35, align 2, !tbaa !24, !range !25, !noundef !26
  %134 = trunc nuw i8 %133 to i1
  br i1 %134, label %135, label %.thread124

135:                                              ; preds = %132
  %136 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.8)
  br label %.thread124

.thread124:                                       ; preds = %132, %135
  %137 = getelementptr inbounds i8, ptr %0, i64 136
  store i8 1, ptr %137, align 8, !tbaa !28
  %138 = getelementptr inbounds i8, ptr %0, i64 137
  store i8 1, ptr %138, align 1, !tbaa !29
  %139 = getelementptr inbounds i8, ptr %0, i64 44
  store i32 1, ptr %139, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #6
  br label %.thread134

140:                                              ; preds = %130
  %brmerge121.not = select i1 %107, i1 %108, i1 false
  br i1 %brmerge121.not, label %149, label %141

141:                                              ; preds = %140
  %142 = load i8, ptr %35, align 2, !tbaa !24, !range !25, !noundef !26
  %143 = trunc nuw i8 %142 to i1
  br i1 %143, label %144, label %146

144:                                              ; preds = %141
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.23)
  br label %146

146:                                              ; preds = %144, %141
  %147 = load double, ptr %7, align 8, !tbaa !27
  %148 = load double, ptr %8, align 8, !tbaa !27
  br label %166

149:                                              ; preds = %140
  %150 = load double, ptr %8, align 8, !tbaa !27
  %151 = fsub double %.087150, %.084151
  %152 = fmul double %151, %150
  %153 = fcmp ugt double %152, 0.000000e+00
  %.pre158 = load i8, ptr %35, align 2, !tbaa !24, !range !25
  br i1 %153, label %158, label %154

154:                                              ; preds = %149
  %155 = trunc nuw i8 %.pre158 to i1
  br i1 %155, label %156, label %158

156:                                              ; preds = %154
  %157 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.24)
  %.pre = load i8, ptr %35, align 2, !tbaa !24, !range !25
  br label %158

158:                                              ; preds = %154, %156, %149
  %159 = phi i8 [ %.pre, %156 ], [ %.pre158, %154 ], [ %.pre158, %149 ]
  %.1102 = phi double [ %.0105146, %156 ], [ %.0105146, %154 ], [ %.0101147, %149 ]
  %.195 = phi double [ %.098148, %156 ], [ %.098148, %154 ], [ %.094149, %149 ]
  %.188 = phi double [ %.084151, %156 ], [ %.084151, %154 ], [ %.087150, %149 ]
  %160 = trunc nuw i8 %159 to i1
  br i1 %160, label %161, label %163

161:                                              ; preds = %158
  %162 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.25)
  br label %163

163:                                              ; preds = %161, %158
  %164 = load double, ptr %7, align 8, !tbaa !27
  %165 = load double, ptr %8, align 8, !tbaa !27
  br label %166

166:                                              ; preds = %146, %163
  %.2107 = phi double [ %.0105146, %146 ], [ %164, %163 ]
  %.3104 = phi double [ %147, %146 ], [ %.1102, %163 ]
  %.2100 = phi double [ %.098148, %146 ], [ %165, %163 ]
  %.397 = phi double [ %148, %146 ], [ %.195, %163 ]
  %.390 = phi double [ %.2111, %146 ], [ %.188, %163 ]
  %.286 = phi double [ %.084151, %146 ], [ %.2111, %163 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #6
  %.093 = add nsw i32 %.093152, 1
  %167 = load i32, ptr %0, align 8, !tbaa !17
  %.not = icmp slt i32 %.093, %167
  br i1 %.not, label %38, label %._crit_edge, !llvm.loop !32

._crit_edge:                                      ; preds = %166, %14
  %.0109.lcssa = phi double [ %2, %14 ], [ %.2111, %166 ]
  %168 = getelementptr inbounds i8, ptr %0, i64 44
  store i32 6, ptr %168, align 4, !tbaa !5
  br label %.thread134

.thread134:                                       ; preds = %71, %70, %.thread124, %._crit_edge, %12
  %.4 = phi double [ 0.000000e+00, %12 ], [ %.0109.lcssa, %._crit_edge ], [ %.2111, %.thread124 ], [ %54, %70 ], [ %54, %71 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  ret double %.4
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 #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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { "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 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 #6 = { 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, !12, i64 44}
!6 = !{!"_ZTSN10linesearch15CubicLineSearchE", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !11, i64 40, !11, i64 41, !12, i64 44, !10, i64 48, !10, i64 56, !7, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !11, i64 136, !11, i64 137, !11, i64 138}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!"_ZTSN10linesearch15CubicLineSearch11ReturnCodesE", !8, i64 0}
!13 = !{!6, !10, i64 48}
!14 = !{!6, !10, i64 72}
!15 = !{!6, !10, i64 104}
!16 = !{!6, !7, i64 64}
!17 = !{!6, !7, i64 0}
!18 = !{!6, !10, i64 56}
!19 = !{!6, !10, i64 128}
!20 = !{!6, !10, i64 120}
!21 = !{!6, !10, i64 96}
!22 = !{!6, !10, i64 88}
!23 = !{!6, !10, i64 32}
!24 = !{!6, !11, i64 138}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = !{!10, !10, i64 0}
!28 = !{!6, !11, i64 136}
!29 = !{!6, !11, i64 137}
!30 = !{!31, !31, i64 0}
!31 = !{!"_ZTS22CubicSplineReturnCodes", !8, i64 0}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}


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