; LLVM IR from buresjan/optim_lbm :: nomad/src/Math/Double.ll (ZNK9NOMAD_4_36Double6relErrERKS0_)

; 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.NOMAD_4_3::Double" = type <{ ptr, double, i8, [7 x i8] }>
%"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 }

@_ZTIN9NOMAD_4_36Double10NotDefinedE = external dso_local constant { ptr, ptr, ptr }, align 8
@.str.23 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [59 x i8], align 1

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

; Function Attrs: 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

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) #0

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

declare ptr @__cxa_allocate_exception(i64)

declare void @__cxa_throw(ptr, ptr, ptr)

declare void @__cxa_free_exception(ptr)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9NOMAD_4_36Double10NotDefinedC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiS9_(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 @_ZN9NOMAD_4_39ExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(112)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK9NOMAD_4_36Double6relErrERKS0_(ptr dead_on_unwind noalias writable sret(%"class.NOMAD_4_3::Double") align 8 %0, ptr noundef nonnull align 8 dereferenceable(17) %1, ptr noundef nonnull align 8 dereferenceable(17) %2) #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::allocator", align 1
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.std::__cxx11::basic_string", align 8
  %12 = alloca %"class.std::allocator", align 1
  %13 = alloca i1, align 1
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca i32, align 4
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %21 = load ptr, ptr %5, align 8
  %22 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %21, i32 0, i32 2
  %23 = load i8, ptr %22, align 8, !tbaa !9, !range !13, !noundef !14
  %24 = trunc i8 %23 to i1
  br i1 %24, label %25, label %30

25:                                               ; preds = %3
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %26, i32 0, i32 2
  %28 = load i8, ptr %27, align 8, !tbaa !9, !range !13, !noundef !14
  %29 = trunc i8 %28 to i1
  br i1 %29, label %52, label %30

30:                                               ; preds = %25, %3
  store i1 true, ptr %13, align 1
  %31 = call ptr @__cxa_allocate_exception(i64 112) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef @.str.23, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %32 unwind label %35

32:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef @.str.47, ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %33 unwind label %39

33:                                               ; preds = %32
  invoke void @_ZN9NOMAD_4_36Double10NotDefinedC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiS9_(ptr noundef nonnull align 8 dereferenceable(112) %31, ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef 932, ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %34 unwind label %43

34:                                               ; preds = %33
  store i1 false, ptr %13, align 1
  invoke void @__cxa_throw(ptr %31, ptr @_ZTIN9NOMAD_4_36Double10NotDefinedE, ptr @_ZN9NOMAD_4_39ExceptionD2Ev) #5
          to label %124 unwind label %43

35:                                               ; preds = %30
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %9, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %10, align 4
  br label %48

39:                                               ; preds = %32
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %9, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %10, align 4
  br label %47

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

47:                                               ; preds = %43, %39
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #4
  br label %48

48:                                               ; preds = %47, %35
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #4
  %49 = load i1, ptr %13, align 1
  br i1 %49, label %50, label %51

50:                                               ; preds = %48
  call void @__cxa_free_exception(ptr %31) #4
  br label %51

51:                                               ; preds = %50, %48
  br label %119

52:                                               ; preds = %25
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = icmp eq ptr %21, %53
  br i1 %54, label %62, label %55

55:                                               ; preds = %52
  %56 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %21, i32 0, i32 1
  %57 = load double, ptr %56, align 8, !tbaa !15
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %58, i32 0, i32 1
  %60 = load double, ptr %59, align 8, !tbaa !15
  %61 = fcmp oeq double %57, %60
  br i1 %61, label %62, label %63

62:                                               ; preds = %55, %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  store double 0.000000e+00, ptr %14, align 8, !tbaa !16
  call void @_ZN9NOMAD_4_36DoubleC1ERKd(ptr noundef nonnull align 8 dereferenceable(17) %0, ptr noundef nonnull align 8 dereferenceable(8) %14)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %118

63:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %64 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %21, i32 0, i32 1
  %65 = load double, ptr %64, align 8, !tbaa !15
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %66, i32 0, i32 1
  %68 = load double, ptr %67, align 8, !tbaa !15
  %69 = fsub double %65, %68
  %70 = call double @llvm.fabs.f64(double %69)
  store double %70, ptr %15, align 8, !tbaa !16
  %71 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %21, i32 0, i32 1
  %72 = load double, ptr %71, align 8, !tbaa !15
  %73 = fcmp oeq double %72, 0.000000e+00
  br i1 %73, label %79, label %74

74:                                               ; preds = %63
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %75, i32 0, i32 1
  %77 = load double, ptr %76, align 8, !tbaa !15
  %78 = fcmp oeq double %77, 0.000000e+00
  br i1 %78, label %79, label %84

79:                                               ; preds = %74, %63
  %80 = load double, ptr %15, align 8, !tbaa !16
  %81 = fcmp ogt double %80, 2.000000e+00
  br i1 %81, label %82, label %83

82:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  store double 2.000000e+00, ptr %16, align 8, !tbaa !16
  call void @_ZN9NOMAD_4_36DoubleC1ERKd(ptr noundef nonnull align 8 dereferenceable(17) %0, ptr noundef nonnull align 8 dereferenceable(8) %16)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  store i32 1, ptr %17, align 4
  br label %117

83:                                               ; preds = %79
  call void @_ZN9NOMAD_4_36DoubleC1ERKd(ptr noundef nonnull align 8 dereferenceable(17) %0, ptr noundef nonnull align 8 dereferenceable(8) %15)
  store i32 1, ptr %17, align 4
  br label %117

84:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %85 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %21, i32 0, i32 1
  %86 = load double, ptr %85, align 8, !tbaa !15
  %87 = call double @llvm.fabs.f64(double %86)
  store double %87, ptr %18, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %88, i32 0, i32 1
  %90 = load double, ptr %89, align 8, !tbaa !15
  %91 = call double @llvm.fabs.f64(double %90)
  store double %91, ptr %19, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %92 = load double, ptr %15, align 8, !tbaa !16
  %93 = load double, ptr %18, align 8, !tbaa !16
  %94 = load double, ptr %19, align 8, !tbaa !16
  %95 = fcmp olt double %93, %94
  br i1 %95, label %96, label %98

96:                                               ; preds = %84
  %97 = load double, ptr %19, align 8, !tbaa !16
  br label %100

98:                                               ; preds = %84
  %99 = load double, ptr %18, align 8, !tbaa !16
  br label %100

100:                                              ; preds = %98, %96
  %101 = phi double [ %97, %96 ], [ %99, %98 ]
  %102 = fdiv double %92, %101
  store double %102, ptr %20, align 8, !tbaa !16
  %103 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %21, i32 0, i32 1
  %104 = load double, ptr %103, align 8, !tbaa !15
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  %106 = getelementptr inbounds %"class.NOMAD_4_3::Double", ptr %105, i32 0, i32 1
  %107 = load double, ptr %106, align 8, !tbaa !15
  %108 = fmul double %104, %107
  %109 = fcmp olt double %108, 0.000000e+00
  br i1 %109, label %110, label %115

110:                                              ; preds = %100
  %111 = load double, ptr %15, align 8, !tbaa !16
  %112 = fcmp olt double %111, 1.000000e+00
  br i1 %112, label %113, label %114

113:                                              ; preds = %110
  call void @_ZN9NOMAD_4_36DoubleC1ERKd(ptr noundef nonnull align 8 dereferenceable(17) %0, ptr noundef nonnull align 8 dereferenceable(8) %15)
  store i32 1, ptr %17, align 4
  br label %116

114:                                              ; preds = %110
  br label %115

115:                                              ; preds = %114, %100
  call void @_ZN9NOMAD_4_36DoubleC1ERKd(ptr noundef nonnull align 8 dereferenceable(17) %0, ptr noundef nonnull align 8 dereferenceable(8) %20)
  store i32 1, ptr %17, align 4
  br label %116

116:                                              ; preds = %115, %113
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  br label %117

117:                                              ; preds = %116, %83, %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %118

118:                                              ; preds = %117, %62
  ret void

119:                                              ; preds = %51
  %120 = load ptr, ptr %9, align 8
  %121 = load i32, ptr %10, align 4
  %122 = insertvalue { ptr, i32 } poison, ptr %120, 0
  %123 = insertvalue { ptr, i32 } %122, i32 %121, 1
  resume { ptr, i32 } %123

124:                                              ; preds = %34
  unreachable
}

; 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 void @_ZN9NOMAD_4_36DoubleC1ERKd(ptr, ptr)

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
attributes #5 = { 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, !12, i64 16}
!10 = !{!"_ZTSN9NOMAD_4_36DoubleE", !11, i64 8, !12, i64 16}
!11 = !{!"double", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!10, !11, i64 8}
!16 = !{!11, !11, i64 0}


; 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.NOMAD_4_3::Double" = type <{ ptr, double, i8, [7 x i8] }>
%"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 }

@_ZTIN9NOMAD_4_36Double10NotDefinedE = external dso_local constant { ptr, ptr, ptr }, align 8
@.str.23 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [59 x i8], align 1

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

; Function Attrs: mustprogress 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

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) #0

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

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

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 void @_ZN9NOMAD_4_36Double10NotDefinedC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiS9_(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 @_ZN9NOMAD_4_39ExceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(112)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK9NOMAD_4_36Double6relErrERKS0_(ptr dead_on_unwind noalias writable sret(%"class.NOMAD_4_3::Double") align 8 %0, ptr noundef nonnull readonly align 8 dereferenceable(17) %1, ptr noundef nonnull readonly align 8 dereferenceable(17) %2) local_unnamed_addr #2 align 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 double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = getelementptr inbounds i8, ptr %1, i64 16
  %13 = load i8, ptr %12, align 8, !tbaa !5, !range !11, !noundef !12
  %14 = trunc nuw i8 %13 to i1
  br i1 %14, label %15, label %19

15:                                               ; preds = %3
  %16 = getelementptr inbounds i8, ptr %2, i64 16
  %17 = load i8, ptr %16, align 8, !tbaa !5, !range !11, !noundef !12
  %18 = trunc nuw i8 %17 to i1
  br i1 %18, label %31, label %19

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

21:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull @.str.47, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %22 unwind label %25

22:                                               ; preds = %21
  invoke void @_ZN9NOMAD_4_36Double10NotDefinedC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiS9_(ptr noundef nonnull align 8 dereferenceable(112) %20, ptr noundef nonnull align 8 dereferenceable(32) %4, i32 noundef 932, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %23 unwind label %27

23:                                               ; preds = %22
  invoke void @__cxa_throw(ptr nonnull %20, ptr nonnull @_ZTIN9NOMAD_4_36Double10NotDefinedE, ptr nonnull @_ZN9NOMAD_4_39ExceptionD2Ev) #5
          to label %61 unwind label %27

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

25:                                               ; preds = %21
  %26 = landingpad { ptr, i32 }
          cleanup
  br label %29

27:                                               ; preds = %23, %22
  %.017 = phi i1 [ false, %23 ], [ true, %22 ]
  %28 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #4
  br label %29

29:                                               ; preds = %25, %27
  %.118 = phi i1 [ %.017, %27 ], [ true, %25 ]
  %.pn = phi { ptr, i32 } [ %28, %27 ], [ %26, %25 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  br i1 %.118, label %30, label %60

30:                                               ; preds = %.thread, %29
  %.pn.pn28 = phi { ptr, i32 } [ %24, %.thread ], [ %.pn, %29 ]
  call void @__cxa_free_exception(ptr %20) #4
  br label %60

31:                                               ; preds = %15
  %32 = icmp eq ptr %1, %2
  br i1 %32, label %39, label %33

33:                                               ; preds = %31
  %34 = getelementptr inbounds i8, ptr %1, i64 8
  %35 = load double, ptr %34, align 8, !tbaa !13
  %36 = getelementptr inbounds i8, ptr %2, i64 8
  %37 = load double, ptr %36, align 8, !tbaa !13
  %38 = fcmp oeq double %35, %37
  br i1 %38, label %39, label %40

39:                                               ; preds = %33, %31
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  store double 0.000000e+00, ptr %8, align 8, !tbaa !14
  call void @_ZN9NOMAD_4_36DoubleC1ERKd(ptr noundef nonnull align 8 dereferenceable(17) %0, ptr noundef nonnull align 8 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  br label %59

40:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  %41 = fsub double %35, %37
  %42 = tail call double @llvm.fabs.f64(double %41)
  store double %42, ptr %9, align 8, !tbaa !14
  %43 = fcmp oeq double %35, 0.000000e+00
  %44 = fcmp oeq double %37, 0.000000e+00
  %or.cond29 = or i1 %43, %44
  br i1 %or.cond29, label %45, label %49

45:                                               ; preds = %40
  %46 = fcmp ogt double %42, 2.000000e+00
  br i1 %46, label %47, label %48

47:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  store double 2.000000e+00, ptr %10, align 8, !tbaa !14
  call void @_ZN9NOMAD_4_36DoubleC1ERKd(ptr noundef nonnull align 8 dereferenceable(17) %0, ptr noundef nonnull align 8 dereferenceable(8) %10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  br label %58

48:                                               ; preds = %45
  call void @_ZN9NOMAD_4_36DoubleC1ERKd(ptr noundef nonnull align 8 dereferenceable(17) %0, ptr noundef nonnull align 8 dereferenceable(8) %9)
  br label %58

49:                                               ; preds = %40
  %50 = tail call double @llvm.fabs.f64(double %35)
  %51 = tail call double @llvm.fabs.f64(double %37)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  %52 = fcmp olt double %50, %51
  %53 = select i1 %52, double %51, double %50
  %54 = fdiv double %42, %53
  store double %54, ptr %11, align 8, !tbaa !14
  %55 = fmul double %35, %37
  %56 = fcmp olt double %55, 0.000000e+00
  %57 = fcmp olt double %42, 1.000000e+00
  %or.cond = and i1 %56, %57
  %. = select i1 %or.cond, ptr %9, ptr %11
  call void @_ZN9NOMAD_4_36DoubleC1ERKd(ptr noundef nonnull align 8 dereferenceable(17) %0, ptr noundef nonnull align 8 dereferenceable(8) %.)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  br label %58

58:                                               ; preds = %49, %48, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  br label %59

59:                                               ; preds = %58, %39
  ret void

60:                                               ; preds = %29, %30
  %.pn.pn27 = phi { ptr, i32 } [ %.pn, %29 ], [ %.pn.pn28, %30 ]
  resume { ptr, i32 } %.pn.pn27

61:                                               ; preds = %23
  unreachable
}

; 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 void @_ZN9NOMAD_4_36DoubleC1ERKd(ptr, ptr) local_unnamed_addr

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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
attributes #5 = { 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, !10, i64 16}
!6 = !{!"_ZTSN9NOMAD_4_36DoubleE", !7, i64 8, !10, i64 16}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"bool", !8, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!6, !7, i64 8}
!14 = !{!7, !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass