; LLVM IR from atlantis13579/Riemann :: Src/Collision (GeometryQuery)

; 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.Ray3 = type { %"class.Maths::TVector3", %"class.Maths::TVector3" }
%"class.Maths::TVector3" = type { float, float, float }
%"struct.Riemann::RayCastResult" = type <{ i8, [3 x i8], float, float, %"class.Maths::TVector3", %"class.Maths::TVector3", [4 x i8], ptr, %"class.std::vector", i32, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Riemann::Geometry *, std::allocator<Riemann::Geometry *>>::_Vector_impl" }
%"struct.std::_Vector_base<Riemann::Geometry *, std::allocator<Riemann::Geometry *>>::_Vector_impl" = type { %"struct.std::_Vector_base<Riemann::Geometry *, std::allocator<Riemann::Geometry *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Riemann::Geometry *, std::allocator<Riemann::Geometry *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.Riemann::GeometryQuery" = type { %"class.std::vector", ptr, ptr }
%"struct.Riemann::RayCastOption" = type { i32, [4 x i8], %"struct.Riemann::RayCastCache", i8, float, i32, %"struct.Riemann::CollisionData", ptr }
%"struct.Riemann::RayCastCache" = type <{ ptr, %"class.Riemann::StaticStack", [4 x i8] }>
%"class.Riemann::StaticStack" = type { i32, [32 x i32] }
%"struct.Riemann::CollisionData" = type { i32, i32, i32, i32 }

; 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7Riemann13GeometryQuery12RayCastQueryERKN5Maths8TVector3IfEES5_RKNS_13RayCastOptionEPNS_13RayCastResultE(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 8 dereferenceable(192) %3, ptr noundef %4) #1 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca i1, align 1
  %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.Ray3, align 4
  %13 = alloca i8, align 1
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca %"struct.Riemann::RayCastResult", align 8
  %17 = alloca i8, align 1
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  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
  %20 = load ptr, ptr %7, align 8
  %21 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN7Riemann13RayCastResult5ResetEv(ptr noundef nonnull align 8 dereferenceable(76) %21)
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #5
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  %23 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZN4Ray3C2ERKN5Maths8TVector3IfEES4_b(ptr noundef nonnull align 4 dereferenceable(24) %12, ptr noundef nonnull align 4 dereferenceable(12) %22, ptr noundef nonnull align 4 dereferenceable(12) %23, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #5
  store i8 0, ptr %13, align 1, !tbaa !9
  %24 = getelementptr inbounds %"class.Riemann::GeometryQuery", ptr %20, i32 0, i32 1
  %25 = load ptr, ptr %24, align 8, !tbaa !11
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %54

27:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %28 = getelementptr inbounds %"class.Riemann::GeometryQuery", ptr %20, i32 0, i32 0
  %29 = call noundef ptr @_ZNSt6vectorIPN7Riemann8GeometryESaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #5
  store ptr %29, ptr %14, align 8, !tbaa !5
  %30 = load ptr, ptr %14, align 8, !tbaa !5
  %31 = icmp ne ptr %30, null
  br i1 %31, label %32, label %39

32:                                               ; preds = %27
  %33 = getelementptr inbounds %"class.Riemann::GeometryQuery", ptr %20, i32 0, i32 1
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  %35 = load ptr, ptr %14, align 8, !tbaa !5
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  %37 = load ptr, ptr %11, align 8, !tbaa !5
  %38 = call noundef zeroext i1 @_ZNK7Riemann8AABBTree7RayCastERK4Ray3PPNS_8GeometryEPKNS_13RayCastOptionEPNS_13RayCastResultE(ptr noundef nonnull align 8 dereferenceable(24) %34, ptr noundef nonnull align 4 dereferenceable(24) %12, ptr noundef %35, ptr noundef %36, ptr noundef %37)
  br label %39

39:                                               ; preds = %32, %27
  %40 = phi i1 [ false, %27 ], [ %38, %32 ]
  %41 = zext i1 %40 to i8
  store i8 %41, ptr %13, align 1, !tbaa !9
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = getelementptr inbounds %"struct.Riemann::RayCastOption", ptr %42, i32 0, i32 0
  %44 = load i32, ptr %43, align 8, !tbaa !17
  %45 = icmp eq i32 %44, 1
  br i1 %45, label %46, label %50

46:                                               ; preds = %39
  %47 = load i8, ptr %13, align 1, !tbaa !9, !range !25, !noundef !26
  %48 = trunc i8 %47 to i1
  br i1 %48, label %49, label %50

49:                                               ; preds = %46
  store i1 true, ptr %6, align 1
  store i32 1, ptr %15, align 4
  br label %51

50:                                               ; preds = %46, %39
  store i32 0, ptr %15, align 4
  br label %51

51:                                               ; preds = %50, %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  %52 = load i32, ptr %15, align 4
  switch i32 %52, label %81 [
    i32 0, label %53
  ]

53:                                               ; preds = %51
  br label %54

54:                                               ; preds = %53, %5
  %55 = getelementptr inbounds %"class.Riemann::GeometryQuery", ptr %20, i32 0, i32 2
  %56 = load ptr, ptr %55, align 8, !tbaa !27
  %57 = icmp ne ptr %56, null
  br i1 %57, label %58, label %78

58:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 80, ptr %16) #5
  call void @_ZN7Riemann13RayCastResultC2Ev(ptr noundef nonnull align 8 dereferenceable(76) %16)
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #5
  %59 = getelementptr inbounds %"class.Riemann::GeometryQuery", ptr %20, i32 0, i32 2
  %60 = load ptr, ptr %59, align 8, !tbaa !27
  %61 = load ptr, ptr %10, align 8, !tbaa !5
  %62 = invoke noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree7RayCastERK4Ray3PKNS_13RayCastOptionEPNS_13RayCastResultE(ptr noundef nonnull align 8 dereferenceable(44) %60, ptr noundef nonnull align 4 dereferenceable(24) %12, ptr noundef %61, ptr noundef %16)
          to label %63 unwind label %70

63:                                               ; preds = %58
  %64 = zext i1 %62 to i8
  store i8 %64, ptr %17, align 1, !tbaa !9
  %65 = load i8, ptr %17, align 1, !tbaa !9, !range !25, !noundef !26
  %66 = trunc i8 %65 to i1
  br i1 %66, label %67, label %74

67:                                               ; preds = %63
  %68 = load ptr, ptr %11, align 8, !tbaa !5
  invoke void @_ZN7Riemann13RayCastResult5MergeERKS0_(ptr noundef nonnull align 8 dereferenceable(76) %68, ptr noundef nonnull align 8 dereferenceable(76) %16)
          to label %69 unwind label %70

69:                                               ; preds = %67
  store i1 true, ptr %6, align 1
  store i32 1, ptr %15, align 4
  br label %75

70:                                               ; preds = %67, %58
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %18, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #5
  call void @_ZN7Riemann13RayCastResultD2Ev(ptr noundef nonnull align 8 dereferenceable(76) %16) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #5
  br label %83

74:                                               ; preds = %63
  store i32 0, ptr %15, align 4
  br label %75

75:                                               ; preds = %74, %69
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #5
  call void @_ZN7Riemann13RayCastResultD2Ev(ptr noundef nonnull align 8 dereferenceable(76) %16) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %16) #5
  %76 = load i32, ptr %15, align 4
  switch i32 %76, label %81 [
    i32 0, label %77
  ]

77:                                               ; preds = %75
  br label %78

78:                                               ; preds = %77, %54
  %79 = load i8, ptr %13, align 1, !tbaa !9, !range !25, !noundef !26
  %80 = trunc i8 %79 to i1
  store i1 %80, ptr %6, align 1
  store i32 1, ptr %15, align 4
  br label %81

81:                                               ; preds = %78, %75, %51
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #5
  %82 = load i1, ptr %6, align 1
  ret i1 %82

83:                                               ; preds = %70
  %84 = load ptr, ptr %18, align 8
  %85 = load i32, ptr %19, align 4
  %86 = insertvalue { ptr, i32 } poison, ptr %84, 0
  %87 = insertvalue { ptr, i32 } %86, i32 %85, 1
  resume { ptr, i32 } %87
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann13RayCastResult5ResetEv(ptr noundef nonnull align 8 dereferenceable(76)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Ray3C2ERKN5Maths8TVector3IfEES4_b(ptr noundef nonnull align 4 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), i1 noundef zeroext) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNSt6vectorIPN7Riemann8GeometryESaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

declare noundef zeroext i1 @_ZNK7Riemann8AABBTree7RayCastERK4Ray3PPNS_8GeometryEPKNS_13RayCastOptionEPNS_13RayCastResultE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(24), ptr noundef, ptr noundef, ptr noundef) #3

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

