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

@.str.24 = external hidden unnamed_addr constant [83 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [78 x i8], align 1

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

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 noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH13PhysicsSystem27JobSolveVelocityConstraintsEPNS_20PhysicsUpdateContextEPNS1_4StepE(ptr noundef nonnull align 16 dereferenceable(1172) %0, ptr noundef %1, ptr noundef %2) #4 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 float, align 4
  %9 = alloca ptr, align 8
  %10 = alloca float, align 4
  %11 = alloca i8, align 1
  %12 = alloca i8, align 1
  %13 = alloca i8, align 1
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca %"class.JPH::DummyCalculateSolverSteps", align 1
  %22 = alloca i8, align 1
  %23 = alloca i8, align 1
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca i8, align 1
  %31 = alloca i8, align 1
  %32 = alloca %"struct.JPH::AssertLastParam", align 1
  %33 = alloca %"struct.JPH::AssertLastParam", align 1
  %34 = alloca %"class.JPH::CalculateSolverSteps", align 8
  %35 = alloca i32, align 4
  %36 = 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
  %37 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #8
  call void @_ZN3JPH10BodyAccess5GrantC2ENS0_7EAccessES2_(ptr noundef nonnull align 1 dereferenceable(1) %7, i8 noundef zeroext 3, i8 noundef zeroext 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %"class.JPH::PhysicsUpdateContext", ptr %38, i32 0, i32 4
  %40 = load float, ptr %39, align 8, !tbaa !9
  store float %40, ptr %8, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = getelementptr inbounds %"class.JPH::PhysicsUpdateContext", ptr %41, i32 0, i32 8
  %43 = load ptr, ptr %42, align 8, !tbaa !19
  store ptr %43, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = getelementptr inbounds %"struct.JPH::PhysicsUpdateContext::Step", ptr %44, i32 0, i32 1
  %46 = load i8, ptr %45, align 8, !tbaa !20, !range !28, !noundef !29
  %47 = trunc i8 %46 to i1
  br i1 %47, label %48, label %52

48:                                               ; preds = %3
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds %"class.JPH::PhysicsUpdateContext", ptr %49, i32 0, i32 5
  %51 = load float, ptr %50, align 4, !tbaa !30
  br label %53

52:                                               ; preds = %3
  br label %53

53:                                               ; preds = %52, %48
  %54 = phi float [ %51, %48 ], [ 1.000000e+00, %52 ]
  store float %54, ptr %10, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #8
  store i8 1, ptr %11, align 1, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #8
  %55 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %37, i32 0, i32 13
  %56 = getelementptr inbounds %"struct.JPH::PhysicsSettings", ptr %55, i32 0, i32 23
  %57 = load i8, ptr %56, align 8, !tbaa !32, !range !28, !noundef !29
  %58 = trunc i8 %57 to i1
  %59 = zext i1 %58 to i8
  store i8 %59, ptr %12, align 1, !tbaa !31
  br label %60

60:                                               ; preds = %324, %317, %312, %123, %53
  %61 = load i8, ptr %12, align 1, !tbaa !31, !range !28, !noundef !29
  %62 = trunc i8 %61 to i1
  br i1 %62, label %63, label %127

63:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %64 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %37, i32 0, i32 18
  %65 = invoke noundef i32 @_ZN3JPH19LargeIslandSplitter14FetchNextBatchERjRPjS3_S3_S3_Rb(ptr noundef nonnull align 8 dereferenceable(60) %64, ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %66 unwind label %67

66:                                               ; preds = %63
  switch i32 %65, label %122 [
    i32 1, label %71
    i32 0, label %122
    i32 2, label %121
  ]

67:                                               ; preds = %95, %89, %63
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %19, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %20, align 4
  br label %126

71:                                               ; preds = %66
  %72 = load i8, ptr %13, align 1, !tbaa !31, !range !28, !noundef !29
  %73 = trunc i8 %72 to i1
  br i1 %73, label %74, label %89

74:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #8
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = load ptr, ptr %15, align 8, !tbaa !5
  %77 = load ptr, ptr %16, align 8, !tbaa !5
  %78 = load float, ptr %10, align 4, !tbaa !18
  invoke void @_ZN3JPH17ConstraintManager29sWarmStartVelocityConstraintsINS_25DummyCalculateSolverStepsEEEvPPNS_10ConstraintEPKjS7_fRT_(ptr noundef %75, ptr noundef %76, ptr noundef %77, float noundef %78, ptr noundef nonnull align 1 dereferenceable(1) %21)
          to label %79 unwind label %85

79:                                               ; preds = %74
  %80 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %37, i32 0, i32 15
  %81 = load ptr, ptr %17, align 8, !tbaa !5
  %82 = load ptr, ptr %18, align 8, !tbaa !5
  %83 = load float, ptr %10, align 4, !tbaa !18
  invoke void @_ZN3JPH24ContactConstraintManager28WarmStartVelocityConstraintsINS_25DummyCalculateSolverStepsEEEvPKjS4_fRT_(ptr noundef nonnull align 8 dereferenceable(248) %80, ptr noundef %81, ptr noundef %82, float noundef %83, ptr noundef nonnull align 1 dereferenceable(1) %21)
          to label %84 unwind label %85

84:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #8
  br label %101

85:                                               ; preds = %79, %74
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %19, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #8
  br label %126

89:                                               ; preds = %71
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = load ptr, ptr %15, align 8, !tbaa !5
  %92 = load ptr, ptr %16, align 8, !tbaa !5
  %93 = load float, ptr %8, align 4, !tbaa !18
  %94 = invoke noundef zeroext i1 @_ZN3JPH17ConstraintManager25sSolveVelocityConstraintsEPPNS_10ConstraintEPKjS5_f(ptr noundef %90, ptr noundef %91, ptr noundef %92, float noundef %93)
          to label %95 unwind label %67

95:                                               ; preds = %89
  %96 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %37, i32 0, i32 15
  %97 = load ptr, ptr %17, align 8, !tbaa !5
  %98 = load ptr, ptr %18, align 8, !tbaa !5
  %99 = invoke noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24SolveVelocityConstraintsEPKjS2_(ptr noundef nonnull align 8 dereferenceable(248) %96, ptr noundef %97, ptr noundef %98)
          to label %100 unwind label %67

100:                                              ; preds = %95
  br label %101

101:                                              ; preds = %100, %84
  call void @llvm.lifetime.start.p0(i64 1, ptr %22) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %23) #8
  %102 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %37, i32 0, i32 18
  %103 = load i32, ptr %14, align 4, !tbaa !58
  %104 = load ptr, ptr %15, align 8, !tbaa !5
  %105 = load ptr, ptr %16, align 8, !tbaa !5
  %106 = load ptr, ptr %17, align 8, !tbaa !5
  %107 = load ptr, ptr %18, align 8, !tbaa !5
  invoke void @_ZN3JPH19LargeIslandSplitter18MarkBatchProcessedEjPKjS2_S2_S2_RbS3_(ptr noundef nonnull align 8 dereferenceable(60) %102, i32 noundef %103, ptr noundef %104, ptr noundef %105, ptr noundef %106, ptr noundef %107, ptr noundef nonnull align 1 dereferenceable(1) %22, ptr noundef nonnull align 1 dereferenceable(1) %23)
          to label %108 unwind label %116

108:                                              ; preds = %101
  %109 = load i8, ptr %22, align 1, !tbaa !31, !range !28, !noundef !29
  %110 = trunc i8 %109 to i1
  br i1 %110, label %111, label %120

111:                                              ; preds = %108
  %112 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %37, i32 0, i32 15
  %113 = load ptr, ptr %17, align 8, !tbaa !5
  %114 = load ptr, ptr %18, align 8, !tbaa !5
  invoke void @_ZNK3JPH24ContactConstraintManager20StoreAppliedImpulsesEPKjS2_(ptr noundef nonnull align 8 dereferenceable(248) %112, ptr noundef %113, ptr noundef %114)
          to label %115 unwind label %116

115:                                              ; preds = %111
  br label %120

116:                                              ; preds = %111, %101
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %19, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #8
  br label %126

120:                                              ; preds = %115, %108
  store i32 3, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #8
  br label %123

121:                                              ; preds = %66
  store i8 0, ptr %12, align 1, !tbaa !31
  br label %122

122:                                              ; preds = %121, %66, %66
  store i32 0, ptr %24, align 4
  br label %123

123:                                              ; preds = %122, %120
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #8
  %124 = load i32, ptr %24, align 4
  switch i32 %124, label %332 [
    i32 0, label %125
    i32 3, label %60
  ]

125:                                              ; preds = %123
  br label %127

126:                                              ; preds = %116, %85, %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #8
  br label %326

127:                                              ; preds = %125, %60
  %128 = load i8, ptr %11, align 1, !tbaa !31, !range !28, !noundef !29
  %129 = trunc i8 %128 to i1
  br i1 %129, label %130, label %314

130:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  %131 = load ptr, ptr %6, align 8, !tbaa !5
  %132 = getelementptr inbounds %"struct.JPH::PhysicsUpdateContext::Step", ptr %131, i32 0, i32 22
  %133 = call noundef i32 @_ZNSt13__atomic_baseIjEppEi(ptr noundef nonnull align 4 dereferenceable(4) %132, i32 noundef 0) #8
  store i32 %133, ptr %25, align 4, !tbaa !58
  %134 = load i32, ptr %25, align 4, !tbaa !58
  %135 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %37, i32 0, i32 17
  %136 = invoke noundef i32 @_ZNK3JPH13IslandBuilder13GetNumIslandsEv(ptr noundef nonnull align 8 dereferenceable(112) %135)
          to label %137 unwind label %140

137:                                              ; preds = %130
  %138 = icmp uge i32 %134, %136
  br i1 %138, label %139, label %144

139:                                              ; preds = %137
  store i8 0, ptr %11, align 1, !tbaa !31
  store i32 3, ptr %24, align 4
  br label %312, !llvm.loop !59

140:                                              ; preds = %130
  %141 = landingpad { ptr, i32 }
          cleanup
  %142 = extractvalue { ptr, i32 } %141, 0
  store ptr %142, ptr %19, align 8
  %143 = extractvalue { ptr, i32 } %141, 1
  store i32 %143, ptr %20, align 4
  br label %313

144:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %30) #8
  %145 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %37, i32 0, i32 17
  %146 = load i32, ptr %25, align 4, !tbaa !58
  %147 = invoke noundef zeroext i1 @_ZNK3JPH13IslandBuilder22GetConstraintsInIslandEjRPjS2_(ptr noundef nonnull align 8 dereferenceable(112) %145, i32 noundef %146, ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 8 dereferenceable(8) %27)
          to label %148 unwind label %177

148:                                              ; preds = %144
  %149 = zext i1 %147 to i8
  store i8 %149, ptr %30, align 1, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 1, ptr %31) #8
  %150 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %37, i32 0, i32 17
  %151 = load i32, ptr %25, align 4, !tbaa !58
  %152 = invoke noundef zeroext i1 @_ZNK3JPH13IslandBuilder19GetContactsInIslandEjRPjS2_(ptr noundef nonnull align 8 dereferenceable(112) %150, i32 noundef %151, ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull align 8 dereferenceable(8) %29)
          to label %153 unwind label %181

153:                                              ; preds = %148
  %154 = zext i1 %152 to i8
  store i8 %154, ptr %31, align 1, !tbaa !31
  %155 = load i8, ptr %31, align 1, !tbaa !31, !range !28, !noundef !29
  %156 = trunc i8 %155 to i1
  br i1 %156, label %204, label %157

157:                                              ; preds = %153
  %158 = load i8, ptr %30, align 1, !tbaa !31, !range !28, !noundef !29
  %159 = trunc i8 %158 to i1
  br i1 %159, label %204, label %160

160:                                              ; preds = %157
  br label %161

161:                                              ; preds = %200, %160
  %162 = load i32, ptr %25, align 4, !tbaa !58
  %163 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %37, i32 0, i32 17
  %164 = invoke noundef i32 @_ZNK3JPH13IslandBuilder13GetNumIslandsEv(ptr noundef nonnull align 8 dereferenceable(112) %163)
          to label %165 unwind label %181

165:                                              ; preds = %161
  %166 = icmp ult i32 %162, %164
  br i1 %166, label %167, label %203

167:                                              ; preds = %165
  br label %168

168:                                              ; preds = %167
  %169 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %37, i32 0, i32 17
  %170 = load i32, ptr %25, align 4, !tbaa !58
  %171 = invoke noundef zeroext i1 @_ZNK3JPH13IslandBuilder22GetConstraintsInIslandEjRPjS2_(ptr noundef nonnull align 8 dereferenceable(112) %169, i32 noundef %170, ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 8 dereferenceable(8) %27)
          to label %172 unwind label %181

172:                                              ; preds = %168
  br i1 %171, label %173, label %185

173:                                              ; preds = %172
  %174 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.54, ptr noundef @.str.24, i32 noundef 1405)
          to label %175 unwind label %181

175:                                              ; preds = %173
  br i1 %174, label %176, label %185

176:                                              ; preds = %175
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #8, !srcloc !61
  br label %185

177:                                              ; preds = %144
  %178 = landingpad { ptr, i32 }
          cleanup
  %179 = extractvalue { ptr, i32 } %178, 0
  store ptr %179, ptr %19, align 8
  %180 = extractvalue { ptr, i32 } %178, 1
  store i32 %180, ptr %20, align 4
  br label %311

181:                                              ; preds = %213, %209, %193, %188, %173, %168, %161, %148
  %182 = landingpad { ptr, i32 }
          cleanup
  %183 = extractvalue { ptr, i32 } %182, 0
  store ptr %183, ptr %19, align 8
  %184 = extractvalue { ptr, i32 } %182, 1
  store i32 %184, ptr %20, align 4
  br label %310

185:                                              ; preds = %176, %175, %172
  br label %186

186:                                              ; preds = %185
  br label %187

187:                                              ; preds = %186
  br label %188

188:                                              ; preds = %187
  %189 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %37, i32 0, i32 17
  %190 = load i32, ptr %25, align 4, !tbaa !58
  %191 = invoke noundef zeroext i1 @_ZNK3JPH13IslandBuilder19GetContactsInIslandEjRPjS2_(ptr noundef nonnull align 8 dereferenceable(112) %189, i32 noundef %190, ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull align 8 dereferenceable(8) %29)
          to label %192 unwind label %181

192:                                              ; preds = %188
  br i1 %191, label %193, label %197

193:                                              ; preds = %192
  %194 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.55, ptr noundef @.str.24, i32 noundef 1406)
          to label %195 unwind label %181

195:                                              ; preds = %193
  br i1 %194, label %196, label %197

196:                                              ; preds = %195
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #8, !srcloc !62
  br label %197

197:                                              ; preds = %196, %195, %192
  br label %198

198:                                              ; preds = %197
  br label %199

199:                                              ; preds = %198
  br label %200

200:                                              ; preds = %199
  %201 = load i32, ptr %25, align 4, !tbaa !58
  %202 = add i32 %201, 1
  store i32 %202, ptr %25, align 4, !tbaa !58
  br label %161, !llvm.loop !63

203:                                              ; preds = %165
  store i8 0, ptr %11, align 1, !tbaa !31
  store i32 3, ptr %24, align 4
  br label %309, !llvm.loop !59

204:                                              ; preds = %157, %153
  %205 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %37, i32 0, i32 13
  %206 = getelementptr inbounds %"struct.JPH::PhysicsSettings", ptr %205, i32 0, i32 19
  %207 = load i8, ptr %206, align 4, !tbaa !64, !range !28, !noundef !29
  %208 = trunc i8 %207 to i1
  br i1 %208, label %209, label %218

209:                                              ; preds = %204
  %210 = load ptr, ptr %9, align 8, !tbaa !5
  %211 = load ptr, ptr %26, align 8, !tbaa !5
  %212 = load ptr, ptr %27, align 8, !tbaa !5
  invoke void @_ZN3JPH17ConstraintManager16sSortConstraintsEPPNS_10ConstraintEPjS4_(ptr noundef %210, ptr noundef %211, ptr noundef %212)
          to label %213 unwind label %181

213:                                              ; preds = %209
  %214 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %37, i32 0, i32 15
  %215 = load ptr, ptr %28, align 8, !tbaa !5
  %216 = load ptr, ptr %29, align 8, !tbaa !5
  invoke void @_ZNK3JPH24ContactConstraintManager12SortContactsEPjS1_(ptr noundef nonnull align 8 dereferenceable(248) %214, ptr noundef %215, ptr noundef %216)
          to label %217 unwind label %181

217:                                              ; preds = %213
  br label %218

218:                                              ; preds = %217, %204
  call void @llvm.lifetime.start.p0(i64 24, ptr %34) #8
  %219 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %37, i32 0, i32 13
  invoke void @_ZN3JPH20CalculateSolverStepsC2ERKNS_15PhysicsSettingsE(ptr noundef nonnull align 8 dereferenceable(18) %34, ptr noundef nonnull align 4 dereferenceable(83) %219)
          to label %220 unwind label %235

220:                                              ; preds = %218
  %221 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %37, i32 0, i32 13
  %222 = getelementptr inbounds %"struct.JPH::PhysicsSettings", ptr %221, i32 0, i32 23
  %223 = load i8, ptr %222, align 8, !tbaa !32, !range !28, !noundef !29
  %224 = trunc i8 %223 to i1
  br i1 %224, label %225, label %239

225:                                              ; preds = %220
  %226 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %37, i32 0, i32 18
  %227 = load i32, ptr %25, align 4, !tbaa !58
  %228 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %37, i32 0, i32 17
  %229 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %37, i32 0, i32 2
  %230 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %37, i32 0, i32 15
  %231 = load ptr, ptr %9, align 8, !tbaa !5
  %232 = invoke noundef zeroext i1 @_ZN3JPH19LargeIslandSplitter11SplitIslandEjRKNS_13IslandBuilderERKNS_11BodyManagerERKNS_24ContactConstraintManagerEPPNS_10ConstraintERNS_20CalculateSolverStepsE(ptr noundef nonnull align 8 dereferenceable(60) %226, i32 noundef %227, ptr noundef nonnull align 8 dereferenceable(112) %228, ptr noundef nonnull align 8 dereferenceable(297) %229, ptr noundef nonnull align 8 dereferenceable(248) %230, ptr noundef %231, ptr noundef nonnull align 8 dereferenceable(18) %34)
          to label %233 unwind label %235

233:                                              ; preds = %225
  br i1 %232, label %234, label %239

234:                                              ; preds = %233
  store i32 3, ptr %24, align 4
  br label %307, !llvm.loop !59

235:                                              ; preds = %302, %254, %250, %249, %244, %239, %225, %218
  %236 = landingpad { ptr, i32 }
          cleanup
  %237 = extractvalue { ptr, i32 } %236, 0
  store ptr %237, ptr %19, align 8
  %238 = extractvalue { ptr, i32 } %236, 1
  store i32 %238, ptr %20, align 4
  br label %308

239:                                              ; preds = %233, %220
  %240 = load ptr, ptr %9, align 8, !tbaa !5
  %241 = load ptr, ptr %26, align 8, !tbaa !5
  %242 = load ptr, ptr %27, align 8, !tbaa !5
  %243 = load float, ptr %10, align 4, !tbaa !18
  invoke void @_ZN3JPH17ConstraintManager29sWarmStartVelocityConstraintsINS_20CalculateSolverStepsEEEvPPNS_10ConstraintEPKjS7_fRT_(ptr noundef %240, ptr noundef %241, ptr noundef %242, float noundef %243, ptr noundef nonnull align 8 dereferenceable(18) %34)
          to label %244 unwind label %235

244:                                              ; preds = %239
  %245 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %37, i32 0, i32 15
  %246 = load ptr, ptr %28, align 8, !tbaa !5
  %247 = load ptr, ptr %29, align 8, !tbaa !5
  %248 = load float, ptr %10, align 4, !tbaa !18
  invoke void @_ZN3JPH24ContactConstraintManager28WarmStartVelocityConstraintsINS_20CalculateSolverStepsEEEvPKjS4_fRT_(ptr noundef nonnull align 8 dereferenceable(248) %245, ptr noundef %246, ptr noundef %247, float noundef %248, ptr noundef nonnull align 8 dereferenceable(18) %34)
          to label %249 unwind label %235

249:                                              ; preds = %244
  invoke void @_ZN3JPH20CalculateSolverSteps8FinalizeEv(ptr noundef nonnull align 8 dereferenceable(18) %34)
          to label %250 unwind label %235

250:                                              ; preds = %249
  %251 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %37, i32 0, i32 17
  %252 = load i32, ptr %25, align 4, !tbaa !58
  %253 = invoke noundef i32 @_ZNK3JPH20CalculateSolverSteps19GetNumPositionStepsEv(ptr noundef nonnull align 8 dereferenceable(18) %34)
          to label %254 unwind label %235

254:                                              ; preds = %250
  invoke void @_ZN3JPH13IslandBuilder19SetNumPositionStepsEjj(ptr noundef nonnull align 8 dereferenceable(112) %251, i32 noundef %252, i32 noundef %253)
          to label %255 unwind label %235

255:                                              ; preds = %254
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #8
  store i32 0, ptr %35, align 4, !tbaa !58
  br label %256

256:                                              ; preds = %297, %255
  %257 = load i32, ptr %35, align 4, !tbaa !58
  %258 = invoke noundef i32 @_ZNK3JPH20CalculateSolverSteps19GetNumVelocityStepsEv(ptr noundef nonnull align 8 dereferenceable(18) %34)
          to label %259 unwind label %262

259:                                              ; preds = %256
  %260 = icmp ult i32 %257, %258
  br i1 %260, label %266, label %261

261:                                              ; preds = %259
  store i32 12, ptr %24, align 4
  br label %300

262:                                              ; preds = %256
  %263 = landingpad { ptr, i32 }
          cleanup
  %264 = extractvalue { ptr, i32 } %263, 0
  store ptr %264, ptr %19, align 8
  %265 = extractvalue { ptr, i32 } %263, 1
  store i32 %265, ptr %20, align 4
  br label %301

266:                                              ; preds = %259
  call void @llvm.lifetime.start.p0(i64 1, ptr %36) #8
  %267 = load ptr, ptr %9, align 8, !tbaa !5
  %268 = load ptr, ptr %26, align 8, !tbaa !5
  %269 = load ptr, ptr %27, align 8, !tbaa !5
  %270 = load float, ptr %8, align 4, !tbaa !18
  %271 = invoke noundef zeroext i1 @_ZN3JPH17ConstraintManager25sSolveVelocityConstraintsEPPNS_10ConstraintEPKjS5_f(ptr noundef %267, ptr noundef %268, ptr noundef %269, float noundef %270)
          to label %272 unwind label %289

272:                                              ; preds = %266
  %273 = zext i1 %271 to i8
  store i8 %273, ptr %36, align 1, !tbaa !31
  %274 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %37, i32 0, i32 15
  %275 = load ptr, ptr %28, align 8, !tbaa !5
  %276 = load ptr, ptr %29, align 8, !tbaa !5
  %277 = invoke noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24SolveVelocityConstraintsEPKjS2_(ptr noundef nonnull align 8 dereferenceable(248) %274, ptr noundef %275, ptr noundef %276)
          to label %278 unwind label %289

278:                                              ; preds = %272
  %279 = zext i1 %277 to i32
  %280 = load i8, ptr %36, align 1, !tbaa !31, !range !28, !noundef !29
  %281 = trunc i8 %280 to i1
  %282 = zext i1 %281 to i32
  %283 = or i32 %282, %279
  %284 = icmp ne i32 %283, 0
  %285 = zext i1 %284 to i8
  store i8 %285, ptr %36, align 1, !tbaa !31
  %286 = load i8, ptr %36, align 1, !tbaa !31, !range !28, !noundef !29
  %287 = trunc i8 %286 to i1
  br i1 %287, label %293, label %288

288:                                              ; preds = %278
  store i32 12, ptr %24, align 4
  br label %294

289:                                              ; preds = %272, %266
  %290 = landingpad { ptr, i32 }
          cleanup
  %291 = extractvalue { ptr, i32 } %290, 0
  store ptr %291, ptr %19, align 8
  %292 = extractvalue { ptr, i32 } %290, 1
  store i32 %292, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %36) #8
  br label %301

293:                                              ; preds = %278
  store i32 0, ptr %24, align 4
  br label %294

