; LLVM IR from rvillegasm/NuMath :: src/singleVariableEquations/closedMethods (bisection)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::initializer_list" = type { ptr, i64 }
%"class.std::allocator" = type { i8 }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@_ZTIN6numath13IterExceptionE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN6numath17IntervalExceptionE = external dso_local constant { ptr, ptr, ptr }, align 8

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN6numath23singleVariableEquations9bisectionEPFddEddidPKcRSt6vectorIS5_IdSaIdEESaIS7_EE(ptr noundef %0, double noundef %1, double noundef %2, i32 noundef %3, double noundef %4, ptr noundef %5, ptr noundef nonnull align 8 dereferenceable(24) %6) #0 personality ptr @__gxx_personality_v0 {
  %8 = alloca double, align 8
  %9 = alloca ptr, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca i32, align 4
  %13 = alloca double, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %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 i32, align 4
  %24 = alloca %"class.std::vector", align 8
  %25 = alloca %"class.std::initializer_list", align 8
  %26 = alloca [4 x double], align 8
  %27 = alloca %"class.std::allocator", align 1
  %28 = alloca ptr, align 8
  %29 = alloca i32, align 4
  %30 = alloca %"class.std::vector", align 8
  %31 = alloca %"class.std::initializer_list", align 8
  %32 = alloca [4 x double], align 8
  %33 = alloca %"class.std::allocator", align 1
  store ptr %0, ptr %9, align 8, !tbaa !5
  store double %1, ptr %10, align 8, !tbaa !9
  store double %2, ptr %11, align 8, !tbaa !9
  store i32 %3, ptr %12, align 4, !tbaa !11
  store double %4, ptr %13, align 8, !tbaa !9
  store ptr %5, ptr %14, align 8, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %34 = load ptr, ptr %9, align 8, !tbaa !5
  %35 = load double, ptr %10, align 8, !tbaa !9
  %36 = call noundef double %34(double noundef %35)
  store double %36, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  %38 = load double, ptr %11, align 8, !tbaa !9
  %39 = call noundef double %37(double noundef %38)
  store double %39, ptr %22, align 8, !tbaa !9
  %40 = load double, ptr %21, align 8, !tbaa !9
  %41 = fcmp oeq double %40, 0.000000e+00
  br i1 %41, label %42, label %44

42:                                               ; preds = %7
  %43 = load double, ptr %10, align 8, !tbaa !9
  store double %43, ptr %8, align 8
  store i32 1, ptr %23, align 4
  br label %188

44:                                               ; preds = %7
  %45 = load double, ptr %22, align 8, !tbaa !9
  %46 = fcmp oeq double %45, 0.000000e+00
  br i1 %46, label %47, label %49

47:                                               ; preds = %44
  %48 = load double, ptr %11, align 8, !tbaa !9
  store double %48, ptr %8, align 8
  store i32 1, ptr %23, align 4
  br label %188

49:                                               ; preds = %44
  %50 = load double, ptr %21, align 8, !tbaa !9
  %51 = load double, ptr %22, align 8, !tbaa !9
  %52 = fmul double %50, %51
  %53 = fcmp olt double %52, 0.000000e+00
  br i1 %53, label %54, label %184

54:                                               ; preds = %49
  %55 = load double, ptr %10, align 8, !tbaa !9
  %56 = load double, ptr %11, align 8, !tbaa !9
  %57 = fadd double %55, %56
  %58 = fdiv double %57, 2.000000e+00
  store double %58, ptr %17, align 8, !tbaa !9
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  %60 = load double, ptr %17, align 8, !tbaa !9
  %61 = call noundef double %59(double noundef %60)
  store double %61, ptr %19, align 8, !tbaa !9
  store i32 1, ptr %16, align 4, !tbaa !11
  %62 = load double, ptr %13, align 8, !tbaa !9
  %63 = fadd double %62, 1.000000e+00
  store double %63, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %24) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %26) #8
  %64 = load i32, ptr %16, align 4, !tbaa !11
  %65 = sitofp i32 %64 to double
  store double %65, ptr %26, align 8, !tbaa !9
  %66 = getelementptr inbounds double, ptr %26, i64 1
  %67 = load double, ptr %17, align 8, !tbaa !9
  store double %67, ptr %66, align 8, !tbaa !9
  %68 = getelementptr inbounds double, ptr %26, i64 2
  %69 = load double, ptr %19, align 8, !tbaa !9
  store double %69, ptr %68, align 8, !tbaa !9
  %70 = getelementptr inbounds double, ptr %26, i64 3
  %71 = load double, ptr %20, align 8, !tbaa !9
  store double %71, ptr %70, align 8, !tbaa !9
  %72 = getelementptr inbounds %"class.std::initializer_list", ptr %25, i32 0, i32 0
  store ptr %26, ptr %72, align 8, !tbaa !13
  %73 = getelementptr inbounds %"class.std::initializer_list", ptr %25, i32 0, i32 1
  store i64 4, ptr %73, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 1, ptr %27) #8
  call void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %27) #8
  %74 = getelementptr inbounds { ptr, i64 }, ptr %25, i32 0, i32 0
  %75 = load ptr, ptr %74, align 8
  %76 = getelementptr inbounds { ptr, i64 }, ptr %25, i32 0, i32 1
  %77 = load i64, ptr %76, align 8
  invoke void @_ZNSt6vectorIdSaIdEEC2ESt16initializer_listIdERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %24, ptr %75, i64 %77, ptr noundef nonnull align 1 dereferenceable(1) %27)
          to label %78 unwind label %102

78:                                               ; preds = %54
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %27) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %26) #8
  %79 = load ptr, ptr %15, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIS_IdSaIdEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %79, ptr noundef nonnull align 8 dereferenceable(24) %24)
          to label %80 unwind label %106

80:                                               ; preds = %78
  br label %81

81:                                               ; preds = %158, %80
  %82 = load double, ptr %20, align 8, !tbaa !9
  %83 = load double, ptr %13, align 8, !tbaa !9
  %84 = fcmp ogt double %82, %83
  br i1 %84, label %85, label %92

85:                                               ; preds = %81
  %86 = load double, ptr %19, align 8, !tbaa !9
  %87 = fcmp une double %86, 0.000000e+00
  br i1 %87, label %88, label %92

88:                                               ; preds = %85
  %89 = load i32, ptr %16, align 4, !tbaa !11
  %90 = load i32, ptr %12, align 4, !tbaa !11
  %91 = icmp slt i32 %89, %90
  br label %92

92:                                               ; preds = %88, %85, %81
  %93 = phi i1 [ false, %85 ], [ false, %81 ], [ %91, %88 ]
  br i1 %93, label %94, label %168

94:                                               ; preds = %92
  %95 = load double, ptr %21, align 8, !tbaa !9
  %96 = load double, ptr %19, align 8, !tbaa !9
  %97 = fmul double %95, %96
  %98 = fcmp olt double %97, 0.000000e+00
  br i1 %98, label %99, label %110

99:                                               ; preds = %94
  %100 = load double, ptr %17, align 8, !tbaa !9
  store double %100, ptr %11, align 8, !tbaa !9
  %101 = load double, ptr %19, align 8, !tbaa !9
  store double %101, ptr %22, align 8, !tbaa !9
  br label %113

102:                                              ; preds = %54
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %28, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %29, align 4
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %27) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %26) #8
  br label %183

106:                                              ; preds = %179, %113, %78
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %28, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %29, align 4
  br label %182

110:                                              ; preds = %94
  %111 = load double, ptr %17, align 8, !tbaa !9
  store double %111, ptr %10, align 8, !tbaa !9
  %112 = load double, ptr %19, align 8, !tbaa !9
  store double %112, ptr %21, align 8, !tbaa !9
  br label %113

113:                                              ; preds = %110, %99
  %114 = load double, ptr %17, align 8, !tbaa !9
  store double %114, ptr %18, align 8, !tbaa !9
  %115 = load double, ptr %10, align 8, !tbaa !9
  %116 = load double, ptr %11, align 8, !tbaa !9
  %117 = fadd double %115, %116
  %118 = fdiv double %117, 2.000000e+00
  store double %118, ptr %17, align 8, !tbaa !9
  %119 = load ptr, ptr %9, align 8, !tbaa !5
  %120 = load double, ptr %17, align 8, !tbaa !9
  %121 = invoke noundef double %119(double noundef %120)
          to label %122 unwind label %106

122:                                              ; preds = %113
  store double %121, ptr %19, align 8, !tbaa !9
  %123 = load ptr, ptr %14, align 8, !tbaa !5
  %124 = call i32 @strcmp(ptr noundef %123, ptr noundef @.str) #9
  %125 = icmp eq i32 %124, 0
  br i1 %125, label %126, label %131

126:                                              ; preds = %122
  %127 = load double, ptr %17, align 8, !tbaa !9
  %128 = load double, ptr %18, align 8, !tbaa !9
  %129 = fsub double %127, %128
  %130 = call double @llvm.fabs.f64(double %129)
  br label %138

131:                                              ; preds = %122
  %132 = load double, ptr %17, align 8, !tbaa !9
  %133 = load double, ptr %18, align 8, !tbaa !9
  %134 = fsub double %132, %133
  %135 = load double, ptr %17, align 8, !tbaa !9
  %136 = fdiv double %134, %135
  %137 = call double @llvm.fabs.f64(double %136)
  br label %138

138:                                              ; preds = %131, %126
  %139 = phi double [ %130, %126 ], [ %137, %131 ]
  store double %139, ptr %20, align 8, !tbaa !9
  %140 = load i32, ptr %16, align 4, !tbaa !11
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %16, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %30) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %32) #8
  %142 = load i32, ptr %16, align 4, !tbaa !11
  %143 = sitofp i32 %142 to double
  store double %143, ptr %32, align 8, !tbaa !9
  %144 = getelementptr inbounds double, ptr %32, i64 1
  %145 = load double, ptr %17, align 8, !tbaa !9
  store double %145, ptr %144, align 8, !tbaa !9
  %146 = getelementptr inbounds double, ptr %32, i64 2
  %147 = load double, ptr %19, align 8, !tbaa !9
  store double %147, ptr %146, align 8, !tbaa !9
  %148 = getelementptr inbounds double, ptr %32, i64 3
  %149 = load double, ptr %20, align 8, !tbaa !9
  store double %149, ptr %148, align 8, !tbaa !9
  %150 = getelementptr inbounds %"class.std::initializer_list", ptr %31, i32 0, i32 0
  store ptr %32, ptr %150, align 8, !tbaa !13
  %151 = getelementptr inbounds %"class.std::initializer_list", ptr %31, i32 0, i32 1
  store i64 4, ptr %151, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 1, ptr %33) #8
  call void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %33) #8
  %152 = getelementptr inbounds { ptr, i64 }, ptr %31, i32 0, i32 0
  %153 = load ptr, ptr %152, align 8
  %154 = getelementptr inbounds { ptr, i64 }, ptr %31, i32 0, i32 1
  %155 = load i64, ptr %154, align 8
  invoke void @_ZNSt6vectorIdSaIdEEC2ESt16initializer_listIdERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %30, ptr %153, i64 %155, ptr noundef nonnull align 1 dereferenceable(1) %33)
          to label %156 unwind label %159

156:                                              ; preds = %138
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %33) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %32) #8
  %157 = load ptr, ptr %15, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIS_IdSaIdEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %157, ptr noundef nonnull align 8 dereferenceable(24) %30)
          to label %158 unwind label %163

158:                                              ; preds = %156
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %30) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %30) #8
  br label %81, !llvm.loop !17

