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

; 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.4 }
%union.anon.4 = 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 }
%"struct.JPH::RayCastT" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"class.JPH::SphereShape" = type { %"class.JPH::ConvexShape.base", float }
%"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.3", [4 x i8], i64, i8, i8 }>
%"class.JPH::RefTarget.3" = 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 } @_ZN3JPH4Vec35sZeroEv() #2 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: mustprogress uwtable
define dso_local void @_ZNK3JPH11SphereShape7CastRayERKNS_7RayCastERKNS_15RayCastSettingsERKNS_17SubShapeIDCreatorERNS_18CollisionCollectorINS_13RayCastResultENS_31CollisionCollectorTraitsCastRayEEERKNS_11ShapeFilterE(ptr noundef nonnull align 8 dereferenceable(48) %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 #4 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 i32, align 4
  %16 = alloca %"class.JPH::Vec3", align 16
  %17 = alloca %"class.JPH::Vec3", align 16
  %18 = alloca %"class.JPH::Vec3", align 16
  %19 = alloca %"class.JPH::RayCastResult", align 4
  %20 = alloca %"class.JPH::BodyID", align 4
  %21 = 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
  %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 %114

31:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = getelementptr inbounds %"struct.JPH::RayCastT", ptr %32, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %16, ptr align 16 %33, i64 16, i1 false), !tbaa.struct !11
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = getelementptr inbounds %"struct.JPH::RayCastT", ptr %34, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %17, ptr align 16 %35, i64 16, i1 false), !tbaa.struct !11
  %36 = call { double, double } @_ZN3JPH4Vec35sZeroEv()
  %37 = getelementptr inbounds %"class.JPH::Vec3", ptr %18, i32 0, i32 0
  %38 = getelementptr inbounds %union.anon.4, ptr %37, i32 0, i32 0
  %39 = getelementptr inbounds { double, double }, ptr %38, i32 0, i32 0
  %40 = extractvalue { double, double } %36, 0
  store double %40, ptr %39, align 16
  %41 = getelementptr inbounds { double, double }, ptr %38, i32 0, i32 1
  %42 = extractvalue { double, double } %36, 1
  store double %42, ptr %41, align 8
  %43 = getelementptr inbounds %"class.JPH::SphereShape", ptr %22, i32 0, i32 1
  %44 = load float, ptr %43, align 4, !tbaa !13
  %45 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %46 = load double, ptr %45, align 16
  %47 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 1
  %48 = load double, ptr %47, align 8
  %49 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 0
  %50 = load double, ptr %49, align 16
  %51 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 1
  %52 = load double, ptr %51, align 8
  %53 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %54 = load double, ptr %53, align 16
  %55 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %56 = load double, ptr %55, align 8
  %57 = call noundef i32 @_ZN3JPH9RaySphereENS_4Vec3ES0_S0_fRfS1_(double %46, double %48, double %50, double %52, double %54, double %56, float noundef %44, ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
  store i32 %57, ptr %15, align 4, !tbaa !26
  %58 = load i32, ptr %15, align 4, !tbaa !26
  %59 = icmp sgt i32 %58, 0
  br i1 %59, label %60, label %113

60:                                               ; preds = %31
  %61 = load float, ptr %14, align 4, !tbaa !27
  %62 = fcmp oge float %61, 0.000000e+00
  br i1 %62, label %63, label %113

63:                                               ; preds = %60
  %64 = load float, ptr %13, align 4, !tbaa !27
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  %66 = call noundef float @_ZNK3JPH18CollisionCollectorINS_13RayCastResultENS_31CollisionCollectorTraitsCastRayEE19GetEarlyOutFractionEv(ptr noundef nonnull align 8 dereferenceable(24) %65)
  %67 = fcmp olt float %64, %66
  br i1 %67, label %68, label %113

68:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 12, ptr %19) #8
  call void @_ZN3JPH13RayCastResultC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %19)
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  %69 = load ptr, ptr %11, align 8, !tbaa !5
  %70 = call noundef ptr @_ZNK3JPH18CollisionCollectorINS_13RayCastResultENS_31CollisionCollectorTraitsCastRayEE10GetContextEv(ptr noundef nonnull align 8 dereferenceable(24) %69)
  %71 = call i32 @_ZN3JPH16TransformedShape10sGetBodyIDEPKS0_(ptr noundef %70)
  %72 = getelementptr inbounds %"class.JPH::BodyID", ptr %20, i32 0, i32 0
  store i32 %71, ptr %72, align 4
  %73 = getelementptr inbounds %"class.JPH::BroadPhaseCastResult", ptr %19, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %73, ptr align 4 %20, i64 4, i1 false), !tbaa.struct !28
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  %74 = load ptr, ptr %10, align 8, !tbaa !5
  %75 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH17SubShapeIDCreator5GetIDEv(ptr noundef nonnull align 4 dereferenceable(8) %74)
  %76 = getelementptr inbounds %"class.JPH::RayCastResult", ptr %19, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %76, ptr align 4 %75, i64 4, i1 false), !tbaa.struct !28
  %77 = load ptr, ptr %9, align 8, !tbaa !5
  %78 = getelementptr inbounds %"class.JPH::RayCastSettings", ptr %77, i32 0, i32 2
  %79 = load i8, ptr %78, align 1, !tbaa !29, !range !33, !noundef !34
  %80 = trunc i8 %79 to i1
  br i1 %80, label %84, label %81

81:                                               ; preds = %68
  %82 = load float, ptr %13, align 4, !tbaa !27
  %83 = fcmp ogt float %82, 0.000000e+00
  br i1 %83, label %84, label %92

84:                                               ; preds = %81, %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  store float 0.000000e+00, ptr %21, align 4, !tbaa !27
  %85 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %86 = load float, ptr %85, align 4, !tbaa !27
  %87 = getelementptr inbounds %"class.JPH::BroadPhaseCastResult", ptr %19, i32 0, i32 1
  store float %86, ptr %87, align 4, !tbaa !35
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  %88 = load ptr, ptr %11, align 8, !tbaa !5
  %89 = load ptr, ptr %88, align 8, !tbaa !9
  %90 = getelementptr inbounds ptr, ptr %89, i64 6
  %91 = load ptr, ptr %90, align 8
  call void %91(ptr noundef nonnull align 8 dereferenceable(24) %88, ptr noundef nonnull align 4 dereferenceable(12) %19)
  br label %92

92:                                               ; preds = %84, %81
  %93 = load ptr, ptr %9, align 8, !tbaa !5
  %94 = getelementptr inbounds %"class.JPH::RayCastSettings", ptr %93, i32 0, i32 1
  %95 = load i8, ptr %94, align 1, !tbaa !38
  %96 = icmp eq i8 %95, 1
  br i1 %96, label %97, label %112

97:                                               ; preds = %92
  %98 = load i32, ptr %15, align 4, !tbaa !26
  %99 = icmp sgt i32 %98, 1
  br i1 %99, label %100, label %112

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

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

112:                                              ; preds = %105, %100, %97, %92
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #8
  br label %113

113:                                              ; preds = %112, %63, %60, %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %114

114:                                              ; preds = %113, %30
  ret void
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef i32 @_ZN3JPH9RaySphereENS_4Vec3ES0_S0_fRfS1_(double, double, double, double, double, double, float noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i32 @_ZN3JPH16TransformedShape10sGetBodyIDEPKS0_(ptr noundef) #7 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

; 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)) #6

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 = { 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 = { 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 = { 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 #6 = { 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 #7 = { 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 #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, !25, i64 44}
!14 = !{!"_ZTSN3JPH11SphereShapeE", !15, i64 0, !25, i64 44}
!15 = !{!"_ZTSN3JPH11ConvexShapeE", !16, i64 0, !24, i64 32, !25, i64 40}
!16 = !{!"_ZTSN3JPH5ShapeE", !17, i64 8, !21, i64 16, !22, i64 24, !23, i64 25}
!17 = !{!"_ZTSN3JPH9RefTargetINS_5ShapeEEE", !18, i64 0}
!18 = !{!"_ZTSSt6atomicIjE", !19, i64 0}
!19 = !{!"_ZTSSt13__atomic_baseIjE", !20, i64 0}
!20 = !{!"int", !7, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!"_ZTSN3JPH10EShapeTypeE", !7, i64 0}
!23 = !{!"_ZTSN3JPH13EShapeSubTypeE", !7, i64 0}
!24 = !{!"_ZTSN3JPH8RefConstINS_15PhysicsMaterialEEE", !6, i64 0}
!25 = !{!"float", !7, i64 0}
!26 = !{!20, !20, i64 0}
!27 = !{!25, !25, i64 0}
!28 = !{i64 0, i64 4, !26}
!29 = !{!30, !32, i64 2}
!30 = !{!"_ZTSN3JPH15RayCastSettingsE", !31, i64 0, !31, i64 1, !32, i64 2}
!31 = !{!"_ZTSN3JPH13EBackFaceModeE", !7, i64 0}
!32 = !{!"bool", !7, i64 0}
!33 = !{i8 0, i8 2}
!34 = !{}
!35 = !{!36, !25, i64 4}
!36 = !{!"_ZTSN3JPH20BroadPhaseCastResultE", !37, i64 0, !25, i64 4}
!37 = !{!"_ZTSN3JPH6BodyIDE", !20, i64 0}
!38 = !{!30, !31, 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: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec35sZeroEv() 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: mustprogress uwtable
define dso_local void @_ZNK3JPH11SphereShape7CastRayERKNS_7RayCastERKNS_15RayCastSettingsERKNS_17SubShapeIDCreatorERNS_18CollisionCollectorINS_13RayCastResultENS_31CollisionCollectorTraitsCastRayEEERKNS_11ShapeFilterE(ptr noundef nonnull align 8 dereferenceable(48) %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 #3 align 2 {
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca %"class.JPH::RayCastResult", align 4
  %10 = alloca float, align 4
  %11 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH17SubShapeIDCreator5GetIDEv(ptr noundef nonnull align 4 dereferenceable(8) %3)
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  %14 = load ptr, ptr %13, align 8
  %15 = tail call noundef zeroext i1 %14(ptr noundef nonnull align 8 dereferenceable(12) %5, ptr noundef nonnull %0, ptr noundef nonnull align 4 dereferenceable(4) %11)
  br i1 %15, label %16, label %66

16:                                               ; 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
  %17 = getelementptr inbounds i8, ptr %1, i64 16
  %.sroa.07.0.copyload = load double, ptr %17, 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
  %18 = tail call { double, double } @_ZN3JPH4Vec35sZeroEv()
  %19 = extractvalue { double, double } %18, 0
  %20 = extractvalue { double, double } %18, 1
  %21 = getelementptr inbounds i8, ptr %0, i64 44
  %22 = load float, ptr %21, align 4, !tbaa !10
  %23 = call noundef i32 @_ZN3JPH9RaySphereENS_4Vec3ES0_S0_fRfS1_(double %.sroa.09.0.copyload, double %.sroa.210.0.copyload, double %.sroa.07.0.copyload, double %.sroa.28.0.copyload, double %19, double %20, float noundef %22, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %24 = icmp sgt i32 %23, 0
  %25 = load float, ptr %8, align 4
  %26 = fcmp oge float %25, 0.000000e+00
  %or.cond = select i1 %24, i1 %26, i1 false
  br i1 %or.cond, label %27, label %65

27:                                               ; preds = %16
  %28 = load float, ptr %7, align 4, !tbaa !24
  %29 = call noundef float @_ZNK3JPH18CollisionCollectorINS_13RayCastResultENS_31CollisionCollectorTraitsCastRayEE19GetEarlyOutFractionEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %30 = fcmp olt float %28, %29
  br i1 %30, label %31, label %65

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

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

49:                                               ; preds = %31, %42
  %50 = getelementptr inbounds i8, ptr %2, i64 1
  %51 = load i8, ptr %50, align 1, !tbaa !35
  %52 = icmp eq i8 %51, 1
  %53 = icmp ugt i32 %23, 1
  %or.cond5 = and i1 %53, %52
  br i1 %or.cond5, label %54, label %64

54:                                               ; preds = %49
  %55 = load float, ptr %8, align 4, !tbaa !24
  %56 = call noundef float @_ZNK3JPH18CollisionCollectorINS_13RayCastResultENS_31CollisionCollectorTraitsCastRayEE19GetEarlyOutFractionEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %57 = fcmp olt float %55, %56
  br i1 %57, label %58, label %64

58:                                               ; preds = %54
  %59 = load float, ptr %8, align 4, !tbaa !24
  %60 = getelementptr inbounds i8, ptr %9, i64 4
  store float %59, ptr %60, align 4, !tbaa !32
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %61, i64 48
  %63 = load ptr, ptr %62, align 8
  call void %63(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(12) %9)
  br label %64

64:                                               ; preds = %58, %54, %49
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #7
  br label %65

65:                                               ; preds = %64, %27, %16
  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 %66

66:                                               ; preds = %6, %65
  ret void
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef i32 @_ZN3JPH9RaySphereENS_4Vec3ES0_S0_fRfS1_(double, double, double, double, double, double, float noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK3JPH18CollisionCollectorINS_13RayCastResultENS_31CollisionCollectorTraitsCastRayEE19GetEarlyOutFractionEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #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) local_unnamed_addr #6 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

; 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 #5

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 = { 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 = { 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 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"omnipotent char", !7, i64 0}
!10 = !{!11, !23, i64 44}
!11 = !{!"_ZTSN3JPH11SphereShapeE", !12, i64 0, !23, i64 44}
!12 = !{!"_ZTSN3JPH11ConvexShapeE", !13, i64 0, !21, i64 32, !23, i64 40}
!13 = !{!"_ZTSN3JPH5ShapeE", !14, i64 8, !18, i64 16, !19, i64 24, !20, i64 25}
!14 = !{!"_ZTSN3JPH9RefTargetINS_5ShapeEEE", !15, i64 0}
!15 = !{!"_ZTSSt6atomicIjE", !16, i64 0}
!16 = !{!"_ZTSSt13__atomic_baseIjE", !17, i64 0}
!17 = !{!"int", !9, i64 0}
!18 = !{!"long", !9, i64 0}
!19 = !{!"_ZTSN3JPH10EShapeTypeE", !9, i64 0}
!20 = !{!"_ZTSN3JPH13EShapeSubTypeE", !9, i64 0}
!21 = !{!"_ZTSN3JPH8RefConstINS_15PhysicsMaterialEEE", !22, i64 0}
!22 = !{!"any pointer", !9, i64 0}
!23 = !{!"float", !9, i64 0}
!24 = !{!23, !23, i64 0}
!25 = !{!17, !17, i64 0}
!26 = !{!27, !29, i64 2}
!27 = !{!"_ZTSN3JPH15RayCastSettingsE", !28, i64 0, !28, i64 1, !29, i64 2}
!28 = !{!"_ZTSN3JPH13EBackFaceModeE", !9, i64 0}
!29 = !{!"bool", !9, i64 0}
!30 = !{i8 0, i8 2}
!31 = !{}
!32 = !{!33, !23, i64 4}
!33 = !{!"_ZTSN3JPH20BroadPhaseCastResultE", !34, i64 0, !23, i64 4}
!34 = !{!"_ZTSN3JPH6BodyIDE", !17, i64 0}
!35 = !{!27, !28, i64 1}


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