; LLVM IR from jrouwe/JoltPhysics :: Jolt/Physics/Collision/Shape (BoxShape)

; 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.JPH::Vec3" = type { %union.anon.3 }
%union.anon.3 = type { <4 x float> }
%"class.JPH::RayInvDirection" = type { %"class.JPH::Vec3", %"class.JPH::UVec4" }
%"class.JPH::UVec4" = type { %union.anon.7 }
%union.anon.7 = type { <2 x i64> }
%"class.JPH::RayCastResult" = type { %"class.JPH::BroadPhaseCastResult", %"class.JPH::SubShapeID" }
%"class.JPH::BroadPhaseCastResult" = type { %"class.JPH::BodyID", float }
%"class.JPH::BodyID" = type { i32 }
%"class.JPH::SubShapeID" = type { i32 }
%"struct.JPH::RayCastT" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"class.JPH::BoxShape" = type <{ %"class.JPH::ConvexShape.base", [4 x i8], %"class.JPH::Vec3", float, [12 x i8] }>
%"class.JPH::ConvexShape.base" = type <{ %"class.JPH::Shape.base", [6 x i8], %"class.JPH::RefConst", float }>
%"class.JPH::Shape.base" = type <{ ptr, %"class.JPH::RefTarget.4", [4 x i8], i64, i8, i8 }>
%"class.JPH::RefTarget.4" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::RefConst" = type { ptr }
%"class.JPH::RayCastSettings" = type { i8, i8, i8 }

; 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: 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) #1

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3ngEv(ptr noundef nonnull align 16 dereferenceable(16)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH15RayInvDirectionC2ENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(32), double, double) unnamed_addr #4 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH8BoxShape7CastRayERKNS_7RayCastERKNS_15RayCastSettingsERKNS_17SubShapeIDCreatorERNS_18CollisionCollectorINS_13RayCastResultENS_31CollisionCollectorTraitsCastRayEEERKNS_11ShapeFilterE(ptr noundef nonnull align 16 dereferenceable(80) %0, ptr noundef nonnull align 16 dereferenceable(32) %1, ptr noundef nonnull align 1 dereferenceable(3) %2, ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(12) %5) unnamed_addr #6 align 2 {
  %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 ptr, align 8
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca %"class.JPH::Vec3", align 16
  %16 = alloca %"class.JPH::RayInvDirection", align 16
  %17 = alloca %"class.JPH::Vec3", align 16
  %18 = alloca %"class.JPH::Vec3", align 16
  %19 = alloca %"class.JPH::Vec3", align 16
  %20 = alloca %"class.JPH::RayCastResult", align 4
  %21 = alloca %"class.JPH::BodyID", align 4
  %22 = alloca float, 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
  store ptr %5, ptr %12, align 8, !tbaa !5
  %23 = load ptr, ptr %7, align 8
  %24 = load ptr, ptr %12, align 8, !tbaa !5
  %25 = load ptr, ptr %10, align 8, !tbaa !5
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH17SubShapeIDCreator5GetIDEv(ptr noundef nonnull align 4 dereferenceable(8) %25)
  %27 = load ptr, ptr %24, align 8, !tbaa !9
  %28 = getelementptr inbounds ptr, ptr %27, i64 2
  %29 = load ptr, ptr %28, align 8
  %30 = call noundef zeroext i1 %29(ptr noundef nonnull align 8 dereferenceable(12) %24, ptr noundef %23, ptr noundef nonnull align 4 dereferenceable(4) %26)
  br i1 %30, label %32, label %31

31:                                               ; preds = %6
  br label %116

32:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = getelementptr inbounds %"struct.JPH::RayCastT", ptr %33, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %15, ptr align 16 %34, i64 16, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #8
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = getelementptr inbounds %"struct.JPH::RayCastT", ptr %35, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %17, ptr align 16 %36, i64 16, i1 false), !tbaa.struct !11
  %37 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 0
  %38 = load double, ptr %37, align 16
  %39 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 1
  %40 = load double, ptr %39, align 8
  call void @_ZN3JPH15RayInvDirectionC2ENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(32) %16, double %38, double %40)
  %41 = getelementptr inbounds %"class.JPH::BoxShape", ptr %23, i32 0, i32 2
  %42 = call { double, double } @_ZNK3JPH4Vec3ngEv(ptr noundef nonnull align 16 dereferenceable(16) %41)
  %43 = getelementptr inbounds %"class.JPH::Vec3", ptr %18, i32 0, i32 0
  %44 = getelementptr inbounds %union.anon.3, ptr %43, i32 0, i32 0
  %45 = getelementptr inbounds { double, double }, ptr %44, i32 0, i32 0
  %46 = extractvalue { double, double } %42, 0
  store double %46, ptr %45, align 16
  %47 = getelementptr inbounds { double, double }, ptr %44, i32 0, i32 1
  %48 = extractvalue { double, double } %42, 1
  store double %48, ptr %47, align 8
  %49 = getelementptr inbounds %"class.JPH::BoxShape", ptr %23, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %19, ptr align 16 %49, i64 16, i1 false), !tbaa.struct !11
  %50 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 0
  %51 = load double, ptr %50, align 16
  %52 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 1
  %53 = load double, ptr %52, align 8
  %54 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %55 = load double, ptr %54, align 16
  %56 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %57 = load double, ptr %56, align 8
  %58 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %59 = load double, ptr %58, align 16
  %60 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  %61 = load double, ptr %60, align 8
  call void @_ZN3JPH8RayAABoxENS_4Vec3ERKNS_15RayInvDirectionES0_S0_RfS4_(double %51, double %53, ptr noundef nonnull align 16 dereferenceable(32) %16, double %55, double %57, double %59, double %61, ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #8
  %62 = load float, ptr %13, align 4, !tbaa !13
  %63 = load float, ptr %14, align 4, !tbaa !13
  %64 = fcmp ole float %62, %63
  br i1 %64, label %65, label %115

65:                                               ; preds = %32
  %66 = load float, ptr %14, align 4, !tbaa !13
  %67 = fcmp oge float %66, 0.000000e+00
  br i1 %67, label %68, label %115

68:                                               ; preds = %65
  %69 = load float, ptr %13, align 4, !tbaa !13
  %70 = load ptr, ptr %11, align 8, !tbaa !5
  %71 = call noundef float @_ZNK3JPH18CollisionCollectorINS_13RayCastResultENS_31CollisionCollectorTraitsCastRayEE19GetEarlyOutFractionEv(ptr noundef nonnull align 8 dereferenceable(24) %70)
  %72 = fcmp olt float %69, %71
  br i1 %72, label %73, label %115

73:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 12, ptr %20) #8
  call void @_ZN3JPH13RayCastResultC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %20)
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  %74 = load ptr, ptr %11, align 8, !tbaa !5
  %75 = call noundef ptr @_ZNK3JPH18CollisionCollectorINS_13RayCastResultENS_31CollisionCollectorTraitsCastRayEE10GetContextEv(ptr noundef nonnull align 8 dereferenceable(24) %74)
  %76 = call i32 @_ZN3JPH16TransformedShape10sGetBodyIDEPKS0_(ptr noundef %75)
  %77 = getelementptr inbounds %"class.JPH::BodyID", ptr %21, i32 0, i32 0
  store i32 %76, ptr %77, align 4
  %78 = getelementptr inbounds %"class.JPH::BroadPhaseCastResult", ptr %20, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %78, ptr align 4 %21, i64 4, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  %79 = load ptr, ptr %10, align 8, !tbaa !5
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH17SubShapeIDCreator5GetIDEv(ptr noundef nonnull align 4 dereferenceable(8) %79)
  %81 = getelementptr inbounds %"class.JPH::RayCastResult", ptr %20, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %81, ptr align 4 %80, i64 4, i1 false), !tbaa.struct !15
  %82 = load ptr, ptr %9, align 8, !tbaa !5
  %83 = getelementptr inbounds %"class.JPH::RayCastSettings", ptr %82, i32 0, i32 2
  %84 = load i8, ptr %83, align 1, !tbaa !18, !range !22, !noundef !23
  %85 = trunc i8 %84 to i1
  br i1 %85, label %89, label %86

86:                                               ; preds = %73
  %87 = load float, ptr %13, align 4, !tbaa !13
  %88 = fcmp ogt float %87, 0.000000e+00
  br i1 %88, label %89, label %97

89:                                               ; preds = %86, %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  store float 0.000000e+00, ptr %22, align 4, !tbaa !13
  %90 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %22, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %91 = load float, ptr %90, align 4, !tbaa !13
  %92 = getelementptr inbounds %"class.JPH::BroadPhaseCastResult", ptr %20, i32 0, i32 1
  store float %91, ptr %92, align 4, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  %93 = load ptr, ptr %11, align 8, !tbaa !5
  %94 = load ptr, ptr %93, align 8, !tbaa !9
  %95 = getelementptr inbounds ptr, ptr %94, i64 6
  %96 = load ptr, ptr %95, align 8
  call void %96(ptr noundef nonnull align 8 dereferenceable(24) %93, ptr noundef nonnull align 4 dereferenceable(12) %20)
  br label %97

97:                                               ; preds = %89, %86
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = getelementptr inbounds %"class.JPH::RayCastSettings", ptr %98, i32 0, i32 1
  %100 = load i8, ptr %99, align 1, !tbaa !27
  %101 = icmp eq i8 %100, 1
  br i1 %101, label %102, label %114

102:                                              ; preds = %97
  %103 = load float, ptr %14, align 4, !tbaa !13
  %104 = load ptr, ptr %11, align 8, !tbaa !5
  %105 = call noundef float @_ZNK3JPH18CollisionCollectorINS_13RayCastResultENS_31CollisionCollectorTraitsCastRayEE19GetEarlyOutFractionEv(ptr noundef nonnull align 8 dereferenceable(24) %104)
  %106 = fcmp olt float %103, %105
  br i1 %106, label %107, label %114

107:                                              ; preds = %102
  %108 = load float, ptr %14, align 4, !tbaa !13
  %109 = getelementptr inbounds %"class.JPH::BroadPhaseCastResult", ptr %20, i32 0, i32 1
  store float %108, ptr %109, align 4, !tbaa !24
  %110 = load ptr, ptr %11, align 8, !tbaa !5
  %111 = load ptr, ptr %110, align 8, !tbaa !9
  %112 = getelementptr inbounds ptr, ptr %111, i64 6
  %113 = load ptr, ptr %112, align 8
  call void %113(ptr noundef nonnull align 8 dereferenceable(24) %110, ptr noundef nonnull align 4 dereferenceable(12) %20)
  br label %114

114:                                              ; preds = %107, %102, %97
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #8
  br label %115

115:                                              ; preds = %114, %68, %65, %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %116

116:                                              ; preds = %115, %31
  ret void
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3JPH8RayAABoxENS_4Vec3ERKNS_15RayInvDirectionES0_S0_RfS4_(double, double, ptr noundef nonnull align 16 dereferenceable(32), double, double, double, double, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #7

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i32 @_ZN3JPH16TransformedShape10sGetBodyIDEPKS0_(ptr noundef) #4 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 = { 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 #4 = { 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 #5 = { 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 = { 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 #7 = { alwaysinline 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 #8 = { 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{i64 0, i64 16, !12}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{i64 0, i64 4, !16}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!19, !21, i64 2}
!19 = !{!"_ZTSN3JPH15RayCastSettingsE", !20, i64 0, !20, i64 1, !21, i64 2}
!20 = !{!"_ZTSN3JPH13EBackFaceModeE", !7, i64 0}
!21 = !{!"bool", !7, i64 0}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = !{!25, !14, i64 4}
!25 = !{!"_ZTSN3JPH20BroadPhaseCastResultE", !26, i64 0, !14, i64 4}
!26 = !{!"_ZTSN3JPH6BodyIDE", !17, i64 0}
!27 = !{!19, !20, i64 1}


; 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.JPH::RayInvDirection" = type { %"class.JPH::Vec3", %"class.JPH::UVec4" }
%"class.JPH::Vec3" = type { %union.anon.3 }
%union.anon.3 = type { <4 x float> }
%"class.JPH::UVec4" = type { %union.anon.7 }
%union.anon.7 = type { <2 x i64> }
%"class.JPH::RayCastResult" = type { %"class.JPH::BroadPhaseCastResult", %"class.JPH::SubShapeID" }
%"class.JPH::BroadPhaseCastResult" = type { %"class.JPH::BodyID", float }
%"class.JPH::BodyID" = type { i32 }
%"class.JPH::SubShapeID" = type { i32 }

; 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: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3ngEv(ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH15RayInvDirectionC2ENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(32), double, double) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH8BoxShape7CastRayERKNS_7RayCastERKNS_15RayCastSettingsERKNS_17SubShapeIDCreatorERNS_18CollisionCollectorINS_13RayCastResultENS_31CollisionCollectorTraitsCastRayEEERKNS_11ShapeFilterE(ptr noundef nonnull align 16 dereferenceable(80) %0, ptr nocapture noundef nonnull readonly align 16 dereferenceable(32) %1, ptr nocapture noundef nonnull readonly align 1 dereferenceable(3) %2, ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(12) %5) unnamed_addr #5 align 2 {
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca %"class.JPH::RayInvDirection", align 16
  %10 = alloca %"class.JPH::RayCastResult", align 4
  %11 = alloca float, align 4
  %12 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH17SubShapeIDCreator5GetIDEv(ptr noundef nonnull align 4 dereferenceable(8) %3)
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %13, i64 16
  %15 = load ptr, ptr %14, align 8
  %16 = tail call noundef zeroext i1 %15(ptr noundef nonnull align 8 dereferenceable(12) %5, ptr noundef nonnull %0, ptr noundef nonnull align 4 dereferenceable(4) %12)
  br i1 %16, label %17, label %64

17:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  %.sroa.09.0.copyload = load double, ptr %1, align 16
  %.sroa.210.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 8
  %.sroa.210.0.copyload = load double, ptr %.sroa.210.0..sroa_idx, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #7
  %18 = getelementptr inbounds i8, ptr %1, i64 16
  %.sroa.07.0.copyload = load double, ptr %18, align 16
  %.sroa.28.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 24
  %.sroa.28.0.copyload = load double, ptr %.sroa.28.0..sroa_idx, align 8, !tbaa !8
  call void @_ZN3JPH15RayInvDirectionC2ENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(32) %9, double %.sroa.07.0.copyload, double %.sroa.28.0.copyload)
  %19 = getelementptr inbounds i8, ptr %0, i64 48
  %20 = call { double, double } @_ZNK3JPH4Vec3ngEv(ptr noundef nonnull align 16 dereferenceable(16) %19)
  %21 = extractvalue { double, double } %20, 0
  %22 = extractvalue { double, double } %20, 1
  %.sroa.04.0.copyload = load double, ptr %19, align 16
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 56
  %.sroa.2.0.copyload = load double, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !8
  call void @_ZN3JPH8RayAABoxENS_4Vec3ERKNS_15RayInvDirectionES0_S0_RfS4_(double %.sroa.09.0.copyload, double %.sroa.210.0.copyload, ptr noundef nonnull align 16 dereferenceable(32) %9, double %21, double %22, double %.sroa.04.0.copyload, double %.sroa.2.0.copyload, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #7
  %23 = load float, ptr %7, align 4, !tbaa !10
  %24 = load float, ptr %8, align 4
  %25 = fcmp ole float %23, %24
  %26 = fcmp oge float %24, 0.000000e+00
  %or.cond = and i1 %25, %26
  br i1 %or.cond, label %27, label %63

27:                                               ; preds = %17
  %28 = call noundef float @_ZNK3JPH18CollisionCollectorINS_13RayCastResultENS_31CollisionCollectorTraitsCastRayEE19GetEarlyOutFractionEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %29 = fcmp olt float %23, %28
  br i1 %29, label %30, label %63

30:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #7
  call void @_ZN3JPH13RayCastResultC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %10)
  %31 = call noundef ptr @_ZNK3JPH18CollisionCollectorINS_13RayCastResultENS_31CollisionCollectorTraitsCastRayEE10GetContextEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %32 = call i32 @_ZN3JPH16TransformedShape10sGetBodyIDEPKS0_(ptr noundef %31)
  store i32 %32, ptr %10, align 4, !tbaa !12
  %33 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH17SubShapeIDCreator5GetIDEv(ptr noundef nonnull align 4 dereferenceable(8) %3)
  %34 = getelementptr inbounds i8, ptr %10, i64 8
  %35 = load i32, ptr %33, align 4, !tbaa !12
  store i32 %35, ptr %34, align 4, !tbaa !12
  %36 = getelementptr inbounds i8, ptr %2, i64 2
  %37 = load i8, ptr %36, align 1, !tbaa !14, !range !18, !noundef !19
  %38 = trunc nuw i8 %37 to i1
  %39 = load float, ptr %7, align 4
  %40 = fcmp ogt float %39, 0.000000e+00
  %or.cond3 = select i1 %38, i1 true, i1 %40
  br i1 %or.cond3, label %41, label %48

41:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #7
  store float 0.000000e+00, ptr %11, align 4, !tbaa !10
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %43 = load float, ptr %42, align 4, !tbaa !10
  %44 = getelementptr inbounds i8, ptr %10, i64 4
  store float %43, ptr %44, align 4, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %45, i64 48
  %47 = load ptr, ptr %46, align 8
  call void %47(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(12) %10)
  br label %48

48:                                               ; preds = %30, %41
  %49 = getelementptr inbounds i8, ptr %2, i64 1
  %50 = load i8, ptr %49, align 1, !tbaa !23
  %51 = icmp eq i8 %50, 1
  br i1 %51, label %52, label %62

52:                                               ; preds = %48
  %53 = load float, ptr %8, align 4, !tbaa !10
  %54 = call noundef float @_ZNK3JPH18CollisionCollectorINS_13RayCastResultENS_31CollisionCollectorTraitsCastRayEE19GetEarlyOutFractionEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %55 = fcmp olt float %53, %54
  br i1 %55, label %56, label %62

56:                                               ; preds = %52
  %57 = load float, ptr %8, align 4, !tbaa !10
  %58 = getelementptr inbounds i8, ptr %10, i64 4
  store float %57, ptr %58, align 4, !tbaa !20
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds i8, ptr %59, i64 48
  %61 = load ptr, ptr %60, align 8
  call void %61(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(12) %10)
  br label %62

62:                                               ; preds = %56, %52, %48
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #7
  br label %63

63:                                               ; preds = %62, %27, %17
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  br label %64

64:                                               ; preds = %6, %63
  ret void
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3JPH8RayAABoxENS_4Vec3ERKNS_15RayInvDirectionES0_S0_RfS4_(double, double, ptr noundef nonnull align 16 dereferenceable(32), double, double, double, double, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #6

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH13RayCastResultC2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i32 @_ZN3JPH16TransformedShape10sGetBodyIDEPKS0_(ptr noundef) local_unnamed_addr #3 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 = { 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 #4 = { 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 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 = { alwaysinline 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 #7 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"omnipotent char", !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"float", !9, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !9, i64 0}
!14 = !{!15, !17, i64 2}
!15 = !{!"_ZTSN3JPH15RayCastSettingsE", !16, i64 0, !16, i64 1, !17, i64 2}
!16 = !{!"_ZTSN3JPH13EBackFaceModeE", !9, i64 0}
!17 = !{!"bool", !9, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!21, !11, i64 4}
!21 = !{!"_ZTSN3JPH20BroadPhaseCastResultE", !22, i64 0, !11, i64 4}
!22 = !{!"_ZTSN3JPH6BodyIDE", !13, i64 0}
!23 = !{!15, !16, i64 1}


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