; LLVM IR from jrouwe/JoltPhysics :: Jolt/Physics (PhysicsSystem)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.JPH::AssertLastParam" = type { i8 }
%"class.JPH::PhysicsUpdateContext" = type <{ ptr, ptr, ptr, ptr, float, float, %"struct.std::atomic", [4 x i8], ptr, ptr, ptr, %"class.JPH::Array.19", i32, [4 x i8], ptr, %"struct.std::atomic", [4 x i8] }>
%"class.JPH::Array.19" = type { %"class.JPH::STLTempAllocator", i64, i64, ptr }
%"class.JPH::STLTempAllocator" = type { ptr }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"struct.JPH::PhysicsUpdateContext::Step" = type { ptr, i8, i8, %"struct.JPH::BroadPhase::UpdateState", i32, %"struct.std::atomic", [60 x i8], %"struct.std::atomic", [60 x i8], %"struct.std::atomic", [60 x i8], %"struct.std::atomic", [60 x i8], %"struct.std::atomic", [60 x i8], %"struct.std::atomic", [60 x i8], %"class.JPH::StaticArray", i32, %"struct.std::atomic", %"struct.std::atomic", %"struct.std::atomic", %"struct.std::atomic", %"struct.std::atomic", %"struct.std::atomic", ptr, i32, %"struct.std::atomic", %"struct.std::atomic", ptr, i32, %"class.JPH::JobSystem::JobHandle", %"class.JPH::StaticArray.20", %"class.JPH::StaticArray.20", %"class.JPH::StaticArray.20", %"class.JPH::StaticArray.20", %"class.JPH::JobSystem::JobHandle", %"class.JPH::StaticArray.20", %"class.JPH::JobSystem::JobHandle", %"class.JPH::JobSystem::JobHandle", %"class.JPH::JobSystem::JobHandle", %"class.JPH::StaticArray.20", %"class.JPH::JobSystem::JobHandle", %"class.JPH::StaticArray.20", %"class.JPH::JobSystem::JobHandle", %"class.JPH::JobSystem::JobHandle", %"class.JPH::StaticArray.20", %"class.JPH::JobSystem::JobHandle", %"class.JPH::JobSystem::JobHandle", %"class.JPH::StaticArray.20", %"class.JPH::StaticArray.20", %"class.JPH::JobSystem::JobHandle", %"class.JPH::JobSystem::JobHandle" }
%"struct.JPH::BroadPhase::UpdateState" = type { [4 x ptr] }
%"class.JPH::StaticArray" = type { i32, [32 x %"struct.JPH::StaticArray<JPH::PhysicsUpdateContext::BodyPairQueue, 32>::Storage"] }
%"struct.JPH::StaticArray<JPH::PhysicsUpdateContext::BodyPairQueue, 32>::Storage" = type { [128 x i8] }
%"class.JPH::StaticArray.20" = type { i32, [4 x i8], [32 x %"struct.JPH::StaticArray<JPH::JobSystem::JobHandle, 32>::Storage"] }
%"struct.JPH::StaticArray<JPH::JobSystem::JobHandle, 32>::Storage" = type { [8 x i8] }
%"class.JPH::JobSystem::JobHandle" = type { %"class.JPH::Ref" }
%"class.JPH::Ref" = type { ptr }
%"class.JPH::PhysicsSystem" = type <{ ptr, ptr, %"class.JPH::BodyManager", %"class.JPH::BodyLockInterfaceNoLock", %"class.JPH::BodyLockInterfaceLocking", %"class.JPH::BodyInterface", %"class.JPH::BodyInterface", %"class.JPH::NarrowPhaseQuery", %"class.JPH::NarrowPhaseQuery", ptr, ptr, ptr, %"class.std::function", %"struct.JPH::PhysicsSettings", [4 x i8], %"class.JPH::ContactConstraintManager", %"class.JPH::ConstraintManager", %"class.JPH::IslandBuilder", %"class.JPH::LargeIslandSplitter", %"class.JPH::Mutex", %"class.JPH::Array.10", %"class.JPH::Vec3", float, [12 x i8] }>
%"class.JPH::BodyManager" = type <{ %"class.JPH::Array", i32, [4 x i8], i64, %"class.JPH::Mutex", %"class.JPH::MutexArray", %"class.JPH::Array.0", %"class.JPH::Mutex", [2 x ptr], [2 x %"struct.std::atomic"], i32, [4 x i8], %"class.JPH::Mutex", %"class.JPH::Array.3", ptr, ptr, i8, [7 x i8] }>
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::MutexArray" = type <{ ptr, i32, [4 x i8] }>
%"class.JPH::Array.0" = type { i64, i64, ptr }
%"class.JPH::Array.3" = type { i64, i64, ptr }
%"class.JPH::BodyLockInterfaceNoLock" = type { %"class.JPH::BodyLockInterface" }
%"class.JPH::BodyLockInterface" = type { ptr, ptr }
%"class.JPH::BodyLockInterfaceLocking" = type { %"class.JPH::BodyLockInterface" }
%"class.JPH::BodyInterface" = type { ptr, ptr, ptr }
%"class.JPH::NarrowPhaseQuery" = type { ptr, ptr }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%"struct.JPH::PhysicsSettings" = type <{ i32, i32, i32, float, float, float, float, float, float, float, float, float, float, float, i32, i32, float, float, float, i8, i8, i8, i8, i8, i8, i8, i8 }>
%"class.JPH::ContactConstraintManager" = type { [8 x i8], [2 x %"class.JPH::ContactConstraintManager::ManifoldCache"], i32, ptr, ptr, ptr, ptr, ptr, i32, %"struct.std::atomic", ptr }
%"class.JPH::ContactConstraintManager::ManifoldCache" = type <{ %"class.JPH::LFHMAllocator", %"class.JPH::LockFreeHashMap", %"class.JPH::LockFreeHashMap.6", i8, [7 x i8] }>
%"class.JPH::LFHMAllocator" = type { ptr, i32, %"struct.std::atomic" }
%"class.JPH::LockFreeHashMap" = type { ptr, %"struct.std::atomic", ptr, i32, i32 }
%"class.JPH::LockFreeHashMap.6" = type { ptr, %"struct.std::atomic", ptr, i32, i32 }
%"class.JPH::ConstraintManager" = type { ptr, %"class.JPH::Array.7", %"class.JPH::Mutex" }
%"class.JPH::Array.7" = type { i64, i64, ptr }
%"class.JPH::IslandBuilder" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32 }
%"class.JPH::LargeIslandSplitter" = type <{ i32, [4 x i8], ptr, ptr, ptr, i32, %"struct.std::atomic", i32, [4 x i8], ptr, %"struct.std::atomic", [4 x i8] }>
%"class.JPH::Mutex" = type { %"class.std::mutex", %"class.std::thread::id" }
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::thread::id" = type { i64 }
%"class.JPH::Array.10" = type { i64, i64, ptr }
%"class.JPH::Vec3" = type { %union.anon.13 }
%union.anon.13 = type { <4 x float> }

@.str.24 = external hidden unnamed_addr constant [83 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [40 x i8], align 1

; 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: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3JPH11BodyManager18GetNumActiveBodiesENS_9EBodyTypeE(ptr noundef nonnull align 8 dereferenceable(297), i8 noundef zeroext) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH13PhysicsSystem23JobPreIntegrateVelocityEPNS_20PhysicsUpdateContextEPNS1_4StepE(ptr noundef nonnull align 16 dereferenceable(1172) %0, ptr noundef %1, ptr noundef %2) #3 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"struct.JPH::AssertLastParam", align 1
  %9 = alloca %"struct.JPH::AssertLastParam", align 1
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %10 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = getelementptr inbounds %"class.JPH::PhysicsUpdateContext", ptr %11, i32 0, i32 1
  %13 = load ptr, ptr %12, align 8, !tbaa !9
  store ptr %13, ptr %7, align 8, !tbaa !5
  br label %14

14:                                               ; preds = %3
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  %16 = getelementptr inbounds %"struct.JPH::PhysicsUpdateContext::Step", ptr %15, i32 0, i32 25
  %17 = load ptr, ptr %16, align 8, !tbaa !18
  %18 = icmp eq ptr %17, null
  br i1 %18, label %22, label %19

19:                                               ; preds = %14
  %20 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.56, ptr noundef @.str.24, i32 noundef 1478)
  br i1 %20, label %21, label %22

21:                                               ; preds = %19
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !26
  br label %22

22:                                               ; preds = %21, %19, %14
  br label %23

23:                                               ; preds = %22
  br label %24

24:                                               ; preds = %23
  %25 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %10, i32 0, i32 2
  %26 = call noundef i32 @_ZNK3JPH11BodyManager21GetNumActiveCCDBodiesEv(ptr noundef nonnull align 8 dereferenceable(297) %25)
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds %"struct.JPH::PhysicsUpdateContext::Step", ptr %27, i32 0, i32 26
  store i32 %26, ptr %28, align 8, !tbaa !27
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = getelementptr inbounds %"struct.JPH::PhysicsUpdateContext::Step", ptr %30, i32 0, i32 26
  %32 = load i32, ptr %31, align 8, !tbaa !27
  %33 = zext i32 %32 to i64
  %34 = mul i64 %33, 144
  %35 = trunc i64 %34 to i32
  %36 = load ptr, ptr %29, align 8, !tbaa !28
  %37 = getelementptr inbounds ptr, ptr %36, i64 2
  %38 = load ptr, ptr %37, align 8
  %39 = call noundef ptr %38(ptr noundef nonnull align 8 dereferenceable(8) %29, i32 noundef %35)
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds %"struct.JPH::PhysicsUpdateContext::Step", ptr %40, i32 0, i32 25
  store ptr %39, ptr %41, align 8, !tbaa !18
  br label %42

42:                                               ; preds = %24
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = getelementptr inbounds %"struct.JPH::PhysicsUpdateContext::Step", ptr %43, i32 0, i32 29
  %45 = load ptr, ptr %44, align 8, !tbaa !30
  %46 = icmp eq ptr %45, null
  br i1 %46, label %50, label %47

47:                                               ; preds = %42
  %48 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.57, ptr noundef @.str.24, i32 noundef 1483)
  br i1 %48, label %49, label %50

49:                                               ; preds = %47
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !31
  br label %50

50:                                               ; preds = %49, %47, %42
  br label %51

51:                                               ; preds = %50
  br label %52

52:                                               ; preds = %51
  %53 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %10, i32 0, i32 2
  %54 = call noundef i32 @_ZNK3JPH11BodyManager18GetNumActiveBodiesENS_9EBodyTypeE(ptr noundef nonnull align 8 dereferenceable(297) %53, i8 noundef zeroext 0)
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = getelementptr inbounds %"struct.JPH::PhysicsUpdateContext::Step", ptr %55, i32 0, i32 30
  store i32 %54, ptr %56, align 8, !tbaa !32
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = getelementptr inbounds %"struct.JPH::PhysicsUpdateContext::Step", ptr %58, i32 0, i32 30
  %60 = load i32, ptr %59, align 8, !tbaa !32
  %61 = zext i32 %60 to i64
  %62 = mul i64 %61, 4
  %63 = trunc i64 %62 to i32
  %64 = load ptr, ptr %57, align 8, !tbaa !28
  %65 = getelementptr inbounds ptr, ptr %64, i64 2
  %66 = load ptr, ptr %65, align 8
  %67 = call noundef ptr %66(ptr noundef nonnull align 8 dereferenceable(8) %57, i32 noundef %63)
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = getelementptr inbounds %"struct.JPH::PhysicsUpdateContext::Step", ptr %68, i32 0, i32 29
  store ptr %67, ptr %69, align 8, !tbaa !30
  %70 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %10, i32 0, i32 18
  call void @_ZN3JPH19LargeIslandSplitter24PrepareForSolvePositionsEv(ptr noundef nonnull align 8 dereferenceable(60) %70)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  ret void
}

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

declare void @_ZN3JPH19LargeIslandSplitter24PrepareForSolvePositionsEv(ptr noundef nonnull align 8 dereferenceable(60)) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { "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 = !{!10, !6, i64 8}
!10 = !{!"_ZTSN3JPH20PhysicsUpdateContextE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !11, i64 36, !12, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !15, i64 72, !14, i64 104, !6, i64 112, !12, i64 120}
!11 = !{!"float", !7, i64 0}
!12 = !{!"_ZTSSt6atomicIjE", !13, i64 0}
!13 = !{!"_ZTSSt13__atomic_baseIjE", !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTSN3JPH5ArrayINS_20PhysicsUpdateContext4StepENS_16STLTempAllocatorIS2_EEEE", !16, i64 0, !17, i64 8, !17, i64 16, !6, i64 24}
!16 = !{!"_ZTSN3JPH16STLTempAllocatorINS_20PhysicsUpdateContext4StepEEE", !6, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!19, !6, i64 4568}
!19 = !{!"_ZTSN3JPH20PhysicsUpdateContext4StepE", !6, i64 0, !20, i64 8, !20, i64 9, !21, i64 16, !14, i64 48, !12, i64 52, !7, i64 56, !12, i64 116, !7, i64 120, !12, i64 180, !7, i64 184, !12, i64 244, !7, i64 248, !12, i64 308, !7, i64 312, !12, i64 372, !7, i64 376, !22, i64 436, !14, i64 4536, !12, i64 4540, !12, i64 4544, !12, i64 4548, !12, i64 4552, !12, i64 4556, !12, i64 4560, !6, i64 4568, !14, i64 4576, !12, i64 4580, !12, i64 4584, !6, i64 4592, !14, i64 4600, !23, i64 4608, !25, i64 4616, !25, i64 4880, !25, i64 5144, !25, i64 5408, !23, i64 5672, !25, i64 5680, !23, i64 5944, !23, i64 5952, !23, i64 5960, !25, i64 5968, !23, i64 6232, !25, i64 6240, !23, i64 6504, !23, i64 6512, !25, i64 6520, !23, i64 6784, !23, i64 6792, !25, i64 6800, !25, i64 7064, !23, i64 7328, !23, i64 7336}
!20 = !{!"bool", !7, i64 0}
!21 = !{!"_ZTSN3JPH10BroadPhase11UpdateStateE", !7, i64 0}
!22 = !{!"_ZTSN3JPH11StaticArrayINS_20PhysicsUpdateContext13BodyPairQueueELj32EEE", !14, i64 0, !7, i64 4}
!23 = !{!"_ZTSN3JPH9JobSystem9JobHandleE", !24, i64 0}
!24 = !{!"_ZTSN3JPH3RefINS_9JobSystem3JobEEE", !6, i64 0}
!25 = !{!"_ZTSN3JPH11StaticArrayINS_9JobSystem9JobHandleELj32EEE", !14, i64 0, !7, i64 8}
!26 = !{i64 2160026733}
!27 = !{!19, !14, i64 4576}
!28 = !{!29, !29, i64 0}
!29 = !{!"vtable pointer", !8, i64 0}
!30 = !{!19, !6, i64 4592}
!31 = !{i64 2160027103}
!32 = !{!19, !14, i64 4600}


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

@.str.24 = external hidden unnamed_addr constant [83 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [40 x i8], align 1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3JPH11BodyManager18GetNumActiveBodiesENS_9EBodyTypeE(ptr noundef nonnull align 8 dereferenceable(297), i8 noundef zeroext) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH13PhysicsSystem23JobPreIntegrateVelocityEPNS_20PhysicsUpdateContextEPNS1_4StepE(ptr noundef nonnull align 16 dereferenceable(1172) %0, ptr nocapture noundef readonly %1, ptr nocapture noundef %2) local_unnamed_addr #2 align 2 {
  %4 = getelementptr inbounds i8, ptr %1, i64 8
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %2, i64 4568
  %7 = load ptr, ptr %6, align 8, !tbaa !17
  %8 = icmp eq ptr %7, null
  br i1 %8, label %12, label %9

9:                                                ; preds = %3
  %10 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.56, ptr noundef nonnull @.str.24, i32 noundef 1478)
  br i1 %10, label %11, label %12

11:                                               ; preds = %9
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #4, !srcloc !25
  br label %12

12:                                               ; preds = %11, %9, %3
  %13 = getelementptr inbounds i8, ptr %0, i64 16
  %14 = tail call noundef i32 @_ZNK3JPH11BodyManager21GetNumActiveCCDBodiesEv(ptr noundef nonnull align 8 dereferenceable(297) %13)
  %15 = getelementptr inbounds i8, ptr %2, i64 4576
  store i32 %14, ptr %15, align 8, !tbaa !26
  %16 = mul i32 %14, 144
  %17 = load ptr, ptr %5, align 8, !tbaa !27
  %18 = getelementptr inbounds i8, ptr %17, i64 16
  %19 = load ptr, ptr %18, align 8
  %20 = tail call noundef ptr %19(ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef %16)
  store ptr %20, ptr %6, align 8, !tbaa !17
  %21 = getelementptr inbounds i8, ptr %2, i64 4592
  %22 = load ptr, ptr %21, align 8, !tbaa !29
  %23 = icmp eq ptr %22, null
  br i1 %23, label %27, label %24

24:                                               ; preds = %12
  %25 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.57, ptr noundef nonnull @.str.24, i32 noundef 1483)
  br i1 %25, label %26, label %27

26:                                               ; preds = %24
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #4, !srcloc !30
  br label %27

27:                                               ; preds = %26, %24, %12
  %28 = tail call noundef i32 @_ZNK3JPH11BodyManager18GetNumActiveBodiesENS_9EBodyTypeE(ptr noundef nonnull align 8 dereferenceable(297) %13, i8 noundef zeroext 0)
  %29 = getelementptr inbounds i8, ptr %2, i64 4600
  store i32 %28, ptr %29, align 8, !tbaa !31
  %30 = shl i32 %28, 2
  %31 = load ptr, ptr %5, align 8, !tbaa !27
  %32 = getelementptr inbounds i8, ptr %31, i64 16
  %33 = load ptr, ptr %32, align 8
  %34 = tail call noundef ptr %33(ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef %30)
  store ptr %34, ptr %21, align 8, !tbaa !29
  %35 = getelementptr inbounds i8, ptr %0, i64 1016
  tail call void @_ZN3JPH19LargeIslandSplitter24PrepareForSolvePositionsEv(ptr noundef nonnull align 8 dereferenceable(60) %35)
  ret void
}

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

declare void @_ZN3JPH19LargeIslandSplitter24PrepareForSolvePositionsEv(ptr noundef nonnull align 8 dereferenceable(60)) local_unnamed_addr #3

attributes #0 = { 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 #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { "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, !7, i64 8}
!6 = !{!"_ZTSN3JPH20PhysicsUpdateContextE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !10, i64 36, !11, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !14, i64 72, !13, i64 104, !7, i64 112, !11, i64 120}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!"_ZTSSt6atomicIjE", !12, i64 0}
!12 = !{!"_ZTSSt13__atomic_baseIjE", !13, i64 0}
!13 = !{!"int", !8, i64 0}
!14 = !{!"_ZTSN3JPH5ArrayINS_20PhysicsUpdateContext4StepENS_16STLTempAllocatorIS2_EEEE", !15, i64 0, !16, i64 8, !16, i64 16, !7, i64 24}
!15 = !{!"_ZTSN3JPH16STLTempAllocatorINS_20PhysicsUpdateContext4StepEEE", !7, i64 0}
!16 = !{!"long", !8, i64 0}
!17 = !{!18, !7, i64 4568}
!18 = !{!"_ZTSN3JPH20PhysicsUpdateContext4StepE", !7, i64 0, !19, i64 8, !19, i64 9, !20, i64 16, !13, i64 48, !11, i64 52, !8, i64 56, !11, i64 116, !8, i64 120, !11, i64 180, !8, i64 184, !11, i64 244, !8, i64 248, !11, i64 308, !8, i64 312, !11, i64 372, !8, i64 376, !21, i64 436, !13, i64 4536, !11, i64 4540, !11, i64 4544, !11, i64 4548, !11, i64 4552, !11, i64 4556, !11, i64 4560, !7, i64 4568, !13, i64 4576, !11, i64 4580, !11, i64 4584, !7, i64 4592, !13, i64 4600, !22, i64 4608, !24, i64 4616, !24, i64 4880, !24, i64 5144, !24, i64 5408, !22, i64 5672, !24, i64 5680, !22, i64 5944, !22, i64 5952, !22, i64 5960, !24, i64 5968, !22, i64 6232, !24, i64 6240, !22, i64 6504, !22, i64 6512, !24, i64 6520, !22, i64 6784, !22, i64 6792, !24, i64 6800, !24, i64 7064, !22, i64 7328, !22, i64 7336}
!19 = !{!"bool", !8, i64 0}
!20 = !{!"_ZTSN3JPH10BroadPhase11UpdateStateE", !8, i64 0}
!21 = !{!"_ZTSN3JPH11StaticArrayINS_20PhysicsUpdateContext13BodyPairQueueELj32EEE", !13, i64 0, !8, i64 4}
!22 = !{!"_ZTSN3JPH9JobSystem9JobHandleE", !23, i64 0}
!23 = !{!"_ZTSN3JPH3RefINS_9JobSystem3JobEEE", !7, i64 0}
!24 = !{!"_ZTSN3JPH11StaticArrayINS_9JobSystem9JobHandleELj32EEE", !13, i64 0, !8, i64 8}
!25 = !{i64 2160026733}
!26 = !{!18, !13, i64 4576}
!27 = !{!28, !28, i64 0}
!28 = !{!"vtable pointer", !9, i64 0}
!29 = !{!18, !7, i64 4592}
!30 = !{i64 2160027103}
!31 = !{!18, !13, i64 4600}


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