; LLVM IR from buresjan/optim_lbm :: nomad/ext/sgtelib/src/Surrogate_Utils.ll (ZN7SGTELIB11gammacdfinvEddd)

; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }

@.str.11 = external hidden unnamed_addr constant [94 x i8], align 1
@_ZTIN7SGTELIB9ExceptionE = external dso_local constant { ptr, ptr, ptr }, align 8
@.str.65 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [41 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

declare ptr @__cxa_allocate_exception(i64)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7SGTELIB9ExceptionC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiS8_(ptr noundef nonnull align 8 dereferenceable(112), ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

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

declare void @__cxa_throw(ptr, ptr, ptr)

declare void @__cxa_free_exception(ptr)

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN7SGTELIB8gammacdfEddd(double noundef, double noundef, double noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN7SGTELIB11gammacdfinvEddd(double noundef %0, double noundef %1, double noundef %2) #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca %"class.std::allocator", align 1
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca %"class.std::allocator", align 1
  %14 = alloca i1, align 1
  %15 = alloca %"class.std::__cxx11::basic_string", align 8
  %16 = alloca %"class.std::allocator", align 1
  %17 = alloca %"class.std::__cxx11::basic_string", align 8
  %18 = alloca %"class.std::allocator", align 1
  %19 = alloca i1, align 1
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca i32, align 4
  store double %0, ptr %5, align 8, !tbaa !5
  store double %1, ptr %6, align 8, !tbaa !5
  store double %2, ptr %7, align 8, !tbaa !5
  %24 = load double, ptr %6, align 8, !tbaa !5
  %25 = fcmp ole double %24, 0.000000e+00
  br i1 %25, label %29, label %26

26:                                               ; preds = %3
  %27 = load double, ptr %7, align 8, !tbaa !5
  %28 = fcmp ole double %27, 0.000000e+00
  br i1 %28, label %29, label %51

29:                                               ; preds = %26, %3
  store i1 true, ptr %14, align 1
  %30 = call ptr @__cxa_allocate_exception(i64 112) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #3
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #3
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef @.str.11, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %31 unwind label %34

31:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #3
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #3
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef @.str.65, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %32 unwind label %38

32:                                               ; preds = %31
  invoke void @_ZN7SGTELIB9ExceptionC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiS8_(ptr noundef nonnull align 8 dereferenceable(112) %30, ptr noundef nonnull align 8 dereferenceable(32) %8, i32 noundef 678, ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %33 unwind label %42

33:                                               ; preds = %32
  store i1 false, ptr %14, align 1
  invoke void @__cxa_throw(ptr %30, ptr @_ZTIN7SGTELIB9ExceptionE, ptr @_ZN7SGTELIB9ExceptionD2Ev) #4
          to label %139 unwind label %42

34:                                               ; preds = %29
  %35 = landingpad { ptr, i32 }
          cleanup
  %36 = extractvalue { ptr, i32 } %35, 0
  store ptr %36, ptr %10, align 8
  %37 = extractvalue { ptr, i32 } %35, 1
  store i32 %37, ptr %11, align 4
  br label %47

38:                                               ; preds = %31
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %10, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %11, align 4
  br label %46

42:                                               ; preds = %33, %32
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %10, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #3
  br label %46

46:                                               ; preds = %42, %38
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #3
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #3
  br label %47

47:                                               ; preds = %46, %34
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #3
  %48 = load i1, ptr %14, align 1
  br i1 %48, label %49, label %50

49:                                               ; preds = %47
  call void @__cxa_free_exception(ptr %30) #3
  br label %50

50:                                               ; preds = %49, %47
  br label %134

51:                                               ; preds = %26
  %52 = load double, ptr %5, align 8, !tbaa !5
  %53 = fcmp olt double %52, 0.000000e+00
  br i1 %53, label %57, label %54

54:                                               ; preds = %51
  %55 = load double, ptr %5, align 8, !tbaa !5
  %56 = fcmp ogt double %55, 1.000000e+00
  br i1 %56, label %57, label %79

57:                                               ; preds = %54, %51
  store i1 true, ptr %19, align 1
  %58 = call ptr @__cxa_allocate_exception(i64 112) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #3
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #3
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef @.str.11, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %59 unwind label %62

59:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #3
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #3
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef @.str.66, ptr noundef nonnull align 1 dereferenceable(1) %18)
          to label %60 unwind label %66

60:                                               ; preds = %59
  invoke void @_ZN7SGTELIB9ExceptionC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiS8_(ptr noundef nonnull align 8 dereferenceable(112) %58, ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef 682, ptr noundef nonnull align 8 dereferenceable(32) %17)
          to label %61 unwind label %70

61:                                               ; preds = %60
  store i1 false, ptr %19, align 1
  invoke void @__cxa_throw(ptr %58, ptr @_ZTIN7SGTELIB9ExceptionE, ptr @_ZN7SGTELIB9ExceptionD2Ev) #4
          to label %139 unwind label %70

62:                                               ; preds = %57
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %10, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %11, align 4
  br label %75

66:                                               ; preds = %59
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %10, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %11, align 4
  br label %74

70:                                               ; preds = %61, %60
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %10, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #3
  br label %74

74:                                               ; preds = %70, %66
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #3
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #3
  br label %75

75:                                               ; preds = %74, %62
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #3
  %76 = load i1, ptr %19, align 1
  br i1 %76, label %77, label %78

77:                                               ; preds = %75
  call void @__cxa_free_exception(ptr %58) #3
  br label %78

78:                                               ; preds = %77, %75
  br label %134

79:                                               ; preds = %54
  %80 = load double, ptr %5, align 8, !tbaa !5
  %81 = fcmp oeq double %80, 1.000000e+00
  br i1 %81, label %82, label %83

82:                                               ; preds = %79
  store double 0x7FEFFFFFFFFFFFFF, ptr %4, align 8
  br label %132

83:                                               ; preds = %79
  %84 = load double, ptr %5, align 8, !tbaa !5
  %85 = fcmp oeq double %84, 0.000000e+00
  br i1 %85, label %86, label %87

86:                                               ; preds = %83
  store double 0.000000e+00, ptr %4, align 8
  br label %132

87:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  store double 0.000000e+00, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  store double 1.000000e+00, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #3
  store i32 0, ptr %23, align 4, !tbaa !9
  br label %88

88:                                               ; preds = %104, %87
  %89 = load double, ptr %21, align 8, !tbaa !5
  %90 = load double, ptr %6, align 8, !tbaa !5
  %91 = load double, ptr %7, align 8, !tbaa !5
  %92 = call noundef double @_ZN7SGTELIB8gammacdfEddd(double noundef %89, double noundef %90, double noundef %91)
  %93 = load double, ptr %5, align 8, !tbaa !5
  %94 = fcmp olt double %92, %93
  br i1 %94, label %95, label %105

95:                                               ; preds = %88
  %96 = load double, ptr %21, align 8, !tbaa !5
  store double %96, ptr %20, align 8, !tbaa !5
  %97 = load double, ptr %21, align 8, !tbaa !5
  %98 = fmul double %97, 2.000000e+00
  store double %98, ptr %21, align 8, !tbaa !5
  %99 = load i32, ptr %23, align 4, !tbaa !9
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %23, align 4, !tbaa !9
  %101 = load i32, ptr %23, align 4, !tbaa !9
  %102 = icmp sgt i32 %101, 10
  br i1 %102, label %103, label %104

103:                                              ; preds = %95
  br label %105

104:                                              ; preds = %95
  br label %88, !llvm.loop !11

105:                                              ; preds = %103, %88
  br label %106

106:                                              ; preds = %126, %105
  %107 = load double, ptr %21, align 8, !tbaa !5
  %108 = load double, ptr %20, align 8, !tbaa !5
  %109 = fsub double %107, %108
  %110 = fcmp ogt double %109, 1.000000e-09
  br i1 %110, label %111, label %127

111:                                              ; preds = %106
  %112 = load double, ptr %20, align 8, !tbaa !5
  %113 = load double, ptr %21, align 8, !tbaa !5
  %114 = fadd double %112, %113
  %115 = fdiv double %114, 2.000000e+00
  store double %115, ptr %22, align 8, !tbaa !5
  %116 = load double, ptr %22, align 8, !tbaa !5
  %117 = load double, ptr %6, align 8, !tbaa !5
  %118 = load double, ptr %7, align 8, !tbaa !5
  %119 = call noundef double @_ZN7SGTELIB8gammacdfEddd(double noundef %116, double noundef %117, double noundef %118)
  %120 = load double, ptr %5, align 8, !tbaa !5
  %121 = fcmp ogt double %119, %120
  br i1 %121, label %122, label %124

122:                                              ; preds = %111
  %123 = load double, ptr %22, align 8, !tbaa !5
  store double %123, ptr %21, align 8, !tbaa !5
  br label %126

124:                                              ; preds = %111
  %125 = load double, ptr %22, align 8, !tbaa !5
  store double %125, ptr %20, align 8, !tbaa !5
  br label %126

126:                                              ; preds = %124, %122
  br label %106, !llvm.loop !13

127:                                              ; preds = %106
  %128 = load double, ptr %20, align 8, !tbaa !5
  %129 = load double, ptr %21, align 8, !tbaa !5
  %130 = fadd double %128, %129
  %131 = fdiv double %130, 2.000000e+00
  store double %131, ptr %4, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  br label %132

132:                                              ; preds = %127, %86, %82
  %133 = load double, ptr %4, align 8
  ret double %133

134:                                              ; preds = %78, %50
  %135 = load ptr, ptr %10, align 8
  %136 = load i32, ptr %11, align 4
  %137 = insertvalue { ptr, i32 } poison, ptr %135, 0
  %138 = insertvalue { ptr, i32 } %137, i32 %136, 1
  resume { ptr, i32 } %138

139:                                              ; preds = %61, %33
  unreachable
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
attributes #4 = { 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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }

@.str.11 = external hidden unnamed_addr constant [94 x i8], align 1
@_ZTIN7SGTELIB9ExceptionE = external dso_local constant { ptr, ptr, ptr }, align 8
@.str.65 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [41 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7SGTELIB9ExceptionC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiS8_(ptr noundef nonnull align 8 dereferenceable(112), ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

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

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

declare void @__cxa_free_exception(ptr) local_unnamed_addr

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN7SGTELIB8gammacdfEddd(double noundef, double noundef, double noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN7SGTELIB11gammacdfinvEddd(double noundef %0, double noundef %1, double noundef %2) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::allocator", align 1
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca %"class.std::allocator", align 1
  %10 = alloca %"class.std::__cxx11::basic_string", align 8
  %11 = alloca %"class.std::allocator", align 1
  %12 = fcmp ole double %1, 0.000000e+00
  %13 = fcmp ole double %2, 0.000000e+00
  %or.cond = or i1 %12, %13
  br i1 %or.cond, label %14, label %25

14:                                               ; preds = %3
  %15 = tail call ptr @__cxa_allocate_exception(i64 112) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #3
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #3
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull @.str.11, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %16 unwind label %.thread

16:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #3
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #3
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull @.str.65, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %17 unwind label %20

17:                                               ; preds = %16
  invoke void @_ZN7SGTELIB9ExceptionC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiS8_(ptr noundef nonnull align 8 dereferenceable(112) %15, ptr noundef nonnull align 8 dereferenceable(32) %4, i32 noundef 678, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %18 unwind label %22

18:                                               ; preds = %17
  invoke void @__cxa_throw(ptr nonnull %15, ptr nonnull @_ZTIN7SGTELIB9ExceptionE, ptr nonnull @_ZN7SGTELIB9ExceptionD2Ev) #4
          to label %77 unwind label %22

.thread:                                          ; preds = %14
  %19 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #3
  br label %.sink.split

20:                                               ; preds = %16
  %21 = landingpad { ptr, i32 }
          cleanup
  br label %24

22:                                               ; preds = %18, %17
  %.042 = phi i1 [ false, %18 ], [ true, %17 ]
  %23 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #3
  br label %24

24:                                               ; preds = %20, %22
  %.pn60 = phi { ptr, i32 } [ %23, %22 ], [ %21, %20 ]
  %.143 = phi i1 [ %.042, %22 ], [ true, %20 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #3
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #3
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #3
  br i1 %.143, label %.sink.split, label %76

25:                                               ; preds = %3
  %26 = fcmp olt double %0, 0.000000e+00
  %27 = fcmp ogt double %0, 1.000000e+00
  %or.cond3 = or i1 %26, %27
  br i1 %or.cond3, label %28, label %39

28:                                               ; preds = %25
  %29 = tail call ptr @__cxa_allocate_exception(i64 112) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %9) #3
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #3
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull @.str.11, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %30 unwind label %.thread67

30:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %11) #3
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #3
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull @.str.66, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %31 unwind label %34

31:                                               ; preds = %30
  invoke void @_ZN7SGTELIB9ExceptionC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiS8_(ptr noundef nonnull align 8 dereferenceable(112) %29, ptr noundef nonnull align 8 dereferenceable(32) %8, i32 noundef 682, ptr noundef nonnull align 8 dereferenceable(32) %10)
          to label %32 unwind label %36

32:                                               ; preds = %31
  invoke void @__cxa_throw(ptr nonnull %29, ptr nonnull @_ZTIN7SGTELIB9ExceptionE, ptr nonnull @_ZN7SGTELIB9ExceptionD2Ev) #4
          to label %77 unwind label %36

.thread67:                                        ; preds = %28
  %33 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #3
  br label %.sink.split

34:                                               ; preds = %30
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %38

36:                                               ; preds = %32, %31
  %.039 = phi i1 [ false, %32 ], [ true, %31 ]
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #3
  br label %38

38:                                               ; preds = %34, %36
  %.pn = phi { ptr, i32 } [ %37, %36 ], [ %35, %34 ]
  %.140 = phi i1 [ %.039, %36 ], [ true, %34 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #3
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #3
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #3
  br i1 %.140, label %.sink.split, label %76

39:                                               ; preds = %25
  %40 = fcmp oeq double %0, 1.000000e+00
  br i1 %40, label %75, label %41

41:                                               ; preds = %39
  %42 = fcmp oeq double %0, 0.000000e+00
  br i1 %42, label %75, label %.preheader

.preheader:                                       ; preds = %41
  %43 = tail call noundef double @_ZN7SGTELIB8gammacdfEddd(double noundef 1.000000e+00, double noundef %1, double noundef %2)
  %44 = fcmp olt double %43, %0
  br i1 %44, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.preheader
  %45 = tail call noundef double @_ZN7SGTELIB8gammacdfEddd(double noundef 2.000000e+00, double noundef %1, double noundef %2)
  %46 = fcmp olt double %45, %0
  br i1 %46, label %.lr.ph.1, label %._crit_edge, !llvm.loop !5

.lr.ph.1:                                         ; preds = %.lr.ph.preheader
  %47 = tail call noundef double @_ZN7SGTELIB8gammacdfEddd(double noundef 4.000000e+00, double noundef %1, double noundef %2)
  %48 = fcmp olt double %47, %0
  br i1 %48, label %.lr.ph.2, label %._crit_edge, !llvm.loop !5

.lr.ph.2:                                         ; preds = %.lr.ph.1
  %49 = tail call noundef double @_ZN7SGTELIB8gammacdfEddd(double noundef 8.000000e+00, double noundef %1, double noundef %2)
  %50 = fcmp olt double %49, %0
  br i1 %50, label %.lr.ph.3, label %._crit_edge, !llvm.loop !5

.lr.ph.3:                                         ; preds = %.lr.ph.2
  %51 = tail call noundef double @_ZN7SGTELIB8gammacdfEddd(double noundef 1.600000e+01, double noundef %1, double noundef %2)
  %52 = fcmp olt double %51, %0
  br i1 %52, label %.lr.ph.4, label %._crit_edge, !llvm.loop !5

.lr.ph.4:                                         ; preds = %.lr.ph.3
  %53 = tail call noundef double @_ZN7SGTELIB8gammacdfEddd(double noundef 3.200000e+01, double noundef %1, double noundef %2)
  %54 = fcmp olt double %53, %0
  br i1 %54, label %.lr.ph.5, label %._crit_edge, !llvm.loop !5

.lr.ph.5:                                         ; preds = %.lr.ph.4
  %55 = tail call noundef double @_ZN7SGTELIB8gammacdfEddd(double noundef 6.400000e+01, double noundef %1, double noundef %2)
  %56 = fcmp olt double %55, %0
  br i1 %56, label %.lr.ph.6, label %._crit_edge, !llvm.loop !5

.lr.ph.6:                                         ; preds = %.lr.ph.5
  %57 = tail call noundef double @_ZN7SGTELIB8gammacdfEddd(double noundef 1.280000e+02, double noundef %1, double noundef %2)
  %58 = fcmp olt double %57, %0
  br i1 %58, label %.lr.ph.7, label %._crit_edge, !llvm.loop !5

.lr.ph.7:                                         ; preds = %.lr.ph.6
  %59 = tail call noundef double @_ZN7SGTELIB8gammacdfEddd(double noundef 2.560000e+02, double noundef %1, double noundef %2)
  %60 = fcmp olt double %59, %0
  br i1 %60, label %.lr.ph.8, label %._crit_edge, !llvm.loop !5

.lr.ph.8:                                         ; preds = %.lr.ph.7
  %61 = tail call noundef double @_ZN7SGTELIB8gammacdfEddd(double noundef 5.120000e+02, double noundef %1, double noundef %2)
  %62 = fcmp olt double %61, %0
  br i1 %62, label %.lr.ph.9, label %._crit_edge, !llvm.loop !5

.lr.ph.9:                                         ; preds = %.lr.ph.8
  %63 = tail call noundef double @_ZN7SGTELIB8gammacdfEddd(double noundef 1.024000e+03, double noundef %1, double noundef %2)
  %64 = fcmp olt double %63, %0
  br i1 %64, label %.lr.ph.10, label %._crit_edge, !llvm.loop !5

.lr.ph.10:                                        ; preds = %.lr.ph.9
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.preheader, %.lr.ph.1, %.lr.ph.2, %.lr.ph.3, %.lr.ph.4, %.lr.ph.5, %.lr.ph.6, %.lr.ph.7, %.lr.ph.8, %.lr.ph.9, %.lr.ph.10, %.preheader
  %.136 = phi double [ 0.000000e+00, %.preheader ], [ 1.000000e+00, %.lr.ph.preheader ], [ 2.000000e+00, %.lr.ph.1 ], [ 4.000000e+00, %.lr.ph.2 ], [ 8.000000e+00, %.lr.ph.3 ], [ 1.600000e+01, %.lr.ph.4 ], [ 3.200000e+01, %.lr.ph.5 ], [ 6.400000e+01, %.lr.ph.6 ], [ 1.280000e+02, %.lr.ph.7 ], [ 2.560000e+02, %.lr.ph.8 ], [ 5.120000e+02, %.lr.ph.9 ], [ 1.024000e+03, %.lr.ph.10 ]
  %.1 = phi double [ 1.000000e+00, %.preheader ], [ 2.000000e+00, %.lr.ph.preheader ], [ 4.000000e+00, %.lr.ph.1 ], [ 8.000000e+00, %.lr.ph.2 ], [ 1.600000e+01, %.lr.ph.3 ], [ 3.200000e+01, %.lr.ph.4 ], [ 6.400000e+01, %.lr.ph.5 ], [ 1.280000e+02, %.lr.ph.6 ], [ 2.560000e+02, %.lr.ph.7 ], [ 5.120000e+02, %.lr.ph.8 ], [ 1.024000e+03, %.lr.ph.9 ], [ 2.048000e+03, %.lr.ph.10 ]
  %65 = fsub double %.1, %.136
  %66 = fcmp ogt double %65, 1.000000e-09
  br i1 %66, label %.lr.ph80, label %._crit_edge81

.lr.ph80:                                         ; preds = %._crit_edge, %.lr.ph80
  %.278 = phi double [ %..2, %.lr.ph80 ], [ %.1, %._crit_edge ]
  %.23777 = phi double [ %.237., %.lr.ph80 ], [ %.136, %._crit_edge ]
  %67 = fadd double %.23777, %.278
  %68 = fmul double %67, 5.000000e-01
  %69 = tail call noundef double @_ZN7SGTELIB8gammacdfEddd(double noundef %68, double noundef %1, double noundef %2)
  %70 = fcmp ogt double %69, %0
  %.237. = select i1 %70, double %.23777, double %68
  %..2 = select i1 %70, double %68, double %.278
  %71 = fsub double %..2, %.237.
  %72 = fcmp ogt double %71, 1.000000e-09
  br i1 %72, label %.lr.ph80, label %._crit_edge81, !llvm.loop !7

._crit_edge81:                                    ; preds = %.lr.ph80, %._crit_edge
  %.237.lcssa = phi double [ %.136, %._crit_edge ], [ %.237., %.lr.ph80 ]
  %.2.lcssa = phi double [ %.1, %._crit_edge ], [ %..2, %.lr.ph80 ]
  %73 = fadd double %.237.lcssa, %.2.lcssa
  %74 = fmul double %73, 5.000000e-01
  br label %75

75:                                               ; preds = %41, %39, %._crit_edge81
  %.033 = phi double [ %74, %._crit_edge81 ], [ 0x7FEFFFFFFFFFFFFF, %39 ], [ 0.000000e+00, %41 ]
  ret double %.033

.sink.split:                                      ; preds = %38, %.thread67, %24, %.thread
  %.sink = phi ptr [ %15, %.thread ], [ %15, %24 ], [ %29, %.thread67 ], [ %29, %38 ]
  %.pn60.pn.pn.ph = phi { ptr, i32 } [ %19, %.thread ], [ %.pn60, %24 ], [ %33, %.thread67 ], [ %.pn, %38 ]
  call void @__cxa_free_exception(ptr %.sink) #3
  br label %76

76:                                               ; preds = %.sink.split, %38, %24
  %.pn60.pn.pn = phi { ptr, i32 } [ %.pn60, %24 ], [ %.pn, %38 ], [ %.pn60.pn.pn.ph, %.sink.split ]
  resume { ptr, i32 } %.pn60.pn.pn

77:                                               ; preds = %32, %18
  unreachable
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
attributes #4 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}


; Effective O3 passes: GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass