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

%"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, 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> }
%"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(1172), 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(1172) %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 13
  %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 !46
  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 !47
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #6
  %49 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %35, i32 0, i32 13
  %50 = getelementptr inbounds %"struct.JPH::PhysicsSettings", ptr %49, i32 0, i32 23
  %51 = load i8, ptr %50, align 8, !tbaa !48, !range !49, !noundef !50
  %52 = trunc i8 %51 to i1
  %53 = zext i1 %52 to i8
  store i8 %53, ptr %16, align 1, !tbaa !47
  br label %54

54:                                               ; preds = %241, %234, %229, %106, %48
  %55 = load i8, ptr %16, align 1, !tbaa !47, !range !49, !noundef !50
  %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 18
  %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 %245

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 %244

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 %243

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 15
  %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 18
  %87 = load i32, ptr %18, align 4, !tbaa !51
  %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 !47, !range !49, !noundef !50
  %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 18
  %97 = load i32, ptr %18, align 4, !tbaa !51
  %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(1172) %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, !llvm.loop !52

104:                                              ; preds = %60
  store i8 0, ptr %16, align 1, !tbaa !47
  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 %251 [
    i32 0, label %108
    i32 3, label %54
  ]

108:                                              ; preds = %106
  br label %109

109:                                              ; preds = %108, %54
  %110 = load i8, ptr %15, align 1, !tbaa !47, !range !49, !noundef !50
  %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 !51
  %116 = load i32, ptr %26, align 4, !tbaa !51
  %117 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %35, i32 0, i32 17
  %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 !47
  store i32 3, ptr %25, align 4
  br label %229, !llvm.loop !52

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 17
  %128 = load i32, ptr %26, align 4, !tbaa !51
  %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 17
  %132 = load i32, ptr %26, align 4, !tbaa !51
  %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 !51
  %150 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %35, i32 0, i32 13
  %151 = getelementptr inbounds %"struct.JPH::PhysicsSettings", ptr %150, i32 0, i32 23
  %152 = load i8, ptr %151, align 8, !tbaa !48, !range !49, !noundef !50
  %153 = trunc i8 %152 to i1
  br i1 %153, label %154, label %162

154:                                              ; preds = %134
  %155 = load i32, ptr %31, align 4, !tbaa !51
  %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, !llvm.loop !52

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 !51
  %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 17
  %167 = load i32, ptr %26, align 4, !tbaa !51
  %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 !51
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #6
  store i32 0, ptr %33, align 4, !tbaa !51
  br label %170

170:                                              ; preds = %211, %169
  %171 = load i32, ptr %33, align 4, !tbaa !51
  %172 = load i32, ptr %32, align 4, !tbaa !51
  %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 !47
  %188 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %35, i32 0, i32 15
  %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 !47, !range !49, !noundef !50
  %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 !47
  %200 = load i8, ptr %34, align 1, !tbaa !47, !range !49, !noundef !50
  %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 !51
  %213 = add i32 %212, 1
  store i32 %213, ptr %33, align 4, !tbaa !51
  br label %170, !llvm.loop !54

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 !51
  %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(1172) %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, !llvm.loop !52

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 %54

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

231:                                              ; preds = %109
  %232 = load i8, ptr %15, align 1, !tbaa !47, !range !49, !noundef !50
  %233 = trunc i8 %232 to i1
  br i1 %233, label %234, label %235

234:                                              ; preds = %231
  br label %54, !llvm.loop !52

235:                                              ; preds = %231
  %236 = load i8, ptr %16, align 1, !tbaa !47, !range !49, !noundef !50
  %237 = trunc i8 %236 to i1
  br i1 %237, label %238, label %239

238:                                              ; preds = %235
  call void @_ZNSt11this_thread5yieldEv() #6
  br label %240

239:                                              ; preds = %235
  br label %242

240:                                              ; preds = %238
  br label %241

241:                                              ; preds = %240
  br label %54, !llvm.loop !52

242:                                              ; preds = %239
  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

243:                                              ; 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 %244

244:                                              ; preds = %243, %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 %245

245:                                              ; preds = %244, %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 %246

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

251:                                              ; 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 500}
!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, !6, i64 448, !36, i64 456, !38, i64 488, !39, i64 576, !40, i64 824, !42, i64 904, !43, i64 1016, !23, i64 1080, !44, i64 1128, !45, i64 1152, !11, i64 1168}
!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 = !{!"_ZTSSt8functionIFvRKN3JPH4BodyES3_RKNS0_5Mat44ES6_RNS0_20CollideShapeSettingsERNS0_18CollisionCollectorINS0_18CollideShapeResultENS0_36CollisionCollectorTraitsCollideShapeEEERKNS0_11ShapeFilterEEE", !37, i64 0, !6, i64 24}
!37 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!38 = !{!"_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}
!39 = !{!"_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}
!40 = !{!"_ZTSN3JPH17ConstraintManagerE", !6, i64 0, !41, i64 8, !23, i64 32}
!41 = !{!"_ZTSN3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!42 = !{!"_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}
!43 = !{!"_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}
!44 = !{!"_ZTSN3JPH5ArrayIPNS_19PhysicsStepListenerENS_12STLAllocatorIS2_EEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!45 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!46 = !{!10, !6, i64 48}
!47 = !{!30, !30, i64 0}
!48 = !{!20, !30, i64 568}
!49 = !{i8 0, i8 2}
!50 = !{}
!51 = !{!14, !14, i64 0}
!52 = distinct !{!52, !53}
!53 = !{!"llvm.loop.mustprogress"}
!54 = distinct !{!54, !53}


; 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(1172), 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(1172) %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 %37

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 500
  %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 !44
  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 568
  %29 = load i8, ptr %28, align 8, !tbaa !45, !range !46, !noundef !47
  %30 = getelementptr inbounds i8, ptr %0, i64 1016
  %31 = getelementptr inbounds i8, ptr %0, i64 576
  %32 = getelementptr inbounds i8, ptr %2, i64 4556
  %33 = getelementptr inbounds i8, ptr %0, i64 904
  br label %.outer.outer

.outer.outer:                                     ; preds = %.outer.outer.backedge, %19
  %.044.ph.ph = phi i8 [ %29, %19 ], [ %.347, %.outer.outer.backedge ]
  %.040.ph.ph = phi i1 [ true, %19 ], [ %.not, %.outer.outer.backedge ]
  br label %.outer

.outer:                                           ; preds = %.outer.outer, %115
  %.044.ph = phi i8 [ %.347, %115 ], [ %.044.ph.ph, %.outer.outer ]
  %34 = trunc nuw i8 %.044.ph to i1
  br i1 %34, label %.lr.ph, label %.loopexit59

.lr.ph:                                           ; preds = %.outer, %62
  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
  %35 = 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 %36 unwind label %39

36:                                               ; preds = %.lr.ph
  switch i32 %35, label %.thread.loopexit [
    i32 1, label %41
    i32 2, label %.thread
  ]

37:                                               ; preds = %3
  %38 = landingpad { ptr, i32 }
          cleanup
  br label %118

39:                                               ; preds = %61, %58, %49, %45, %41, %.lr.ph
  %40 = 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 %117

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

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

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

55:                                               ; preds = %49
  %56 = load i8, ptr %14, align 1, !tbaa !50, !range !46, !noundef !47
  %57 = trunc nuw i8 %56 to i1
  br i1 %57, label %58, label %62, !llvm.loop !51

58:                                               ; preds = %55
  %59 = load i32, ptr %8, align 4, !tbaa !49
  %60 = invoke noundef i32 @_ZNK3JPH19LargeIslandSplitter14GetIslandIndexEj(ptr noundef nonnull align 8 dereferenceable(60) %30, i32 noundef %59)
          to label %61 unwind label %39

61:                                               ; preds = %58
  invoke void @_ZN3JPH13PhysicsSystem25CheckSleepAndUpdateBoundsEjPKNS_20PhysicsUpdateContextEPKNS1_4StepERNS0_13BodiesToSleepE(ptr noundef nonnull align 16 dereferenceable(1172) %0, i32 noundef %60, ptr noundef %1, ptr noundef %2, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %62 unwind label %39, !llvm.loop !51

.thread.loopexit:                                 ; preds = %36
  br label %.thread

.thread:                                          ; preds = %36, %.thread.loopexit
  %.246.ph = phi i8 [ %.044.ph, %.thread.loopexit ], [ 0, %36 ]
  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 %.loopexit59

62:                                               ; preds = %55, %61
  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 %.lr.ph

.loopexit59:                                      ; preds = %.outer, %.thread
  %.347 = phi i8 [ %.246.ph, %.thread ], [ %.044.ph, %.outer ]
  br i1 %.040.ph.ph, label %63, label %113

63:                                               ; preds = %.loopexit59
  %64 = call noundef i32 @_ZNSt13__atomic_baseIjEppEi(ptr noundef nonnull align 4 dereferenceable(4) %32, i32 noundef 0) #6
  %65 = call noundef i32 @_ZNK3JPH13IslandBuilder13GetNumIslandsEv(ptr noundef nonnull align 8 dereferenceable(112) %33)
  %.not = icmp ult i32 %64, %65
  br i1 %.not, label %66, label %.outer.outer.backedge

.outer.outer.backedge:                            ; preds = %63, %111
  br label %.outer.outer, !llvm.loop !51

66:                                               ; preds = %63
  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
  %67 = invoke noundef zeroext i1 @_ZNK3JPH13IslandBuilder22GetConstraintsInIslandEjRPjS2_(ptr noundef nonnull align 8 dereferenceable(112) %33, i32 noundef %64, ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %68 unwind label %89

68:                                               ; preds = %66
  %69 = invoke noundef zeroext i1 @_ZNK3JPH13IslandBuilder19GetContactsInIslandEjRPjS2_(ptr noundef nonnull align 8 dereferenceable(112) %33, i32 noundef %64, ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %70 unwind label %89

70:                                               ; preds = %68
  %71 = load ptr, ptr %16, align 8, !tbaa !48
  %72 = load ptr, ptr %15, align 8, !tbaa !48
  %73 = ptrtoint ptr %71 to i64
  %74 = ptrtoint ptr %72 to i64
  %75 = sub i64 %73, %74
  %76 = lshr exact i64 %75, 2
  %77 = trunc i64 %76 to i32
  %78 = load ptr, ptr %18, align 8, !tbaa !48
  %79 = load ptr, ptr %17, align 8, !tbaa !48
  %80 = ptrtoint ptr %78 to i64
  %81 = ptrtoint ptr %79 to i64
  %82 = sub i64 %80, %81
  %83 = lshr exact i64 %82, 2
  %84 = trunc i64 %83 to i32
  %85 = add i32 %84, %77
  %86 = load i8, ptr %28, align 8, !tbaa !45, !range !46, !noundef !47
  %87 = trunc nuw i8 %86 to i1
  %88 = icmp ugt i32 %85, 127
  %or.cond = select i1 %87, i1 %88, i1 false
  br i1 %or.cond, label %111, label %91, !llvm.loop !51

89:                                               ; preds = %68, %66
  %90 = landingpad { ptr, i32 }
          cleanup
  br label %112

91:                                               ; preds = %70
  %.not49 = icmp eq i32 %85, 0
  br i1 %.not49, label %.loopexit, label %92

92:                                               ; preds = %91
  %93 = invoke noundef i32 @_ZNK3JPH13IslandBuilder19GetNumPositionStepsEj(ptr noundef nonnull align 8 dereferenceable(112) %33, i32 noundef %64)
          to label %.preheader unwind label %94

.preheader:                                       ; preds = %92
  %.not65 = icmp eq i32 %93, 0
  br i1 %.not65, label %.loopexit, label %.lr.ph62

94:                                               ; preds = %92
  %95 = landingpad { ptr, i32 }
          cleanup
  br label %112

.lr.ph62:                                         ; preds = %.preheader, %103
  %.061 = phi i32 [ %105, %103 ], [ 0, %.preheader ]
  %96 = load ptr, ptr %15, align 8, !tbaa !48
  %97 = load ptr, ptr %16, align 8, !tbaa !48
  %98 = invoke noundef zeroext i1 @_ZN3JPH17ConstraintManager25sSolvePositionConstraintsEPPNS_10ConstraintEPKjS5_ff(ptr noundef %25, ptr noundef %96, ptr noundef %97, float noundef %21, float noundef %23)
          to label %99 unwind label %107

99:                                               ; preds = %.lr.ph62
  %100 = load ptr, ptr %17, align 8, !tbaa !48
  %101 = load ptr, ptr %18, align 8, !tbaa !48
  %102 = invoke noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24SolvePositionConstraintsEPKjS2_(ptr noundef nonnull align 8 dereferenceable(248) %31, ptr noundef %100, ptr noundef %101)
          to label %103 unwind label %107

103:                                              ; preds = %99
  %104 = or i1 %98, %102
  %105 = add nuw i32 %.061, 1
  %106 = icmp ult i32 %105, %93
  %or.cond64 = select i1 %104, i1 %106, i1 false
  br i1 %or.cond64, label %.lr.ph62, label %.loopexit, !llvm.loop !53

107:                                              ; preds = %99, %.lr.ph62
  %108 = landingpad { ptr, i32 }
          cleanup
  br label %112

.loopexit:                                        ; preds = %103, %.preheader, %91
  invoke void @_ZN3JPH13PhysicsSystem25CheckSleepAndUpdateBoundsEjPKNS_20PhysicsUpdateContextEPKNS1_4StepERNS0_13BodiesToSleepE(ptr noundef nonnull align 16 dereferenceable(1172) %0, i32 noundef %64, ptr noundef %1, ptr noundef %2, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %111 unwind label %109, !llvm.loop !51

109:                                              ; preds = %.loopexit
  %110 = landingpad { ptr, i32 }
          cleanup
  br label %112

111:                                              ; preds = %.loopexit, %70
  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 %.outer.outer.backedge

112:                                              ; preds = %109, %107, %94, %89
  %.pn51.pn = phi { ptr, i32 } [ %90, %89 ], [ %110, %109 ], [ %108, %107 ], [ %95, %94 ]
  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 %117

113:                                              ; preds = %.loopexit59
  %114 = trunc nuw i8 %.347 to i1
  br i1 %114, label %115, label %116

115:                                              ; preds = %113
  call void @_ZNSt11this_thread5yieldEv() #6
  br label %.outer, !llvm.loop !51

116:                                              ; preds = %113
  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

117:                                              ; preds = %112, %39
  %.pn51.pn.pn = phi { ptr, i32 } [ %.pn51.pn, %112 ], [ %40, %39 ]
  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 %118

118:                                              ; preds = %117, %37
  %.pn51.pn.pn.pn = phi { ptr, i32 } [ %.pn51.pn.pn, %117 ], [ %38, %37 ]
  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 } %.pn51.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 500}
!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, !7, i64 448, !34, i64 456, !36, i64 488, !37, i64 576, !38, i64 824, !40, i64 904, !41, i64 1016, !21, i64 1080, !42, i64 1128, !43, i64 1152, !10, i64 1168}
!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 = !{!"_ZTSSt8functionIFvRKN3JPH4BodyES3_RKNS0_5Mat44ES6_RNS0_20CollideShapeSettingsERNS0_18CollisionCollectorINS0_18CollideShapeResultENS0_36CollisionCollectorTraitsCollideShapeEEERKNS0_11ShapeFilterEEE", !35, i64 0, !7, i64 24}
!35 = !{!"_ZTSSt14_Function_base", !8, i64 0, !7, i64 16}
!36 = !{!"_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}
!37 = !{!"_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}
!38 = !{!"_ZTSN3JPH17ConstraintManagerE", !7, i64 0, !39, i64 8, !21, i64 32}
!39 = !{!"_ZTSN3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEEE", !16, i64 0, !16, i64 8, !7, i64 16}
!40 = !{!"_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}
!41 = !{!"_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}
!42 = !{!"_ZTSN3JPH5ArrayIPNS_19PhysicsStepListenerENS_12STLAllocatorIS2_EEEE", !16, i64 0, !16, i64 8, !7, i64 16}
!43 = !{!"_ZTSN3JPH4Vec3E", !8, i64 0}
!44 = !{!6, !7, i64 48}
!45 = !{!18, !28, i64 568}
!46 = !{i8 0, i8 2}
!47 = !{}
!48 = !{!7, !7, i64 0}
!49 = !{!13, !13, i64 0}
!50 = !{!28, !28, i64 0}
!51 = distinct !{!51, !52}
!52 = !{!"llvm.loop.mustprogress"}
!53 = distinct !{!53, !52}


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