; LLVM IR from jrouwe/JoltPhysics :: Jolt/Physics/Body/BodyManager.ll (ZN3JPH11BodyManager16DeactivateBodiesEPKNS_6BodyIDEi)

; 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::UniqueLock" = type <{ ptr, ptr, i32, [4 x i8] }>
%"struct.JPH::AssertLastParam" = type { i8 }
%"class.JPH::BodyID" = type { i32 }
%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%"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 }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"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.3" = type { i64, i64, ptr }
%"class.JPH::Body" = type <{ %"class.JPH::Vec3", %"class.JPH::Quat", %"class.JPH::AABox", %"class.JPH::RefConst", ptr, i64, %"class.JPH::CollisionGroup", float, float, %"class.JPH::BodyID", i16, i8, %"class.JPH::BroadPhaseLayer", i8, %"struct.std::atomic.8", [6 x i8] }>
%"class.JPH::Quat" = type { %"class.JPH::Vec4" }
%"class.JPH::Vec4" = type { %union.anon.6 }
%union.anon.6 = type { <4 x float> }
%"class.JPH::AABox" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"class.JPH::RefConst" = type { ptr }
%"class.JPH::CollisionGroup" = type { %"class.JPH::RefConst.7", i32, i32 }
%"class.JPH::RefConst.7" = type { ptr }
%"class.JPH::BroadPhaseLayer" = type { i8 }
%"struct.std::atomic.8" = type { %"struct.std::__atomic_base.9" }
%"struct.std::__atomic_base.9" = type { i8 }
%"class.JPH::MotionProperties" = type <{ %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Quat", %"class.JPH::Float3", %"class.JPH::Float3", float, float, float, float, float, float, i32, i32, i8, i8, i8, i8, i8, [3 x i8], [3 x %"class.JPH::Sphere"], float, i8, i8, [10 x i8] }>
%"class.JPH::Float3" = type { float, float, float }
%"class.JPH::Sphere" = type { %"class.JPH::Float3", float }

@_ZN3JPHL26sOverrideAllowDeactivationE = external hidden thread_local global i8, align 1
@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [51 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH10UniqueLockINS_5MutexEEC2ERS1_PKNS_11BodyManagerENS_17EPhysicsLockTypesE(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef nonnull align 8 dereferenceable(48), ptr noundef, i32 noundef) unnamed_addr #2 align 2

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec35sZeroEv() #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122)) #7 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH6BodyID9IsInvalidEv(ptr noundef nonnull align 4 dereferenceable(4)) #7 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jS1_NS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3JPH6BodyID8GetIndexEv(ptr noundef nonnull align 4 dereferenceable(4)) #7 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH6BodyIDeqERKS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #7 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH4Body14IsInBroadPhaseEv(ptr noundef nonnull align 16 dereferenceable(122)) #7 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH11BodyManager16DeactivateBodiesEPKNS_6BodyIDEi(ptr noundef nonnull align 8 dereferenceable(297) %0, ptr noundef %1, i32 noundef %2) #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.JPH::UniqueLock", align 8
  %8 = alloca %"struct.JPH::AssertLastParam", align 1
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %"class.JPH::BodyID", align 4
  %14 = alloca ptr, align 8
  %15 = alloca %"struct.JPH::AssertLastParam", align 1
  %16 = alloca %"struct.JPH::AssertLastParam", align 1
  %17 = alloca %"class.JPH::Vec3", align 16
  %18 = alloca %"class.JPH::Vec3", align 16
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  %19 = load ptr, ptr %4, align 8
  %20 = load i32, ptr %6, align 4, !tbaa !9
  %21 = icmp sle i32 %20, 0
  br i1 %21, label %22, label %23

22:                                               ; preds = %3
  br label %171

23:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #8
  %24 = getelementptr inbounds %"class.JPH::BodyManager", ptr %19, i32 0, i32 7
  call void @_ZN3JPH10UniqueLockINS_5MutexEEC2ERS1_PKNS_11BodyManagerENS_17EPhysicsLockTypesE(ptr noundef nonnull align 8 dereferenceable(20) %7, ptr noundef nonnull align 8 dereferenceable(48) %24, ptr noundef %19, i32 noundef 32)
  br label %25

25:                                               ; preds = %23
  %26 = getelementptr inbounds %"class.JPH::BodyManager", ptr %19, i32 0, i32 16
  %27 = load i8, ptr %26, align 8, !tbaa !11, !range !23, !noundef !24
  %28 = trunc i8 %27 to i1
  br i1 %28, label %29, label %41

29:                                               ; preds = %25
  %30 = call align 1 ptr @llvm.threadlocal.address.p0(ptr align 1 @_ZN3JPHL26sOverrideAllowDeactivationE)
  %31 = load i8, ptr %30, align 1, !tbaa !25, !range !23, !noundef !24
  %32 = trunc i8 %31 to i1
  br i1 %32, label %41, label %33

33:                                               ; preds = %29
  %34 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.14, ptr noundef @.str.1, i32 noundef 589)
          to label %35 unwind label %37

35:                                               ; preds = %33
  br i1 %34, label %36, label %41

36:                                               ; preds = %35
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #8, !srcloc !26
  br label %41

37:                                               ; preds = %33
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %9, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %10, align 4
  br label %172

41:                                               ; preds = %36, %35, %29, %25
  br label %42

42:                                               ; preds = %41
  br label %43

43:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %44, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = load i32, ptr %6, align 4, !tbaa !9
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds %"class.JPH::BodyID", ptr %45, i64 %47
  store ptr %48, ptr %12, align 8, !tbaa !5
  br label %49

49:                                               ; preds = %166, %43
  %50 = load ptr, ptr %11, align 8, !tbaa !5
  %51 = load ptr, ptr %12, align 8, !tbaa !5
  %52 = icmp ult ptr %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %170

54:                                               ; preds = %49
  %55 = load ptr, ptr %11, align 8, !tbaa !5
  %56 = invoke noundef zeroext i1 @_ZNK3JPH6BodyID9IsInvalidEv(ptr noundef nonnull align 4 dereferenceable(4) %55)
          to label %57 unwind label %77

57:                                               ; preds = %54
  br i1 %56, label %165, label %58

58:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %59 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %59, i64 4, i1 false), !tbaa.struct !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %60 = getelementptr inbounds %"class.JPH::BodyManager", ptr %19, i32 0, i32 0
  %61 = invoke noundef i32 @_ZNK3JPH6BodyID8GetIndexEv(ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %62 unwind label %81

62:                                               ; preds = %58
  %63 = zext i32 %61 to i64
  %64 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %60, i64 noundef %63)
          to label %65 unwind label %81

65:                                               ; preds = %62
  %66 = load ptr, ptr %64, align 8, !tbaa !5
  store ptr %66, ptr %14, align 8, !tbaa !5
  br label %67

67:                                               ; preds = %65
  %68 = load ptr, ptr %14, align 8, !tbaa !5
  %69 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122) %68)
          to label %70 unwind label %81

70:                                               ; preds = %67
  %71 = invoke noundef zeroext i1 @_ZNK3JPH6BodyIDeqERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %69, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %72 unwind label %81

72:                                               ; preds = %70
  br i1 %71, label %85, label %73

73:                                               ; preds = %72
  %74 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.11, ptr noundef @.str.1, i32 noundef 597)
          to label %75 unwind label %81

75:                                               ; preds = %73
  br i1 %74, label %76, label %85

76:                                               ; preds = %75
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #8, !srcloc !28
  br label %85

77:                                               ; preds = %54
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %9, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %10, align 4
  br label %169

81:                                               ; preds = %149, %144, %110, %92, %88, %73, %70, %67, %62, %58
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %9, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %10, align 4
  br label %164

85:                                               ; preds = %76, %75, %72
  br label %86

86:                                               ; preds = %85
  br label %87

87:                                               ; preds = %86
  br label %88

88:                                               ; preds = %87
  %89 = load ptr, ptr %14, align 8, !tbaa !5
  %90 = invoke noundef zeroext i1 @_ZNK3JPH4Body14IsInBroadPhaseEv(ptr noundef nonnull align 16 dereferenceable(122) %89)
          to label %91 unwind label %81

91:                                               ; preds = %88
  br i1 %90, label %96, label %92

92:                                               ; preds = %91
  %93 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jS1_NS_15AssertLastParamE(ptr noundef @.str.12, ptr noundef @.str.1, i32 noundef 598, ptr noundef @.str.13)
          to label %94 unwind label %81

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

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

96:                                               ; preds = %95, %94, %91
  br label %97

97:                                               ; preds = %96
  br label %98

98:                                               ; preds = %97
  %99 = load ptr, ptr %14, align 8, !tbaa !5
  %100 = getelementptr inbounds %"class.JPH::Body", ptr %99, i32 0, i32 4
  %101 = load ptr, ptr %100, align 8, !tbaa !30
  %102 = icmp ne ptr %101, null
  br i1 %102, label %103, label %163

103:                                              ; preds = %98
  %104 = load ptr, ptr %14, align 8, !tbaa !5
  %105 = getelementptr inbounds %"class.JPH::Body", ptr %104, i32 0, i32 4
  %106 = load ptr, ptr %105, align 8, !tbaa !30
  %107 = getelementptr inbounds %"class.JPH::MotionProperties", ptr %106, i32 0, i32 12
  %108 = load i32, ptr %107, align 16, !tbaa !47
  %109 = icmp ne i32 %108, -1
  br i1 %109, label %110, label %163

110:                                              ; preds = %103
  %111 = load ptr, ptr %14, align 8, !tbaa !5
  invoke void @_ZN3JPH11BodyManager26RemoveBodyFromActiveBodiesERNS_4BodyE(ptr noundef nonnull align 8 dereferenceable(297) %19, ptr noundef nonnull align 16 dereferenceable(122) %111)
          to label %112 unwind label %81

112:                                              ; preds = %110
  %113 = load ptr, ptr %14, align 8, !tbaa !5
  %114 = getelementptr inbounds %"class.JPH::Body", ptr %113, i32 0, i32 4
  %115 = load ptr, ptr %114, align 8, !tbaa !30
  %116 = getelementptr inbounds %"class.JPH::MotionProperties", ptr %115, i32 0, i32 13
  store i32 -1, ptr %116, align 4, !tbaa !52
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #8
  %117 = invoke { double, double } @_ZN3JPH4Vec35sZeroEv()
          to label %118 unwind label %154

118:                                              ; preds = %112
  %119 = getelementptr inbounds %"class.JPH::Vec3", ptr %17, i32 0, i32 0
  %120 = getelementptr inbounds %union.anon, ptr %119, i32 0, i32 0
  %121 = getelementptr inbounds { double, double }, ptr %120, i32 0, i32 0
  %122 = extractvalue { double, double } %117, 0
  store double %122, ptr %121, align 16
  %123 = getelementptr inbounds { double, double }, ptr %120, i32 0, i32 1
  %124 = extractvalue { double, double } %117, 1
  store double %124, ptr %123, align 8
  %125 = load ptr, ptr %14, align 8, !tbaa !5
  %126 = getelementptr inbounds %"class.JPH::Body", ptr %125, i32 0, i32 4
  %127 = load ptr, ptr %126, align 8, !tbaa !30
  %128 = getelementptr inbounds %"class.JPH::MotionProperties", ptr %127, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %128, ptr align 16 %17, i64 16, i1 false), !tbaa.struct !53
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #8
  %129 = invoke { double, double } @_ZN3JPH4Vec35sZeroEv()
          to label %130 unwind label %158

130:                                              ; preds = %118
  %131 = getelementptr inbounds %"class.JPH::Vec3", ptr %18, i32 0, i32 0
  %132 = getelementptr inbounds %union.anon, ptr %131, i32 0, i32 0
  %133 = getelementptr inbounds { double, double }, ptr %132, i32 0, i32 0
  %134 = extractvalue { double, double } %129, 0
  store double %134, ptr %133, align 16
  %135 = getelementptr inbounds { double, double }, ptr %132, i32 0, i32 1
  %136 = extractvalue { double, double } %129, 1
  store double %136, ptr %135, align 8
  %137 = load ptr, ptr %14, align 8, !tbaa !5
  %138 = getelementptr inbounds %"class.JPH::Body", ptr %137, i32 0, i32 4
  %139 = load ptr, ptr %138, align 8, !tbaa !30
  %140 = getelementptr inbounds %"class.JPH::MotionProperties", ptr %139, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %140, ptr align 16 %18, i64 16, i1 false), !tbaa.struct !53
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #8
  %141 = getelementptr inbounds %"class.JPH::BodyManager", ptr %19, i32 0, i32 14
  %142 = load ptr, ptr %141, align 8, !tbaa !55
  %143 = icmp ne ptr %142, null
  br i1 %143, label %144, label %162

144:                                              ; preds = %130
  %145 = getelementptr inbounds %"class.JPH::BodyManager", ptr %19, i32 0, i32 14
  %146 = load ptr, ptr %145, align 8, !tbaa !55
  %147 = load ptr, ptr %14, align 8, !tbaa !5
  %148 = invoke noundef i64 @_ZNK3JPH4Body11GetUserDataEv(ptr noundef nonnull align 16 dereferenceable(122) %147)
          to label %149 unwind label %81

149:                                              ; preds = %144
  %150 = load ptr, ptr %146, align 8, !tbaa !56
  %151 = getelementptr inbounds ptr, ptr %150, i64 3
  %152 = load ptr, ptr %151, align 8
  invoke void %152(ptr noundef nonnull align 8 dereferenceable(8) %146, ptr noundef nonnull align 4 dereferenceable(4) %13, i64 noundef %148)
          to label %153 unwind label %81

153:                                              ; preds = %149
  br label %162

154:                                              ; preds = %112
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %9, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #8
  br label %164

158:                                              ; preds = %118
  %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
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #8
  br label %164

162:                                              ; preds = %153, %130
  br label %163

163:                                              ; preds = %162, %103, %98
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %165

164:                                              ; preds = %158, %154, %81
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %169

165:                                              ; preds = %163, %57
  br label %166

166:                                              ; preds = %165
  %167 = load ptr, ptr %11, align 8, !tbaa !5
  %168 = getelementptr inbounds %"class.JPH::BodyID", ptr %167, i32 1
  store ptr %168, ptr %11, align 8, !tbaa !5
  br label %49, !llvm.loop !58

169:                                              ; preds = %164, %77
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %172

170:                                              ; preds = %53
  call void @_ZN3JPH10UniqueLockINS_5MutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %7) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #8
  br label %171

171:                                              ; preds = %170, %22
  ret void

172:                                              ; preds = %169, %37
  call void @_ZN3JPH10UniqueLockINS_5MutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %7) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #8
  br label %173

173:                                              ; preds = %172
  %174 = load ptr, ptr %9, align 8
  %175 = load i32, ptr %10, align 4
  %176 = insertvalue { ptr, i32 } poison, ptr %174, 0
  %177 = insertvalue { ptr, i32 } %176, i32 %175, 1
  resume { ptr, i32 } %177
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 = { 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 #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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !22, i64 296}
!12 = !{!"_ZTSN3JPH11BodyManagerE", !13, i64 0, !10, i64 24, !14, i64 32, !15, i64 40, !19, i64 88, !20, i64 104, !15, i64 128, !7, i64 176, !7, i64 192, !10, i64 200, !15, i64 208, !21, i64 256, !6, i64 280, !6, i64 288, !22, i64 296}
!13 = !{!"_ZTSN3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEEE", !14, i64 0, !14, i64 8, !6, i64 16}
!14 = !{!"long", !7, i64 0}
!15 = !{!"_ZTSN3JPH5MutexE", !16, i64 0, !18, i64 40}
!16 = !{!"_ZTSSt5mutex", !17, i64 0}
!17 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!18 = !{!"_ZTSNSt6thread2idE", !14, i64 0}
!19 = !{!"_ZTSN3JPH10MutexArrayINS_11SharedMutexEEE", !6, i64 0, !10, i64 8}
!20 = !{!"_ZTSN3JPH5ArrayIhNS_12STLAllocatorIhEEEE", !14, i64 0, !14, i64 8, !6, i64 16}
!21 = !{!"_ZTSN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEEE", !14, i64 0, !14, i64 8, !6, i64 16}
!22 = !{!"bool", !7, i64 0}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = !{!22, !22, i64 0}
!26 = !{i64 2158737076}
!27 = !{i64 0, i64 4, !9}
!28 = !{i64 2158737416}
!29 = !{i64 2158737804}
!30 = !{!31, !6, i64 72}
!31 = !{!"_ZTSN3JPH4BodyE", !32, i64 0, !33, i64 16, !35, i64 32, !36, i64 64, !6, i64 72, !14, i64 80, !37, i64 88, !39, i64 104, !39, i64 108, !40, i64 112, !41, i64 116, !42, i64 118, !43, i64 119, !44, i64 120, !45, i64 121}
!32 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!33 = !{!"_ZTSN3JPH4QuatE", !34, i64 0}
!34 = !{!"_ZTSN3JPH4Vec4E", !7, i64 0}
!35 = !{!"_ZTSN3JPH5AABoxE", !32, i64 0, !32, i64 16}
!36 = !{!"_ZTSN3JPH8RefConstINS_5ShapeEEE", !6, i64 0}
!37 = !{!"_ZTSN3JPH14CollisionGroupE", !38, i64 0, !10, i64 8, !10, i64 12}
!38 = !{!"_ZTSN3JPH8RefConstINS_11GroupFilterEEE", !6, i64 0}
!39 = !{!"float", !7, i64 0}
!40 = !{!"_ZTSN3JPH6BodyIDE", !10, i64 0}
!41 = !{!"short", !7, i64 0}
!42 = !{!"_ZTSN3JPH9EBodyTypeE", !7, i64 0}
!43 = !{!"_ZTSN3JPH15BroadPhaseLayerE", !7, i64 0}
!44 = !{!"_ZTSN3JPH11EMotionTypeE", !7, i64 0}
!45 = !{!"_ZTSSt6atomicIhE", !46, i64 0}
!46 = !{!"_ZTSSt13__atomic_baseIhE", !7, i64 0}
!47 = !{!48, !10, i64 112}
!48 = !{!"_ZTSN3JPH16MotionPropertiesE", !32, i64 0, !32, i64 16, !32, i64 32, !33, i64 48, !49, i64 64, !49, i64 76, !39, i64 88, !39, i64 92, !39, i64 96, !39, i64 100, !39, i64 104, !39, i64 108, !10, i64 112, !10, i64 116, !50, i64 120, !22, i64 121, !51, i64 122, !7, i64 123, !7, i64 124, !7, i64 128, !39, i64 176, !42, i64 180, !44, i64 181}
!49 = !{!"_ZTSN3JPH6Float3E", !39, i64 0, !39, i64 4, !39, i64 8}
!50 = !{!"_ZTSN3JPH14EMotionQualityE", !7, i64 0}
!51 = !{!"_ZTSN3JPH12EAllowedDOFsE", !7, i64 0}
!52 = !{!48, !10, i64 116}
!53 = !{i64 0, i64 16, !54}
!54 = !{!7, !7, i64 0}
!55 = !{!12, !6, i64 280}
!56 = !{!57, !57, i64 0}
!57 = !{!"vtable pointer", !8, i64 0}
!58 = distinct !{!58, !59}
!59 = !{!"llvm.loop.mustprogress"}


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

@_ZN3JPHL26sOverrideAllowDeactivationE = external hidden thread_local local_unnamed_addr global i8, align 1
@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [51 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: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH10UniqueLockINS_5MutexEEC2ERS1_PKNS_11BodyManagerENS_17EPhysicsLockTypesE(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef nonnull align 8 dereferenceable(48), ptr noundef, i32 noundef) unnamed_addr #2 align 2

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

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec35sZeroEv() local_unnamed_addr #5 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH6BodyID9IsInvalidEv(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #6 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3JPH6BodyID8GetIndexEv(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH6BodyIDeqERKS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #6 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK3JPH4Body11GetUserDataEv(ptr noundef nonnull align 16 dereferenceable(122)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH11BodyManager16DeactivateBodiesEPKNS_6BodyIDEi(ptr noundef nonnull align 8 dereferenceable(297) %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.JPH::UniqueLock", align 8
  %5 = alloca %"class.JPH::BodyID", align 4
  %6 = icmp slt i32 %2, 1
  br i1 %6, label %84, label %7

7:                                                ; preds = %3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #7
  %8 = getelementptr inbounds i8, ptr %0, i64 128
  call void @_ZN3JPH10UniqueLockINS_5MutexEEC2ERS1_PKNS_11BodyManagerENS_17EPhysicsLockTypesE(ptr noundef nonnull align 8 dereferenceable(20) %4, ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull %0, i32 noundef 32)
  %9 = getelementptr inbounds i8, ptr %0, i64 296
  %10 = load i8, ptr %9, align 8, !tbaa !5, !range !21, !noundef !22
  %11 = trunc nuw i8 %10 to i1
  br i1 %11, label %12, label %.lr.ph

12:                                               ; preds = %7
  %13 = call align 1 ptr @llvm.threadlocal.address.p0(ptr align 1 @_ZN3JPHL26sOverrideAllowDeactivationE)
  %14 = load i8, ptr %13, align 1, !tbaa !23, !range !21, !noundef !22
  %15 = trunc nuw i8 %14 to i1
  br i1 %15, label %.lr.ph, label %16

16:                                               ; preds = %12
  %17 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.1, i32 noundef 589)
          to label %18 unwind label %20

18:                                               ; preds = %16
  br i1 %17, label %19, label %.lr.ph

19:                                               ; preds = %18
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #7, !srcloc !24
  br label %.lr.ph

20:                                               ; preds = %16
  %21 = landingpad { ptr, i32 }
          cleanup
  br label %85

.lr.ph:                                           ; preds = %7, %12, %18, %19
  %22 = zext nneg i32 %2 to i64
  %23 = getelementptr inbounds %"class.JPH::BodyID", ptr %1, i64 %22
  %24 = getelementptr inbounds i8, ptr %0, i64 280
  br label %25

._crit_edge:                                      ; preds = %81
  call void @_ZN3JPH10UniqueLockINS_5MutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  br label %84

25:                                               ; preds = %.lr.ph, %81
  %.02432 = phi ptr [ %1, %.lr.ph ], [ %82, %81 ]
  %26 = call noundef zeroext i1 @_ZNK3JPH6BodyID9IsInvalidEv(ptr noundef nonnull align 4 dereferenceable(4) %.02432)
  br i1 %26, label %81, label %27

27:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %28 = load i32, ptr %.02432, align 4, !tbaa !25
  store i32 %28, ptr %5, align 4, !tbaa !25
  %29 = call noundef i32 @_ZNK3JPH6BodyID8GetIndexEv(ptr noundef nonnull align 4 dereferenceable(4) %5)
  %30 = zext i32 %29 to i64
  %31 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %30)
          to label %32 unwind label %40

32:                                               ; preds = %27
  %33 = load ptr, ptr %31, align 8, !tbaa !26
  %34 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122) %33)
  %35 = call noundef zeroext i1 @_ZNK3JPH6BodyIDeqERKS0_(ptr noundef nonnull align 4 dereferenceable(4) %34, ptr noundef nonnull align 4 dereferenceable(4) %5)
  br i1 %35, label %42, label %36

36:                                               ; preds = %32
  %37 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.1, i32 noundef 597)
          to label %38 unwind label %40

38:                                               ; preds = %36
  br i1 %37, label %39, label %42

39:                                               ; preds = %38
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #7, !srcloc !27
  br label %42

40:                                               ; preds = %70, %54, %44, %36, %27
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %80

42:                                               ; preds = %32, %38, %39
  %43 = call noundef zeroext i1 @_ZNK3JPH4Body14IsInBroadPhaseEv(ptr noundef nonnull align 16 dereferenceable(122) %33)
  br i1 %43, label %48, label %44

44:                                               ; preds = %42
  %45 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jS1_NS_15AssertLastParamE(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.1, i32 noundef 598, ptr noundef nonnull @.str.13)
          to label %46 unwind label %40

46:                                               ; preds = %44
  br i1 %45, label %47, label %48

47:                                               ; preds = %46
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #7, !srcloc !28
  br label %48

48:                                               ; preds = %47, %46, %42
  %49 = getelementptr inbounds i8, ptr %33, i64 72
  %50 = load ptr, ptr %49, align 8, !tbaa !29
  %.not = icmp eq ptr %50, null
  br i1 %.not, label %79, label %51

51:                                               ; preds = %48
  %52 = getelementptr inbounds i8, ptr %50, i64 112
  %53 = load i32, ptr %52, align 16, !tbaa !46
  %.not28 = icmp eq i32 %53, -1
  br i1 %.not28, label %79, label %54

54:                                               ; preds = %51
  invoke void @_ZN3JPH11BodyManager26RemoveBodyFromActiveBodiesERNS_4BodyE(ptr noundef nonnull align 8 dereferenceable(297) %0, ptr noundef nonnull align 16 dereferenceable(122) %33)
          to label %55 unwind label %40

55:                                               ; preds = %54
  %56 = load ptr, ptr %49, align 8, !tbaa !29
  %57 = getelementptr inbounds i8, ptr %56, i64 116
  store i32 -1, ptr %57, align 4, !tbaa !51
  %58 = invoke { double, double } @_ZN3JPH4Vec35sZeroEv()
          to label %59 unwind label %75

59:                                               ; preds = %55
  %60 = extractvalue { double, double } %58, 0
  %61 = extractvalue { double, double } %58, 1
  %62 = load ptr, ptr %49, align 8, !tbaa !29
  store double %60, ptr %62, align 16
  %.sroa.52.0..sroa_idx = getelementptr inbounds i8, ptr %62, i64 8
  store double %61, ptr %.sroa.52.0..sroa_idx, align 8, !tbaa !52
  %63 = invoke { double, double } @_ZN3JPH4Vec35sZeroEv()
          to label %64 unwind label %77

64:                                               ; preds = %59
  %65 = extractvalue { double, double } %63, 0
  %66 = extractvalue { double, double } %63, 1
  %67 = load ptr, ptr %49, align 8, !tbaa !29
  %68 = getelementptr inbounds i8, ptr %67, i64 16
  store double %65, ptr %68, align 16
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %67, i64 24
  store double %66, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !52
  %69 = load ptr, ptr %24, align 8, !tbaa !53
  %.not29 = icmp eq ptr %69, null
  br i1 %.not29, label %79, label %70

70:                                               ; preds = %64
  %71 = call noundef i64 @_ZNK3JPH4Body11GetUserDataEv(ptr noundef nonnull align 16 dereferenceable(122) %33)
  %72 = load ptr, ptr %69, align 8, !tbaa !54
  %73 = getelementptr inbounds i8, ptr %72, i64 24
  %74 = load ptr, ptr %73, align 8
  invoke void %74(ptr noundef nonnull align 8 dereferenceable(8) %69, ptr noundef nonnull align 4 dereferenceable(4) %5, i64 noundef %71)
          to label %79 unwind label %40

75:                                               ; preds = %55
  %76 = landingpad { ptr, i32 }
          cleanup
  br label %80

77:                                               ; preds = %59
  %78 = landingpad { ptr, i32 }
          cleanup
  br label %80

79:                                               ; preds = %64, %70, %51, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %81