declare noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree7RayCastERK4Ray3PKNS_13RayCastOptionEPNS_13RayCastResultE(ptr noundef nonnull align 8 dereferenceable(44), ptr noundef nonnull align 4 dereferenceable(24), ptr noundef, ptr noundef) #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7Riemann13RayCastResultD2Ev(ptr noundef nonnull align 8 dereferenceable(76)) unnamed_addr #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 = { 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 #5 = { 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 = !{!"bool", !7, i64 0}
!11 = !{!12, !6, i64 24}
!12 = !{!"_ZTSN7Riemann13GeometryQueryE", !13, i64 0, !6, i64 24, !6, i64 32}
!13 = !{!"_ZTSSt6vectorIPN7Riemann8GeometryESaIS2_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIPN7Riemann8GeometryESaIS2_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIPN7Riemann8GeometryESaIS2_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIPN7Riemann8GeometryESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!18, !19, i64 0}
!18 = !{!"_ZTSN7Riemann13RayCastOptionE", !19, i64 0, !20, i64 8, !10, i64 152, !23, i64 156, !22, i64 160, !24, i64 164, !6, i64 184}
!19 = !{!"_ZTSN7Riemann13RayCastOption11RayCastTypeE", !7, i64 0}
!20 = !{!"_ZTSN7Riemann12RayCastCacheE", !6, i64 0, !21, i64 8}
!21 = !{!"_ZTSN7Riemann11StaticStackIjLi32EEE", !22, i64 0, !7, i64 4}
!22 = !{!"int", !7, i64 0}
!23 = !{!"float", !7, i64 0}
!24 = !{!"_ZTSN7Riemann13CollisionDataE", !22, i64 0, !22, i64 4, !22, i64 8, !22, i64 12}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = !{!12, !6, i64 32}


; 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.Ray3 = type { %"class.Maths::TVector3", %"class.Maths::TVector3" }
%"class.Maths::TVector3" = type { float, float, float }
%"struct.Riemann::RayCastResult" = type <{ i8, [3 x i8], float, float, %"class.Maths::TVector3", %"class.Maths::TVector3", [4 x i8], ptr, %"class.std::vector", i32, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Riemann::Geometry *, std::allocator<Riemann::Geometry *>>::_Vector_impl" }
%"struct.std::_Vector_base<Riemann::Geometry *, std::allocator<Riemann::Geometry *>>::_Vector_impl" = type { %"struct.std::_Vector_base<Riemann::Geometry *, std::allocator<Riemann::Geometry *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Riemann::Geometry *, std::allocator<Riemann::Geometry *>>::_Vector_impl_data" = type { ptr, ptr, 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7Riemann13GeometryQuery12RayCastQueryERKN5Maths8TVector3IfEES5_RKNS_13RayCastOptionEPNS_13RayCastResultE(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 8 dereferenceable(192) %3, ptr noundef nonnull %4) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %class.Ray3, align 4
  %7 = alloca %"struct.Riemann::RayCastResult", align 8
  tail call void @_ZN7Riemann13RayCastResult5ResetEv(ptr noundef nonnull align 8 dereferenceable(76) %4)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  call void @_ZN4Ray3C2ERKN5Maths8TVector3IfEES4_b(ptr noundef nonnull align 4 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2, i1 noundef zeroext false)
  %8 = getelementptr inbounds i8, ptr %0, i64 24
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %.not = icmp eq ptr %9, null
  br i1 %.not, label %.critedge, label %10

10:                                               ; preds = %5
  %11 = call noundef ptr @_ZNSt6vectorIPN7Riemann8GeometryESaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  %.not22 = icmp eq ptr %11, null
  br i1 %.not22, label %.critedge, label %12

12:                                               ; preds = %10
  %13 = load ptr, ptr %8, align 8, !tbaa !5
  %14 = call noundef zeroext i1 @_ZNK7Riemann8AABBTree7RayCastERK4Ray3PPNS_8GeometryEPKNS_13RayCastOptionEPNS_13RayCastResultE(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 4 dereferenceable(24) %6, ptr noundef nonnull %11, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %15 = load i32, ptr %3, align 8, !tbaa !14
  %16 = icmp eq i32 %15, 1
  %brmerge.not = and i1 %14, %16
  br i1 %brmerge.not, label %27, label %.critedge

.critedge:                                        ; preds = %10, %12, %5
  %.019 = phi i1 [ false, %5 ], [ %14, %12 ], [ false, %10 ]
  %17 = getelementptr inbounds i8, ptr %0, i64 32
  %18 = load ptr, ptr %17, align 8, !tbaa !23
  %.not23 = icmp eq ptr %18, null
  br i1 %.not23, label %27, label %19

19:                                               ; preds = %.critedge
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %7) #5
  call void @_ZN7Riemann13RayCastResultC2Ev(ptr noundef nonnull align 8 dereferenceable(76) %7)
  %20 = load ptr, ptr %17, align 8, !tbaa !23
  %21 = invoke noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree7RayCastERK4Ray3PKNS_13RayCastOptionEPNS_13RayCastResultE(ptr noundef nonnull align 8 dereferenceable(44) %20, ptr noundef nonnull align 4 dereferenceable(24) %6, ptr noundef nonnull %3, ptr noundef nonnull %7)
          to label %22 unwind label %24

22:                                               ; preds = %19
  br i1 %21, label %23, label %.critedge27

23:                                               ; preds = %22
  invoke void @_ZN7Riemann13RayCastResult5MergeERKS0_(ptr noundef nonnull align 8 dereferenceable(76) %4, ptr noundef nonnull align 8 dereferenceable(76) %7)
          to label %26 unwind label %24

24:                                               ; preds = %23, %19
  %25 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7Riemann13RayCastResultD2Ev(ptr noundef nonnull align 8 dereferenceable(76) %7) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  resume { ptr, i32 } %25

26:                                               ; preds = %23
  call void @_ZN7Riemann13RayCastResultD2Ev(ptr noundef nonnull align 8 dereferenceable(76) %7) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %7) #5
  br label %27

.critedge27:                                      ; preds = %22
  call void @_ZN7Riemann13RayCastResultD2Ev(ptr noundef nonnull align 8 dereferenceable(76) %7) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %7) #5
  br label %27

27:                                               ; preds = %.critedge, %.critedge27, %26, %12
  %.3 = phi i1 [ true, %26 ], [ true, %12 ], [ %.019, %.critedge27 ], [ %.019, %.critedge ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  ret i1 %.3
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann13RayCastResult5ResetEv(ptr noundef nonnull align 8 dereferenceable(76)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Ray3C2ERKN5Maths8TVector3IfEES4_b(ptr noundef nonnull align 4 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), i1 noundef zeroext) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNSt6vectorIPN7Riemann8GeometryESaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

declare noundef zeroext i1 @_ZNK7Riemann8AABBTree7RayCastERK4Ray3PPNS_8GeometryEPKNS_13RayCastOptionEPNS_13RayCastResultE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(24), ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

declare noundef zeroext i1 @_ZNK7Riemann15DynamicAABBTree7RayCastERK4Ray3PKNS_13RayCastOptionEPNS_13RayCastResultE(ptr noundef nonnull align 8 dereferenceable(44), ptr noundef nonnull align 4 dereferenceable(24), ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Riemann13RayCastResult5MergeERKS0_(ptr noundef nonnull align 8 dereferenceable(76), ptr noundef nonnull align 8 dereferenceable(76)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7Riemann13RayCastResultD2Ev(ptr noundef nonnull align 8 dereferenceable(76)) unnamed_addr #4 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 = { 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 #5 = { 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, !11, i64 24}
!6 = !{!"_ZTSN7Riemann13GeometryQueryE", !7, i64 0, !11, i64 24, !11, i64 32}
!7 = !{!"_ZTSSt6vectorIPN7Riemann8GeometryESaIS2_EE", !8, i64 0}
!8 = !{!"_ZTSSt12_Vector_baseIPN7Riemann8GeometryESaIS2_EE", !9, i64 0}
!9 = !{!"_ZTSNSt12_Vector_baseIPN7Riemann8GeometryESaIS2_EE12_Vector_implE", !10, i64 0}
!10 = !{!"_ZTSNSt12_Vector_baseIPN7Riemann8GeometryESaIS2_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!15, !16, i64 0}
!15 = !{!"_ZTSN7Riemann13RayCastOptionE", !16, i64 0, !17, i64 8, !20, i64 152, !21, i64 156, !19, i64 160, !22, i64 164, !11, i64 184}
!16 = !{!"_ZTSN7Riemann13RayCastOption11RayCastTypeE", !12, i64 0}
!17 = !{!"_ZTSN7Riemann12RayCastCacheE", !11, i64 0, !18, i64 8}
!18 = !{!"_ZTSN7Riemann11StaticStackIjLi32EEE", !19, i64 0, !12, i64 4}
!19 = !{!"int", !12, i64 0}
!20 = !{!"bool", !12, i64 0}
!21 = !{!"float", !12, i64 0}
!22 = !{!"_ZTSN7Riemann13CollisionDataE", !19, i64 0, !19, i64 4, !19, i64 8, !19, i64 12}
!23 = !{!6, !11, i64 32}


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