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

; 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.5 }
%union.anon.5 = type { <4 x float> }
%"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 }
%"class.JPH::PlaneShape" = type { %"class.JPH::Shape.base", %"class.JPH::Plane", %"class.JPH::RefConst", float, %"class.JPH::AABox" }
%"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::Plane" = type { %"class.JPH::Vec4" }
%"class.JPH::Vec4" = type { %union.anon.3 }
%union.anon.3 = type { <4 x float> }
%"class.JPH::RefConst" = type { ptr }
%"class.JPH::AABox" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"struct.JPH::RayCastT" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"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: mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH5Plane9GetNormalEv(ptr noundef nonnull align 16 dereferenceable(16)) #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) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZNK3JPH5Plane14SignedDistanceENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(16), double, double) #1 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)) #3 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) #4 align 2

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

30:                                               ; preds = %6
  br label %120

31:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %32 = getelementptr inbounds %"class.JPH::PlaneShape", ptr %22, i32 0, i32 1
  %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 %14, ptr align 16 %34, i64 16, i1 false), !tbaa.struct !11
  %35 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 0
  %36 = load double, ptr %35, align 16
  %37 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 1
  %38 = load double, ptr %37, align 8
  %39 = call noundef float @_ZNK3JPH5Plane14SignedDistanceENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(16) %32, double %36, double %38)
  store float %39, ptr %13, align 4, !tbaa !13
  %40 = load ptr, ptr %9, align 8, !tbaa !5
  %41 = getelementptr inbounds %"class.JPH::RayCastSettings", ptr %40, i32 0, i32 2
  %42 = load i8, ptr %41, align 1, !tbaa !15, !range !19, !noundef !20
  %43 = trunc i8 %42 to i1
  br i1 %43, label %44, label %65

44:                                               ; preds = %31
  %45 = load float, ptr %13, align 4, !tbaa !13
  %46 = fcmp ole float %45, 0.000000e+00
  br i1 %46, label %47, label %65

47:                                               ; preds = %44
  %48 = load ptr, ptr %11, align 8, !tbaa !5
  %49 = call noundef float @_ZNK3JPH18CollisionCollectorINS_13RayCastResultENS_31CollisionCollectorTraitsCastRayEE19GetEarlyOutFractionEv(ptr noundef nonnull align 8 dereferenceable(24) %48)
  %50 = fcmp ogt float %49, 0.000000e+00
  br i1 %50, label %51, label %65

51:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 12, ptr %15) #7
  call void @_ZN3JPH13RayCastResultC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %15)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %52 = load ptr, ptr %11, align 8, !tbaa !5
  %53 = call noundef ptr @_ZNK3JPH18CollisionCollectorINS_13RayCastResultENS_31CollisionCollectorTraitsCastRayEE10GetContextEv(ptr noundef nonnull align 8 dereferenceable(24) %52)
  %54 = call i32 @_ZN3JPH16TransformedShape10sGetBodyIDEPKS0_(ptr noundef %53)
  %55 = getelementptr inbounds %"class.JPH::BodyID", ptr %16, i32 0, i32 0
  store i32 %54, ptr %55, align 4
  %56 = getelementptr inbounds %"class.JPH::BroadPhaseCastResult", ptr %15, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %56, ptr align 4 %16, i64 4, i1 false), !tbaa.struct !21
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  %57 = getelementptr inbounds %"class.JPH::BroadPhaseCastResult", ptr %15, i32 0, i32 1
  store float 0.000000e+00, ptr %57, align 4, !tbaa !24
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH17SubShapeIDCreator5GetIDEv(ptr noundef nonnull align 4 dereferenceable(8) %58)
  %60 = getelementptr inbounds %"class.JPH::RayCastResult", ptr %15, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %60, ptr align 4 %59, i64 4, i1 false), !tbaa.struct !21
  %61 = load ptr, ptr %11, align 8, !tbaa !5
  %62 = load ptr, ptr %61, align 8, !tbaa !9
  %63 = getelementptr inbounds ptr, ptr %62, i64 6
  %64 = load ptr, ptr %63, align 8
  call void %64(ptr noundef nonnull align 8 dereferenceable(24) %61, ptr noundef nonnull align 4 dereferenceable(12) %15)
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #7
  br label %65

65:                                               ; preds = %51, %47, %44, %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  %67 = getelementptr inbounds %"struct.JPH::RayCastT", ptr %66, i32 0, i32 1
  %68 = getelementptr inbounds %"class.JPH::PlaneShape", ptr %22, i32 0, i32 1
  %69 = call { double, double } @_ZNK3JPH5Plane9GetNormalEv(ptr noundef nonnull align 16 dereferenceable(16) %68)
  %70 = getelementptr inbounds %"class.JPH::Vec3", ptr %18, i32 0, i32 0
  %71 = getelementptr inbounds %union.anon.5, ptr %70, i32 0, i32 0
  %72 = getelementptr inbounds { double, double }, ptr %71, i32 0, i32 0
  %73 = extractvalue { double, double } %69, 0
  store double %73, ptr %72, align 16
  %74 = getelementptr inbounds { double, double }, ptr %71, i32 0, i32 1
  %75 = extractvalue { double, double } %69, 1
  store double %75, ptr %74, align 8
  %76 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %77 = load double, ptr %76, align 16
  %78 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %79 = load double, ptr %78, align 8
  %80 = call noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %67, double %77, double %79)
  store float %80, ptr %17, align 4, !tbaa !13
  %81 = load float, ptr %17, align 4, !tbaa !13
  %82 = fcmp une float %81, 0.000000e+00
  br i1 %82, label %83, label %119

83:                                               ; preds = %65
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = getelementptr inbounds %"class.JPH::RayCastSettings", ptr %84, i32 0, i32 1
  %86 = load i8, ptr %85, align 1, !tbaa !27
  %87 = icmp eq i8 %86, 1
  br i1 %87, label %91, label %88

88:                                               ; preds = %83
  %89 = load float, ptr %17, align 4, !tbaa !13
  %90 = fcmp olt float %89, 0.000000e+00
  br i1 %90, label %91, label %119

91:                                               ; preds = %88, %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %92 = load float, ptr %13, align 4, !tbaa !13
  %93 = fneg float %92
  %94 = load float, ptr %17, align 4, !tbaa !13
  %95 = fdiv float %93, %94
  store float %95, ptr %19, align 4, !tbaa !13
  %96 = load float, ptr %19, align 4, !tbaa !13
  %97 = fcmp oge float %96, 0.000000e+00
  br i1 %97, label %98, label %118

98:                                               ; preds = %91
  %99 = load float, ptr %19, align 4, !tbaa !13
  %100 = load ptr, ptr %11, align 8, !tbaa !5
  %101 = call noundef float @_ZNK3JPH18CollisionCollectorINS_13RayCastResultENS_31CollisionCollectorTraitsCastRayEE19GetEarlyOutFractionEv(ptr noundef nonnull align 8 dereferenceable(24) %100)
  %102 = fcmp olt float %99, %101
  br i1 %102, label %103, label %118

103:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 12, ptr %20) #7
  call void @_ZN3JPH13RayCastResultC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %20)
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %104 = load ptr, ptr %11, align 8, !tbaa !5
  %105 = call noundef ptr @_ZNK3JPH18CollisionCollectorINS_13RayCastResultENS_31CollisionCollectorTraitsCastRayEE10GetContextEv(ptr noundef nonnull align 8 dereferenceable(24) %104)
  %106 = call i32 @_ZN3JPH16TransformedShape10sGetBodyIDEPKS0_(ptr noundef %105)
  %107 = getelementptr inbounds %"class.JPH::BodyID", ptr %21, i32 0, i32 0
  store i32 %106, ptr %107, align 4
  %108 = getelementptr inbounds %"class.JPH::BroadPhaseCastResult", ptr %20, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %108, ptr align 4 %21, i64 4, i1 false), !tbaa.struct !21
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  %109 = load float, ptr %19, align 4, !tbaa !13
  %110 = getelementptr inbounds %"class.JPH::BroadPhaseCastResult", ptr %20, i32 0, i32 1
  store float %109, ptr %110, align 4, !tbaa !24
  %111 = load ptr, ptr %10, align 8, !tbaa !5
  %112 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH17SubShapeIDCreator5GetIDEv(ptr noundef nonnull align 4 dereferenceable(8) %111)
  %113 = getelementptr inbounds %"class.JPH::RayCastResult", ptr %20, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %113, ptr align 4 %112, i64 4, i1 false), !tbaa.struct !21
  %114 = load ptr, ptr %11, align 8, !tbaa !5
  %115 = load ptr, ptr %114, align 8, !tbaa !9
  %116 = getelementptr inbounds ptr, ptr %115, i64 6
  %117 = load ptr, ptr %116, align 8
  call void %117(ptr noundef nonnull align 8 dereferenceable(24) %114, ptr noundef nonnull align 4 dereferenceable(12) %20)
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #7
  br label %118

118:                                              ; preds = %103, %98, %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %119

119:                                              ; preds = %118, %88, %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %120

120:                                              ; preds = %119, %30
  ret void
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK3JPH18CollisionCollectorINS_13RayCastResultENS_31CollisionCollectorTraitsCastRayEE10GetContextEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = { alwaysinline 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #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 = !{!"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 = !{!16, !18, i64 2}
!16 = !{!"_ZTSN3JPH15RayCastSettingsE", !17, i64 0, !17, i64 1, !18, i64 2}
!17 = !{!"_ZTSN3JPH13EBackFaceModeE", !7, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{i64 0, i64 4, !22}
!22 = !{!23, !23, i64 0}
!23 = !{!"int", !7, i64 0}
!24 = !{!25, !14, i64 4}
!25 = !{!"_ZTSN3JPH20BroadPhaseCastResultE", !26, i64 0, !14, i64 4}
!26 = !{!"_ZTSN3JPH6BodyIDE", !23, i64 0}
!27 = !{!16, !17, 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::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: mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH5Plane9GetNormalEv(ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZNK3JPH5Plane14SignedDistanceENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(16), double, double) local_unnamed_addr #1 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 #2 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH10PlaneShape7CastRayERKNS_7RayCastERKNS_15RayCastSettingsERKNS_17SubShapeIDCreatorERNS_18CollisionCollectorINS_13RayCastResultENS_31CollisionCollectorTraitsCastRayEEERKNS_11ShapeFilterE(ptr noundef nonnull align 16 dereferenceable(96) %0, ptr noundef nonnull 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 #1 align 2 {
  %7 = alloca %"class.JPH::RayCastResult", align 4
  %8 = alloca %"class.JPH::RayCastResult", align 4
  %9 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH17SubShapeIDCreator5GetIDEv(ptr noundef nonnull align 4 dereferenceable(8) %3)
  %10 = load ptr, ptr %5, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %10, i64 16
  %12 = load ptr, ptr %11, align 8
  %13 = tail call noundef zeroext i1 %12(ptr noundef nonnull align 8 dereferenceable(12) %5, ptr noundef nonnull %0, ptr noundef nonnull align 4 dereferenceable(4) %9)
  br i1 %13, label %14, label %63

14:                                               ; preds = %6
  %15 = getelementptr inbounds i8, ptr %0, i64 32
  %.sroa.011.0.copyload = load double, ptr %1, align 16
  %.sroa.212.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 8
  %.sroa.212.0.copyload = load double, ptr %.sroa.212.0..sroa_idx, align 8, !tbaa !8
  %16 = tail call noundef float @_ZNK3JPH5Plane14SignedDistanceENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(16) %15, double %.sroa.011.0.copyload, double %.sroa.212.0.copyload)
  %17 = getelementptr inbounds i8, ptr %2, i64 2
  %18 = load i8, ptr %17, align 1, !tbaa !10, !range !14, !noundef !15
  %19 = trunc nuw i8 %18 to i1
  %20 = fcmp ole float %16, 0.000000e+00
  %or.cond = and i1 %20, %19
  br i1 %or.cond, label %21, label %34

21:                                               ; preds = %14
  %22 = tail call noundef float @_ZNK3JPH18CollisionCollectorINS_13RayCastResultENS_31CollisionCollectorTraitsCastRayEE19GetEarlyOutFractionEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %23 = fcmp ogt float %22, 0.000000e+00
  br i1 %23, label %24, label %34

24:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #6
  call void @_ZN3JPH13RayCastResultC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %7)
  %25 = call noundef ptr @_ZNK3JPH18CollisionCollectorINS_13RayCastResultENS_31CollisionCollectorTraitsCastRayEE10GetContextEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %26 = call i32 @_ZN3JPH16TransformedShape10sGetBodyIDEPKS0_(ptr noundef %25)
  store i32 %26, ptr %7, align 4, !tbaa !16
  %27 = getelementptr inbounds i8, ptr %7, i64 4
  store float 0.000000e+00, ptr %27, align 4, !tbaa !18
  %28 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH17SubShapeIDCreator5GetIDEv(ptr noundef nonnull align 4 dereferenceable(8) %3)
  %29 = getelementptr inbounds i8, ptr %7, i64 8
  %30 = load i32, ptr %28, align 4, !tbaa !16
  store i32 %30, ptr %29, align 4, !tbaa !16
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %31, i64 48
  %33 = load ptr, ptr %32, align 8
  call void %33(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(12) %7)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #6
  br label %34

34:                                               ; preds = %24, %21, %14
  %35 = getelementptr inbounds i8, ptr %1, i64 16
  %36 = call { double, double } @_ZNK3JPH5Plane9GetNormalEv(ptr noundef nonnull align 16 dereferenceable(16) %15)
  %37 = extractvalue { double, double } %36, 0
  %38 = extractvalue { double, double } %36, 1
  %39 = call noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %35, double %37, double %38)
  %40 = fcmp une float %39, 0.000000e+00
  br i1 %40, label %41, label %63

41:                                               ; preds = %34
  %42 = getelementptr inbounds i8, ptr %2, i64 1
  %43 = load i8, ptr %42, align 1, !tbaa !22
  %44 = icmp eq i8 %43, 1
  %45 = fcmp olt float %39, 0.000000e+00
  %or.cond3 = or i1 %45, %44
  br i1 %or.cond3, label %46, label %63

46:                                               ; preds = %41
  %47 = fneg float %16
  %48 = fdiv float %47, %39
  %49 = fcmp ult float %48, 0.000000e+00
  br i1 %49, label %63, label %50

50:                                               ; preds = %46
  %51 = call noundef float @_ZNK3JPH18CollisionCollectorINS_13RayCastResultENS_31CollisionCollectorTraitsCastRayEE19GetEarlyOutFractionEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %52 = fcmp olt float %48, %51
  br i1 %52, label %53, label %63

53:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #6
  call void @_ZN3JPH13RayCastResultC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %8)
  %54 = call noundef ptr @_ZNK3JPH18CollisionCollectorINS_13RayCastResultENS_31CollisionCollectorTraitsCastRayEE10GetContextEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %55 = call i32 @_ZN3JPH16TransformedShape10sGetBodyIDEPKS0_(ptr noundef %54)
  store i32 %55, ptr %8, align 4, !tbaa !16
  %56 = getelementptr inbounds i8, ptr %8, i64 4
  store float %48, ptr %56, align 4, !tbaa !18
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH17SubShapeIDCreator5GetIDEv(ptr noundef nonnull align 4 dereferenceable(8) %3)
  %58 = getelementptr inbounds i8, ptr %8, i64 8
  %59 = load i32, ptr %57, align 4, !tbaa !16
  store i32 %59, ptr %58, align 4, !tbaa !16
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = getelementptr inbounds i8, ptr %60, i64 48
  %62 = load ptr, ptr %61, align 8
  call void %62(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(12) %8)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #6
  br label %63

63:                                               ; preds = %34, %41, %53, %50, %46, %6
  ret void
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i32 @_ZN3JPH16TransformedShape10sGetBodyIDEPKS0_(ptr noundef) local_unnamed_addr #5 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 #2 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 = { alwaysinline 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 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 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"omnipotent char", !7, i64 0}
!10 = !{!11, !13, i64 2}
!11 = !{!"_ZTSN3JPH15RayCastSettingsE", !12, i64 0, !12, i64 1, !13, i64 2}
!12 = !{!"_ZTSN3JPH13EBackFaceModeE", !9, i64 0}
!13 = !{!"bool", !9, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !9, i64 0}
!18 = !{!19, !21, i64 4}
!19 = !{!"_ZTSN3JPH20BroadPhaseCastResultE", !20, i64 0, !21, i64 4}
!20 = !{!"_ZTSN3JPH6BodyIDE", !17, i64 0}
!21 = !{!"float", !9, i64 0}
!22 = !{!11, !12, i64 1}


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