; LLVM IR from zig-gamedev/zphysics :: libs/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"

%"class.JPH::BodyAccess::Grant" = type { i8 }
%"class.JPH::BodyManager::GrantActiveBodiesAccess" = type { i8 }
%"class.JPH::PhysicsSystem::BodiesToSleep" = type { ptr, ptr, ptr }
%"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 }
%"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, %"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", [8 x i8], %"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 }
%"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> }
%"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 }

; 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: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH10BodyAccess5GrantC2ENS0_7EAccessES2_(ptr noundef nonnull align 1 dereferenceable(1), i8 noundef zeroext, i8 noundef zeroext) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH11BodyManager23GrantActiveBodiesAccessC2Ebb(ptr noundef nonnull align 1 dereferenceable(1), i1 noundef zeroext, i1 noundef zeroext) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH11BodyManager23GrantActiveBodiesAccessD2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH10BodyAccess5GrantD2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

declare noundef i32 @_ZN3JPH19LargeIslandSplitter14FetchNextBatchERjRPjS3_S3_S3_Rb(ptr noundef nonnull align 8 dereferenceable(60), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(1)) #4

declare void @_ZN3JPH19LargeIslandSplitter18MarkBatchProcessedEjPKjS2_S2_S2_RbS3_(ptr noundef nonnull align 8 dereferenceable(60), i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) #4

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

declare noundef zeroext i1 @_ZNK3JPH13IslandBuilder22GetConstraintsInIslandEjRPjS2_(ptr noundef nonnull align 8 dereferenceable(112), i32 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

declare noundef zeroext i1 @_ZNK3JPH13IslandBuilder19GetContactsInIslandEjRPjS2_(ptr noundef nonnull align 8 dereferenceable(112), i32 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt11this_thread5yieldEv() #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH13PhysicsSystem25CheckSleepAndUpdateBoundsEjPKNS_20PhysicsUpdateContextEPKNS1_4StepERNS0_13BodiesToSleepE(ptr noundef nonnull align 16 dereferenceable(1140), i32 noundef, ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(24)) #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH13PhysicsSystem27JobSolvePositionConstraintsEPNS_20PhysicsUpdateContextEPNS1_4StepE(ptr noundef nonnull align 16 dereferenceable(1140) %0, ptr noundef %1, ptr noundef %2) #5 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.JPH::BodyAccess::Grant", align 1
  %8 = alloca %"class.JPH::BodyManager::GrantActiveBodiesAccess", align 1
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca ptr, align 8
  %14 = alloca %"class.JPH::PhysicsSystem::BodiesToSleep", align 8
  %15 = alloca i8, align 1
  %16 = alloca i8, align 1
  %17 = alloca i8, align 1
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i8, align 1
  %24 = alloca i8, align 1
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca ptr, align 8
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i8, 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
  %35 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #6
  call void @_ZN3JPH10BodyAccess5GrantC2ENS0_7EAccessES2_(ptr noundef nonnull align 1 dereferenceable(1) %7, i8 noundef zeroext 0, i8 noundef zeroext 3)
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #6
  invoke void @_ZN3JPH11BodyManager23GrantActiveBodiesAccessC2Ebb(ptr noundef nonnull align 1 dereferenceable(1) %8, i1 noundef zeroext false, i1 noundef zeroext true)
          to label %36 unwind label %61

36:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %"class.JPH::PhysicsUpdateContext", ptr %37, i32 0, i32 4
  %39 = load float, ptr %38, align 8, !tbaa !9
  store float %39, ptr %11, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %40 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %35, i32 0, i32 11
  %41 = getelementptr inbounds %"struct.JPH::PhysicsSettings", ptr %40, i32 0, i32 3
  %42 = load float, ptr %41, align 4, !tbaa !19
  store float %42, ptr %12, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %"class.JPH::PhysicsUpdateContext", ptr %43, i32 0, i32 8
  %45 = load ptr, ptr %44, align 8, !tbaa !44
  store ptr %45, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #6
  %46 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %35, i32 0, i32 2
  %47 = alloca i8, i64 2048, align 16
  invoke void @_ZN3JPH13PhysicsSystem13BodiesToSleepC2ERNS_11BodyManagerEPNS_6BodyIDE(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(297) %46, ptr noundef %47)
          to label %48 unwind label %65

48:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #6
  store i8 1, ptr %15, align 1, !tbaa !45
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #6
  %49 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %35, i32 0, i32 11
  %50 = getelementptr inbounds %"struct.JPH::PhysicsSettings", ptr %49, i32 0, i32 23
  %51 = load i8, ptr %50, align 16, !tbaa !46, !range !47, !noundef !48
  %52 = trunc i8 %51 to i1
  %53 = zext i1 %52 to i8
  store i8 %53, ptr %16, align 1, !tbaa !45
  br label %54

54:                                               ; preds = %238, %48
  %55 = load i8, ptr %16, align 1, !tbaa !45, !range !47, !noundef !48
  %56 = trunc i8 %55 to i1
  br i1 %56, label %57, label %109

57:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %58 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %35, i32 0, i32 16
  %59 = invoke noundef i32 @_ZN3JPH19LargeIslandSplitter14FetchNextBatchERjRPjS3_S3_S3_Rb(ptr noundef nonnull align 8 dereferenceable(60) %58, ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %60 unwind label %69

60:                                               ; preds = %57
  switch i32 %59, label %105 [
    i32 1, label %73
    i32 0, label %105
    i32 2, label %104
  ]

61:                                               ; preds = %3
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %9, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %10, align 4
  br label %243

65:                                               ; preds = %36
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %9, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %10, align 4
  br label %242

69:                                               ; preds = %99, %95, %85, %80, %73, %57
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %9, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #6
  br label %241

73:                                               ; preds = %60
  %74 = load ptr, ptr %13, align 8, !tbaa !5
  %75 = load ptr, ptr %19, align 8, !tbaa !5
  %76 = load ptr, ptr %20, align 8, !tbaa !5
  %77 = load float, ptr %11, align 4, !tbaa !18
  %78 = load float, ptr %12, align 4, !tbaa !18
  %79 = invoke noundef zeroext i1 @_ZN3JPH17ConstraintManager25sSolvePositionConstraintsEPPNS_10ConstraintEPKjS5_ff(ptr noundef %74, ptr noundef %75, ptr noundef %76, float noundef %77, float noundef %78)
          to label %80 unwind label %69

80:                                               ; preds = %73
  %81 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %35, i32 0, i32 13
  %82 = load ptr, ptr %21, align 8, !tbaa !5
  %83 = load ptr, ptr %22, align 8, !tbaa !5
  %84 = invoke noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24SolvePositionConstraintsEPKjS2_(ptr noundef nonnull align 8 dereferenceable(248) %81, ptr noundef %82, ptr noundef %83)
          to label %85 unwind label %69

85:                                               ; preds = %80
  %86 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %35, i32 0, i32 16
  %87 = load i32, ptr %18, align 4, !tbaa !49
  %88 = load ptr, ptr %19, align 8, !tbaa !5
  %89 = load ptr, ptr %20, align 8, !tbaa !5
  %90 = load ptr, ptr %21, align 8, !tbaa !5
  %91 = load ptr, ptr %22, align 8, !tbaa !5
  invoke void @_ZN3JPH19LargeIslandSplitter18MarkBatchProcessedEjPKjS2_S2_S2_RbS3_(ptr noundef nonnull align 8 dereferenceable(60) %86, i32 noundef %87, ptr noundef %88, ptr noundef %89, ptr noundef %90, ptr noundef %91, ptr noundef nonnull align 1 dereferenceable(1) %23, ptr noundef nonnull align 1 dereferenceable(1) %24)
          to label %92 unwind label %69

92:                                               ; preds = %85
  %93 = load i8, ptr %24, align 1, !tbaa !45, !range !47, !noundef !48
  %94 = trunc i8 %93 to i1
  br i1 %94, label %95, label %103

95:                                               ; preds = %92
  %96 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %35, i32 0, i32 16
  %97 = load i32, ptr %18, align 4, !tbaa !49
  %98 = invoke noundef i32 @_ZNK3JPH19LargeIslandSplitter14GetIslandIndexEj(ptr noundef nonnull align 8 dereferenceable(60) %96, i32 noundef %97)
          to label %99 unwind label %69

99:                                               ; preds = %95
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN3JPH13PhysicsSystem25CheckSleepAndUpdateBoundsEjPKNS_20PhysicsUpdateContextEPKNS1_4StepERNS0_13BodiesToSleepE(ptr noundef nonnull align 16 dereferenceable(1140) %35, i32 noundef %98, ptr noundef %100, ptr noundef %101, ptr noundef nonnull align 8 dereferenceable(24) %14)
          to label %102 unwind label %69

102:                                              ; preds = %99
  br label %103

103:                                              ; preds = %102, %92
  store i32 3, ptr %25, align 4
  br label %106

104:                                              ; preds = %60
  store i8 0, ptr %16, align 1, !tbaa !45
  br label %105

105:                                              ; preds = %104, %60, %60
  store i32 0, ptr %25, align 4
  br label %106

106:                                              ; preds = %105, %103
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #6
  %107 = load i32, ptr %25, align 4
  switch i32 %107, label %249 [
    i32 0, label %108
    i32 3, label %232
  ]

108:                                              ; preds = %106
  br label %109

109:                                              ; preds = %108, %54
  %110 = load i8, ptr %15, align 1, !tbaa !45, !range !47, !noundef !48
  %111 = trunc i8 %110 to i1
  br i1 %111, label %112, label %231

112:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  %113 = load ptr, ptr %6, align 8, !tbaa !5
  %114 = getelementptr inbounds %"struct.JPH::PhysicsUpdateContext::Step", ptr %113, i32 0, i32 23
  %115 = call noundef i32 @_ZNSt13__atomic_baseIjEppEi(ptr noundef nonnull align 4 dereferenceable(4) %114, i32 noundef 0) #6
  store i32 %115, ptr %26, align 4, !tbaa !49
  %116 = load i32, ptr %26, align 4, !tbaa !49
  %117 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %35, i32 0, i32 15
  %118 = invoke noundef i32 @_ZNK3JPH13IslandBuilder13GetNumIslandsEv(ptr noundef nonnull align 8 dereferenceable(112) %117)
          to label %119 unwind label %122

119:                                              ; preds = %112
  %120 = icmp uge i32 %116, %118
  br i1 %120, label %121, label %126

121:                                              ; preds = %119
  store i8 0, ptr %15, align 1, !tbaa !45
  store i32 3, ptr %25, align 4
  br label %229

122:                                              ; preds = %112
  %123 = landingpad { ptr, i32 }
          cleanup
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %9, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %10, align 4
  br label %230

126:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  %127 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %35, i32 0, i32 15
  %128 = load i32, ptr %26, align 4, !tbaa !49
  %129 = invoke noundef zeroext i1 @_ZNK3JPH13IslandBuilder22GetConstraintsInIslandEjRPjS2_(ptr noundef nonnull align 8 dereferenceable(112) %127, i32 noundef %128, ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 8 dereferenceable(8) %28)
          to label %130 unwind label %158

130:                                              ; preds = %126
  %131 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %35, i32 0, i32 15
  %132 = load i32, ptr %26, align 4, !tbaa !49
  %133 = invoke noundef zeroext i1 @_ZNK3JPH13IslandBuilder19GetContactsInIslandEjRPjS2_(ptr noundef nonnull align 8 dereferenceable(112) %131, i32 noundef %132, ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef nonnull align 8 dereferenceable(8) %30)
          to label %134 unwind label %158

134:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #6
  %135 = load ptr, ptr %28, align 8, !tbaa !5
  %136 = load ptr, ptr %27, align 8, !tbaa !5
  %137 = ptrtoint ptr %135 to i64
  %138 = ptrtoint ptr %136 to i64
  %139 = sub i64 %137, %138
  %140 = sdiv exact i64 %139, 4
  %141 = trunc i64 %140 to i32
  %142 = load ptr, ptr %30, align 8, !tbaa !5
  %143 = load ptr, ptr %29, align 8, !tbaa !5
  %144 = ptrtoint ptr %142 to i64
  %145 = ptrtoint ptr %143 to i64
  %146 = sub i64 %144, %145
  %147 = sdiv exact i64 %146, 4
  %148 = trunc i64 %147 to i32
  %149 = add i32 %141, %148
  store i32 %149, ptr %31, align 4, !tbaa !49
  %150 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %35, i32 0, i32 11
  %151 = getelementptr inbounds %"struct.JPH::PhysicsSettings", ptr %150, i32 0, i32 23
  %152 = load i8, ptr %151, align 16, !tbaa !46, !range !47, !noundef !48
  %153 = trunc i8 %152 to i1
  br i1 %153, label %154, label %162

154:                                              ; preds = %134
  %155 = load i32, ptr %31, align 4, !tbaa !49
  %156 = icmp uge i32 %155, 128
  br i1 %156, label %157, label %162

157:                                              ; preds = %154
  store i32 3, ptr %25, align 4
  br label %226

158:                                              ; preds = %130, %126
  %159 = landingpad { ptr, i32 }
          cleanup
  %160 = extractvalue { ptr, i32 } %159, 0
  store ptr %160, ptr %9, align 8
  %161 = extractvalue { ptr, i32 } %159, 1
  store i32 %161, ptr %10, align 4
  br label %228

162:                                              ; preds = %154, %134
  %163 = load i32, ptr %31, align 4, !tbaa !49
  %164 = icmp ugt i32 %163, 0
  br i1 %164, label %165, label %217

165:                                              ; preds = %162
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #6
  %166 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %35, i32 0, i32 15
  %167 = load i32, ptr %26, align 4, !tbaa !49
  %168 = invoke noundef i32 @_ZNK3JPH13IslandBuilder19GetNumPositionStepsEj(ptr noundef nonnull align 8 dereferenceable(112) %166, i32 noundef %167)
          to label %169 unwind label %175

169:                                              ; preds = %165
  store i32 %168, ptr %32, align 4, !tbaa !49
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #6
  store i32 0, ptr %33, align 4, !tbaa !49
  br label %170

170:                                              ; preds = %211, %169
  %171 = load i32, ptr %33, align 4, !tbaa !49
  %172 = load i32, ptr %32, align 4, !tbaa !49
  %173 = icmp ult i32 %171, %172
  br i1 %173, label %179, label %174

174:                                              ; preds = %170
  store i32 5, ptr %25, align 4
  br label %214

175:                                              ; preds = %165
  %176 = landingpad { ptr, i32 }
          cleanup
  %177 = extractvalue { ptr, i32 } %176, 0
  store ptr %177, ptr %9, align 8
  %178 = extractvalue { ptr, i32 } %176, 1
  store i32 %178, ptr %10, align 4
  br label %216

179:                                              ; preds = %170
  call void @llvm.lifetime.start.p0(i64 1, ptr %34) #6
  %180 = load ptr, ptr %13, align 8, !tbaa !5
  %181 = load ptr, ptr %27, align 8, !tbaa !5
  %182 = load ptr, ptr %28, align 8, !tbaa !5
  %183 = load float, ptr %11, align 4, !tbaa !18
  %184 = load float, ptr %12, align 4, !tbaa !18
  %185 = invoke noundef zeroext i1 @_ZN3JPH17ConstraintManager25sSolvePositionConstraintsEPPNS_10ConstraintEPKjS5_ff(ptr noundef %180, ptr noundef %181, ptr noundef %182, float noundef %183, float noundef %184)
          to label %186 unwind label %203

186:                                              ; preds = %179
  %187 = zext i1 %185 to i8
  store i8 %187, ptr %34, align 1, !tbaa !45
  %188 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %35, i32 0, i32 13
  %189 = load ptr, ptr %29, align 8, !tbaa !5
  %190 = load ptr, ptr %30, align 8, !tbaa !5
  %191 = invoke noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24SolvePositionConstraintsEPKjS2_(ptr noundef nonnull align 8 dereferenceable(248) %188, ptr noundef %189, ptr noundef %190)
          to label %192 unwind label %203

192:                                              ; preds = %186
  %193 = zext i1 %191 to i32
  %194 = load i8, ptr %34, align 1, !tbaa !45, !range !47, !noundef !48
  %195 = trunc i8 %194 to i1
  %196 = zext i1 %195 to i32
  %197 = or i32 %196, %193
  %198 = icmp ne i32 %197, 0
  %199 = zext i1 %198 to i8
  store i8 %199, ptr %34, align 1, !tbaa !45
  %200 = load i8, ptr %34, align 1, !tbaa !45, !range !47, !noundef !48
  %201 = trunc i8 %200 to i1
  br i1 %201, label %207, label %202

202:                                              ; preds = %192
  store i32 5, ptr %25, align 4
  br label %208

203:                                              ; preds = %186, %179
  %204 = landingpad { ptr, i32 }
          cleanup
  %205 = extractvalue { ptr, i32 } %204, 0
  store ptr %205, ptr %9, align 8
  %206 = extractvalue { ptr, i32 } %204, 1
  store i32 %206, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %34) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #6
  br label %216

207:                                              ; preds = %192
  store i32 0, ptr %25, align 4
  br label %208

208:                                              ; preds = %207, %202
  call void @llvm.lifetime.end.p0(i64 1, ptr %34) #6
  %209 = load i32, ptr %25, align 4
  switch i32 %209, label %214 [
    i32 0, label %210
  ]

210:                                              ; preds = %208
  br label %211

211:                                              ; preds = %210
  %212 = load i32, ptr %33, align 4, !tbaa !49
  %213 = add i32 %212, 1
  store i32 %213, ptr %33, align 4, !tbaa !49
  br label %170, !llvm.loop !50

214:                                              ; preds = %208, %174
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #6
  br label %215

215:                                              ; preds = %214
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #6
  br label %217

216:                                              ; preds = %203, %175
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #6
  br label %227

217:                                              ; preds = %215, %162
  %218 = load i32, ptr %26, align 4, !tbaa !49
  %219 = load ptr, ptr %5, align 8, !tbaa !5
  %220 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN3JPH13PhysicsSystem25CheckSleepAndUpdateBoundsEjPKNS_20PhysicsUpdateContextEPKNS1_4StepERNS0_13BodiesToSleepE(ptr noundef nonnull align 16 dereferenceable(1140) %35, i32 noundef %218, ptr noundef %219, ptr noundef %220, ptr noundef nonnull align 8 dereferenceable(24) %14)
          to label %221 unwind label %222

221:                                              ; preds = %217
  store i32 3, ptr %25, align 4
  br label %226

222:                                              ; preds = %217
  %223 = landingpad { ptr, i32 }
          cleanup
  %224 = extractvalue { ptr, i32 } %223, 0
  store ptr %224, ptr %9, align 8
  %225 = extractvalue { ptr, i32 } %223, 1
  store i32 %225, ptr %10, align 4
  br label %227

226:                                              ; preds = %221, %157
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  br label %229

227:                                              ; preds = %222, %216
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #6
  br label %228

228:                                              ; preds = %227, %158
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  br label %230

229:                                              ; preds = %226, %121
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  br label %232

230:                                              ; preds = %228, %122
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  br label %241

231:                                              ; preds = %109
  call void @_ZNSt11this_thread5yieldEv() #6
  br label %232

232:                                              ; preds = %231, %229, %106
  %233 = load i8, ptr %15, align 1, !tbaa !45, !range !47, !noundef !48
  %234 = trunc i8 %233 to i1
  br i1 %234, label %238, label %235

235:                                              ; preds = %232
  %236 = load i8, ptr %16, align 1, !tbaa !45, !range !47, !noundef !48
  %237 = trunc i8 %236 to i1
  br label %238

238:                                              ; preds = %235, %232
  %239 = phi i1 [ true, %232 ], [ %237, %235 ]
  br i1 %239, label %54, label %240, !llvm.loop !52

240:                                              ; preds = %238
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #6
  call void @_ZN3JPH13PhysicsSystem13BodiesToSleepD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @_ZN3JPH11BodyManager23GrantActiveBodiesAccessD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #6
  call void @_ZN3JPH10BodyAccess5GrantD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  ret void

241:                                              ; preds = %230, %69
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #6
  call void @_ZN3JPH13PhysicsSystem13BodiesToSleepD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #6
  br label %242

242:                                              ; preds = %241, %65
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @_ZN3JPH11BodyManager23GrantActiveBodiesAccessD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #6
  br label %243

243:                                              ; preds = %242, %61
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #6
  call void @_ZN3JPH10BodyAccess5GrantD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  br label %244

244:                                              ; preds = %243
  %245 = load ptr, ptr %9, align 8
  %246 = load i32, ptr %10, align 4
  %247 = insertvalue { ptr, i32 } poison, ptr %245, 0
  %248 = insertvalue { ptr, i32 } %247, i32 %246, 1
  resume { ptr, i32 } %248

249:                                              ; preds = %106
  unreachable
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH13PhysicsSystem13BodiesToSleepC2ERNS_11BodyManagerEPNS_6BodyIDE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(297), ptr noundef) unnamed_addr #2 align 2

declare noundef zeroext i1 @_ZN3JPH17ConstraintManager25sSolvePositionConstraintsEPPNS_10ConstraintEPKjS5_ff(ptr noundef, ptr noundef, ptr noundef, float noundef, float noundef) #4

declare noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24SolvePositionConstraintsEPKjS2_(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH19LargeIslandSplitter14GetIslandIndexEj(ptr noundef nonnull align 8 dereferenceable(60), i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH13IslandBuilder19GetNumPositionStepsEj(ptr noundef nonnull align 8 dereferenceable(112), i32 noundef) #5 align 2

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

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 = { 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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, !11, i64 32}
!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 = !{!11, !11, i64 0}
!19 = !{!20, !11, i64 460}
!20 = !{!"_ZTSN3JPH13PhysicsSystemE", !6, i64 0, !6, i64 8, !21, i64 16, !31, i64 320, !33, i64 336, !34, i64 352, !34, i64 376, !35, i64 400, !35, i64 416, !6, i64 432, !6, i64 440, !36, i64 448, !37, i64 536, !38, i64 784, !40, i64 864, !41, i64 976, !23, i64 1040, !42, i64 1088, !43, i64 1120, !11, i64 1136}
!21 = !{!"_ZTSN3JPH11BodyManagerE", !22, i64 0, !14, i64 24, !17, i64 32, !23, i64 40, !27, i64 88, !28, i64 104, !23, i64 128, !7, i64 176, !7, i64 192, !14, i64 200, !23, i64 208, !29, i64 256, !6, i64 280, !6, i64 288, !30, i64 296}
!22 = !{!"_ZTSN3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!23 = !{!"_ZTSN3JPH5MutexE", !24, i64 0, !26, i64 40}
!24 = !{!"_ZTSSt5mutex", !25, i64 0}
!25 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!26 = !{!"_ZTSNSt6thread2idE", !17, i64 0}
!27 = !{!"_ZTSN3JPH10MutexArrayINS_11SharedMutexEEE", !6, i64 0, !14, i64 8}
!28 = !{!"_ZTSN3JPH5ArrayIhNS_12STLAllocatorIhEEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!29 = !{!"_ZTSN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!30 = !{!"bool", !7, i64 0}
!31 = !{!"_ZTSN3JPH23BodyLockInterfaceNoLockE", !32, i64 0}
!32 = !{!"_ZTSN3JPH17BodyLockInterfaceE", !6, i64 8}
!33 = !{!"_ZTSN3JPH24BodyLockInterfaceLockingE", !32, i64 0}
!34 = !{!"_ZTSN3JPH13BodyInterfaceE", !6, i64 0, !6, i64 8, !6, i64 16}
!35 = !{!"_ZTSN3JPH16NarrowPhaseQueryE", !6, i64 0, !6, i64 8}
!36 = !{!"_ZTSN3JPH15PhysicsSettingsE", !14, i64 0, !14, i64 4, !14, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !14, i64 56, !14, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !30, i64 76, !30, i64 77, !30, i64 78, !30, i64 79, !30, i64 80, !30, i64 81, !30, i64 82}
!37 = !{!"_ZTSN3JPH24ContactConstraintManagerE", !7, i64 8, !14, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !14, i64 232, !12, i64 236, !6, i64 240}
!38 = !{!"_ZTSN3JPH17ConstraintManagerE", !6, i64 0, !39, i64 8, !23, i64 32}
!39 = !{!"_ZTSN3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!40 = !{!"_ZTSN3JPH13IslandBuilderE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !14, i64 88, !14, i64 92, !14, i64 96, !14, i64 100, !14, i64 104, !14, i64 108}
!41 = !{!"_ZTSN3JPH19LargeIslandSplitterE", !14, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !14, i64 32, !12, i64 36, !14, i64 40, !6, i64 48, !12, i64 56}
!42 = !{!"_ZTSN3JPH5ArrayIPNS_19PhysicsStepListenerENS_12STLAllocatorIS2_EEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!43 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!44 = !{!10, !6, i64 48}
!45 = !{!30, !30, i64 0}
!46 = !{!20, !30, i64 528}
!47 = !{i8 0, i8 2}
!48 = !{}
!49 = !{!14, !14, i64 0}
!50 = distinct !{!50, !51}
!51 = !{!"llvm.loop.mustprogress"}
!52 = distinct !{!52, !51}


; 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::BodyAccess::Grant" = type { i8 }
%"class.JPH::BodyManager::GrantActiveBodiesAccess" = type { i8 }
%"class.JPH::PhysicsSystem::BodiesToSleep" = type { ptr, ptr, ptr }

; 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: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH10BodyAccess5GrantC2ENS0_7EAccessES2_(ptr noundef nonnull align 1 dereferenceable(1), i8 noundef zeroext, i8 noundef zeroext) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH11BodyManager23GrantActiveBodiesAccessC2Ebb(ptr noundef nonnull align 1 dereferenceable(1), i1 noundef zeroext, i1 noundef zeroext) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH11BodyManager23GrantActiveBodiesAccessD2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH10BodyAccess5GrantD2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3JPH13IslandBuilder13GetNumIslandsEv(ptr noundef nonnull align 8 dereferenceable(112)) local_unnamed_addr #3 align 2

declare noundef i32 @_ZN3JPH19LargeIslandSplitter14FetchNextBatchERjRPjS3_S3_S3_Rb(ptr noundef nonnull align 8 dereferenceable(60), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4

declare void @_ZN3JPH19LargeIslandSplitter18MarkBatchProcessedEjPKjS2_S2_S2_RbS3_(ptr noundef nonnull align 8 dereferenceable(60), i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4

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

declare noundef zeroext i1 @_ZNK3JPH13IslandBuilder22GetConstraintsInIslandEjRPjS2_(ptr noundef nonnull align 8 dereferenceable(112), i32 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

declare noundef zeroext i1 @_ZNK3JPH13IslandBuilder19GetContactsInIslandEjRPjS2_(ptr noundef nonnull align 8 dereferenceable(112), i32 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt11this_thread5yieldEv() local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH13PhysicsSystem25CheckSleepAndUpdateBoundsEjPKNS_20PhysicsUpdateContextEPKNS1_4StepERNS0_13BodiesToSleepE(ptr noundef nonnull align 16 dereferenceable(1140), i32 noundef, ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH13PhysicsSystem27JobSolvePositionConstraintsEPNS_20PhysicsUpdateContextEPNS1_4StepE(ptr noundef nonnull align 16 dereferenceable(1140) %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.JPH::BodyAccess::Grant", align 1
  %5 = alloca %"class.JPH::BodyManager::GrantActiveBodiesAccess", align 1
  %6 = alloca %"class.JPH::PhysicsSystem::BodiesToSleep", align 8
  %7 = alloca i8, align 1
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i8, align 1
  %14 = alloca i8, align 1
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #6
  call void @_ZN3JPH10BodyAccess5GrantC2ENS0_7EAccessES2_(ptr noundef nonnull align 1 dereferenceable(1) %4, i8 noundef zeroext 0, i8 noundef zeroext 3)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #6
  invoke void @_ZN3JPH11BodyManager23GrantActiveBodiesAccessC2Ebb(ptr noundef nonnull align 1 dereferenceable(1) %5, i1 noundef zeroext false, i1 noundef zeroext true)
          to label %19 unwind label %39

19:                                               ; preds = %3
  %20 = getelementptr inbounds i8, ptr %1, i64 32
  %21 = load float, ptr %20, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %0, i64 460
  %23 = load float, ptr %22, align 4, !tbaa !17
  %24 = getelementptr inbounds i8, ptr %1, i64 48
  %25 = load ptr, ptr %24, align 8, !tbaa !42
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  %26 = getelementptr inbounds i8, ptr %0, i64 16
  %27 = alloca [2048 x i8], align 16
  call void @_ZN3JPH13PhysicsSystem13BodiesToSleepC2ERNS_11BodyManagerEPNS_6BodyIDE(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(297) %26, ptr noundef nonnull %27)
  %28 = getelementptr inbounds i8, ptr %0, i64 528
  %29 = load i8, ptr %28, align 16, !tbaa !43, !range !44, !noundef !45
  %30 = getelementptr inbounds i8, ptr %0, i64 976
  %31 = getelementptr inbounds i8, ptr %0, i64 536
  %32 = getelementptr inbounds i8, ptr %2, i64 4556
  %33 = getelementptr inbounds i8, ptr %0, i64 864
  br label %34

34:                                               ; preds = %119, %19
  %.045 = phi i8 [ %29, %19 ], [ %.449, %119 ]
  %.040 = phi i8 [ 1, %19 ], [ %.242, %119 ]
  %35 = trunc nuw i8 %.045 to i1
  br i1 %35, label %36, label %66

36:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #6
  %37 = invoke noundef i32 @_ZN3JPH19LargeIslandSplitter14FetchNextBatchERjRPjS3_S3_S3_Rb(ptr noundef nonnull align 8 dereferenceable(60) %30, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %38 unwind label %41

38:                                               ; preds = %36
  switch i32 %37, label %.thread [
    i32 1, label %43
    i32 2, label %64
  ]

39:                                               ; preds = %3
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %125

41:                                               ; preds = %63, %60, %51, %47, %43, %36
  %42 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #6
  br label %124

43:                                               ; preds = %38
  %44 = load ptr, ptr %9, align 8, !tbaa !46
  %45 = load ptr, ptr %10, align 8, !tbaa !46
  %46 = invoke noundef zeroext i1 @_ZN3JPH17ConstraintManager25sSolvePositionConstraintsEPPNS_10ConstraintEPKjS5_ff(ptr noundef %25, ptr noundef %44, ptr noundef %45, float noundef %21, float noundef %23)
          to label %47 unwind label %41

47:                                               ; preds = %43
  %48 = load ptr, ptr %11, align 8, !tbaa !46
  %49 = load ptr, ptr %12, align 8, !tbaa !46
  %50 = invoke noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24SolvePositionConstraintsEPKjS2_(ptr noundef nonnull align 8 dereferenceable(248) %31, ptr noundef %48, ptr noundef %49)
          to label %51 unwind label %41

51:                                               ; preds = %47
  %52 = load i32, ptr %8, align 4, !tbaa !47
  %53 = load ptr, ptr %9, align 8, !tbaa !46
  %54 = load ptr, ptr %10, align 8, !tbaa !46
  %55 = load ptr, ptr %11, align 8, !tbaa !46
  %56 = load ptr, ptr %12, align 8, !tbaa !46
  invoke void @_ZN3JPH19LargeIslandSplitter18MarkBatchProcessedEjPKjS2_S2_S2_RbS3_(ptr noundef nonnull align 8 dereferenceable(60) %30, i32 noundef %52, ptr noundef %53, ptr noundef %54, ptr noundef %55, ptr noundef %56, ptr noundef nonnull align 1 dereferenceable(1) %13, ptr noundef nonnull align 1 dereferenceable(1) %14)
          to label %57 unwind label %41

57:                                               ; preds = %51
  %58 = load i8, ptr %14, align 1, !tbaa !48, !range !44, !noundef !45
  %59 = trunc nuw i8 %58 to i1
  br i1 %59, label %60, label %65

60:                                               ; preds = %57
  %61 = load i32, ptr %8, align 4, !tbaa !47
  %62 = invoke noundef i32 @_ZNK3JPH19LargeIslandSplitter14GetIslandIndexEj(ptr noundef nonnull align 8 dereferenceable(60) %30, i32 noundef %61)
          to label %63 unwind label %41

63:                                               ; preds = %60
  invoke void @_ZN3JPH13PhysicsSystem25CheckSleepAndUpdateBoundsEjPKNS_20PhysicsUpdateContextEPKNS1_4StepERNS0_13BodiesToSleepE(ptr noundef nonnull align 16 dereferenceable(1140) %0, i32 noundef %62, ptr noundef %1, ptr noundef %2, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %65 unwind label %41

64:                                               ; preds = %38
  br label %.thread

.thread:                                          ; preds = %64, %38
  %.247.ph = phi i8 [ 0, %64 ], [ %.045, %38 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #6
  br label %66

65:                                               ; preds = %57, %63
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #6
  br label %119

66:                                               ; preds = %.thread, %34
  %.348 = phi i8 [ %.045, %34 ], [ %.247.ph, %.thread ]
  %67 = trunc nuw i8 %.040 to i1
  br i1 %67, label %68, label %118

68:                                               ; preds = %66
  %69 = call noundef i32 @_ZNSt13__atomic_baseIjEppEi(ptr noundef nonnull align 4 dereferenceable(4) %32, i32 noundef 0) #6
  %70 = call noundef i32 @_ZNK3JPH13IslandBuilder13GetNumIslandsEv(ptr noundef nonnull align 8 dereferenceable(112) %33)
  %.not = icmp ult i32 %69, %70
  br i1 %.not, label %71, label %119

71:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #6
  %72 = invoke noundef zeroext i1 @_ZNK3JPH13IslandBuilder22GetConstraintsInIslandEjRPjS2_(ptr noundef nonnull align 8 dereferenceable(112) %33, i32 noundef %69, ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %73 unwind label %94

73:                                               ; preds = %71
  %74 = invoke noundef zeroext i1 @_ZNK3JPH13IslandBuilder19GetContactsInIslandEjRPjS2_(ptr noundef nonnull align 8 dereferenceable(112) %33, i32 noundef %69, ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %75 unwind label %94

75:                                               ; preds = %73
  %76 = load ptr, ptr %16, align 8, !tbaa !46
  %77 = load ptr, ptr %15, align 8, !tbaa !46
  %78 = ptrtoint ptr %76 to i64
  %79 = ptrtoint ptr %77 to i64
  %80 = sub i64 %78, %79
  %81 = lshr exact i64 %80, 2
  %82 = trunc i64 %81 to i32
  %83 = load ptr, ptr %18, align 8, !tbaa !46
  %84 = load ptr, ptr %17, align 8, !tbaa !46
  %85 = ptrtoint ptr %83 to i64
  %86 = ptrtoint ptr %84 to i64
  %87 = sub i64 %85, %86
  %88 = lshr exact i64 %87, 2
  %89 = trunc i64 %88 to i32
  %90 = add i32 %89, %82
  %91 = load i8, ptr %28, align 16, !tbaa !43, !range !44, !noundef !45
  %92 = trunc nuw i8 %91 to i1
  %93 = icmp ugt i32 %90, 127
  %or.cond = select i1 %92, i1 %93, i1 false
  br i1 %or.cond, label %116, label %96

94:                                               ; preds = %73, %71
  %95 = landingpad { ptr, i32 }
          cleanup
  br label %117

96:                                               ; preds = %75
  %.not51 = icmp eq i32 %90, 0
  br i1 %.not51, label %.loopexit, label %97

97:                                               ; preds = %96
  %98 = invoke noundef i32 @_ZNK3JPH13IslandBuilder19GetNumPositionStepsEj(ptr noundef nonnull align 8 dereferenceable(112) %33, i32 noundef %69)
          to label %.preheader unwind label %99

.preheader:                                       ; preds = %97
  %.not64 = icmp eq i32 %98, 0
  br i1 %.not64, label %.loopexit, label %.lr.ph

99:                                               ; preds = %97
  %100 = landingpad { ptr, i32 }
          cleanup
  br label %117

.lr.ph:                                           ; preds = %.preheader, %108
  %.061 = phi i32 [ %110, %108 ], [ 0, %.preheader ]
  %101 = load ptr, ptr %15, align 8, !tbaa !46
  %102 = load ptr, ptr %16, align 8, !tbaa !46
  %103 = invoke noundef zeroext i1 @_ZN3JPH17ConstraintManager25sSolvePositionConstraintsEPPNS_10ConstraintEPKjS5_ff(ptr noundef %25, ptr noundef %101, ptr noundef %102, float noundef %21, float noundef %23)
          to label %104 unwind label %112

104:                                              ; preds = %.lr.ph
  %105 = load ptr, ptr %17, align 8, !tbaa !46
  %106 = load ptr, ptr %18, align 8, !tbaa !46
  %107 = invoke noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24SolvePositionConstraintsEPKjS2_(ptr noundef nonnull align 8 dereferenceable(248) %31, ptr noundef %105, ptr noundef %106)
          to label %108 unwind label %112

108:                                              ; preds = %104
  %109 = or i1 %103, %107
  %110 = add nuw i32 %.061, 1
  %111 = icmp ult i32 %110, %98
  %or.cond63 = select i1 %109, i1 %111, i1 false
  br i1 %or.cond63, label %.lr.ph, label %.loopexit, !llvm.loop !49

112:                                              ; preds = %104, %.lr.ph
  %113 = landingpad { ptr, i32 }
          cleanup
  br label %117

.loopexit:                                        ; preds = %108, %.preheader, %96
  invoke void @_ZN3JPH13PhysicsSystem25CheckSleepAndUpdateBoundsEjPKNS_20PhysicsUpdateContextEPKNS1_4StepERNS0_13BodiesToSleepE(ptr noundef nonnull align 16 dereferenceable(1140) %0, i32 noundef %69, ptr noundef %1, ptr noundef %2, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %116 unwind label %114

114:                                              ; preds = %.loopexit
  %115 = landingpad { ptr, i32 }
          cleanup
  br label %117

116:                                              ; preds = %.loopexit, %75
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #6
  br label %119

117:                                              ; preds = %114, %112, %99, %94
  %.pn53.pn = phi { ptr, i32 } [ %95, %94 ], [ %115, %114 ], [ %113, %112 ], [ %100, %99 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #6
  br label %124

118:                                              ; preds = %66
  call void @_ZNSt11this_thread5yieldEv() #6
  br label %119

119:                                              ; preds = %65, %116, %68, %118
  %.449 = phi i8 [ %.045, %65 ], [ %.348, %118 ], [ %.348, %68 ], [ %.348, %116 ]
  %.242 = phi i8 [ %.040, %65 ], [ %.040, %118 ], [ 0, %68 ], [ %.040, %116 ]
  %120 = trunc nuw i8 %.242 to i1
  %121 = trunc nuw i8 %.449 to i1
  %122 = select i1 %120, i1 true, i1 %121
  br i1 %122, label %34, label %123, !llvm.loop !51

123:                                              ; preds = %119
  call void @_ZN3JPH13PhysicsSystem13BodiesToSleepD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  call void @_ZN3JPH11BodyManager23GrantActiveBodiesAccessD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #6
  call void @_ZN3JPH10BodyAccess5GrantD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  ret void

124:                                              ; preds = %117, %41
  %.pn53.pn.pn = phi { ptr, i32 } [ %.pn53.pn, %117 ], [ %42, %41 ]
  call void @_ZN3JPH13PhysicsSystem13BodiesToSleepD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  call void @_ZN3JPH11BodyManager23GrantActiveBodiesAccessD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  br label %125

125:                                              ; preds = %124, %39
  %.pn53.pn.pn.pn = phi { ptr, i32 } [ %.pn53.pn.pn, %124 ], [ %40, %39 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #6
  call void @_ZN3JPH10BodyAccess5GrantD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  resume { ptr, i32 } %.pn53.pn.pn.pn
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH13PhysicsSystem13BodiesToSleepC2ERNS_11BodyManagerEPNS_6BodyIDE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(297), ptr noundef) unnamed_addr #2 align 2

declare noundef zeroext i1 @_ZN3JPH17ConstraintManager25sSolvePositionConstraintsEPPNS_10ConstraintEPKjS5_ff(ptr noundef, ptr noundef, ptr noundef, float noundef, float noundef) local_unnamed_addr #4

declare noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24SolvePositionConstraintsEPKjS2_(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH19LargeIslandSplitter14GetIslandIndexEj(ptr noundef nonnull align 8 dereferenceable(60), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH13IslandBuilder19GetNumPositionStepsEj(ptr noundef nonnull align 8 dereferenceable(112), i32 noundef) local_unnamed_addr #5 align 2

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

attributes #0 = { mustprogress 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 = { 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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, !10, i64 32}
!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, !10, i64 460}
!18 = !{!"_ZTSN3JPH13PhysicsSystemE", !7, i64 0, !7, i64 8, !19, i64 16, !29, i64 320, !31, i64 336, !32, i64 352, !32, i64 376, !33, i64 400, !33, i64 416, !7, i64 432, !7, i64 440, !34, i64 448, !35, i64 536, !36, i64 784, !38, i64 864, !39, i64 976, !21, i64 1040, !40, i64 1088, !41, i64 1120, !10, i64 1136}
!19 = !{!"_ZTSN3JPH11BodyManagerE", !20, i64 0, !13, i64 24, !16, i64 32, !21, i64 40, !25, i64 88, !26, i64 104, !21, i64 128, !8, i64 176, !8, i64 192, !13, i64 200, !21, i64 208, !27, i64 256, !7, i64 280, !7, i64 288, !28, i64 296}
!20 = !{!"_ZTSN3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEEE", !16, i64 0, !16, i64 8, !7, i64 16}
!21 = !{!"_ZTSN3JPH5MutexE", !22, i64 0, !24, i64 40}
!22 = !{!"_ZTSSt5mutex", !23, i64 0}
!23 = !{!"_ZTSSt12__mutex_base", !8, i64 0}
!24 = !{!"_ZTSNSt6thread2idE", !16, i64 0}
!25 = !{!"_ZTSN3JPH10MutexArrayINS_11SharedMutexEEE", !7, i64 0, !13, i64 8}
!26 = !{!"_ZTSN3JPH5ArrayIhNS_12STLAllocatorIhEEEE", !16, i64 0, !16, i64 8, !7, i64 16}
!27 = !{!"_ZTSN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEEE", !16, i64 0, !16, i64 8, !7, i64 16}
!28 = !{!"bool", !8, i64 0}
!29 = !{!"_ZTSN3JPH23BodyLockInterfaceNoLockE", !30, i64 0}
!30 = !{!"_ZTSN3JPH17BodyLockInterfaceE", !7, i64 8}
!31 = !{!"_ZTSN3JPH24BodyLockInterfaceLockingE", !30, i64 0}
!32 = !{!"_ZTSN3JPH13BodyInterfaceE", !7, i64 0, !7, i64 8, !7, i64 16}
!33 = !{!"_ZTSN3JPH16NarrowPhaseQueryE", !7, i64 0, !7, i64 8}
!34 = !{!"_ZTSN3JPH15PhysicsSettingsE", !13, i64 0, !13, i64 4, !13, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !13, i64 56, !13, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !28, i64 76, !28, i64 77, !28, i64 78, !28, i64 79, !28, i64 80, !28, i64 81, !28, i64 82}
!35 = !{!"_ZTSN3JPH24ContactConstraintManagerE", !8, i64 8, !13, i64 184, !7, i64 192, !7, i64 200, !7, i64 208, !7, i64 216, !7, i64 224, !13, i64 232, !11, i64 236, !7, i64 240}
!36 = !{!"_ZTSN3JPH17ConstraintManagerE", !7, i64 0, !37, i64 8, !21, i64 32}
!37 = !{!"_ZTSN3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEEE", !16, i64 0, !16, i64 8, !7, i64 16}
!38 = !{!"_ZTSN3JPH13IslandBuilderE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !13, i64 88, !13, i64 92, !13, i64 96, !13, i64 100, !13, i64 104, !13, i64 108}
!39 = !{!"_ZTSN3JPH19LargeIslandSplitterE", !13, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !13, i64 32, !11, i64 36, !13, i64 40, !7, i64 48, !11, i64 56}
!40 = !{!"_ZTSN3JPH5ArrayIPNS_19PhysicsStepListenerENS_12STLAllocatorIS2_EEEE", !16, i64 0, !16, i64 8, !7, i64 16}
!41 = !{!"_ZTSN3JPH4Vec3E", !8, i64 0}
!42 = !{!6, !7, i64 48}
!43 = !{!18, !28, i64 528}
!44 = !{i8 0, i8 2}
!45 = !{}
!46 = !{!7, !7, i64 0}
!47 = !{!13, !13, i64 0}
!48 = !{!28, !28, i64 0}
!49 = distinct !{!49, !50}
!50 = !{!"llvm.loop.mustprogress"}
!51 = distinct !{!51, !50}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass