; LLVM IR from rvillegasm/NuMath :: src/singleVariableEquations/openMethods (multipleRoots)

; 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
@_ZTIN6numath20DenominatorExceptionE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN6numath13IterExceptionE = external dso_local constant { ptr, ptr, ptr }, align 8

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN6numath23singleVariableEquations13multipleRootsEPFddES2_S2_didPKcRSt6vectorIS5_IdSaIdEESaIS7_EE(ptr noundef %0, ptr noundef %1, ptr noundef %2, double noundef %3, i32 noundef %4, double noundef %5, ptr noundef %6, ptr noundef nonnull align 8 dereferenceable(24) %7) #0 personality ptr @__gxx_personality_v0 {
  %9 = alloca double, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca double, align 8
  %14 = alloca i32, align 4
  %15 = alloca double, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %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 %"class.std::vector", align 8
  %26 = alloca %"class.std::initializer_list", align 8
  %27 = alloca [4 x double], align 8
  %28 = alloca %"class.std::allocator", align 1
  %29 = alloca ptr, align 8
  %30 = alloca i32, align 4
  %31 = alloca %"class.std::vector", align 8
  %32 = alloca %"class.std::initializer_list", align 8
  %33 = alloca [4 x double], align 8
  %34 = alloca %"class.std::allocator", align 1
  %35 = alloca i32, align 4
  store ptr %0, ptr %10, align 8, !tbaa !5
  store ptr %1, ptr %11, align 8, !tbaa !5
  store ptr %2, ptr %12, align 8, !tbaa !5
  store double %3, ptr %13, align 8, !tbaa !9
  store i32 %4, ptr %14, align 4, !tbaa !11
  store double %5, ptr %15, align 8, !tbaa !9
  store ptr %6, ptr %16, align 8, !tbaa !5
  store ptr %7, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, 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
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  %37 = load double, ptr %13, align 8, !tbaa !9
  %38 = call noundef double %36(double noundef %37)
  store double %38, ptr %19, align 8, !tbaa !9
  %39 = load ptr, ptr %11, align 8, !tbaa !5
  %40 = load double, ptr %13, align 8, !tbaa !9
  %41 = call noundef double %39(double noundef %40)
  store double %41, ptr %20, align 8, !tbaa !9
  %42 = load ptr, ptr %12, align 8, !tbaa !5
  %43 = load double, ptr %13, align 8, !tbaa !9
  %44 = call noundef double %42(double noundef %43)
  store double %44, ptr %21, align 8, !tbaa !9
  %45 = load double, ptr %20, align 8, !tbaa !9
  %46 = call double @pow(double noundef %45, double noundef 2.000000e+00) #8
  %47 = load double, ptr %19, align 8, !tbaa !9
  %48 = load double, ptr %21, align 8, !tbaa !9
  %49 = fneg double %47
  %50 = call double @llvm.fmuladd.f64(double %49, double %48, double %46)
  store double %50, ptr %23, align 8, !tbaa !9
  %51 = load double, ptr %15, align 8, !tbaa !9
  %52 = fadd double %51, 1.000000e+00
  store double %52, ptr %24, align 8, !tbaa !9
  store i32 0, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %25) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %27) #8
  %53 = load i32, ptr %18, align 4, !tbaa !11
  %54 = sitofp i32 %53 to double
  store double %54, ptr %27, align 8, !tbaa !9
  %55 = getelementptr inbounds double, ptr %27, i64 1
  %56 = load double, ptr %13, align 8, !tbaa !9
  store double %56, ptr %55, align 8, !tbaa !9
  %57 = getelementptr inbounds double, ptr %27, i64 2
  %58 = load double, ptr %19, align 8, !tbaa !9
  store double %58, ptr %57, align 8, !tbaa !9
  %59 = getelementptr inbounds double, ptr %27, i64 3
  %60 = load double, ptr %24, align 8, !tbaa !9
  store double %60, ptr %59, align 8, !tbaa !9
  %61 = getelementptr inbounds %"class.std::initializer_list", ptr %26, i32 0, i32 0
  store ptr %27, ptr %61, align 8, !tbaa !13
  %62 = getelementptr inbounds %"class.std::initializer_list", ptr %26, i32 0, i32 1
  store i64 4, ptr %62, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 1, ptr %28) #8
  call void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %28) #8
  %63 = getelementptr inbounds { ptr, i64 }, ptr %26, i32 0, i32 0
  %64 = load ptr, ptr %63, align 8
  %65 = getelementptr inbounds { ptr, i64 }, ptr %26, i32 0, i32 1
  %66 = load i64, ptr %65, align 8
  invoke void @_ZNSt6vectorIdSaIdEEC2ESt16initializer_listIdERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr %64, i64 %66, ptr noundef nonnull align 1 dereferenceable(1) %28)
          to label %67 unwind label %149

67:                                               ; preds = %8
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %28) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %27) #8
  %68 = load ptr, ptr %17, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIS_IdSaIdEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %68, ptr noundef nonnull align 8 dereferenceable(24) %25)
          to label %69 unwind label %153

69:                                               ; preds = %67
  br label %70

70:                                               ; preds = %148, %69
  %71 = load double, ptr %24, align 8, !tbaa !9
  %72 = load double, ptr %15, align 8, !tbaa !9
  %73 = fcmp ogt double %71, %72
  br i1 %73, label %74, label %84

74:                                               ; preds = %70
  %75 = load double, ptr %19, align 8, !tbaa !9
  %76 = fcmp une double %75, 0.000000e+00
  br i1 %76, label %77, label %84

77:                                               ; preds = %74
  %78 = load double, ptr %23, align 8, !tbaa !9
  %79 = fcmp une double %78, 0.000000e+00
  br i1 %79, label %80, label %84

80:                                               ; preds = %77
  %81 = load i32, ptr %18, align 4, !tbaa !11
  %82 = load i32, ptr %14, align 4, !tbaa !11
  %83 = icmp slt i32 %81, %82
  br label %84

84:                                               ; preds = %80, %77, %74, %70
  %85 = phi i1 [ false, %77 ], [ false, %74 ], [ false, %70 ], [ %83, %80 ]
  br i1 %85, label %86, label %166

86:                                               ; preds = %84
  %87 = load double, ptr %13, align 8, !tbaa !9
  %88 = load double, ptr %19, align 8, !tbaa !9
  %89 = load double, ptr %20, align 8, !tbaa !9
  %90 = fmul double %88, %89
  %91 = load double, ptr %23, align 8, !tbaa !9
  %92 = fdiv double %90, %91
  %93 = fsub double %87, %92
  store double %93, ptr %22, align 8, !tbaa !9
  %94 = load ptr, ptr %10, align 8, !tbaa !5
  %95 = load double, ptr %22, align 8, !tbaa !9
  %96 = invoke noundef double %94(double noundef %95)
          to label %97 unwind label %153

97:                                               ; preds = %86
  store double %96, ptr %19, align 8, !tbaa !9
  %98 = load ptr, ptr %11, align 8, !tbaa !5
  %99 = load double, ptr %22, align 8, !tbaa !9
  %100 = invoke noundef double %98(double noundef %99)
          to label %101 unwind label %153

101:                                              ; preds = %97
  store double %100, ptr %20, align 8, !tbaa !9
  %102 = load ptr, ptr %12, align 8, !tbaa !5
  %103 = load double, ptr %22, align 8, !tbaa !9
  %104 = invoke noundef double %102(double noundef %103)
          to label %105 unwind label %153

105:                                              ; preds = %101
  store double %104, ptr %21, align 8, !tbaa !9
  %106 = load ptr, ptr %16, align 8, !tbaa !5
  %107 = call i32 @strcmp(ptr noundef %106, ptr noundef @.str) #9
  %108 = icmp eq i32 %107, 0
  br i1 %108, label %109, label %114

109:                                              ; preds = %105
  %110 = load double, ptr %22, align 8, !tbaa !9
  %111 = load double, ptr %13, align 8, !tbaa !9
  %112 = fsub double %110, %111
  %113 = call double @llvm.fabs.f64(double %112)
  br label %121

114:                                              ; preds = %105
  %115 = load double, ptr %22, align 8, !tbaa !9
  %116 = load double, ptr %13, align 8, !tbaa !9
  %117 = fsub double %115, %116
  %118 = load double, ptr %22, align 8, !tbaa !9
  %119 = fdiv double %117, %118
  %120 = call double @llvm.fabs.f64(double %119)
  br label %121

121:                                              ; preds = %114, %109
  %122 = phi double [ %113, %109 ], [ %120, %114 ]
  store double %122, ptr %24, align 8, !tbaa !9
  %123 = load double, ptr %20, align 8, !tbaa !9
  %124 = call double @pow(double noundef %123, double noundef 2.000000e+00) #8
  %125 = load double, ptr %19, align 8, !tbaa !9
  %126 = load double, ptr %21, align 8, !tbaa !9
  %127 = fneg double %125
  %128 = call double @llvm.fmuladd.f64(double %127, double %126, double %124)
  store double %128, ptr %23, align 8, !tbaa !9
  %129 = load i32, ptr %18, align 4, !tbaa !11
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %18, align 4, !tbaa !11
  %131 = load double, ptr %22, align 8, !tbaa !9
  store double %131, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %31) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %33) #8
  %132 = load i32, ptr %18, align 4, !tbaa !11
  %133 = sitofp i32 %132 to double
  store double %133, ptr %33, align 8, !tbaa !9
  %134 = getelementptr inbounds double, ptr %33, i64 1
  %135 = load double, ptr %13, align 8, !tbaa !9
  store double %135, ptr %134, align 8, !tbaa !9
  %136 = getelementptr inbounds double, ptr %33, i64 2
  %137 = load double, ptr %19, align 8, !tbaa !9
  store double %137, ptr %136, align 8, !tbaa !9
  %138 = getelementptr inbounds double, ptr %33, i64 3
  %139 = load double, ptr %24, align 8, !tbaa !9
  store double %139, ptr %138, align 8, !tbaa !9
  %140 = getelementptr inbounds %"class.std::initializer_list", ptr %32, i32 0, i32 0
  store ptr %33, ptr %140, align 8, !tbaa !13
  %141 = getelementptr inbounds %"class.std::initializer_list", ptr %32, i32 0, i32 1
  store i64 4, ptr %141, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 1, ptr %34) #8
  call void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %34) #8
  %142 = getelementptr inbounds { ptr, i64 }, ptr %32, i32 0, i32 0
  %143 = load ptr, ptr %142, align 8
  %144 = getelementptr inbounds { ptr, i64 }, ptr %32, i32 0, i32 1
  %145 = load i64, ptr %144, align 8
  invoke void @_ZNSt6vectorIdSaIdEEC2ESt16initializer_listIdERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %31, ptr %143, i64 %145, ptr noundef nonnull align 1 dereferenceable(1) %34)
          to label %146 unwind label %157

146:                                              ; preds = %121
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %34) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %33) #8
  %147 = load ptr, ptr %17, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIS_IdSaIdEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %147, ptr noundef nonnull align 8 dereferenceable(24) %31)
          to label %148 unwind label %161

148:                                              ; preds = %146
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %31) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %31) #8
  br label %70, !llvm.loop !17

149:                                              ; preds = %8
  %150 = landingpad { ptr, i32 }
          cleanup
  %151 = extractvalue { ptr, i32 } %150, 0
  store ptr %151, ptr %29, align 8
  %152 = extractvalue { ptr, i32 } %150, 1
  store i32 %152, ptr %30, align 4
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %28) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %27) #8
  br label %187

153:                                              ; preds = %182, %180, %101, %97, %86, %67
  %154 = landingpad { ptr, i32 }
          cleanup
  %155 = extractvalue { ptr, i32 } %154, 0
  store ptr %155, ptr %29, align 8
  %156 = extractvalue { ptr, i32 } %154, 1
  store i32 %156, ptr %30, align 4
  br label %186

157:                                              ; preds = %121
  %158 = landingpad { ptr, i32 }
          cleanup
  %159 = extractvalue { ptr, i32 } %158, 0
  store ptr %159, ptr %29, align 8
  %160 = extractvalue { ptr, i32 } %158, 1
  store i32 %160, ptr %30, align 4
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %34) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %33) #8
  br label %165

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

165:                                              ; preds = %161, %157
  call void @llvm.lifetime.end.p0(i64 24, ptr %31) #8
  br label %186

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

169:                                              ; preds = %166
  %170 = load double, ptr %13, align 8, !tbaa !9
  store double %170, ptr %9, align 8
  store i32 1, ptr %35, align 4
  br label %184

171:                                              ; preds = %166
  %172 = load double, ptr %24, align 8, !tbaa !9
  %173 = load double, ptr %15, align 8, !tbaa !9
  %174 = fcmp olt double %172, %173
  br i1 %174, label %175, label %177

175:                                              ; preds = %171
  %176 = load double, ptr %22, align 8, !tbaa !9
  store double %176, ptr %9, align 8
  store i32 1, ptr %35, align 4
  br label %184

177:                                              ; preds = %171
  %178 = load double, ptr %23, align 8, !tbaa !9
  %179 = fcmp oeq double %178, 0.000000e+00
  br i1 %179, label %180, label %182

180:                                              ; preds = %177
  %181 = call ptr @__cxa_allocate_exception(i64 8) #8
  call void @llvm.memset.p0.i64(ptr align 16 %181, i8 0, i64 8, i1 false)
  call void @_ZN6numath20DenominatorExceptionC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %181) #8
  invoke void @__cxa_throw(ptr %181, ptr @_ZTIN6numath20DenominatorExceptionE, ptr @_ZNSt9exceptionD2Ev) #10
          to label %193 unwind label %153

