; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R3Shapes/R3Isect.ll (Z12R3IntersectsRK5R3BoxS1_PS_)

; 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.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%class.R3Point = type { [3 x double] }

@RN_EPSILON = external global double, align 8

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z11RNIsGreaterddd(double noundef, double noundef, double noundef) #1

declare i32 @__gxx_personality_v0(...)

declare void @_ZN5R3BoxC1Edddddd(ptr noundef nonnull align 8 dereferenceable(56), double noundef, double noundef, double noundef, double noundef, double noundef, double noundef) unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z12R3IntersectsRK5R3BoxS1_PS_(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(56) %1, ptr noundef %2) #4 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca %class.R3Box, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = call noundef double @_ZNK5R3Box4XMinEv(ptr noundef nonnull align 8 dereferenceable(56) %17)
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = call noundef double @_ZNK5R3Box4XMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %19)
  %21 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %22 = call noundef i32 @_Z11RNIsGreaterddd(double noundef %18, double noundef %20, double noundef %21)
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %64, label %24

24:                                               ; preds = %3
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = call noundef double @_ZNK5R3Box4YMinEv(ptr noundef nonnull align 8 dereferenceable(56) %25)
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = call noundef double @_ZNK5R3Box4YMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %27)
  %29 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %30 = call noundef i32 @_Z11RNIsGreaterddd(double noundef %26, double noundef %28, double noundef %29)
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %64, label %32

32:                                               ; preds = %24
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = call noundef double @_ZNK5R3Box4ZMinEv(ptr noundef nonnull align 8 dereferenceable(56) %33)
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = call noundef double @_ZNK5R3Box4ZMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %35)
  %37 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %38 = call noundef i32 @_Z11RNIsGreaterddd(double noundef %34, double noundef %36, double noundef %37)
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %64, label %40

40:                                               ; preds = %32
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = call noundef double @_ZNK5R3Box4XMinEv(ptr noundef nonnull align 8 dereferenceable(56) %41)
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = call noundef double @_ZNK5R3Box4XMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %43)
  %45 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %46 = call noundef i32 @_Z11RNIsGreaterddd(double noundef %42, double noundef %44, double noundef %45)
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %64, label %48

48:                                               ; preds = %40
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = call noundef double @_ZNK5R3Box4YMinEv(ptr noundef nonnull align 8 dereferenceable(56) %49)
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = call noundef double @_ZNK5R3Box4YMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %51)
  %53 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %54 = call noundef i32 @_Z11RNIsGreaterddd(double noundef %50, double noundef %52, double noundef %53)
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %64, label %56

56:                                               ; preds = %48
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = call noundef double @_ZNK5R3Box4ZMinEv(ptr noundef nonnull align 8 dereferenceable(56) %57)
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = call noundef double @_ZNK5R3Box4ZMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %59)
  %61 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %62 = call noundef i32 @_Z11RNIsGreaterddd(double noundef %58, double noundef %60, double noundef %61)
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %64, label %65

64:                                               ; preds = %56, %48, %40, %32, %24, %3
  store i32 0, ptr %4, align 4
  br label %143

65:                                               ; preds = %56
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = icmp ne ptr %66, null
  br i1 %67, label %68, label %142

68:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = call noundef double @_ZNK5R3Box4XMinEv(ptr noundef nonnull align 8 dereferenceable(56) %69)
  store double %70, ptr %8, align 8, !tbaa !9
  %71 = load double, ptr %8, align 8, !tbaa !9
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = call noundef double @_ZNK5R3Box4XMinEv(ptr noundef nonnull align 8 dereferenceable(56) %72)
  %74 = fcmp olt double %71, %73
  br i1 %74, label %75, label %78

75:                                               ; preds = %68
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = call noundef double @_ZNK5R3Box4XMinEv(ptr noundef nonnull align 8 dereferenceable(56) %76)
  store double %77, ptr %8, align 8, !tbaa !9
  br label %78

78:                                               ; preds = %75, %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = call noundef double @_ZNK5R3Box4YMinEv(ptr noundef nonnull align 8 dereferenceable(56) %79)
  store double %80, ptr %9, align 8, !tbaa !9
  %81 = load double, ptr %9, align 8, !tbaa !9
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = call noundef double @_ZNK5R3Box4YMinEv(ptr noundef nonnull align 8 dereferenceable(56) %82)
  %84 = fcmp olt double %81, %83
  br i1 %84, label %85, label %88

85:                                               ; preds = %78
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = call noundef double @_ZNK5R3Box4YMinEv(ptr noundef nonnull align 8 dereferenceable(56) %86)
  store double %87, ptr %9, align 8, !tbaa !9
  br label %88

88:                                               ; preds = %85, %78
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %89 = load ptr, ptr %5, align 8, !tbaa !5
  %90 = call noundef double @_ZNK5R3Box4ZMinEv(ptr noundef nonnull align 8 dereferenceable(56) %89)
  store double %90, ptr %10, align 8, !tbaa !9
  %91 = load double, ptr %10, align 8, !tbaa !9
  %92 = load ptr, ptr %6, align 8, !tbaa !5
  %93 = call noundef double @_ZNK5R3Box4ZMinEv(ptr noundef nonnull align 8 dereferenceable(56) %92)
  %94 = fcmp olt double %91, %93
  br i1 %94, label %95, label %98

95:                                               ; preds = %88
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  %97 = call noundef double @_ZNK5R3Box4ZMinEv(ptr noundef nonnull align 8 dereferenceable(56) %96)
  store double %97, ptr %10, align 8, !tbaa !9
  br label %98

98:                                               ; preds = %95, %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = call noundef double @_ZNK5R3Box4XMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %99)
  store double %100, ptr %11, align 8, !tbaa !9
  %101 = load double, ptr %11, align 8, !tbaa !9
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  %103 = call noundef double @_ZNK5R3Box4XMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %102)
  %104 = fcmp ogt double %101, %103
  br i1 %104, label %105, label %108

105:                                              ; preds = %98
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  %107 = call noundef double @_ZNK5R3Box4XMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %106)
  store double %107, ptr %11, align 8, !tbaa !9
  br label %108

108:                                              ; preds = %105, %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %109 = load ptr, ptr %5, align 8, !tbaa !5
  %110 = call noundef double @_ZNK5R3Box4YMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %109)
  store double %110, ptr %12, align 8, !tbaa !9
  %111 = load double, ptr %12, align 8, !tbaa !9
  %112 = load ptr, ptr %6, align 8, !tbaa !5
  %113 = call noundef double @_ZNK5R3Box4YMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %112)
  %114 = fcmp ogt double %111, %113
  br i1 %114, label %115, label %118

115:                                              ; preds = %108
  %116 = load ptr, ptr %6, align 8, !tbaa !5
  %117 = call noundef double @_ZNK5R3Box4YMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %116)
  store double %117, ptr %12, align 8, !tbaa !9
  br label %118

118:                                              ; preds = %115, %108
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = call noundef double @_ZNK5R3Box4ZMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %119)
  store double %120, ptr %13, align 8, !tbaa !9
  %121 = load double, ptr %13, align 8, !tbaa !9
  %122 = load ptr, ptr %6, align 8, !tbaa !5
  %123 = call noundef double @_ZNK5R3Box4ZMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %122)
  %124 = fcmp ogt double %121, %123
  br i1 %124, label %125, label %128

125:                                              ; preds = %118
  %126 = load ptr, ptr %6, align 8, !tbaa !5
  %127 = call noundef double @_ZNK5R3Box4ZMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %126)
  store double %127, ptr %13, align 8, !tbaa !9
  br label %128

128:                                              ; preds = %125, %118
  call void @llvm.lifetime.start.p0(i64 56, ptr %14) #6
  %129 = load double, ptr %8, align 8, !tbaa !9
  %130 = load double, ptr %9, align 8, !tbaa !9
  %131 = load double, ptr %10, align 8, !tbaa !9
  %132 = load double, ptr %11, align 8, !tbaa !9
  %133 = load double, ptr %12, align 8, !tbaa !9
  %134 = load double, ptr %13, align 8, !tbaa !9
  call void @_ZN5R3BoxC1Edddddd(ptr noundef nonnull align 8 dereferenceable(56) %14, double noundef %129, double noundef %130, double noundef %131, double noundef %132, double noundef %133, double noundef %134)
  %135 = load ptr, ptr %7, align 8, !tbaa !5
  %136 = invoke noundef nonnull align 8 dereferenceable(56) ptr @_ZN5R3BoxaSERKS_(ptr noundef nonnull align 8 dereferenceable(56) %135, ptr noundef nonnull align 8 dereferenceable(56) %14)
          to label %137 unwind label %138

137:                                              ; preds = %128
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %14) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %142

138:                                              ; preds = %128
  %139 = landingpad { ptr, i32 }
          cleanup
  %140 = extractvalue { ptr, i32 } %139, 0
  store ptr %140, ptr %15, align 8
  %141 = extractvalue { ptr, i32 } %139, 1
  store i32 %141, ptr %16, align 4
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %14) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %145

142:                                              ; preds = %137, %65
  store i32 -1, ptr %4, align 4
  br label %143

143:                                              ; preds = %142, %64
  %144 = load i32, ptr %4, align 4
  ret i32 %144

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4XMinEv(ptr noundef nonnull align 8 dereferenceable(56)) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4XMaxEv(ptr noundef nonnull align 8 dereferenceable(56)) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4YMinEv(ptr noundef nonnull align 8 dereferenceable(56)) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4YMaxEv(ptr noundef nonnull align 8 dereferenceable(56)) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4ZMinEv(ptr noundef nonnull align 8 dereferenceable(56)) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4ZMaxEv(ptr noundef nonnull align 8 dereferenceable(56)) #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZN5R3BoxaSERKS_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) #1 align 2

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

!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}


; 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.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%class.R3Point = type { [3 x double] }

@RN_EPSILON = external local_unnamed_addr global double, align 8

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z11RNIsGreaterddd(double noundef, double noundef, double noundef) local_unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

declare void @_ZN5R3BoxC1Edddddd(ptr noundef nonnull align 8 dereferenceable(56), double noundef, double noundef, double noundef, double noundef, double noundef, double noundef) unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 -1, 1) i32 @_Z12R3IntersectsRK5R3BoxS1_PS_(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(56) %1, ptr noundef %2) local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %4 = alloca %class.R3Box, align 8
  %5 = tail call noundef double @_ZNK5R3Box4XMinEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %6 = tail call noundef double @_ZNK5R3Box4XMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  %7 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %8 = tail call noundef i32 @_Z11RNIsGreaterddd(double noundef %5, double noundef %6, double noundef %7)
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %9, label %76

9:                                                ; preds = %3
  %10 = tail call noundef double @_ZNK5R3Box4YMinEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %11 = tail call noundef double @_ZNK5R3Box4YMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  %12 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %13 = tail call noundef i32 @_Z11RNIsGreaterddd(double noundef %10, double noundef %11, double noundef %12)
  %.not59 = icmp eq i32 %13, 0
  br i1 %.not59, label %14, label %76

14:                                               ; preds = %9
  %15 = tail call noundef double @_ZNK5R3Box4ZMinEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %16 = tail call noundef double @_ZNK5R3Box4ZMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  %17 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %18 = tail call noundef i32 @_Z11RNIsGreaterddd(double noundef %15, double noundef %16, double noundef %17)
  %.not60 = icmp eq i32 %18, 0
  br i1 %.not60, label %19, label %76

19:                                               ; preds = %14
  %20 = tail call noundef double @_ZNK5R3Box4XMinEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  %21 = tail call noundef double @_ZNK5R3Box4XMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %22 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %23 = tail call noundef i32 @_Z11RNIsGreaterddd(double noundef %20, double noundef %21, double noundef %22)
  %.not61 = icmp eq i32 %23, 0
  br i1 %.not61, label %24, label %76

24:                                               ; preds = %19
  %25 = tail call noundef double @_ZNK5R3Box4YMinEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  %26 = tail call noundef double @_ZNK5R3Box4YMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %27 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %28 = tail call noundef i32 @_Z11RNIsGreaterddd(double noundef %25, double noundef %26, double noundef %27)
  %.not62 = icmp eq i32 %28, 0
  br i1 %.not62, label %29, label %76

29:                                               ; preds = %24
  %30 = tail call noundef double @_ZNK5R3Box4ZMinEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  %31 = tail call noundef double @_ZNK5R3Box4ZMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %32 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %33 = tail call noundef i32 @_Z11RNIsGreaterddd(double noundef %30, double noundef %31, double noundef %32)
  %.not63 = icmp eq i32 %33, 0
  br i1 %.not63, label %34, label %76

34:                                               ; preds = %29
  %.not64 = icmp eq ptr %2, null
  br i1 %.not64, label %76, label %35

35:                                               ; preds = %34
  %36 = tail call noundef double @_ZNK5R3Box4XMinEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %37 = tail call noundef double @_ZNK5R3Box4XMinEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  %38 = fcmp olt double %36, %37
  br i1 %38, label %39, label %41

39:                                               ; preds = %35
  %40 = tail call noundef double @_ZNK5R3Box4XMinEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  br label %41

41:                                               ; preds = %39, %35
  %.046 = phi double [ %40, %39 ], [ %36, %35 ]
  %42 = tail call noundef double @_ZNK5R3Box4YMinEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %43 = tail call noundef double @_ZNK5R3Box4YMinEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  %44 = fcmp olt double %42, %43
  br i1 %44, label %45, label %47

45:                                               ; preds = %41
  %46 = tail call noundef double @_ZNK5R3Box4YMinEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  br label %47

47:                                               ; preds = %45, %41
  %.051 = phi double [ %46, %45 ], [ %42, %41 ]
  %48 = tail call noundef double @_ZNK5R3Box4ZMinEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %49 = tail call noundef double @_ZNK5R3Box4ZMinEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  %50 = fcmp olt double %48, %49
  br i1 %50, label %51, label %53

51:                                               ; preds = %47
  %52 = tail call noundef double @_ZNK5R3Box4ZMinEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  br label %53

53:                                               ; preds = %51, %47
  %.050 = phi double [ %52, %51 ], [ %48, %47 ]
  %54 = tail call noundef double @_ZNK5R3Box4XMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %55 = tail call noundef double @_ZNK5R3Box4XMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  %56 = fcmp ogt double %54, %55
  br i1 %56, label %57, label %59

57:                                               ; preds = %53
  %58 = tail call noundef double @_ZNK5R3Box4XMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  br label %59

59:                                               ; preds = %57, %53
  %.049 = phi double [ %58, %57 ], [ %54, %53 ]
  %60 = tail call noundef double @_ZNK5R3Box4YMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %61 = tail call noundef double @_ZNK5R3Box4YMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  %62 = fcmp ogt double %60, %61
  br i1 %62, label %63, label %65

63:                                               ; preds = %59
  %64 = tail call noundef double @_ZNK5R3Box4YMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  br label %65

65:                                               ; preds = %63, %59
  %.048 = phi double [ %64, %63 ], [ %60, %59 ]
  %66 = tail call noundef double @_ZNK5R3Box4ZMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %67 = tail call noundef double @_ZNK5R3Box4ZMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  %68 = fcmp ogt double %66, %67
  br i1 %68, label %69, label %71

69:                                               ; preds = %65
  %70 = tail call noundef double @_ZNK5R3Box4ZMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  br label %71

71:                                               ; preds = %69, %65
  %.047 = phi double [ %70, %69 ], [ %66, %65 ]
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %4) #6
  call void @_ZN5R3BoxC1Edddddd(ptr noundef nonnull align 8 dereferenceable(56) %4, double noundef %.046, double noundef %.051, double noundef %.050, double noundef %.049, double noundef %.048, double noundef %.047)
  %72 = invoke noundef nonnull align 8 dereferenceable(56) ptr @_ZN5R3BoxaSERKS_(ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef nonnull align 8 dereferenceable(56) %4)
          to label %73 unwind label %74

73:                                               ; preds = %71
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %4) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #6
  br label %76

74:                                               ; preds = %71
  %75 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %4) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #6
  resume { ptr, i32 } %75

76:                                               ; preds = %34, %73, %3, %9, %14, %19, %24, %29
  %.0 = phi i32 [ 0, %29 ], [ 0, %24 ], [ 0, %19 ], [ 0, %14 ], [ 0, %9 ], [ 0, %3 ], [ -1, %73 ], [ -1, %34 ]
  ret i32 %.0
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4XMinEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4XMaxEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4YMinEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4YMaxEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4ZMinEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4ZMaxEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZN5R3BoxaSERKS_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #1 align 2

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

!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"}


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