; LLVM IR from jrouwe/JoltPhysics :: Jolt/Physics/Collision/BroadPhase (BroadPhaseBruteForce)

; 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.std::shared_lock" = type <{ ptr, i8, [7 x i8] }>
%"class.JPH::BodyID" = type { i32 }
%"class.JPH::BroadPhaseBruteForce" = type { %"class.JPH::BroadPhase", %"class.JPH::Array", %"class.JPH::SharedMutex" }
%"class.JPH::BroadPhase" = type { %"class.JPH::BroadPhaseQuery", ptr }
%"class.JPH::BroadPhaseQuery" = type { ptr }
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::SharedMutex" = type { %"class.std::shared_mutex", %"class.std::thread::id" }
%"class.std::shared_mutex" = type { %"class.std::__shared_mutex_pthread" }
%"class.std::__shared_mutex_pthread" = type { %union.pthread_rwlock_t }
%union.pthread_rwlock_t = type { %struct.__pthread_rwlock_arch_t }
%struct.__pthread_rwlock_arch_t = type { i32, i32, i32, i32, i32, i32, i32, i32, i8, [7 x i8], i64, i32 }
%"class.std::thread::id" = type { i64 }

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

declare i32 @__gxx_personality_v0(...)

; 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: mustprogress uwtable
declare dso_local void @_ZNSt11shared_lockIN3JPH11SharedMutexEEC2ERS1_(ptr noundef nonnull align 8 dereferenceable(9), ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(122) ptr @_ZN3JPH11BodyManager7GetBodyERKNS_6BodyIDE(ptr noundef nonnull align 8 dereferenceable(297), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZNK3JPH4Body14GetObjectLayerEv(ptr noundef nonnull align 16 dereferenceable(122)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH4Body19GetWorldSpaceBoundsEv(ptr noundef nonnull align 16 dereferenceable(122)) #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH20BroadPhaseBruteForce12CollideAABoxERKNS_5AABoxERNS_18CollisionCollectorINS_6BodyIDENS_36CollisionCollectorTraitsCollideShapeEEERKNS_21BroadPhaseLayerFilterERKNS_17ObjectLayerFilterE(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull align 16 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %"class.std::shared_lock", align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca %"class.JPH::BodyID", align 4
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  %21 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #5
  %22 = getelementptr inbounds %"class.JPH::BroadPhaseBruteForce", ptr %21, i32 0, i32 2
  call void @_ZNSt11shared_lockIN3JPH11SharedMutexEEC2ERS1_(ptr noundef nonnull align 8 dereferenceable(9) %11, ptr noundef nonnull align 8 dereferenceable(64) %22)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %23 = getelementptr inbounds %"class.JPH::BroadPhaseBruteForce", ptr %21, i32 0, i32 1
  store ptr %23, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %24 = load ptr, ptr %12, align 8, !tbaa !5
  %25 = invoke noundef ptr @_ZNK3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %24)
          to label %26 unwind label %35

26:                                               ; preds = %5
  store ptr %25, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %27 = load ptr, ptr %12, align 8, !tbaa !5
  %28 = invoke noundef ptr @_ZNK3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %27)
          to label %29 unwind label %39

29:                                               ; preds = %26
  store ptr %28, ptr %16, align 8, !tbaa !5
  br label %30

30:                                               ; preds = %96, %29
  %31 = load ptr, ptr %13, align 8, !tbaa !5
  %32 = load ptr, ptr %16, align 8, !tbaa !5
  %33 = icmp ne ptr %31, %32
  br i1 %33, label %43, label %34

34:                                               ; preds = %30
  store i32 2, ptr %17, align 4
  br label %100

35:                                               ; preds = %5
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %14, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %15, align 4
  br label %102

39:                                               ; preds = %26
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %14, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %15, align 4
  br label %101

43:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %44 = load ptr, ptr %13, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 4 %44, i64 4, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %45 = getelementptr inbounds %"class.JPH::BroadPhase", ptr %21, i32 0, i32 1
  %46 = load ptr, ptr %45, align 8, !tbaa !12
  %47 = invoke noundef nonnull align 16 dereferenceable(122) ptr @_ZN3JPH11BodyManager7GetBodyERKNS_6BodyIDE(ptr noundef nonnull align 8 dereferenceable(297) %46, ptr noundef nonnull align 4 dereferenceable(4) %18)
          to label %48 unwind label %76

48:                                               ; preds = %43
  store ptr %47, ptr %19, align 8, !tbaa !5
  %49 = load ptr, ptr %10, align 8, !tbaa !5
  %50 = load ptr, ptr %19, align 8, !tbaa !5
  %51 = invoke noundef zeroext i16 @_ZNK3JPH4Body14GetObjectLayerEv(ptr noundef nonnull align 16 dereferenceable(122) %50)
          to label %52 unwind label %76

52:                                               ; preds = %48
  %53 = load ptr, ptr %49, align 8, !tbaa !15
  %54 = getelementptr inbounds ptr, ptr %53, i64 2
  %55 = load ptr, ptr %54, align 8
  %56 = invoke noundef zeroext i1 %55(ptr noundef nonnull align 8 dereferenceable(8) %49, i16 noundef zeroext %51)
          to label %57 unwind label %76

57:                                               ; preds = %52
  br i1 %56, label %58, label %89

58:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %59 = load ptr, ptr %19, align 8, !tbaa !5
  %60 = invoke noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH4Body19GetWorldSpaceBoundsEv(ptr noundef nonnull align 16 dereferenceable(122) %59)
          to label %61 unwind label %80

61:                                               ; preds = %58
  store ptr %60, ptr %20, align 8, !tbaa !5
  %62 = load ptr, ptr %20, align 8, !tbaa !5
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = invoke noundef zeroext i1 @_ZNK3JPH5AABox8OverlapsERKS0_(ptr noundef nonnull align 16 dereferenceable(32) %62, ptr noundef nonnull align 16 dereferenceable(32) %63)
          to label %65 unwind label %80

65:                                               ; preds = %61
  br i1 %64, label %66, label %85

66:                                               ; preds = %65
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = load ptr, ptr %67, align 8, !tbaa !15
  %69 = getelementptr inbounds ptr, ptr %68, i64 6
  %70 = load ptr, ptr %69, align 8
  invoke void %70(ptr noundef nonnull align 8 dereferenceable(24) %67, ptr noundef nonnull align 4 dereferenceable(4) %18)
          to label %71 unwind label %80

71:                                               ; preds = %66
  %72 = load ptr, ptr %8, align 8, !tbaa !5
  %73 = invoke noundef zeroext i1 @_ZNK3JPH18CollisionCollectorINS_6BodyIDENS_36CollisionCollectorTraitsCollideShapeEE14ShouldEarlyOutEv(ptr noundef nonnull align 8 dereferenceable(24) %72)
          to label %74 unwind label %80

74:                                               ; preds = %71
  br i1 %73, label %75, label %84

75:                                               ; preds = %74
  store i32 2, ptr %17, align 4
  br label %86

76:                                               ; preds = %52, %48, %43
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %14, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %15, align 4
  br label %99

80:                                               ; preds = %71, %66, %61, %58
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %14, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %99

84:                                               ; preds = %74
  br label %85

85:                                               ; preds = %84, %65
  store i32 0, ptr %17, align 4
  br label %86

86:                                               ; preds = %85, %75
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  %87 = load i32, ptr %17, align 4
  switch i32 %87, label %90 [
    i32 0, label %88
  ]

88:                                               ; preds = %86
  br label %89

89:                                               ; preds = %88, %57
  store i32 0, ptr %17, align 4
  br label %90

90:                                               ; preds = %89, %86
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  %91 = load i32, ptr %17, align 4
  switch i32 %91, label %93 [
    i32 0, label %92
  ]

92:                                               ; preds = %90
  store i32 0, ptr %17, align 4
  br label %93

93:                                               ; preds = %92, %90
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  %94 = load i32, ptr %17, align 4
  switch i32 %94, label %100 [
    i32 0, label %95
  ]

95:                                               ; preds = %93
  br label %96

96:                                               ; preds = %95
  %97 = load ptr, ptr %13, align 8, !tbaa !5
  %98 = getelementptr inbounds %"class.JPH::BodyID", ptr %97, i32 1
  store ptr %98, ptr %13, align 8, !tbaa !5
  br label %30

99:                                               ; preds = %80, %76
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %101

100:                                              ; preds = %93, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %103

101:                                              ; preds = %99, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %102

102:                                              ; preds = %101, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @_ZNSt11shared_lockIN3JPH11SharedMutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %11) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  br label %104

103:                                              ; preds = %100
  call void @_ZNSt11shared_lockIN3JPH11SharedMutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %11) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  ret void

104:                                              ; preds = %102
  %105 = load ptr, ptr %14, align 8
  %106 = load i32, ptr %15, align 4
  %107 = insertvalue { ptr, i32 } poison, ptr %105, 0
  %108 = insertvalue { ptr, i32 } %107, i32 %106, 1
  resume { ptr, i32 } %108
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH5AABox8OverlapsERKS0_(ptr noundef nonnull align 16 dereferenceable(32), ptr noundef nonnull align 16 dereferenceable(32)) #2 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i64 0, i64 4, !10}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !6, i64 8}
!13 = !{!"_ZTSN3JPH10BroadPhaseE", !14, i64 0, !6, i64 8}
!14 = !{!"_ZTSN3JPH15BroadPhaseQueryE"}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !8, 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"

%"class.std::shared_lock" = type <{ ptr, i8, [7 x i8] }>
%"class.JPH::BodyID" = type { i32 }

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

declare i32 @__gxx_personality_v0(...)

; 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 void @_ZNSt11shared_lockIN3JPH11SharedMutexEEC2ERS1_(ptr noundef nonnull align 8 dereferenceable(9), ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(122) ptr @_ZN3JPH11BodyManager7GetBodyERKNS_6BodyIDE(ptr noundef nonnull align 8 dereferenceable(297), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZNK3JPH4Body14GetObjectLayerEv(ptr noundef nonnull align 16 dereferenceable(122)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH4Body19GetWorldSpaceBoundsEv(ptr noundef nonnull align 16 dereferenceable(122)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt11shared_lockIN3JPH11SharedMutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(9)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH20BroadPhaseBruteForce12CollideAABoxERKNS_5AABoxERNS_18CollisionCollectorINS_6BodyIDENS_36CollisionCollectorTraitsCollideShapeEEERKNS_21BroadPhaseLayerFilterERKNS_17ObjectLayerFilterE(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull align 16 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr nocapture noundef nonnull readnone align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.std::shared_lock", align 8
  %7 = alloca %"class.JPH::BodyID", align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #4
  %8 = getelementptr inbounds i8, ptr %0, i64 40
  call void @_ZNSt11shared_lockIN3JPH11SharedMutexEEC2ERS1_(ptr noundef nonnull align 8 dereferenceable(9) %6, ptr noundef nonnull align 8 dereferenceable(64) %8)
  %9 = getelementptr inbounds i8, ptr %0, i64 16
  %10 = call noundef ptr @_ZNK3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %9)
  %11 = call noundef ptr @_ZNK3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %9)
  %.not29 = icmp eq ptr %10, %11
  br i1 %.not29, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %5
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  br label %13

13:                                               ; preds = %.lr.ph, %.thread
  %.030 = phi ptr [ %10, %.lr.ph ], [ %39, %.thread ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  %14 = load i32, ptr %.030, align 4, !tbaa !5
  store i32 %14, ptr %7, align 4, !tbaa !5
  %15 = load ptr, ptr %12, align 8, !tbaa !9
  %16 = invoke noundef nonnull align 16 dereferenceable(122) ptr @_ZN3JPH11BodyManager7GetBodyERKNS_6BodyIDE(ptr noundef nonnull align 8 dereferenceable(297) %15, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %17 unwind label %34

17:                                               ; preds = %13
  %18 = call noundef zeroext i16 @_ZNK3JPH4Body14GetObjectLayerEv(ptr noundef nonnull align 16 dereferenceable(122) %16)
  %19 = load ptr, ptr %4, align 8, !tbaa !13
  %20 = getelementptr inbounds i8, ptr %19, i64 16
  %21 = load ptr, ptr %20, align 8
  %22 = invoke noundef zeroext i1 %21(ptr noundef nonnull align 8 dereferenceable(8) %4, i16 noundef zeroext %18)
          to label %23 unwind label %34

23:                                               ; preds = %17
  br i1 %22, label %24, label %.thread

24:                                               ; preds = %23
  %25 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNK3JPH4Body19GetWorldSpaceBoundsEv(ptr noundef nonnull align 16 dereferenceable(122) %16)
  %26 = invoke noundef zeroext i1 @_ZNK3JPH5AABox8OverlapsERKS0_(ptr noundef nonnull align 16 dereferenceable(32) %25, ptr noundef nonnull align 16 dereferenceable(32) %1)
          to label %27 unwind label %36

27:                                               ; preds = %24
  br i1 %26, label %28, label %.thread

28:                                               ; preds = %27
  %29 = load ptr, ptr %2, align 8, !tbaa !13
  %30 = getelementptr inbounds i8, ptr %29, i64 48
  %31 = load ptr, ptr %30, align 8
  invoke void %31(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %32 unwind label %36

32:                                               ; preds = %28
  %33 = call noundef zeroext i1 @_ZNK3JPH18CollisionCollectorINS_6BodyIDENS_36CollisionCollectorTraitsCollideShapeEE14ShouldEarlyOutEv(ptr noundef nonnull align 8 dereferenceable(24) %2)
  br i1 %33, label %38, label %.thread

34:                                               ; preds = %17, %13
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %40

36:                                               ; preds = %28, %24
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %40

38:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  br label %.loopexit

.thread:                                          ; preds = %32, %27, %23
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  %39 = getelementptr inbounds i8, ptr %.030, i64 4
  %.not = icmp eq ptr %39, %11
  br i1 %.not, label %.loopexit, label %13

40:                                               ; preds = %36, %34
  %.pn = phi { ptr, i32 } [ %37, %36 ], [ %35, %34 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  call void @_ZNSt11shared_lockIN3JPH11SharedMutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %6) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #4
  resume { ptr, i32 } %.pn

.loopexit:                                        ; preds = %.thread, %5, %38
  call void @_ZNSt11shared_lockIN3JPH11SharedMutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %6) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #4
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH5AABox8OverlapsERKS0_(ptr noundef nonnull align 16 dereferenceable(32), ptr noundef nonnull align 16 dereferenceable(32)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH18CollisionCollectorINS_6BodyIDENS_36CollisionCollectorTraitsCollideShapeEE14ShouldEarlyOutEv(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 = { 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 = { 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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !12, i64 8}
!10 = !{!"_ZTSN3JPH10BroadPhaseE", !11, i64 0, !12, i64 8}
!11 = !{!"_ZTSN3JPH15BroadPhaseQueryE"}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass