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

; 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.R4Matrix = type { [4 x [4 x double]] }
%class.R3Ray = type { %class.R3Line }
%class.R3Line = type { %class.R3Point, %class.R3Vector }
%class.R3Point = type { [3 x double] }
%class.R3Vector = type { [3 x double] }
%class.R3Affine = type { %class.R3Transformation, %class.R4Matrix, %class.R4Matrix, %class.RNFlags }
%class.R3Transformation = type { ptr }
%class.RNFlags = type { i64 }
%class.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }

; 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 @_ZNK13R3OrientedBox7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(128)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(96) ptr @_ZNK13R3OrientedBox11CoordSystemEv(ptr noundef nonnull align 8 dereferenceable(128)) #2 align 2

declare void @_ZNK13R3CoordSystem13InverseMatrixEv(ptr dead_on_unwind writable sret(%class.R4Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(96)) #3

declare void @_ZN8R3AffineC1ERK8R4Matrixi(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef nonnull align 8 dereferenceable(128), i32 noundef) unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK13R3OrientedBox6RadiusEi(ptr noundef nonnull align 8 dereferenceable(128), i32 noundef) #2 align 2

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

declare void @_ZNK13R3CoordSystem6MatrixEv(ptr dead_on_unwind writable sret(%class.R4Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(96)) #3

declare void @_ZN7R3Point9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: nounwind
declare void @_ZN8R3AffineD1Ev(ptr noundef nonnull align 8 dereferenceable(272)) unnamed_addr #4

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z12R3IntersectsRK5R3RayRK5R3BoxP7R3PointP8R3VectorPd(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(56), ptr noundef, ptr noundef, ptr noundef) #5

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z12R3IntersectsRK5R3RayRK13R3OrientedBoxP7R3PointP8R3VectorPd(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(128) %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #5 personality ptr @__gxx_personality_v0 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca %class.R3Ray, align 8
  %13 = alloca %class.R3Affine, align 8
  %14 = alloca %class.R4Matrix, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca %class.R3Box, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca %class.R3Affine, align 8
  %21 = alloca %class.R4Matrix, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  %23 = call noundef i32 @_ZNK13R3OrientedBox7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(128) %22)
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %25, label %26

25:                                               ; preds = %5
  store i32 0, ptr %6, align 4
  br label %112

26:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 48, ptr %12) #6
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN5R3RayC1ERKS_(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 8 dereferenceable(48) %27)
  call void @llvm.lifetime.start.p0(i64 272, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 128, ptr %14) #6
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNK13R3OrientedBox11CoordSystemEv(ptr noundef nonnull align 8 dereferenceable(128) %28)
  call void @_ZNK13R3CoordSystem13InverseMatrixEv(ptr dead_on_unwind writable sret(%class.R4Matrix) align 8 %14, ptr noundef nonnull align 8 dereferenceable(96) %29)
  call void @_ZN8R3AffineC1ERK8R4Matrixi(ptr noundef nonnull align 8 dereferenceable(272) %13, ptr noundef nonnull align 8 dereferenceable(128) %14, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 128, ptr %14) #6
  invoke void @_ZN5R3Ray9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %30 unwind label %61

30:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 56, ptr %17) #6
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = invoke noundef double @_ZNK13R3OrientedBox6RadiusEi(ptr noundef nonnull align 8 dereferenceable(128) %31, i32 noundef 0)
          to label %33 unwind label %65

33:                                               ; preds = %30
  %34 = fneg double %32
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = invoke noundef double @_ZNK13R3OrientedBox6RadiusEi(ptr noundef nonnull align 8 dereferenceable(128) %35, i32 noundef 1)
          to label %37 unwind label %65

37:                                               ; preds = %33
  %38 = fneg double %36
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = invoke noundef double @_ZNK13R3OrientedBox6RadiusEi(ptr noundef nonnull align 8 dereferenceable(128) %39, i32 noundef 2)
          to label %41 unwind label %65

41:                                               ; preds = %37
  %42 = fneg double %40
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = invoke noundef double @_ZNK13R3OrientedBox6RadiusEi(ptr noundef nonnull align 8 dereferenceable(128) %43, i32 noundef 0)
          to label %45 unwind label %65

45:                                               ; preds = %41
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = invoke noundef double @_ZNK13R3OrientedBox6RadiusEi(ptr noundef nonnull align 8 dereferenceable(128) %46, i32 noundef 1)
          to label %48 unwind label %65

48:                                               ; preds = %45
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = invoke noundef double @_ZNK13R3OrientedBox6RadiusEi(ptr noundef nonnull align 8 dereferenceable(128) %49, i32 noundef 2)
          to label %51 unwind label %65

51:                                               ; preds = %48
  invoke void @_ZN5R3BoxC1Edddddd(ptr noundef nonnull align 8 dereferenceable(56) %17, double noundef %34, double noundef %38, double noundef %42, double noundef %44, double noundef %47, double noundef %50)
          to label %52 unwind label %65

52:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = load ptr, ptr %10, align 8, !tbaa !5
  %55 = load ptr, ptr %11, align 8, !tbaa !5
  %56 = invoke noundef i32 @_Z12R3IntersectsRK5R3RayRK5R3BoxP7R3PointP8R3VectorPd(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 8 dereferenceable(56) %17, ptr noundef %53, ptr noundef %54, ptr noundef %55)
          to label %57 unwind label %69

57:                                               ; preds = %52
  store i32 %56, ptr %18, align 4, !tbaa !9
  %58 = load i32, ptr %18, align 4, !tbaa !9
  %59 = icmp eq i32 %58, 0
  br i1 %59, label %60, label %73

60:                                               ; preds = %57
  store i32 0, ptr %6, align 4
  store i32 1, ptr %19, align 4
  br label %108

61:                                               ; preds = %26
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %15, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %16, align 4
  br label %111

65:                                               ; preds = %51, %48, %45, %41, %37, %33, %30
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %15, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %16, align 4
  br label %110

69:                                               ; preds = %52
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %15, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %16, align 4
  br label %109

73:                                               ; preds = %57
  %74 = load ptr, ptr %9, align 8, !tbaa !5
  %75 = icmp ne ptr %74, null
  br i1 %75, label %79, label %76

76:                                               ; preds = %73
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  %78 = icmp ne ptr %77, null
  br i1 %78, label %79, label %106

79:                                               ; preds = %76, %73
  call void @llvm.lifetime.start.p0(i64 272, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 128, ptr %21) #6
  %80 = load ptr, ptr %8, align 8, !tbaa !5
  %81 = invoke noundef nonnull align 8 dereferenceable(96) ptr @_ZNK13R3OrientedBox11CoordSystemEv(ptr noundef nonnull align 8 dereferenceable(128) %80)
          to label %82 unwind label %90

82:                                               ; preds = %79
  invoke void @_ZNK13R3CoordSystem6MatrixEv(ptr dead_on_unwind writable sret(%class.R4Matrix) align 8 %21, ptr noundef nonnull align 8 dereferenceable(96) %81)
          to label %83 unwind label %90

83:                                               ; preds = %82
  invoke void @_ZN8R3AffineC1ERK8R4Matrixi(ptr noundef nonnull align 8 dereferenceable(272) %20, ptr noundef nonnull align 8 dereferenceable(128) %21, i32 noundef 0)
          to label %84 unwind label %90

84:                                               ; preds = %83
  call void @llvm.lifetime.end.p0(i64 128, ptr %21) #6
  %85 = load ptr, ptr %9, align 8, !tbaa !5
  %86 = icmp ne ptr %85, null
  br i1 %86, label %87, label %98

87:                                               ; preds = %84
  %88 = load ptr, ptr %9, align 8, !tbaa !5
  invoke void @_ZN7R3Point9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(24) %88, ptr noundef nonnull align 8 dereferenceable(8) %20)
          to label %89 unwind label %94

89:                                               ; preds = %87
  br label %98

90:                                               ; preds = %83, %82, %79
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %15, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 128, ptr %21) #6
  br label %105

94:                                               ; preds = %101, %87
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %15, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %16, align 4
  call void @_ZN8R3AffineD1Ev(ptr noundef nonnull align 8 dereferenceable(272) %20) #6
  br label %105

98:                                               ; preds = %89, %84
  %99 = load ptr, ptr %10, align 8, !tbaa !5
  %100 = icmp ne ptr %99, null
  br i1 %100, label %101, label %104

101:                                              ; preds = %98
  %102 = load ptr, ptr %10, align 8, !tbaa !5
  invoke void @_ZN8R3Vector9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(24) %102, ptr noundef nonnull align 8 dereferenceable(8) %20)
          to label %103 unwind label %94

103:                                              ; preds = %101
  br label %104

104:                                              ; preds = %103, %98
  call void @_ZN8R3AffineD1Ev(ptr noundef nonnull align 8 dereferenceable(272) %20) #6
  call void @llvm.lifetime.end.p0(i64 272, ptr %20) #6
  br label %106

105:                                              ; preds = %94, %90
  call void @llvm.lifetime.end.p0(i64 272, ptr %20) #6
  br label %109

106:                                              ; preds = %104, %76
  %107 = load i32, ptr %18, align 4, !tbaa !9
  store i32 %107, ptr %6, align 4
  store i32 1, ptr %19, align 4
  br label %108

108:                                              ; preds = %106, %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %17) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %17) #6
  call void @_ZN8R3AffineD1Ev(ptr noundef nonnull align 8 dereferenceable(272) %13) #6
  call void @llvm.lifetime.end.p0(i64 272, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #6
  br label %112

109:                                              ; preds = %105, %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %17) #6
  br label %110

110:                                              ; preds = %109, %65
  call void @llvm.lifetime.end.p0(i64 56, ptr %17) #6
  br label %111

111:                                              ; preds = %110, %61
  call void @_ZN8R3AffineD1Ev(ptr noundef nonnull align 8 dereferenceable(272) %13) #6
  call void @llvm.lifetime.end.p0(i64 272, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #6
  br label %114

112:                                              ; preds = %108, %25
  %113 = load i32, ptr %6, align 4
  ret i32 %113

114:                                              ; preds = %111
  %115 = load ptr, ptr %15, align 8
  %116 = load i32, ptr %16, align 4
  %117 = insertvalue { ptr, i32 } poison, ptr %115, 0
  %118 = insertvalue { ptr, i32 } %117, i32 %116, 1
  resume { ptr, i32 } %118
}

declare void @_ZN5R3RayC1ERKS_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3

declare void @_ZN5R3Ray9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) #3

declare void @_ZN8R3Vector9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #3

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 = { 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 #3 = { "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 = { 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 #5 = { 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 #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 = !{!"int", !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.R4Matrix = type { [4 x [4 x double]] }
%class.R3Ray = type { %class.R3Line }
%class.R3Line = type { %class.R3Point, %class.R3Vector }
%class.R3Point = type { [3 x double] }
%class.R3Vector = type { [3 x double] }
%class.R3Affine = type { %class.R3Transformation, %class.R4Matrix, %class.R4Matrix, %class.RNFlags }
%class.R3Transformation = type { ptr }
%class.RNFlags = type { i64 }
%class.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }

; 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 @_ZNK13R3OrientedBox7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(96) ptr @_ZNK13R3OrientedBox11CoordSystemEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #2 align 2

declare void @_ZNK13R3CoordSystem13InverseMatrixEv(ptr dead_on_unwind writable sret(%class.R4Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(96)) local_unnamed_addr #3

declare void @_ZN8R3AffineC1ERK8R4Matrixi(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef nonnull align 8 dereferenceable(128), i32 noundef) unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK13R3OrientedBox6RadiusEi(ptr noundef nonnull align 8 dereferenceable(128), i32 noundef) local_unnamed_addr #2 align 2

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

declare void @_ZNK13R3CoordSystem6MatrixEv(ptr dead_on_unwind writable sret(%class.R4Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(96)) local_unnamed_addr #3

declare void @_ZN7R3Point9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZN8R3AffineD1Ev(ptr noundef nonnull align 8 dereferenceable(272)) unnamed_addr #4

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z12R3IntersectsRK5R3RayRK5R3BoxP7R3PointP8R3VectorPd(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(56), ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z12R3IntersectsRK5R3RayRK13R3OrientedBoxP7R3PointP8R3VectorPd(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(128) %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #5 personality ptr @__gxx_personality_v0 {
  %6 = alloca %class.R3Ray, align 8
  %7 = alloca %class.R3Affine, align 8
  %8 = alloca %class.R4Matrix, align 8
  %9 = alloca %class.R3Box, align 8
  %10 = alloca %class.R3Affine, align 8
  %11 = alloca %class.R4Matrix, align 8
  %12 = tail call noundef i32 @_ZNK13R3OrientedBox7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(128) %1)
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %13, label %55

13:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %6) #6
  call void @_ZN5R3RayC1ERKS_(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 8 dereferenceable(48) %0)
  call void @llvm.lifetime.start.p0(i64 272, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %8) #6
  %14 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNK13R3OrientedBox11CoordSystemEv(ptr noundef nonnull align 8 dereferenceable(128) %1)
  call void @_ZNK13R3CoordSystem13InverseMatrixEv(ptr dead_on_unwind nonnull writable sret(%class.R4Matrix) align 8 %8, ptr noundef nonnull align 8 dereferenceable(96) %14)
  call void @_ZN8R3AffineC1ERK8R4Matrixi(ptr noundef nonnull align 8 dereferenceable(272) %7, ptr noundef nonnull align 8 dereferenceable(128) %8, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %8) #6
  invoke void @_ZN5R3Ray9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %15 unwind label %29

15:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %9) #6
  %16 = call noundef double @_ZNK13R3OrientedBox6RadiusEi(ptr noundef nonnull align 8 dereferenceable(128) %1, i32 noundef 0)
  %17 = fneg double %16
  %18 = call noundef double @_ZNK13R3OrientedBox6RadiusEi(ptr noundef nonnull align 8 dereferenceable(128) %1, i32 noundef 1)
  %19 = fneg double %18
  %20 = call noundef double @_ZNK13R3OrientedBox6RadiusEi(ptr noundef nonnull align 8 dereferenceable(128) %1, i32 noundef 2)
  %21 = fneg double %20
  %22 = call noundef double @_ZNK13R3OrientedBox6RadiusEi(ptr noundef nonnull align 8 dereferenceable(128) %1, i32 noundef 0)
  %23 = call noundef double @_ZNK13R3OrientedBox6RadiusEi(ptr noundef nonnull align 8 dereferenceable(128) %1, i32 noundef 1)
  %24 = call noundef double @_ZNK13R3OrientedBox6RadiusEi(ptr noundef nonnull align 8 dereferenceable(128) %1, i32 noundef 2)
  invoke void @_ZN5R3BoxC1Edddddd(ptr noundef nonnull align 8 dereferenceable(56) %9, double noundef %17, double noundef %19, double noundef %21, double noundef %22, double noundef %23, double noundef %24)
          to label %25 unwind label %31

25:                                               ; preds = %15
  %26 = invoke noundef i32 @_Z12R3IntersectsRK5R3RayRK5R3BoxP7R3PointP8R3VectorPd(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 8 dereferenceable(56) %9, ptr noundef %2, ptr noundef %3, ptr noundef %4)
          to label %27 unwind label %33

27:                                               ; preds = %25
  %28 = icmp eq i32 %26, 0
  br i1 %28, label %51, label %35

29:                                               ; preds = %13
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %54

31:                                               ; preds = %15
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %53

33:                                               ; preds = %25
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %52

35:                                               ; preds = %27
  %36 = icmp ne ptr %2, null
  %37 = icmp ne ptr %3, null
  %or.cond = or i1 %36, %37
  br i1 %or.cond, label %38, label %51

38:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 272, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %11) #6
  %39 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNK13R3OrientedBox11CoordSystemEv(ptr noundef nonnull align 8 dereferenceable(128) %1)
  invoke void @_ZNK13R3CoordSystem6MatrixEv(ptr dead_on_unwind nonnull writable sret(%class.R4Matrix) align 8 %11, ptr noundef nonnull align 8 dereferenceable(96) %39)
          to label %40 unwind label %43

40:                                               ; preds = %38
  invoke void @_ZN8R3AffineC1ERK8R4Matrixi(ptr noundef nonnull align 8 dereferenceable(272) %10, ptr noundef nonnull align 8 dereferenceable(128) %11, i32 noundef 0)
          to label %41 unwind label %43

41:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %11) #6
  br i1 %36, label %42, label %47

42:                                               ; preds = %41
  invoke void @_ZN7R3Point9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %47 unwind label %45

43:                                               ; preds = %40, %38
  %44 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %11) #6
  br label %50

45:                                               ; preds = %48, %42
  %46 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN8R3AffineD1Ev(ptr noundef nonnull align 8 dereferenceable(272) %10) #6
  br label %50

47:                                               ; preds = %42, %41
  br i1 %37, label %48, label %49

48:                                               ; preds = %47
  invoke void @_ZN8R3Vector9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %49 unwind label %45

49:                                               ; preds = %48, %47
  call void @_ZN8R3AffineD1Ev(ptr noundef nonnull align 8 dereferenceable(272) %10) #6
  call void @llvm.lifetime.end.p0(i64 272, ptr nonnull %10) #6
  br label %51

50:                                               ; preds = %45, %43
  %.pn = phi { ptr, i32 } [ %46, %45 ], [ %44, %43 ]
  call void @llvm.lifetime.end.p0(i64 272, ptr nonnull %10) #6
  br label %52

51:                                               ; preds = %49, %35, %27
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %9) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %9) #6
  call void @_ZN8R3AffineD1Ev(ptr noundef nonnull align 8 dereferenceable(272) %7) #6
  call void @llvm.lifetime.end.p0(i64 272, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #6
  br label %55

52:                                               ; preds = %50, %33
  %.pn.pn = phi { ptr, i32 } [ %.pn, %50 ], [ %34, %33 ]
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %9) #6
  br label %53

53:                                               ; preds = %52, %31
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %52 ], [ %32, %31 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %9) #6
  br label %54

54:                                               ; preds = %53, %29
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %53 ], [ %30, %29 ]
  call void @_ZN8R3AffineD1Ev(ptr noundef nonnull align 8 dereferenceable(272) %7) #6
  call void @llvm.lifetime.end.p0(i64 272, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #6
  resume { ptr, i32 } %.pn.pn.pn.pn

55:                                               ; preds = %5, %51
  %.1 = phi i32 [ %26, %51 ], [ 0, %5 ]
  ret i32 %.1
}

declare void @_ZN5R3RayC1ERKS_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3

declare void @_ZN5R3Ray9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

declare void @_ZN8R3Vector9TransformERK16R3Transformation(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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 = { 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 #3 = { "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 = { 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 #5 = { 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 #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)"}


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