182:                                              ; preds = %177
  %183 = call ptr @__cxa_allocate_exception(i64 8) #8
  call void @llvm.memset.p0.i64(ptr align 16 %183, i8 0, i64 8, i1 false)
  call void @_ZN6numath13IterExceptionC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %183) #8
  invoke void @__cxa_throw(ptr %183, ptr @_ZTIN6numath13IterExceptionE, ptr @_ZNSt9exceptionD2Ev) #10
          to label %193 unwind label %153

184:                                              ; preds = %175, %169
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #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 4, ptr %18) #8
  %185 = load double, ptr %9, align 8
  ret double %185

186:                                              ; preds = %165, %153
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #8
  br label %187

187:                                              ; preds = %186, %149
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #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 4, ptr %18) #8
  br label %188

188:                                              ; preds = %187
  %189 = load ptr, ptr %29, align 8
  %190 = load i32, ptr %30, align 4
  %191 = insertvalue { ptr, i32 } poison, ptr %189, 0
  %192 = insertvalue { ptr, i32 } %191, i32 %190, 1
  resume { ptr, i32 } %192

193:                                              ; preds = %182, %180
  unreachable
}

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

; Function Attrs: nounwind
declare double @pow(double noundef, double noundef) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 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) #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 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) #6

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

declare void @__cxa_throw(ptr, ptr, ptr)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 #5 = { 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { 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 #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
@_ZTIN6numath20DenominatorExceptionE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN6numath13IterExceptionE = external dso_local constant { ptr, ptr, ptr }, align 8

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN6numath23singleVariableEquations13multipleRootsEPFddES2_S2_didPKcRSt6vectorIS5_IdSaIdEESaIS7_EE(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, double noundef %3, i32 noundef %4, double noundef %5, ptr nocapture noundef readonly %6, ptr noundef nonnull align 8 dereferenceable(24) %7) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %9 = alloca %"class.std::vector", align 8
  %10 = alloca [4 x double], align 8
  %11 = alloca %"class.std::allocator", align 1
  %12 = alloca %"class.std::vector", align 8
  %13 = alloca [4 x double], align 8
  %14 = alloca %"class.std::allocator", align 1
  %15 = tail call noundef double %0(double noundef %3)
  %16 = tail call noundef double %1(double noundef %3)
  %17 = tail call noundef double %2(double noundef %3)
  %18 = fadd double %5, 1.000000e+00
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #7
  store double 0.000000e+00, ptr %10, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %10, i64 8
  store double %3, ptr %19, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %10, i64 16
  store double %15, ptr %20, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %10, i64 24
  store double %18, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %11) #7
  call void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #7
  invoke void @_ZNSt6vectorIdSaIdEEC2ESt16initializer_listIdERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr nonnull %10, i64 4, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %22 unwind label %57

22:                                               ; preds = %8
  %23 = fneg double %15
  %square = fmul double %16, %16
  %24 = call double @llvm.fmuladd.f64(double %23, double %17, double %square)
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #7
  invoke void @_ZNSt6vectorIS_IdSaIdEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %.preheader unwind label %.loopexit.split-lp

.preheader:                                       ; preds = %22
  %25 = fcmp ogt double %18, %5
  %26 = fcmp une double %15, 0.000000e+00
  %or.cond91 = and i1 %25, %26
  %27 = fcmp une double %24, 0.000000e+00
  %or.cond392 = and i1 %27, %or.cond91
  %28 = icmp sgt i32 %4, 0
  %or.cond7593 = and i1 %or.cond392, %28
  br i1 %or.cond7593, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %.preheader
  %29 = getelementptr inbounds i8, ptr %13, i64 8
  %30 = getelementptr inbounds i8, ptr %13, i64 16
  %31 = getelementptr inbounds i8, ptr %13, i64 24
  br label %32

32:                                               ; preds = %.lr.ph, %52
  %.06098 = phi double [ %3, %.lr.ph ], [ %35, %52 ]
  %.06597 = phi i32 [ 0, %.lr.ph ], [ %49, %52 ]
  %.06696 = phi double [ %15, %.lr.ph ], [ %36, %52 ]
  %.06895 = phi double [ %24, %.lr.ph ], [ %48, %52 ]
  %.07094 = phi double [ %16, %.lr.ph ], [ %38, %52 ]
  %33 = fmul double %.07094, %.06696
  %34 = fdiv double %33, %.06895
  %35 = fsub double %.06098, %34
  %36 = invoke noundef double %0(double noundef %35)
          to label %37 unwind label %.loopexit

37:                                               ; preds = %32
  %38 = invoke noundef double %1(double noundef %35)
          to label %39 unwind label %.loopexit

39:                                               ; preds = %37
  %40 = invoke noundef double %2(double noundef %35)
          to label %41 unwind label %.loopexit

41:                                               ; preds = %39
  %42 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %6, ptr noundef nonnull dereferenceable(1) @.str) #8
  %43 = icmp eq i32 %42, 0
  %44 = fsub double %35, %.06098
  %45 = fdiv double %44, %35
  %.sink = select i1 %43, double %44, double %45
  %46 = call double @llvm.fabs.f64(double %.sink)
  %square71 = fmul double %38, %38
  %47 = fneg double %36
  %48 = call double @llvm.fmuladd.f64(double %47, double %40, double %square71)
  %49 = add nuw nsw i32 %.06597, 1
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %13) #7
  %50 = uitofp nneg i32 %49 to double
  store double %50, ptr %13, align 8, !tbaa !5
  store double %35, ptr %29, align 8, !tbaa !5
  store double %36, ptr %30, align 8, !tbaa !5
  store double %46, ptr %31, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %14) #7
  call void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #7
  invoke void @_ZNSt6vectorIdSaIdEEC2ESt16initializer_listIdERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr nonnull %13, i64 4, ptr noundef nonnull align 1 dereferenceable(1) %14)
          to label %51 unwind label %59

51:                                               ; preds = %41
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #7
  invoke void @_ZNSt6vectorIS_IdSaIdEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %12)
          to label %52 unwind label %61

52:                                               ; preds = %51
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #7
  %53 = fcmp ogt double %46, %5
  %54 = fcmp une double %36, 0.000000e+00
  %or.cond = and i1 %53, %54
  %55 = fcmp une double %48, 0.000000e+00
  %or.cond3 = and i1 %55, %or.cond
  %56 = icmp slt i32 %49, %4
  %or.cond75 = select i1 %or.cond3, i1 %56, i1 false
  br i1 %or.cond75, label %32, label %.critedge, !llvm.loop !9

57:                                               ; preds = %8
  %58 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #7
  br label %75

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

.loopexit.split-lp:                               ; preds = %.invoke, %22
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %74

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

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

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

.critedge:                                        ; preds = %52, %.preheader
  %.069.lcssa = phi double [ undef, %.preheader ], [ %35, %52 ]
  %.068.lcssa = phi double [ %24, %.preheader ], [ %48, %52 ]
  %.067.lcssa = phi double [ %18, %.preheader ], [ %46, %52 ]
  %.066.lcssa = phi double [ %15, %.preheader ], [ %36, %52 ]
  %.060.lcssa = phi double [ %3, %.preheader ], [ %35, %52 ]
  %64 = fcmp oeq double %.066.lcssa, 0.000000e+00
  br i1 %64, label %73, label %65

65:                                               ; preds = %.critedge
  %66 = fcmp olt double %.067.lcssa, %5
  br i1 %66, label %73, label %67

67:                                               ; preds = %65
  %68 = fcmp oeq double %.068.lcssa, 0.000000e+00
  %69 = call ptr @__cxa_allocate_exception(i64 8) #7
  store i64 0, ptr %69, align 16
  br i1 %68, label %70, label %72

70:                                               ; preds = %67
  call void @_ZN6numath20DenominatorExceptionC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %69) #7
  br label %.invoke

.invoke:                                          ; preds = %72, %70
  %71 = phi ptr [ @_ZTIN6numath20DenominatorExceptionE, %70 ], [ @_ZTIN6numath13IterExceptionE, %72 ]
  invoke void @__cxa_throw(ptr nonnull %69, ptr nonnull %71, ptr nonnull @_ZNSt9exceptionD2Ev) #9
          to label %.cont unwind label %.loopexit.split-lp

.cont:                                            ; preds = %.invoke
  unreachable

72:                                               ; preds = %67
  call void @_ZN6numath13IterExceptionC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %69) #7
  br label %.invoke

73:                                               ; preds = %65, %.critedge
  %.0 = phi double [ %.060.lcssa, %.critedge ], [ %.069.lcssa, %65 ]
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #7
  ret double %.0

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

75:                                               ; preds = %74, %57
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %74 ], [ %58, %57 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #7
  resume { ptr, i32 } %.pn.pn.pn
}

; 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 nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 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 #4

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

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

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6numath20DenominatorExceptionC2Ev(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 @_ZN6numath13IterExceptionC2Ev(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 #3 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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #4 = { 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 #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