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

; 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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN6numath23singleVariableEquations10fixedPointEPFddES2_didPKcRSt6vectorIS5_IdSaIdEESaIS7_EE(ptr noundef %0, ptr 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 ptr, 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 double, align 8
  %17 = alloca i32, align 4
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca %"class.std::vector", align 8
  %21 = alloca %"class.std::initializer_list", align 8
  %22 = alloca [4 x double], align 8
  %23 = alloca %"class.std::allocator", align 1
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca %"class.std::vector", align 8
  %27 = alloca %"class.std::initializer_list", align 8
  %28 = alloca [4 x double], align 8
  %29 = alloca %"class.std::allocator", align 1
  %30 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  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 8, ptr %16) #8
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = load double, ptr %11, align 8, !tbaa !9
  %33 = call noundef double %31(double noundef %32)
  store double %33, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 0, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %34 = load double, ptr %13, align 8, !tbaa !9
  %35 = fadd double %34, 1.000000e+00
  store double %35, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  store double 0.000000e+00, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %22) #8
  %36 = load i32, ptr %17, align 4, !tbaa !11
  %37 = sitofp i32 %36 to double
  store double %37, ptr %22, align 8, !tbaa !9
  %38 = getelementptr inbounds double, ptr %22, i64 1
  %39 = load double, ptr %11, align 8, !tbaa !9
  store double %39, ptr %38, align 8, !tbaa !9
  %40 = getelementptr inbounds double, ptr %22, i64 2
  %41 = load double, ptr %16, align 8, !tbaa !9
  store double %41, ptr %40, align 8, !tbaa !9
  %42 = getelementptr inbounds double, ptr %22, i64 3
  %43 = load double, ptr %18, align 8, !tbaa !9
  store double %43, ptr %42, align 8, !tbaa !9
  %44 = getelementptr inbounds %"class.std::initializer_list", ptr %21, i32 0, i32 0
  store ptr %22, ptr %44, align 8, !tbaa !13
  %45 = getelementptr inbounds %"class.std::initializer_list", ptr %21, i32 0, i32 1
  store i64 4, ptr %45, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 1, ptr %23) #8
  call void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #8
  %46 = getelementptr inbounds { ptr, i64 }, ptr %21, i32 0, i32 0
  %47 = load ptr, ptr %46, align 8
  %48 = getelementptr inbounds { ptr, i64 }, ptr %21, i32 0, i32 1
  %49 = load i64, ptr %48, align 8
  invoke void @_ZNSt6vectorIdSaIdEEC2ESt16initializer_listIdERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %20, ptr %47, i64 %49, ptr noundef nonnull align 1 dereferenceable(1) %23)
          to label %50 unwind label %112

50:                                               ; preds = %7
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #8
  %51 = load ptr, ptr %15, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIS_IdSaIdEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %51, ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %52 unwind label %116

52:                                               ; preds = %50
  br label %53

53:                                               ; preds = %111, %52
  %54 = load double, ptr %16, align 8, !tbaa !9
  %55 = fcmp une double %54, 0.000000e+00
  br i1 %55, label %56, label %64

56:                                               ; preds = %53
  %57 = load double, ptr %18, align 8, !tbaa !9
  %58 = load double, ptr %13, align 8, !tbaa !9
  %59 = fcmp ogt double %57, %58
  br i1 %59, label %60, label %64

60:                                               ; preds = %56
  %61 = load i32, ptr %17, align 4, !tbaa !11
  %62 = load i32, ptr %12, align 4, !tbaa !11
  %63 = icmp slt i32 %61, %62
  br label %64

64:                                               ; preds = %60, %56, %53
  %65 = phi i1 [ false, %56 ], [ false, %53 ], [ %63, %60 ]
  br i1 %65, label %66, label %129

66:                                               ; preds = %64
  %67 = load ptr, ptr %10, align 8, !tbaa !5
  %68 = load double, ptr %11, align 8, !tbaa !9
  %69 = invoke noundef double %67(double noundef %68)
          to label %70 unwind label %116

70:                                               ; preds = %66
  store double %69, ptr %19, align 8, !tbaa !9
  %71 = load ptr, ptr %9, align 8, !tbaa !5
  %72 = load double, ptr %19, align 8, !tbaa !9
  %73 = invoke noundef double %71(double noundef %72)
          to label %74 unwind label %116

74:                                               ; preds = %70
  store double %73, ptr %16, align 8, !tbaa !9
  %75 = load ptr, ptr %14, align 8, !tbaa !5
  %76 = call i32 @strcmp(ptr noundef %75, ptr noundef @.str) #9
  %77 = icmp eq i32 %76, 0
  br i1 %77, label %78, label %83

78:                                               ; preds = %74
  %79 = load double, ptr %19, align 8, !tbaa !9
  %80 = load double, ptr %11, align 8, !tbaa !9
  %81 = fsub double %79, %80
  %82 = call double @llvm.fabs.f64(double %81)
  br label %90

83:                                               ; preds = %74
  %84 = load double, ptr %19, align 8, !tbaa !9
  %85 = load double, ptr %11, align 8, !tbaa !9
  %86 = fsub double %84, %85
  %87 = load double, ptr %19, align 8, !tbaa !9
  %88 = fdiv double %86, %87
  %89 = call double @llvm.fabs.f64(double %88)
  br label %90

90:                                               ; preds = %83, %78
  %91 = phi double [ %82, %78 ], [ %89, %83 ]
  store double %91, ptr %18, align 8, !tbaa !9
  %92 = load double, ptr %19, align 8, !tbaa !9
  store double %92, ptr %11, align 8, !tbaa !9
  %93 = load i32, ptr %17, align 4, !tbaa !11
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %26) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %28) #8
  %95 = load i32, ptr %17, align 4, !tbaa !11
  %96 = sitofp i32 %95 to double
  store double %96, ptr %28, align 8, !tbaa !9
  %97 = getelementptr inbounds double, ptr %28, i64 1
  %98 = load double, ptr %19, align 8, !tbaa !9
  store double %98, ptr %97, align 8, !tbaa !9
  %99 = getelementptr inbounds double, ptr %28, i64 2
  %100 = load double, ptr %16, align 8, !tbaa !9
  store double %100, ptr %99, align 8, !tbaa !9
  %101 = getelementptr inbounds double, ptr %28, i64 3
  %102 = load double, ptr %18, align 8, !tbaa !9
  store double %102, ptr %101, align 8, !tbaa !9
  %103 = getelementptr inbounds %"class.std::initializer_list", ptr %27, i32 0, i32 0
  store ptr %28, ptr %103, align 8, !tbaa !13
  %104 = getelementptr inbounds %"class.std::initializer_list", ptr %27, i32 0, i32 1
  store i64 4, ptr %104, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 1, ptr %29) #8
  call void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %29) #8
  %105 = getelementptr inbounds { ptr, i64 }, ptr %27, i32 0, i32 0
  %106 = load ptr, ptr %105, align 8
  %107 = getelementptr inbounds { ptr, i64 }, ptr %27, i32 0, i32 1
  %108 = load i64, ptr %107, align 8
  invoke void @_ZNSt6vectorIdSaIdEEC2ESt16initializer_listIdERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %26, ptr %106, i64 %108, ptr noundef nonnull align 1 dereferenceable(1) %29)
          to label %109 unwind label %120

109:                                              ; preds = %90
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %29) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %29) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %28) #8
  %110 = load ptr, ptr %15, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIS_IdSaIdEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %110, ptr noundef nonnull align 8 dereferenceable(24) %26)
          to label %111 unwind label %124

111:                                              ; preds = %109
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %26) #8
  br label %53, !llvm.loop !17

112:                                              ; preds = %7
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %24, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %25, align 4
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #8
  br label %145

116:                                              ; preds = %140, %70, %66, %50
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %24, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %25, align 4
  br label %144

120:                                              ; preds = %90
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %24, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %25, align 4
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %29) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %29) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %28) #8
  br label %128

124:                                              ; preds = %109
  %125 = landingpad { ptr, i32 }
          cleanup
  %126 = extractvalue { ptr, i32 } %125, 0
  store ptr %126, ptr %24, align 8
  %127 = extractvalue { ptr, i32 } %125, 1
  store i32 %127, ptr %25, align 4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  br label %128

128:                                              ; preds = %124, %120
  call void @llvm.lifetime.end.p0(i64 24, ptr %26) #8
  br label %144

129:                                              ; preds = %64
  %130 = load double, ptr %16, align 8, !tbaa !9
  %131 = fcmp oeq double %130, 0.000000e+00
  br i1 %131, label %132, label %134

132:                                              ; preds = %129
  %133 = load double, ptr %11, align 8, !tbaa !9
  store double %133, ptr %8, align 8
  store i32 1, ptr %30, align 4
  br label %142

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

138:                                              ; preds = %134
  %139 = load double, ptr %11, align 8, !tbaa !9
  store double %139, ptr %8, align 8
  store i32 1, ptr %30, align 4
  br label %142

140:                                              ; preds = %134
  %141 = call ptr @__cxa_allocate_exception(i64 8) #8
  call void @llvm.memset.p0.i64(ptr align 16 %141, i8 0, i64 8, i1 false)
  call void @_ZN6numath13IterExceptionC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %141) #8
  invoke void @__cxa_throw(ptr %141, ptr @_ZTIN6numath13IterExceptionE, ptr @_ZNSt9exceptionD2Ev) #10
          to label %151 unwind label %116

142:                                              ; preds = %138, %132
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #8
  call void @llvm.lifetime.end.p0(i64 24, 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 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  %143 = load double, ptr %8, align 8
  ret double %143

144:                                              ; preds = %128, %116
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #8
  br label %145

145:                                              ; preds = %144, %112
  call void @llvm.lifetime.end.p0(i64 24, 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 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  br label %146

146:                                              ; preds = %145
  %147 = load ptr, ptr %24, align 8
  %148 = load i32, ptr %25, align 4
  %149 = insertvalue { ptr, i32 } poison, ptr %147, 0
  %150 = insertvalue { ptr, i32 } %149, i32 %148, 1
  resume { ptr, i32 } %150

151:                                              ; preds = %140
  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

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

declare void @__cxa_throw(ptr, ptr, ptr)

; 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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN6numath23singleVariableEquations10fixedPointEPFddES2_didPKcRSt6vectorIS5_IdSaIdEESaIS7_EE(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %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 %2)
  %15 = 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 0.000000e+00, ptr %9, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %9, i64 8
  store double %2, ptr %16, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %9, i64 16
  store double %14, ptr %17, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %9, i64 24
  store double %15, ptr %18, 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 %19 unwind label %43

19:                                               ; preds = %7
  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 = %19
  %20 = fcmp une double %14, 0.000000e+00
  %21 = fcmp ogt double %15, %4
  %or.cond61 = and i1 %21, %20
  %22 = icmp sgt i32 %3, 0
  %or.cond5062 = and i1 %or.cond61, %22
  br i1 %or.cond5062, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %.preheader
  %23 = getelementptr inbounds i8, ptr %12, i64 8
  %24 = getelementptr inbounds i8, ptr %12, i64 16
  %25 = getelementptr inbounds i8, ptr %12, i64 24
  br label %26

26:                                               ; preds = %.lr.ph, %39
  %.03964 = phi double [ %2, %.lr.ph ], [ %27, %39 ]
  %.04563 = phi i32 [ 0, %.lr.ph ], [ %36, %39 ]
  %27 = invoke noundef double %1(double noundef %.03964)
          to label %28 unwind label %.loopexit

28:                                               ; preds = %26
  %29 = invoke noundef double %0(double noundef %27)
          to label %30 unwind label %.loopexit

30:                                               ; preds = %28
  %31 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) @.str) #8
  %32 = icmp eq i32 %31, 0
  %33 = fsub double %27, %.03964
  %34 = fdiv double %33, %27
  %.sink = select i1 %32, double %33, double %34
  %35 = call double @llvm.fabs.f64(double %.sink)
  %36 = add nuw nsw i32 %.04563, 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
  %37 = uitofp nneg i32 %36 to double
  store double %37, ptr %12, align 8, !tbaa !5
  store double %27, ptr %23, align 8, !tbaa !5
  store double %29, ptr %24, align 8, !tbaa !5
  store double %35, ptr %25, 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 %38 unwind label %45

38:                                               ; preds = %30
  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 %39 unwind label %47

39:                                               ; preds = %38
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #7
  %40 = fcmp une double %29, 0.000000e+00
  %41 = fcmp ogt double %35, %4
  %or.cond = and i1 %41, %40
  %42 = icmp slt i32 %36, %3
  %or.cond50 = select i1 %or.cond, i1 %42, i1 false
  br i1 %or.cond50, label %26, label %.critedge, !llvm.loop !9

43:                                               ; preds = %7
  %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 %56

.loopexit:                                        ; preds = %26, %28
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %55

.loopexit.split-lp:                               ; preds = %19, %52
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %55

45:                                               ; preds = %30
  %46 = 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 %49

47:                                               ; preds = %38
  %48 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #7
  br label %49

49:                                               ; preds = %47, %45
  %.pn = phi { ptr, i32 } [ %48, %47 ], [ %46, %45 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #7
  br label %55

.critedge:                                        ; preds = %39, %.preheader
  %.046.lcssa = phi double [ %15, %.preheader ], [ %35, %39 ]
  %.044.lcssa = phi double [ %14, %.preheader ], [ %29, %39 ]
  %.039.lcssa = phi double [ %2, %.preheader ], [ %27, %39 ]
  %50 = fcmp oeq double %.044.lcssa, 0.000000e+00
  %51 = fcmp olt double %.046.lcssa, %4
  %or.cond51 = or i1 %51, %50
  br i1 %or.cond51, label %54, label %52

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

54:                                               ; 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
  ret double %.039.lcssa

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

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

57:                                               ; preds = %52
  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

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

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

; 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