159:                                              ; preds = %138
  %160 = landingpad { ptr, i32 }
          cleanup
  %161 = extractvalue { ptr, i32 } %160, 0
  store ptr %161, ptr %28, align 8
  %162 = extractvalue { ptr, i32 } %160, 1
  store i32 %162, ptr %29, align 4
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %33) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %32) #8
  br label %167

163:                                              ; preds = %156
  %164 = landingpad { ptr, i32 }
          cleanup
  %165 = extractvalue { ptr, i32 } %164, 0
  store ptr %165, ptr %28, align 8
  %166 = extractvalue { ptr, i32 } %164, 1
  store i32 %166, ptr %29, align 4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %30) #8
  br label %167

167:                                              ; preds = %163, %159
  call void @llvm.lifetime.end.p0(i64 24, ptr %30) #8
  br label %182

168:                                              ; preds = %92
  %169 = load double, ptr %19, align 8, !tbaa !9
  %170 = fcmp oeq double %169, 0.000000e+00
  br i1 %170, label %171, label %173

171:                                              ; preds = %168
  %172 = load double, ptr %17, align 8, !tbaa !9
  store double %172, ptr %8, align 8
  store i32 1, ptr %23, align 4
  br label %181

173:                                              ; preds = %168
  %174 = load double, ptr %20, align 8, !tbaa !9
  %175 = load double, ptr %13, align 8, !tbaa !9
  %176 = fcmp olt double %174, %175
  br i1 %176, label %177, label %179

177:                                              ; preds = %173
  %178 = load double, ptr %17, align 8, !tbaa !9
  store double %178, ptr %8, align 8
  store i32 1, ptr %23, align 4
  br label %181

179:                                              ; preds = %173
  %180 = call ptr @__cxa_allocate_exception(i64 8) #8
  call void @llvm.memset.p0.i64(ptr align 16 %180, i8 0, i64 8, i1 false)
  call void @_ZN6numath13IterExceptionC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %180) #8
  invoke void @__cxa_throw(ptr %180, ptr @_ZTIN6numath13IterExceptionE, ptr @_ZNSt9exceptionD2Ev) #10
          to label %195 unwind label %106

181:                                              ; preds = %177, %171
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #8
  br label %188

182:                                              ; preds = %167, %106
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #8
  br label %183

183:                                              ; preds = %182, %102
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %190

184:                                              ; preds = %49
  br label %185

185:                                              ; preds = %184
  br label %186

186:                                              ; preds = %185
  %187 = call ptr @__cxa_allocate_exception(i64 8) #8
  call void @llvm.memset.p0.i64(ptr align 16 %187, i8 0, i64 8, i1 false)
  call void @_ZN6numath17IntervalExceptionC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %187) #8
  call void @__cxa_throw(ptr %187, ptr @_ZTIN6numath17IntervalExceptionE, ptr @_ZNSt9exceptionD2Ev) #10
  unreachable

188:                                              ; preds = %181, %47, %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  %189 = load double, ptr %8, align 8
  ret double %189

190:                                              ; preds = %183
  %191 = load ptr, ptr %28, align 8
  %192 = load i32, ptr %29, align 4
  %193 = insertvalue { ptr, i32 } poison, ptr %191, 0
  %194 = insertvalue { ptr, i32 } %193, i32 %192, 1
  resume { ptr, i32 } %194

195:                                              ; preds = %179
  unreachable
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEEC2ESt16initializer_listIdERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr, i64, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIS_IdSaIdEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

declare ptr @__cxa_allocate_exception(i64)

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6numath13IterExceptionC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #6 align 2

declare void @__cxa_throw(ptr, ptr, ptr)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6numath17IntervalExceptionC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #6 align 2

; Function Attrs: nounwind
declare void @_ZNSt9exceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #7

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { inlinehint 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 #7 = { 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 #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { noreturn }

!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, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTSSt16initializer_listIdE", !6, i64 0, !15, i64 8}
!15 = !{!"long", !7, i64 0}
!16 = !{!14, !15, i64 8}
!17 = distinct !{!17, !18}
!18 = !{!"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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@_ZTIN6numath13IterExceptionE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN6numath17IntervalExceptionE = external dso_local constant { ptr, ptr, ptr }, align 8

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN6numath23singleVariableEquations9bisectionEPFddEddidPKcRSt6vectorIS5_IdSaIdEESaIS7_EE(ptr nocapture noundef readonly %0, double noundef %1, double noundef %2, i32 noundef %3, double noundef %4, ptr nocapture noundef readonly %5, ptr noundef nonnull align 8 dereferenceable(24) %6) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca [4 x double], align 8
  %10 = alloca %"class.std::allocator", align 1
  %11 = alloca %"class.std::vector", align 8
  %12 = alloca [4 x double], align 8
  %13 = alloca %"class.std::allocator", align 1
  %14 = tail call noundef double %0(double noundef %1)
  %15 = tail call noundef double %0(double noundef %2)
  %16 = fcmp oeq double %14, 0.000000e+00
  br i1 %16, label %72, label %17

17:                                               ; preds = %7
  %18 = fcmp oeq double %15, 0.000000e+00
  br i1 %18, label %72, label %19

19:                                               ; preds = %17
  %20 = fmul double %14, %15
  %21 = fcmp olt double %20, 0.000000e+00
  br i1 %21, label %22, label %70

22:                                               ; preds = %19
  %23 = fadd double %1, %2
  %24 = fmul double %23, 5.000000e-01
  %25 = tail call noundef double %0(double noundef %24)
  %26 = fadd double %4, 1.000000e+00
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #7
  store double 1.000000e+00, ptr %9, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %9, i64 8
  store double %24, ptr %27, align 8, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %9, i64 16
  store double %25, ptr %28, align 8, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %9, i64 24
  store double %26, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #7
  call void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #7
  invoke void @_ZNSt6vectorIdSaIdEEC2ESt16initializer_listIdERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr nonnull %9, i64 4, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %30 unwind label %43

30:                                               ; preds = %22
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #7
  invoke void @_ZNSt6vectorIS_IdSaIdEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %.preheader unwind label %.loopexit.split-lp

.preheader:                                       ; preds = %30
  %31 = fcmp ogt double %26, %4
  %32 = fcmp une double %25, 0.000000e+00
  %or.cond88 = and i1 %32, %31
  %33 = icmp sgt i32 %3, 1
  %or.cond7789 = and i1 %or.cond88, %33
  br i1 %or.cond7789, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %.preheader
  %34 = getelementptr inbounds i8, ptr %12, i64 8
  %35 = getelementptr inbounds i8, ptr %12, i64 16
  %36 = getelementptr inbounds i8, ptr %12, i64 24
  br label %37

37:                                               ; preds = %.lr.ph, %54
  %.05895 = phi double [ %1, %.lr.ph ], [ %.058..072, %54 ]
  %.06594 = phi double [ %2, %.lr.ph ], [ %.072..065, %54 ]
  %.06793 = phi i32 [ 1, %.lr.ph ], [ %51, %54 ]
  %.06892 = phi double [ %14, %.lr.ph ], [ %.068..071, %54 ]
  %.07191 = phi double [ %25, %.lr.ph ], [ %42, %54 ]
  %.07290 = phi double [ %24, %.lr.ph ], [ %41, %54 ]
  %38 = fmul double %.07191, %.06892
  %39 = fcmp olt double %38, 0.000000e+00
  %.068..071 = select i1 %39, double %.06892, double %.07191
  %.072..065 = select i1 %39, double %.07290, double %.06594
  %.058..072 = select i1 %39, double %.05895, double %.07290
  %40 = fadd double %.072..065, %.058..072
  %41 = fmul double %40, 5.000000e-01
  %42 = invoke noundef double %0(double noundef %41)
          to label %45 unwind label %.loopexit

43:                                               ; preds = %22
  %44 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #7
  br label %69

.loopexit:                                        ; preds = %37
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %68

.loopexit.split-lp:                               ; preds = %30, %65
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %68

45:                                               ; preds = %37
  %46 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) @.str) #8
  %47 = icmp eq i32 %46, 0
  %48 = fsub double %41, %.07290
  %49 = fdiv double %48, %41
  %.sink = select i1 %47, double %48, double %49
  %50 = call double @llvm.fabs.f64(double %.sink)
  %51 = add nuw nsw i32 %.06793, 1
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #7
  %52 = uitofp nneg i32 %51 to double
  store double %52, ptr %12, align 8, !tbaa !5
  store double %41, ptr %34, align 8, !tbaa !5
  store double %42, ptr %35, align 8, !tbaa !5
  store double %50, ptr %36, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %13) #7
  call void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #7
  invoke void @_ZNSt6vectorIdSaIdEEC2ESt16initializer_listIdERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr nonnull %12, i64 4, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %53 unwind label %58

53:                                               ; preds = %45
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #7
  invoke void @_ZNSt6vectorIS_IdSaIdEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %11)
          to label %54 unwind label %60

54:                                               ; preds = %53
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #7
  %55 = fcmp ogt double %50, %4
  %56 = fcmp une double %42, 0.000000e+00
  %or.cond = and i1 %56, %55
  %57 = icmp slt i32 %51, %3
  %or.cond77 = select i1 %or.cond, i1 %57, i1 false
  br i1 %or.cond77, label %37, label %.critedge, !llvm.loop !9

58:                                               ; preds = %45
  %59 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #7
  br label %62

60:                                               ; preds = %53
  %61 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #7
  br label %62

62:                                               ; preds = %60, %58
  %.pn = phi { ptr, i32 } [ %61, %60 ], [ %59, %58 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #7
  br label %68

.critedge:                                        ; preds = %54, %.preheader
  %.072.lcssa = phi double [ %24, %.preheader ], [ %41, %54 ]
  %.071.lcssa = phi double [ %25, %.preheader ], [ %42, %54 ]
  %.070.lcssa = phi double [ %26, %.preheader ], [ %50, %54 ]
  %63 = fcmp oeq double %.071.lcssa, 0.000000e+00
  %64 = fcmp olt double %.070.lcssa, %4
  %or.cond78 = or i1 %63, %64
  br i1 %or.cond78, label %67, label %65

65:                                               ; preds = %.critedge
  %66 = call ptr @__cxa_allocate_exception(i64 8) #7
  store i64 0, ptr %66, align 16
  call void @_ZN6numath13IterExceptionC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %66) #7
  invoke void @__cxa_throw(ptr nonnull %66, ptr nonnull @_ZTIN6numath13IterExceptionE, ptr nonnull @_ZNSt9exceptionD2Ev) #9
          to label %73 unwind label %.loopexit.split-lp

67:                                               ; preds = %.critedge
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #7
  br label %72

68:                                               ; preds = %.loopexit, %.loopexit.split-lp, %62
  %.pn.pn = phi { ptr, i32 } [ %.pn, %62 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  br label %69

69:                                               ; preds = %68, %43
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %68 ], [ %44, %43 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #7
  resume { ptr, i32 } %.pn.pn.pn

70:                                               ; preds = %19
  %71 = tail call ptr @__cxa_allocate_exception(i64 8) #7
  store i64 0, ptr %71, align 16
  tail call void @_ZN6numath17IntervalExceptionC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %71) #7
  tail call void @__cxa_throw(ptr nonnull %71, ptr nonnull @_ZTIN6numath17IntervalExceptionE, ptr nonnull @_ZNSt9exceptionD2Ev) #9
  unreachable

72:                                               ; preds = %17, %7, %67
  %.1 = phi double [ %.072.lcssa, %67 ], [ %1, %7 ], [ %2, %17 ]
  ret double %.1

73:                                               ; preds = %65
  unreachable
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEEC2ESt16initializer_listIdERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr, i64, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIS_IdSaIdEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6numath13IterExceptionC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 align 2

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6numath17IntervalExceptionC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 align 2

; Function Attrs: nounwind
declare void @_ZNSt9exceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

!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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


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