; LLVM IR from Razakhel/RaZ :: src/RaZ/Data (BoundingVolumeHierarchy)

; 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"

%"struct.Raz::RayHit" = type { %"class.Raz::Vector", %"class.Raz::Vector", float }
%"class.Raz::Vector" = type { %"struct.std::array" }
%"struct.std::array" = type { [3 x float] }
%"class.Raz::BoundingVolumeHierarchyNode" = type { %"class.Raz::AABB", %"class.std::unique_ptr", %"class.std::unique_ptr", %"struct.Raz::BoundingVolumeHierarchyNode::TriangleInfo" }
%"class.Raz::AABB" = type { %"class.Raz::Shape", %"class.Raz::Vector", %"class.Raz::Vector" }
%"class.Raz::Shape" = type { ptr }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.1" }
%"struct.std::_Head_base.1" = type { ptr }
%"struct.Raz::BoundingVolumeHierarchyNode::TriangleInfo" = type { %"class.Raz::Triangle", ptr }
%"class.Raz::Triangle" = type <{ %"class.Raz::Shape", %"class.Raz::Vector", %"class.Raz::Vector", %"class.Raz::Vector", [4 x i8] }>

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZNK3Raz27BoundingVolumeHierarchyNode5queryERKNS_3RayEPNS_6RayHitE(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull align 4 dereferenceable(36) %1, ptr noundef %2) #0 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"struct.Raz::RayHit", align 4
  %9 = alloca %"struct.Raz::RayHit", align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i8, align 1
  %13 = 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
  %14 = load ptr, ptr %5, align 8
  %15 = call noundef zeroext i1 @_ZNK3Raz27BoundingVolumeHierarchyNode6isLeafEv(ptr noundef nonnull align 8 dereferenceable(104) %14) #6
  br i1 %15, label %16, label %27

16:                                               ; preds = %3
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %14, i32 0, i32 3
  %19 = getelementptr inbounds %"struct.Raz::BoundingVolumeHierarchyNode::TriangleInfo", ptr %18, i32 0, i32 0
  %20 = load ptr, ptr %7, align 8, !tbaa !5
  %21 = call noundef zeroext i1 @_ZNK3Raz3Ray10intersectsERKNS_8TriangleEPNS_6RayHitE(ptr noundef nonnull align 4 dereferenceable(36) %17, ptr noundef nonnull align 8 dereferenceable(48) %19, ptr noundef %20)
  br i1 %21, label %22, label %26

22:                                               ; preds = %16
  %23 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %14, i32 0, i32 3
  %24 = getelementptr inbounds %"struct.Raz::BoundingVolumeHierarchyNode::TriangleInfo", ptr %23, i32 0, i32 1
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  store ptr %25, ptr %4, align 8
  br label %94

26:                                               ; preds = %16
  store ptr null, ptr %4, align 8
  br label %94

27:                                               ; preds = %3
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %14, i32 0, i32 0
  %30 = call noundef zeroext i1 @_ZNK3Raz3Ray10intersectsERKNS_4AABBEPNS_6RayHitE(ptr noundef nonnull align 4 dereferenceable(36) %28, ptr noundef nonnull align 8 dereferenceable(32) %29, ptr noundef null)
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  store ptr null, ptr %4, align 8
  br label %94

32:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 28, ptr %8) #6
  call void @_ZN3Raz6RayHitC2Ev(ptr noundef nonnull align 4 dereferenceable(28) %8) #6
  call void @llvm.lifetime.start.p0(i64 28, ptr %9) #6
  call void @_ZN3Raz6RayHitC2Ev(ptr noundef nonnull align 4 dereferenceable(28) %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %33 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %14, i32 0, i32 1
  %34 = call noundef zeroext i1 @_ZStneIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EEbRKSt10unique_ptrIT_T0_EDn(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr null) #6
  br i1 %34, label %35, label %40

35:                                               ; preds = %32
  %36 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %14, i32 0, i32 1
  %37 = call noundef ptr @_ZNKSt10unique_ptrIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %36) #6
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = call noundef ptr @_ZNK3Raz27BoundingVolumeHierarchyNode5queryERKNS_3RayEPNS_6RayHitE(ptr noundef nonnull align 8 dereferenceable(104) %37, ptr noundef nonnull align 4 dereferenceable(36) %38, ptr noundef %8)
  br label %41

40:                                               ; preds = %32
  br label %41

41:                                               ; preds = %40, %35
  %42 = phi ptr [ %39, %35 ], [ null, %40 ]
  store ptr %42, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %43 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %14, i32 0, i32 2
  %44 = call noundef zeroext i1 @_ZStneIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EEbRKSt10unique_ptrIT_T0_EDn(ptr noundef nonnull align 8 dereferenceable(8) %43, ptr null) #6
  br i1 %44, label %45, label %50

45:                                               ; preds = %41
  %46 = getelementptr inbounds %"class.Raz::BoundingVolumeHierarchyNode", ptr %14, i32 0, i32 2
  %47 = call noundef ptr @_ZNKSt10unique_ptrIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %46) #6
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = call noundef ptr @_ZNK3Raz27BoundingVolumeHierarchyNode5queryERKNS_3RayEPNS_6RayHitE(ptr noundef nonnull align 8 dereferenceable(104) %47, ptr noundef nonnull align 4 dereferenceable(36) %48, ptr noundef %9)
  br label %51

50:                                               ; preds = %41
  br label %51

51:                                               ; preds = %50, %45
  %52 = phi ptr [ %49, %45 ], [ null, %50 ]
  store ptr %52, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #6
  %53 = getelementptr inbounds %"struct.Raz::RayHit", ptr %8, i32 0, i32 2
  %54 = load float, ptr %53, align 4, !tbaa !23
  %55 = getelementptr inbounds %"struct.Raz::RayHit", ptr %9, i32 0, i32 2
  %56 = load float, ptr %55, align 4, !tbaa !23
  %57 = fcmp olt float %54, %56
  %58 = zext i1 %57 to i8
  store i8 %58, ptr %12, align 1, !tbaa !26
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = icmp ne ptr %59, null
  br i1 %60, label %61, label %69

61:                                               ; preds = %51
  %62 = load i8, ptr %12, align 1, !tbaa !26, !range !28, !noundef !29
  %63 = trunc i8 %62 to i1
  br i1 %63, label %64, label %65

64:                                               ; preds = %61
  br label %66

65:                                               ; preds = %61
  br label %66

66:                                               ; preds = %65, %64
  %67 = phi ptr [ %8, %64 ], [ %9, %65 ]
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %68, ptr align 4 %67, i64 28, i1 false), !tbaa.struct !30
  br label %69

69:                                               ; preds = %66, %51
  %70 = load ptr, ptr %10, align 8, !tbaa !5
  %71 = icmp ne ptr %70, null
  br i1 %71, label %72, label %84

72:                                               ; preds = %69
  %73 = load ptr, ptr %11, align 8, !tbaa !5
  %74 = icmp ne ptr %73, null
  br i1 %74, label %75, label %84

75:                                               ; preds = %72
  %76 = load i8, ptr %12, align 1, !tbaa !26, !range !28, !noundef !29
  %77 = trunc i8 %76 to i1
  br i1 %77, label %78, label %80

78:                                               ; preds = %75
  %79 = load ptr, ptr %10, align 8, !tbaa !5
  br label %82

80:                                               ; preds = %75
  %81 = load ptr, ptr %11, align 8, !tbaa !5
  br label %82

82:                                               ; preds = %80, %78
  %83 = phi ptr [ %79, %78 ], [ %81, %80 ]
  store ptr %83, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %93

84:                                               ; preds = %72, %69
  %85 = load ptr, ptr %10, align 8, !tbaa !5
  %86 = icmp ne ptr %85, null
  br i1 %86, label %87, label %89

87:                                               ; preds = %84
  %88 = load ptr, ptr %10, align 8, !tbaa !5
  br label %91

89:                                               ; preds = %84
  %90 = load ptr, ptr %11, align 8, !tbaa !5
  br label %91

91:                                               ; preds = %89, %87
  %92 = phi ptr [ %88, %87 ], [ %90, %89 ]
  store ptr %92, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %93

93:                                               ; preds = %91, %82
  call void @llvm.lifetime.end.p0(i64 1, 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 28, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 28, ptr %8) #6
  br label %94

94:                                               ; preds = %93, %31, %26, %22
  %95 = load ptr, ptr %4, align 8
  ret ptr %95
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3Raz27BoundingVolumeHierarchyNode6isLeafEv(ptr noundef nonnull align 8 dereferenceable(104)) #1 align 2

declare noundef zeroext i1 @_ZNK3Raz3Ray10intersectsERKNS_8TriangleEPNS_6RayHitE(ptr noundef nonnull align 4 dereferenceable(36), ptr noundef nonnull align 8 dereferenceable(48), ptr noundef) #2

declare noundef zeroext i1 @_ZNK3Raz3Ray10intersectsERKNS_4AABBEPNS_6RayHitE(ptr noundef nonnull align 4 dereferenceable(36), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EEbRKSt10unique_ptrIT_T0_EDn(ptr noundef nonnull align 8 dereferenceable(8), ptr) #4

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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

attributes #0 = { 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 #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 = { "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 willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !6, i64 96}
!10 = !{!"_ZTSN3Raz27BoundingVolumeHierarchyNodeE", !11, i64 0, !15, i64 32, !15, i64 40, !21, i64 48}
!11 = !{!"_ZTSN3Raz4AABBE", !12, i64 0, !13, i64 8, !13, i64 20}
!12 = !{!"_ZTSN3Raz5ShapeE"}
!13 = !{!"_ZTSN3Raz6VectorIfLm3EEE", !14, i64 0}
!14 = !{!"_ZTSSt5arrayIfLm3EE", !7, i64 0}
!15 = !{!"_ZTSSt10unique_ptrIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EE", !16, i64 0}
!16 = !{!"_ZTSSt15__uniq_ptr_dataIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_ELb1ELb1EE", !17, i64 0}
!17 = !{!"_ZTSSt15__uniq_ptr_implIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EE", !18, i64 0}
!18 = !{!"_ZTSSt5tupleIJPN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EEE", !19, i64 0}
!19 = !{!"_ZTSSt11_Tuple_implILm0EJPN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EEE", !20, i64 0}
!20 = !{!"_ZTSSt10_Head_baseILm0EPN3Raz27BoundingVolumeHierarchyNodeELb0EE", !6, i64 0}
!21 = !{!"_ZTSN3Raz27BoundingVolumeHierarchyNode12TriangleInfoE", !22, i64 0, !6, i64 48}
!22 = !{!"_ZTSN3Raz8TriangleE", !12, i64 0, !13, i64 8, !13, i64 20, !13, i64 32}
!23 = !{!24, !25, i64 24}
!24 = !{!"_ZTSN3Raz6RayHitE", !13, i64 0, !13, i64 12, !25, i64 24}
!25 = !{!"float", !7, i64 0}
!26 = !{!27, !27, i64 0}
!27 = !{!"bool", !7, i64 0}
!28 = !{i8 0, i8 2}
!29 = !{}
!30 = !{i64 0, i64 12, !31, i64 12, i64 12, !31, i64 24, i64 4, !32}
!31 = !{!7, !7, i64 0}
!32 = !{!25, !25, 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"

%"struct.Raz::RayHit" = type { %"class.Raz::Vector", %"class.Raz::Vector", float }
%"class.Raz::Vector" = type { %"struct.std::array" }
%"struct.std::array" = type { [3 x float] }

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZNK3Raz27BoundingVolumeHierarchyNode5queryERKNS_3RayEPNS_6RayHitE(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull align 4 dereferenceable(36) %1, ptr noundef %2) local_unnamed_addr #0 align 2 {
  %4 = alloca %"struct.Raz::RayHit", align 4
  %5 = alloca %"struct.Raz::RayHit", align 4
  %6 = tail call noundef zeroext i1 @_ZNK3Raz27BoundingVolumeHierarchyNode6isLeafEv(ptr noundef nonnull align 8 dereferenceable(104) %0) #6
  br i1 %6, label %7, label %13

7:                                                ; preds = %3
  %8 = getelementptr inbounds i8, ptr %0, i64 48
  %9 = tail call noundef zeroext i1 @_ZNK3Raz3Ray10intersectsERKNS_8TriangleEPNS_6RayHitE(ptr noundef nonnull align 4 dereferenceable(36) %1, ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef %2)
  br i1 %9, label %10, label %39

10:                                               ; preds = %7
  %11 = getelementptr inbounds i8, ptr %0, i64 96
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  br label %39

13:                                               ; preds = %3
  %14 = tail call noundef zeroext i1 @_ZNK3Raz3Ray10intersectsERKNS_4AABBEPNS_6RayHitE(ptr noundef nonnull align 4 dereferenceable(36) %1, ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef null)
  br i1 %14, label %15, label %39

15:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %4) #6
  call void @_ZN3Raz6RayHitC2Ev(ptr noundef nonnull align 4 dereferenceable(28) %4) #6
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %5) #6
  call void @_ZN3Raz6RayHitC2Ev(ptr noundef nonnull align 4 dereferenceable(28) %5) #6
  %16 = getelementptr inbounds i8, ptr %0, i64 32
  %17 = call noundef zeroext i1 @_ZStneIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EEbRKSt10unique_ptrIT_T0_EDn(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr null) #6
  br i1 %17, label %18, label %21

18:                                               ; preds = %15
  %19 = call noundef ptr @_ZNKSt10unique_ptrIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #6
  %20 = call noundef ptr @_ZNK3Raz27BoundingVolumeHierarchyNode5queryERKNS_3RayEPNS_6RayHitE(ptr noundef nonnull align 8 dereferenceable(104) %19, ptr noundef nonnull align 4 dereferenceable(36) %1, ptr noundef nonnull %4)
  br label %21

21:                                               ; preds = %15, %18
  %22 = phi ptr [ %20, %18 ], [ null, %15 ]
  %23 = getelementptr inbounds i8, ptr %0, i64 40
  %24 = call noundef zeroext i1 @_ZStneIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EEbRKSt10unique_ptrIT_T0_EDn(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr null) #6
  br i1 %24, label %25, label %28

25:                                               ; preds = %21
  %26 = call noundef ptr @_ZNKSt10unique_ptrIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %23) #6
  %27 = call noundef ptr @_ZNK3Raz27BoundingVolumeHierarchyNode5queryERKNS_3RayEPNS_6RayHitE(ptr noundef nonnull align 8 dereferenceable(104) %26, ptr noundef nonnull align 4 dereferenceable(36) %1, ptr noundef nonnull %5)
  br label %28

28:                                               ; preds = %21, %25
  %29 = phi ptr [ %27, %25 ], [ null, %21 ]
  %30 = getelementptr inbounds i8, ptr %4, i64 24
  %31 = load float, ptr %30, align 4, !tbaa !22
  %32 = getelementptr inbounds i8, ptr %5, i64 24
  %33 = load float, ptr %32, align 4, !tbaa !22
  %34 = fcmp olt float %31, %33
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %36, label %35

35:                                               ; preds = %28
  %. = select i1 %34, ptr %4, ptr %5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %2, ptr noundef nonnull align 4 dereferenceable(28) %., i64 28, i1 false), !tbaa.struct !25
  br label %36

36:                                               ; preds = %35, %28
  %.not22 = icmp eq ptr %22, null
  %.not21 = icmp eq ptr %29, null
  %37 = select i1 %.not21, i1 true, i1 %34
  %38 = select i1 %37, ptr %22, ptr %29
  %.0 = select i1 %.not22, ptr %29, ptr %38
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %4) #6
  br label %39

39:                                               ; preds = %13, %7, %36, %10
  %.1 = phi ptr [ %12, %10 ], [ %.0, %36 ], [ null, %7 ], [ null, %13 ]
  ret ptr %.1
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3Raz27BoundingVolumeHierarchyNode6isLeafEv(ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZNK3Raz3Ray10intersectsERKNS_8TriangleEPNS_6RayHitE(ptr noundef nonnull align 4 dereferenceable(36), ptr noundef nonnull align 8 dereferenceable(48), ptr noundef) local_unnamed_addr #2

declare noundef zeroext i1 @_ZNK3Raz3Ray10intersectsERKNS_4AABBEPNS_6RayHitE(ptr noundef nonnull align 4 dereferenceable(36), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EEbRKSt10unique_ptrIT_T0_EDn(ptr noundef nonnull align 8 dereferenceable(8), ptr) local_unnamed_addr #4

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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

attributes #0 = { 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 #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 = { "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 willreturn memory(argmem: readwrite) }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !19, i64 96}
!6 = !{!"_ZTSN3Raz27BoundingVolumeHierarchyNodeE", !7, i64 0, !13, i64 32, !13, i64 40, !20, i64 48}
!7 = !{!"_ZTSN3Raz4AABBE", !8, i64 0, !9, i64 8, !9, i64 20}
!8 = !{!"_ZTSN3Raz5ShapeE"}
!9 = !{!"_ZTSN3Raz6VectorIfLm3EEE", !10, i64 0}
!10 = !{!"_ZTSSt5arrayIfLm3EE", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!"_ZTSSt10unique_ptrIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EE", !14, i64 0}
!14 = !{!"_ZTSSt15__uniq_ptr_dataIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_ELb1ELb1EE", !15, i64 0}
!15 = !{!"_ZTSSt15__uniq_ptr_implIN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EE", !16, i64 0}
!16 = !{!"_ZTSSt5tupleIJPN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EEE", !17, i64 0}
!17 = !{!"_ZTSSt11_Tuple_implILm0EJPN3Raz27BoundingVolumeHierarchyNodeESt14default_deleteIS1_EEE", !18, i64 0}
!18 = !{!"_ZTSSt10_Head_baseILm0EPN3Raz27BoundingVolumeHierarchyNodeELb0EE", !19, i64 0}
!19 = !{!"any pointer", !11, i64 0}
!20 = !{!"_ZTSN3Raz27BoundingVolumeHierarchyNode12TriangleInfoE", !21, i64 0, !19, i64 48}
!21 = !{!"_ZTSN3Raz8TriangleE", !8, i64 0, !9, i64 8, !9, i64 20, !9, i64 32}
!22 = !{!23, !24, i64 24}
!23 = !{!"_ZTSN3Raz6RayHitE", !9, i64 0, !9, i64 12, !24, i64 24}
!24 = !{!"float", !11, i64 0}
!25 = !{i64 0, i64 12, !26, i64 12, i64 12, !26, i64 24, i64 4, !27}
!26 = !{!11, !11, i64 0}
!27 = !{!24, !24, i64 0}


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