294:                                              ; preds = %293, %288
  call void @llvm.lifetime.end.p0(i64 1, ptr %36) #8
  %295 = load i32, ptr %24, align 4
  switch i32 %295, label %300 [
    i32 0, label %296
  ]

296:                                              ; preds = %294
  br label %297

297:                                              ; preds = %296
  %298 = load i32, ptr %35, align 4, !tbaa !58
  %299 = add i32 %298, 1
  store i32 %299, ptr %35, align 4, !tbaa !58
  br label %256, !llvm.loop !65

300:                                              ; preds = %294, %261
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #8
  br label %302

301:                                              ; preds = %289, %262
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #8
  br label %308

302:                                              ; preds = %300
  %303 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %37, i32 0, i32 15
  %304 = load ptr, ptr %28, align 8, !tbaa !5
  %305 = load ptr, ptr %29, align 8, !tbaa !5
  invoke void @_ZNK3JPH24ContactConstraintManager20StoreAppliedImpulsesEPKjS2_(ptr noundef nonnull align 8 dereferenceable(248) %303, ptr noundef %304, ptr noundef %305)
          to label %306 unwind label %235

306:                                              ; preds = %302
  store i32 3, ptr %24, align 4
  br label %307, !llvm.loop !59

307:                                              ; preds = %306, %234
  call void @llvm.lifetime.end.p0(i64 24, ptr %34) #8
  br label %309

308:                                              ; preds = %301, %235
  call void @llvm.lifetime.end.p0(i64 24, ptr %34) #8
  br label %310

309:                                              ; preds = %307, %203
  call void @llvm.lifetime.end.p0(i64 1, ptr %31) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  br label %312

310:                                              ; preds = %308, %181
  call void @llvm.lifetime.end.p0(i64 1, ptr %31) #8
  br label %311

311:                                              ; preds = %310, %177
  call void @llvm.lifetime.end.p0(i64 1, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  br label %313

312:                                              ; preds = %309, %139
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  br label %60

313:                                              ; preds = %311, %140
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  br label %326

314:                                              ; preds = %127
  %315 = load i8, ptr %11, align 1, !tbaa !31, !range !28, !noundef !29
  %316 = trunc i8 %315 to i1
  br i1 %316, label %317, label %318

317:                                              ; preds = %314
  br label %60, !llvm.loop !59

318:                                              ; preds = %314
  %319 = load i8, ptr %12, align 1, !tbaa !31, !range !28, !noundef !29
  %320 = trunc i8 %319 to i1
  br i1 %320, label %321, label %322

321:                                              ; preds = %318
  call void @_ZNSt11this_thread5yieldEv() #8
  br label %323

322:                                              ; preds = %318
  br label %325

323:                                              ; preds = %321
  br label %324

324:                                              ; preds = %323
  br label %60, !llvm.loop !59

325:                                              ; preds = %322
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @_ZN3JPH10BodyAccess5GrantD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #8
  ret void

326:                                              ; preds = %313, %126
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @_ZN3JPH10BodyAccess5GrantD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #8
  br label %327

327:                                              ; preds = %326
  %328 = load ptr, ptr %19, align 8
  %329 = load i32, ptr %20, align 4
  %330 = insertvalue { ptr, i32 } poison, ptr %328, 0
  %331 = insertvalue { ptr, i32 } %330, i32 %329, 1
  resume { ptr, i32 } %331

332:                                              ; preds = %123
  unreachable
}

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

declare void @_ZN3JPH17ConstraintManager29sWarmStartVelocityConstraintsINS_25DummyCalculateSolverStepsEEEvPPNS_10ConstraintEPKjS7_fRT_(ptr noundef, ptr noundef, ptr noundef, float noundef, ptr noundef nonnull align 1 dereferenceable(1)) #5

declare void @_ZN3JPH24ContactConstraintManager28WarmStartVelocityConstraintsINS_25DummyCalculateSolverStepsEEEvPKjS4_fRT_(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, ptr noundef, float noundef, ptr noundef nonnull align 1 dereferenceable(1)) #5

declare noundef zeroext i1 @_ZN3JPH17ConstraintManager25sSolveVelocityConstraintsEPPNS_10ConstraintEPKjS5_f(ptr noundef, ptr noundef, ptr noundef, float noundef) #5

declare noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24SolveVelocityConstraintsEPKjS2_(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, ptr noundef) #5

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

declare void @_ZNK3JPH24ContactConstraintManager20StoreAppliedImpulsesEPKjS2_(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, ptr noundef) #5

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

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

declare void @_ZN3JPH17ConstraintManager16sSortConstraintsEPPNS_10ConstraintEPjS4_(ptr noundef, ptr noundef, ptr noundef) #5

declare void @_ZNK3JPH24ContactConstraintManager12SortContactsEPjS1_(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, ptr noundef) #5

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH20CalculateSolverStepsC2ERKNS_15PhysicsSettingsE(ptr noundef nonnull align 8 dereferenceable(18), ptr noundef nonnull align 4 dereferenceable(83)) unnamed_addr #6 align 2

declare noundef zeroext i1 @_ZN3JPH19LargeIslandSplitter11SplitIslandEjRKNS_13IslandBuilderERKNS_11BodyManagerERKNS_24ContactConstraintManagerEPPNS_10ConstraintERNS_20CalculateSolverStepsE(ptr noundef nonnull align 8 dereferenceable(60), i32 noundef, ptr noundef nonnull align 8 dereferenceable(112), ptr noundef nonnull align 8 dereferenceable(297), ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, ptr noundef nonnull align 8 dereferenceable(18)) #5

declare void @_ZN3JPH17ConstraintManager29sWarmStartVelocityConstraintsINS_20CalculateSolverStepsEEEvPPNS_10ConstraintEPKjS7_fRT_(ptr noundef, ptr noundef, ptr noundef, float noundef, ptr noundef nonnull align 8 dereferenceable(18)) #5

declare void @_ZN3JPH24ContactConstraintManager28WarmStartVelocityConstraintsINS_20CalculateSolverStepsEEEvPKjS4_fRT_(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, ptr noundef, float noundef, ptr noundef nonnull align 8 dereferenceable(18)) #5

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3JPH20CalculateSolverSteps8FinalizeEv(ptr noundef nonnull align 8 dereferenceable(18)) #7 align 2

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3JPH20CalculateSolverSteps19GetNumPositionStepsEv(ptr noundef nonnull align 8 dereferenceable(18)) #6 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3JPH20CalculateSolverSteps19GetNumVelocityStepsEv(ptr noundef nonnull align 8 dereferenceable(18)) #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt11this_thread5yieldEv() #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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "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 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !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 = !{!10, !6, i64 48}
!20 = !{!21, !22, i64 8}
!21 = !{!"_ZTSN3JPH20PhysicsUpdateContext4StepE", !6, i64 0, !22, i64 8, !22, i64 9, !23, i64 16, !14, i64 48, !12, i64 52, !7, i64 56, !12, i64 116, !7, i64 120, !12, i64 180, !7, i64 184, !12, i64 244, !7, i64 248, !12, i64 308, !7, i64 312, !12, i64 372, !7, i64 376, !24, i64 436, !14, i64 4536, !12, i64 4540, !12, i64 4544, !12, i64 4548, !12, i64 4552, !12, i64 4556, !12, i64 4560, !6, i64 4568, !14, i64 4576, !12, i64 4580, !12, i64 4584, !6, i64 4592, !14, i64 4600, !25, i64 4608, !27, i64 4616, !27, i64 4880, !27, i64 5144, !27, i64 5408, !25, i64 5672, !27, i64 5680, !25, i64 5944, !25, i64 5952, !25, i64 5960, !27, i64 5968, !25, i64 6232, !27, i64 6240, !25, i64 6504, !25, i64 6512, !27, i64 6520, !25, i64 6784, !25, i64 6792, !27, i64 6800, !27, i64 7064, !25, i64 7328, !25, i64 7336}
!22 = !{!"bool", !7, i64 0}
!23 = !{!"_ZTSN3JPH10BroadPhase11UpdateStateE", !7, i64 0}
!24 = !{!"_ZTSN3JPH11StaticArrayINS_20PhysicsUpdateContext13BodyPairQueueELj32EEE", !14, i64 0, !7, i64 4}
!25 = !{!"_ZTSN3JPH9JobSystem9JobHandleE", !26, i64 0}
!26 = !{!"_ZTSN3JPH3RefINS_9JobSystem3JobEEE", !6, i64 0}
!27 = !{!"_ZTSN3JPH11StaticArrayINS_9JobSystem9JobHandleELj32EEE", !14, i64 0, !7, i64 8}
!28 = !{i8 0, i8 2}
!29 = !{}
!30 = !{!10, !11, i64 36}
!31 = !{!22, !22, i64 0}
!32 = !{!33, !22, i64 568}
!33 = !{!"_ZTSN3JPH13PhysicsSystemE", !6, i64 0, !6, i64 8, !34, i64 16, !43, i64 320, !45, i64 336, !46, i64 352, !46, i64 376, !47, i64 400, !47, i64 416, !6, i64 432, !6, i64 440, !6, i64 448, !48, i64 456, !50, i64 488, !51, i64 576, !52, i64 824, !54, i64 904, !55, i64 1016, !36, i64 1080, !56, i64 1128, !57, i64 1152, !11, i64 1168}
!34 = !{!"_ZTSN3JPH11BodyManagerE", !35, i64 0, !14, i64 24, !17, i64 32, !36, i64 40, !40, i64 88, !41, i64 104, !36, i64 128, !7, i64 176, !7, i64 192, !14, i64 200, !36, i64 208, !42, i64 256, !6, i64 280, !6, i64 288, !22, i64 296}
!35 = !{!"_ZTSN3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!36 = !{!"_ZTSN3JPH5MutexE", !37, i64 0, !39, i64 40}
!37 = !{!"_ZTSSt5mutex", !38, i64 0}
!38 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!39 = !{!"_ZTSNSt6thread2idE", !17, i64 0}
!40 = !{!"_ZTSN3JPH10MutexArrayINS_11SharedMutexEEE", !6, i64 0, !14, i64 8}
!41 = !{!"_ZTSN3JPH5ArrayIhNS_12STLAllocatorIhEEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!42 = !{!"_ZTSN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!43 = !{!"_ZTSN3JPH23BodyLockInterfaceNoLockE", !44, i64 0}
!44 = !{!"_ZTSN3JPH17BodyLockInterfaceE", !6, i64 8}
!45 = !{!"_ZTSN3JPH24BodyLockInterfaceLockingE", !44, i64 0}
!46 = !{!"_ZTSN3JPH13BodyInterfaceE", !6, i64 0, !6, i64 8, !6, i64 16}
!47 = !{!"_ZTSN3JPH16NarrowPhaseQueryE", !6, i64 0, !6, i64 8}
!48 = !{!"_ZTSSt8functionIFvRKN3JPH4BodyES3_RKNS0_5Mat44ES6_RNS0_20CollideShapeSettingsERNS0_18CollisionCollectorINS0_18CollideShapeResultENS0_36CollisionCollectorTraitsCollideShapeEEERKNS0_11ShapeFilterEEE", !49, i64 0, !6, i64 24}
!49 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!50 = !{!"_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, !22, i64 76, !22, i64 77, !22, i64 78, !22, i64 79, !22, i64 80, !22, i64 81, !22, i64 82}
!51 = !{!"_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}
!52 = !{!"_ZTSN3JPH17ConstraintManagerE", !6, i64 0, !53, i64 8, !36, i64 32}
!53 = !{!"_ZTSN3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!54 = !{!"_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}
!55 = !{!"_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}
!56 = !{!"_ZTSN3JPH5ArrayIPNS_19PhysicsStepListenerENS_12STLAllocatorIS2_EEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!57 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!58 = !{!14, !14, i64 0}
!59 = distinct !{!59, !60}
!60 = !{!"llvm.loop.mustprogress"}
!61 = !{i64 2160025823}
!62 = !{i64 2160026269}
!63 = distinct !{!63, !60}
!64 = !{!33, !22, i64 564}
!65 = distinct !{!65, !60}


; 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::DummyCalculateSolverSteps" = type { i8 }
%"class.JPH::CalculateSolverSteps" = type <{ ptr, i32, i32, i8, i8, [6 x i8] }>

@.str.24 = external hidden unnamed_addr constant [83 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [78 x i8], align 1

; 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 noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH13PhysicsSystem27JobSolveVelocityConstraintsEPNS_20PhysicsUpdateContextEPNS1_4StepE(ptr noundef nonnull align 16 dereferenceable(1172) %0, ptr nocapture noundef readonly %1, ptr noundef %2) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.JPH::BodyAccess::Grant", align 1
  %5 = alloca i8, align 1
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %"class.JPH::DummyCalculateSolverSteps", align 1
  %12 = alloca i8, align 1
  %13 = alloca i8, align 1
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca %"class.JPH::CalculateSolverSteps", align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #8
  call void @_ZN3JPH10BodyAccess5GrantC2ENS0_7EAccessES2_(ptr noundef nonnull align 1 dereferenceable(1) %4, i8 noundef zeroext 3, i8 noundef zeroext 1)
  %19 = getelementptr inbounds i8, ptr %1, i64 32
  %20 = load float, ptr %19, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %1, i64 48
  %22 = load ptr, ptr %21, align 8, !tbaa !17
  %23 = getelementptr inbounds i8, ptr %2, i64 8
  %24 = load i8, ptr %23, align 8, !tbaa !18, !range !26, !noundef !27
  %25 = trunc nuw i8 %24 to i1
  br i1 %25, label %26, label %29

26:                                               ; preds = %3
  %27 = getelementptr inbounds i8, ptr %1, i64 36
  %28 = load float, ptr %27, align 4, !tbaa !28
  br label %29

29:                                               ; preds = %3, %26
  %30 = phi float [ %28, %26 ], [ 1.000000e+00, %3 ]
  %31 = getelementptr inbounds i8, ptr %0, i64 488
  %32 = getelementptr inbounds i8, ptr %0, i64 568
  %33 = load i8, ptr %32, align 8, !tbaa !29, !range !26, !noundef !27
  %34 = getelementptr inbounds i8, ptr %0, i64 1016
  %35 = getelementptr inbounds i8, ptr %0, i64 576
  %36 = getelementptr inbounds i8, ptr %2, i64 4552
  %37 = getelementptr inbounds i8, ptr %0, i64 904
  %38 = getelementptr inbounds i8, ptr %0, i64 564
  %39 = getelementptr inbounds i8, ptr %0, i64 16
  br label %.outer.outer

.outer.outer:                                     ; preds = %.outer.outer.backedge, %29
  %.041.ph.ph = phi i8 [ %33, %29 ], [ %.3, %.outer.outer.backedge ]
  %.040.ph.ph = phi i1 [ true, %29 ], [ %.040.ph.ph.be, %.outer.outer.backedge ]
  br label %.outer

.outer:                                           ; preds = %.outer.outer, %159
  %.041.ph = phi i8 [ %.3, %159 ], [ %.041.ph.ph, %.outer.outer ]
  %40 = trunc nuw i8 %.041.ph to i1
  br i1 %40, label %.lr.ph, label %.loopexit68

.lr.ph:                                           ; preds = %.outer, %79
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #8
  %41 = invoke noundef i32 @_ZN3JPH19LargeIslandSplitter14FetchNextBatchERjRPjS3_S3_S3_Rb(ptr noundef nonnull align 8 dereferenceable(60) %34, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %42 unwind label %43

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

43:                                               ; preds = %61, %57, %.lr.ph
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %80

45:                                               ; preds = %42
  %46 = load i8, ptr %5, align 1, !tbaa !55, !range !26, !noundef !27
  %47 = trunc nuw i8 %46 to i1
  br i1 %47, label %48, label %57

48:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %11) #8
  %49 = load ptr, ptr %7, align 8, !tbaa !56
  %50 = load ptr, ptr %8, align 8, !tbaa !56
  invoke void @_ZN3JPH17ConstraintManager29sWarmStartVelocityConstraintsINS_25DummyCalculateSolverStepsEEEvPPNS_10ConstraintEPKjS7_fRT_(ptr noundef %22, ptr noundef %49, ptr noundef %50, float noundef %30, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %51 unwind label %55

51:                                               ; preds = %48
  %52 = load ptr, ptr %9, align 8, !tbaa !56
  %53 = load ptr, ptr %10, align 8, !tbaa !56
  invoke void @_ZN3JPH24ContactConstraintManager28WarmStartVelocityConstraintsINS_25DummyCalculateSolverStepsEEEvPKjS4_fRT_(ptr noundef nonnull align 8 dereferenceable(248) %35, ptr noundef %52, ptr noundef %53, float noundef %30, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %54 unwind label %55

54:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #8
  br label %65

55:                                               ; preds = %51, %48
  %56 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #8
  br label %80

57:                                               ; preds = %45
  %58 = load ptr, ptr %7, align 8, !tbaa !56
  %59 = load ptr, ptr %8, align 8, !tbaa !56
  %60 = invoke noundef zeroext i1 @_ZN3JPH17ConstraintManager25sSolveVelocityConstraintsEPPNS_10ConstraintEPKjS5_f(ptr noundef %22, ptr noundef %58, ptr noundef %59, float noundef %20)
          to label %61 unwind label %43

61:                                               ; preds = %57
  %62 = load ptr, ptr %9, align 8, !tbaa !56
  %63 = load ptr, ptr %10, align 8, !tbaa !56
  %64 = invoke noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24SolveVelocityConstraintsEPKjS2_(ptr noundef nonnull align 8 dereferenceable(248) %35, ptr noundef %62, ptr noundef %63)
          to label %65 unwind label %43

65:                                               ; preds = %61, %54
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %12) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %13) #8
  %66 = load i32, ptr %6, align 4, !tbaa !57
  %67 = load ptr, ptr %7, align 8, !tbaa !56
  %68 = load ptr, ptr %8, align 8, !tbaa !56
  %69 = load ptr, ptr %9, align 8, !tbaa !56
  %70 = load ptr, ptr %10, align 8, !tbaa !56
  invoke void @_ZN3JPH19LargeIslandSplitter18MarkBatchProcessedEjPKjS2_S2_S2_RbS3_(ptr noundef nonnull align 8 dereferenceable(60) %34, i32 noundef %66, ptr noundef %67, ptr noundef %68, ptr noundef %69, ptr noundef %70, ptr noundef nonnull align 1 dereferenceable(1) %12, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %71 unwind label %77

71:                                               ; preds = %65
  %72 = load i8, ptr %12, align 1, !tbaa !55, !range !26, !noundef !27
  %73 = trunc nuw i8 %72 to i1
  br i1 %73, label %74, label %79

74:                                               ; preds = %71
  %75 = load ptr, ptr %9, align 8, !tbaa !56
  %76 = load ptr, ptr %10, align 8, !tbaa !56
  invoke void @_ZNK3JPH24ContactConstraintManager20StoreAppliedImpulsesEPKjS2_(ptr noundef nonnull align 8 dereferenceable(248) %35, ptr noundef %75, ptr noundef %76)
          to label %79 unwind label %77

77:                                               ; preds = %74, %65
  %78 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %12) #8
  br label %80

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

.thread:                                          ; preds = %42, %.thread.loopexit
  %.243.ph = phi i8 [ %.041.ph, %.thread.loopexit ], [ 0, %42 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #8
  br label %.loopexit68

79:                                               ; preds = %71, %74
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #8
  br label %.lr.ph

80:                                               ; preds = %77, %55, %43
  %.pn = phi { ptr, i32 } [ %78, %77 ], [ %56, %55 ], [ %44, %43 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #8
  br label %161

.loopexit68:                                      ; preds = %.outer, %.thread
  %.3 = phi i8 [ %.243.ph, %.thread ], [ %.041.ph, %.outer ]
  br i1 %.040.ph.ph, label %81, label %157

81:                                               ; preds = %.loopexit68
  %82 = call noundef i32 @_ZNSt13__atomic_baseIjEppEi(ptr noundef nonnull align 4 dereferenceable(4) %36, i32 noundef 0) #8
  %83 = call noundef i32 @_ZNK3JPH13IslandBuilder13GetNumIslandsEv(ptr noundef nonnull align 8 dereferenceable(112) %37)
  %.not = icmp ult i32 %82, %83
  br i1 %.not, label %84, label %.outer.outer.backedge

.outer.outer.backedge:                            ; preds = %81, %.loopexit
  %.040.ph.ph.be = phi i1 [ false, %81 ], [ %brmerge, %.loopexit ]
  br label %.outer.outer, !llvm.loop !58

84:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #8
  %85 = invoke noundef zeroext i1 @_ZNK3JPH13IslandBuilder22GetConstraintsInIslandEjRPjS2_(ptr noundef nonnull align 8 dereferenceable(112) %37, i32 noundef %82, ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %86 unwind label %97

86:                                               ; preds = %84
  %87 = invoke noundef zeroext i1 @_ZNK3JPH13IslandBuilder19GetContactsInIslandEjRPjS2_(ptr noundef nonnull align 8 dereferenceable(112) %37, i32 noundef %82, ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %88 unwind label %.loopexit.split-lp

88:                                               ; preds = %86
  %brmerge = or i1 %85, %87
  br i1 %brmerge, label %110, label %.preheader66

.preheader66:                                     ; preds = %88
  %89 = call noundef i32 @_ZNK3JPH13IslandBuilder13GetNumIslandsEv(ptr noundef nonnull align 8 dereferenceable(112) %37)
  %90 = icmp ult i32 %82, %89
  br i1 %90, label %.lr.ph71, label %.loopexit, !llvm.loop !58

.lr.ph71:                                         ; preds = %.preheader66, %106
  %.04470 = phi i32 [ %107, %106 ], [ %82, %.preheader66 ]
  %91 = invoke noundef zeroext i1 @_ZNK3JPH13IslandBuilder22GetConstraintsInIslandEjRPjS2_(ptr noundef nonnull align 8 dereferenceable(112) %37, i32 noundef %.04470, ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %92 unwind label %.loopexit67

92:                                               ; preds = %.lr.ph71
  br i1 %91, label %93, label %99

93:                                               ; preds = %92
  %94 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.54, ptr noundef nonnull @.str.24, i32 noundef 1405)
          to label %95 unwind label %.loopexit67

95:                                               ; preds = %93
  br i1 %94, label %96, label %99

96:                                               ; preds = %95
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #8, !srcloc !60
  br label %99

97:                                               ; preds = %84
  %98 = landingpad { ptr, i32 }
          cleanup
  br label %156

.loopexit67:                                      ; preds = %.lr.ph71, %93, %99, %102
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %156

.loopexit.split-lp:                               ; preds = %86, %113, %116
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %156

99:                                               ; preds = %92, %95, %96
  %100 = invoke noundef zeroext i1 @_ZNK3JPH13IslandBuilder19GetContactsInIslandEjRPjS2_(ptr noundef nonnull align 8 dereferenceable(112) %37, i32 noundef %.04470, ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %101 unwind label %.loopexit67

101:                                              ; preds = %99
  br i1 %100, label %102, label %106

102:                                              ; preds = %101
  %103 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.55, ptr noundef nonnull @.str.24, i32 noundef 1406)
          to label %104 unwind label %.loopexit67

104:                                              ; preds = %102
  br i1 %103, label %105, label %106

105:                                              ; preds = %104
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #8, !srcloc !61
  br label %106

106:                                              ; preds = %101, %104, %105
  %107 = add nuw i32 %.04470, 1
  %108 = call noundef i32 @_ZNK3JPH13IslandBuilder13GetNumIslandsEv(ptr noundef nonnull align 8 dereferenceable(112) %37)
  %109 = icmp ult i32 %107, %108
  br i1 %109, label %.lr.ph71, label %.loopexit, !llvm.loop !62

110:                                              ; preds = %88
  %111 = load i8, ptr %38, align 4, !tbaa !63, !range !26, !noundef !27
  %112 = trunc nuw i8 %111 to i1
  br i1 %112, label %113, label %119

113:                                              ; preds = %110
  %114 = load ptr, ptr %14, align 8, !tbaa !56
  %115 = load ptr, ptr %15, align 8, !tbaa !56
  invoke void @_ZN3JPH17ConstraintManager16sSortConstraintsEPPNS_10ConstraintEPjS4_(ptr noundef %22, ptr noundef %114, ptr noundef %115)
          to label %116 unwind label %.loopexit.split-lp

116:                                              ; preds = %113
  %117 = load ptr, ptr %16, align 8, !tbaa !56
  %118 = load ptr, ptr %17, align 8, !tbaa !56
  invoke void @_ZNK3JPH24ContactConstraintManager12SortContactsEPjS1_(ptr noundef nonnull align 8 dereferenceable(248) %35, ptr noundef %117, ptr noundef %118)
          to label %119 unwind label %.loopexit.split-lp

119:                                              ; preds = %116, %110
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %18) #8
  call void @_ZN3JPH20CalculateSolverStepsC2ERKNS_15PhysicsSettingsE(ptr noundef nonnull align 8 dereferenceable(18) %18, ptr noundef nonnull align 4 dereferenceable(83) %31)
  %120 = load i8, ptr %32, align 8, !tbaa !29, !range !26, !noundef !27
  %121 = trunc nuw i8 %120 to i1
  br i1 %121, label %122, label %127

122:                                              ; preds = %119
  %123 = invoke noundef zeroext i1 @_ZN3JPH19LargeIslandSplitter11SplitIslandEjRKNS_13IslandBuilderERKNS_11BodyManagerERKNS_24ContactConstraintManagerEPPNS_10ConstraintERNS_20CalculateSolverStepsE(ptr noundef nonnull align 8 dereferenceable(60) %34, i32 noundef %82, ptr noundef nonnull align 8 dereferenceable(112) %37, ptr noundef nonnull align 8 dereferenceable(297) %39, ptr noundef nonnull align 8 dereferenceable(248) %35, ptr noundef %22, ptr noundef nonnull align 8 dereferenceable(18) %18)
          to label %124 unwind label %125

124:                                              ; preds = %122
  br i1 %123, label %154, label %127, !llvm.loop !58

125:                                              ; preds = %._crit_edge, %134, %133, %130, %127, %122
  %126 = landingpad { ptr, i32 }
          cleanup
  br label %155

127:                                              ; preds = %124, %119
  %128 = load ptr, ptr %14, align 8, !tbaa !56
  %129 = load ptr, ptr %15, align 8, !tbaa !56
  invoke void @_ZN3JPH17ConstraintManager29sWarmStartVelocityConstraintsINS_20CalculateSolverStepsEEEvPPNS_10ConstraintEPKjS7_fRT_(ptr noundef %22, ptr noundef %128, ptr noundef %129, float noundef %30, ptr noundef nonnull align 8 dereferenceable(18) %18)
          to label %130 unwind label %125

130:                                              ; preds = %127
  %131 = load ptr, ptr %16, align 8, !tbaa !56
  %132 = load ptr, ptr %17, align 8, !tbaa !56
  invoke void @_ZN3JPH24ContactConstraintManager28WarmStartVelocityConstraintsINS_20CalculateSolverStepsEEEvPKjS4_fRT_(ptr noundef nonnull align 8 dereferenceable(248) %35, ptr noundef %131, ptr noundef %132, float noundef %30, ptr noundef nonnull align 8 dereferenceable(18) %18)
          to label %133 unwind label %125

133:                                              ; preds = %130
  invoke void @_ZN3JPH20CalculateSolverSteps8FinalizeEv(ptr noundef nonnull align 8 dereferenceable(18) %18)
          to label %134 unwind label %125

134:                                              ; preds = %133
  %135 = call noundef i32 @_ZNK3JPH20CalculateSolverSteps19GetNumPositionStepsEv(ptr noundef nonnull align 8 dereferenceable(18) %18)
  invoke void @_ZN3JPH13IslandBuilder19SetNumPositionStepsEjj(ptr noundef nonnull align 8 dereferenceable(112) %37, i32 noundef %82, i32 noundef %135)
          to label %.preheader unwind label %125

.preheader:                                       ; preds = %134
  %136 = call noundef i32 @_ZNK3JPH20CalculateSolverSteps19GetNumVelocityStepsEv(ptr noundef nonnull align 8 dereferenceable(18) %18)
  %.not75 = icmp eq i32 %136, 0
  br i1 %.not75, label %._crit_edge, label %.lr.ph73

137:                                              ; preds = %148
  %138 = add nuw i32 %.072, 1
  %139 = call noundef i32 @_ZNK3JPH20CalculateSolverSteps19GetNumVelocityStepsEv(ptr noundef nonnull align 8 dereferenceable(18) %18)
  %140 = icmp ult i32 %138, %139
  br i1 %140, label %.lr.ph73, label %._crit_edge, !llvm.loop !64

.lr.ph73:                                         ; preds = %.preheader, %137
  %.072 = phi i32 [ %138, %137 ], [ 0, %.preheader ]
  %141 = load ptr, ptr %14, align 8, !tbaa !56
  %142 = load ptr, ptr %15, align 8, !tbaa !56
  %143 = invoke noundef zeroext i1 @_ZN3JPH17ConstraintManager25sSolveVelocityConstraintsEPPNS_10ConstraintEPKjS5_f(ptr noundef %22, ptr noundef %141, ptr noundef %142, float noundef %20)
          to label %144 unwind label %150

144:                                              ; preds = %.lr.ph73
  %145 = load ptr, ptr %16, align 8, !tbaa !56
  %146 = load ptr, ptr %17, align 8, !tbaa !56
  %147 = invoke noundef zeroext i1 @_ZN3JPH24ContactConstraintManager24SolveVelocityConstraintsEPKjS2_(ptr noundef nonnull align 8 dereferenceable(248) %35, ptr noundef %145, ptr noundef %146)
          to label %148 unwind label %150

148:                                              ; preds = %144
  %149 = or i1 %143, %147
  br i1 %149, label %137, label %._crit_edge

150:                                              ; preds = %144, %.lr.ph73
  %151 = landingpad { ptr, i32 }
          cleanup
  br label %155

._crit_edge:                                      ; preds = %148, %137, %.preheader
  %152 = load ptr, ptr %16, align 8, !tbaa !56
  %153 = load ptr, ptr %17, align 8, !tbaa !56
  invoke void @_ZNK3JPH24ContactConstraintManager20StoreAppliedImpulsesEPKjS2_(ptr noundef nonnull align 8 dereferenceable(248) %35, ptr noundef %152, ptr noundef %153)
          to label %154 unwind label %125, !llvm.loop !58

154:                                              ; preds = %._crit_edge, %124
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #8
  br label %.loopexit

155:                                              ; preds = %150, %125
  %.pn58 = phi { ptr, i32 } [ %126, %125 ], [ %151, %150 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #8
  br label %156

.loopexit:                                        ; preds = %106, %.preheader66, %154
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #8
  br label %.outer.outer.backedge

156:                                              ; preds = %.loopexit67, %.loopexit.split-lp, %155, %97
  %.pn58.pn.pn = phi { ptr, i32 } [ %98, %97 ], [ %.pn58, %155 ], [ %lpad.loopexit, %.loopexit67 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #8
  br label %161

157:                                              ; preds = %.loopexit68
  %158 = trunc nuw i8 %.3 to i1
  br i1 %158, label %159, label %160

159:                                              ; preds = %157
  call void @_ZNSt11this_thread5yieldEv() #8
  br label %.outer, !llvm.loop !58

160:                                              ; preds = %157
  call void @_ZN3JPH10BodyAccess5GrantD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #8
  ret void

161:                                              ; preds = %156, %80
  %.pn58.pn.pn.pn = phi { ptr, i32 } [ %.pn58.pn.pn, %156 ], [ %.pn, %80 ]
  call void @_ZN3JPH10BodyAccess5GrantD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #8
  resume { ptr, i32 } %.pn58.pn.pn.pn
}

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

declare void @_ZN3JPH17ConstraintManager29sWarmStartVelocityConstraintsINS_25DummyCalculateSolverStepsEEEvPPNS_10ConstraintEPKjS7_fRT_(ptr noundef, ptr noundef, ptr noundef, float noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #5

declare void @_ZN3JPH24ContactConstraintManager28WarmStartVelocityConstraintsINS_25DummyCalculateSolverStepsEEEvPKjS4_fRT_(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, ptr noundef, float noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #5

declare noundef zeroext i1 @_ZN3JPH17ConstraintManager25sSolveVelocityConstraintsEPPNS_10ConstraintEPKjS5_f(ptr noundef, ptr noundef, ptr noundef, float noundef) local_unnamed_addr #5

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

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

declare void @_ZNK3JPH24ContactConstraintManager20StoreAppliedImpulsesEPKjS2_(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, ptr noundef) local_unnamed_addr #5

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

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

declare void @_ZN3JPH17ConstraintManager16sSortConstraintsEPPNS_10ConstraintEPjS4_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

declare void @_ZNK3JPH24ContactConstraintManager12SortContactsEPjS1_(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH20CalculateSolverStepsC2ERKNS_15PhysicsSettingsE(ptr noundef nonnull align 8 dereferenceable(18), ptr noundef nonnull align 4 dereferenceable(83)) unnamed_addr #6 align 2

declare noundef zeroext i1 @_ZN3JPH19LargeIslandSplitter11SplitIslandEjRKNS_13IslandBuilderERKNS_11BodyManagerERKNS_24ContactConstraintManagerEPPNS_10ConstraintERNS_20CalculateSolverStepsE(ptr noundef nonnull align 8 dereferenceable(60), i32 noundef, ptr noundef nonnull align 8 dereferenceable(112), ptr noundef nonnull align 8 dereferenceable(297), ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, ptr noundef nonnull align 8 dereferenceable(18)) local_unnamed_addr #5

declare void @_ZN3JPH17ConstraintManager29sWarmStartVelocityConstraintsINS_20CalculateSolverStepsEEEvPPNS_10ConstraintEPKjS7_fRT_(ptr noundef, ptr noundef, ptr noundef, float noundef, ptr noundef nonnull align 8 dereferenceable(18)) local_unnamed_addr #5

declare void @_ZN3JPH24ContactConstraintManager28WarmStartVelocityConstraintsINS_20CalculateSolverStepsEEEvPKjS4_fRT_(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, ptr noundef, float noundef, ptr noundef nonnull align 8 dereferenceable(18)) local_unnamed_addr #5

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3JPH20CalculateSolverSteps8FinalizeEv(ptr noundef nonnull align 8 dereferenceable(18)) local_unnamed_addr #7 align 2

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3JPH20CalculateSolverSteps19GetNumPositionStepsEv(ptr noundef nonnull align 8 dereferenceable(18)) local_unnamed_addr #6 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3JPH20CalculateSolverSteps19GetNumVelocityStepsEv(ptr noundef nonnull align 8 dereferenceable(18)) local_unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt11this_thread5yieldEv() local_unnamed_addr #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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "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 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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 = !{!6, !7, i64 48}
!18 = !{!19, !20, i64 8}
!19 = !{!"_ZTSN3JPH20PhysicsUpdateContext4StepE", !7, i64 0, !20, i64 8, !20, i64 9, !21, i64 16, !13, i64 48, !11, i64 52, !8, i64 56, !11, i64 116, !8, i64 120, !11, i64 180, !8, i64 184, !11, i64 244, !8, i64 248, !11, i64 308, !8, i64 312, !11, i64 372, !8, i64 376, !22, i64 436, !13, i64 4536, !11, i64 4540, !11, i64 4544, !11, i64 4548, !11, i64 4552, !11, i64 4556, !11, i64 4560, !7, i64 4568, !13, i64 4576, !11, i64 4580, !11, i64 4584, !7, i64 4592, !13, i64 4600, !23, i64 4608, !25, i64 4616, !25, i64 4880, !25, i64 5144, !25, i64 5408, !23, i64 5672, !25, i64 5680, !23, i64 5944, !23, i64 5952, !23, i64 5960, !25, i64 5968, !23, i64 6232, !25, i64 6240, !23, i64 6504, !23, i64 6512, !25, i64 6520, !23, i64 6784, !23, i64 6792, !25, i64 6800, !25, i64 7064, !23, i64 7328, !23, i64 7336}
!20 = !{!"bool", !8, i64 0}
!21 = !{!"_ZTSN3JPH10BroadPhase11UpdateStateE", !8, i64 0}
!22 = !{!"_ZTSN3JPH11StaticArrayINS_20PhysicsUpdateContext13BodyPairQueueELj32EEE", !13, i64 0, !8, i64 4}
!23 = !{!"_ZTSN3JPH9JobSystem9JobHandleE", !24, i64 0}
!24 = !{!"_ZTSN3JPH3RefINS_9JobSystem3JobEEE", !7, i64 0}
!25 = !{!"_ZTSN3JPH11StaticArrayINS_9JobSystem9JobHandleELj32EEE", !13, i64 0, !8, i64 8}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = !{!6, !10, i64 36}
!29 = !{!30, !20, i64 568}
!30 = !{!"_ZTSN3JPH13PhysicsSystemE", !7, i64 0, !7, i64 8, !31, i64 16, !40, i64 320, !42, i64 336, !43, i64 352, !43, i64 376, !44, i64 400, !44, i64 416, !7, i64 432, !7, i64 440, !7, i64 448, !45, i64 456, !47, i64 488, !48, i64 576, !49, i64 824, !51, i64 904, !52, i64 1016, !33, i64 1080, !53, i64 1128, !54, i64 1152, !10, i64 1168}
!31 = !{!"_ZTSN3JPH11BodyManagerE", !32, i64 0, !13, i64 24, !16, i64 32, !33, i64 40, !37, i64 88, !38, i64 104, !33, i64 128, !8, i64 176, !8, i64 192, !13, i64 200, !33, i64 208, !39, i64 256, !7, i64 280, !7, i64 288, !20, i64 296}
!32 = !{!"_ZTSN3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEEE", !16, i64 0, !16, i64 8, !7, i64 16}
!33 = !{!"_ZTSN3JPH5MutexE", !34, i64 0, !36, i64 40}
!34 = !{!"_ZTSSt5mutex", !35, i64 0}
!35 = !{!"_ZTSSt12__mutex_base", !8, i64 0}
!36 = !{!"_ZTSNSt6thread2idE", !16, i64 0}
!37 = !{!"_ZTSN3JPH10MutexArrayINS_11SharedMutexEEE", !7, i64 0, !13, i64 8}
!38 = !{!"_ZTSN3JPH5ArrayIhNS_12STLAllocatorIhEEEE", !16, i64 0, !16, i64 8, !7, i64 16}
!39 = !{!"_ZTSN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEEE", !16, i64 0, !16, i64 8, !7, i64 16}
!40 = !{!"_ZTSN3JPH23BodyLockInterfaceNoLockE", !41, i64 0}
!41 = !{!"_ZTSN3JPH17BodyLockInterfaceE", !7, i64 8}
!42 = !{!"_ZTSN3JPH24BodyLockInterfaceLockingE", !41, i64 0}
!43 = !{!"_ZTSN3JPH13BodyInterfaceE", !7, i64 0, !7, i64 8, !7, i64 16}
!44 = !{!"_ZTSN3JPH16NarrowPhaseQueryE", !7, i64 0, !7, i64 8}
!45 = !{!"_ZTSSt8functionIFvRKN3JPH4BodyES3_RKNS0_5Mat44ES6_RNS0_20CollideShapeSettingsERNS0_18CollisionCollectorINS0_18CollideShapeResultENS0_36CollisionCollectorTraitsCollideShapeEEERKNS0_11ShapeFilterEEE", !46, i64 0, !7, i64 24}
!46 = !{!"_ZTSSt14_Function_base", !8, i64 0, !7, i64 16}
!47 = !{!"_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, !20, i64 76, !20, i64 77, !20, i64 78, !20, i64 79, !20, i64 80, !20, i64 81, !20, i64 82}
!48 = !{!"_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}
!49 = !{!"_ZTSN3JPH17ConstraintManagerE", !7, i64 0, !50, i64 8, !33, i64 32}
!50 = !{!"_ZTSN3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEEE", !16, i64 0, !16, i64 8, !7, i64 16}
!51 = !{!"_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}
!52 = !{!"_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}
!53 = !{!"_ZTSN3JPH5ArrayIPNS_19PhysicsStepListenerENS_12STLAllocatorIS2_EEEE", !16, i64 0, !16, i64 8, !7, i64 16}
!54 = !{!"_ZTSN3JPH4Vec3E", !8, i64 0}
!55 = !{!20, !20, i64 0}
!56 = !{!7, !7, i64 0}
!57 = !{!13, !13, i64 0}
!58 = distinct !{!58, !59}
!59 = !{!"llvm.loop.mustprogress"}
!60 = !{i64 2160025823}
!61 = !{i64 2160026269}
!62 = distinct !{!62, !59}
!63 = !{!30, !20, i64 564}
!64 = distinct !{!64, !59}


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