80:                                               ; preds = %77, %75, %40
  %.pn = phi { ptr, i32 } [ %41, %40 ], [ %78, %77 ], [ %76, %75 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %85

81:                                               ; preds = %25, %79
  %82 = getelementptr inbounds i8, ptr %.02432, i64 4
  %83 = icmp ult ptr %82, %23
  br i1 %83, label %25, label %._crit_edge, !llvm.loop !56

84:                                               ; preds = %3, %._crit_edge
  ret void

85:                                               ; preds = %80, %20
  %.pn.pn = phi { ptr, i32 } [ %.pn, %80 ], [ %21, %20 ]
  call void @_ZN3JPH10UniqueLockINS_5MutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  resume { ptr, i32 } %.pn.pn
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { 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 #5 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 = { 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 #7 = { 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, !20, i64 296}
!6 = !{!"_ZTSN3JPH11BodyManagerE", !7, i64 0, !12, i64 24, !8, i64 32, !13, i64 40, !17, i64 88, !18, i64 104, !13, i64 128, !9, i64 176, !9, i64 192, !12, i64 200, !13, i64 208, !19, i64 256, !11, i64 280, !11, i64 288, !20, i64 296}
!7 = !{!"_ZTSN3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEEE", !8, i64 0, !8, i64 8, !11, i64 16}
!8 = !{!"long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!"int", !9, i64 0}
!13 = !{!"_ZTSN3JPH5MutexE", !14, i64 0, !16, i64 40}
!14 = !{!"_ZTSSt5mutex", !15, i64 0}
!15 = !{!"_ZTSSt12__mutex_base", !9, i64 0}
!16 = !{!"_ZTSNSt6thread2idE", !8, i64 0}
!17 = !{!"_ZTSN3JPH10MutexArrayINS_11SharedMutexEEE", !11, i64 0, !12, i64 8}
!18 = !{!"_ZTSN3JPH5ArrayIhNS_12STLAllocatorIhEEEE", !8, i64 0, !8, i64 8, !11, i64 16}
!19 = !{!"_ZTSN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEEE", !8, i64 0, !8, i64 8, !11, i64 16}
!20 = !{!"bool", !9, i64 0}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{!20, !20, i64 0}
!24 = !{i64 2158737076}
!25 = !{!12, !12, i64 0}
!26 = !{!11, !11, i64 0}
!27 = !{i64 2158737416}
!28 = !{i64 2158737804}
!29 = !{!30, !11, i64 72}
!30 = !{!"_ZTSN3JPH4BodyE", !31, i64 0, !32, i64 16, !34, i64 32, !35, i64 64, !11, i64 72, !8, i64 80, !36, i64 88, !38, i64 104, !38, i64 108, !39, i64 112, !40, i64 116, !41, i64 118, !42, i64 119, !43, i64 120, !44, i64 121}
!31 = !{!"_ZTSN3JPH4Vec3E", !9, i64 0}
!32 = !{!"_ZTSN3JPH4QuatE", !33, i64 0}
!33 = !{!"_ZTSN3JPH4Vec4E", !9, i64 0}
!34 = !{!"_ZTSN3JPH5AABoxE", !31, i64 0, !31, i64 16}
!35 = !{!"_ZTSN3JPH8RefConstINS_5ShapeEEE", !11, i64 0}
!36 = !{!"_ZTSN3JPH14CollisionGroupE", !37, i64 0, !12, i64 8, !12, i64 12}
!37 = !{!"_ZTSN3JPH8RefConstINS_11GroupFilterEEE", !11, i64 0}
!38 = !{!"float", !9, i64 0}
!39 = !{!"_ZTSN3JPH6BodyIDE", !12, i64 0}
!40 = !{!"short", !9, i64 0}
!41 = !{!"_ZTSN3JPH9EBodyTypeE", !9, i64 0}
!42 = !{!"_ZTSN3JPH15BroadPhaseLayerE", !9, i64 0}
!43 = !{!"_ZTSN3JPH11EMotionTypeE", !9, i64 0}
!44 = !{!"_ZTSSt6atomicIhE", !45, i64 0}
!45 = !{!"_ZTSSt13__atomic_baseIhE", !9, i64 0}
!46 = !{!47, !12, i64 112}
!47 = !{!"_ZTSN3JPH16MotionPropertiesE", !31, i64 0, !31, i64 16, !31, i64 32, !32, i64 48, !48, i64 64, !48, i64 76, !38, i64 88, !38, i64 92, !38, i64 96, !38, i64 100, !38, i64 104, !38, i64 108, !12, i64 112, !12, i64 116, !49, i64 120, !20, i64 121, !50, i64 122, !9, i64 123, !9, i64 124, !9, i64 128, !38, i64 176, !41, i64 180, !43, i64 181}
!48 = !{!"_ZTSN3JPH6Float3E", !38, i64 0, !38, i64 4, !38, i64 8}
!49 = !{!"_ZTSN3JPH14EMotionQualityE", !9, i64 0}
!50 = !{!"_ZTSN3JPH12EAllowedDOFsE", !9, i64 0}
!51 = !{!47, !12, i64 116}
!52 = !{!9, !9, i64 0}
!53 = !{!6, !11, i64 280}
!54 = !{!55, !55, i64 0}
!55 = !{!"vtable pointer", !10, i64 0}
!56 = distinct !{!56, !57}
!57 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,SCCPPass,SROAPass,SimplifyCFGPass