; 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::Array.3" = type { i64, i64, 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 }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"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> }

; 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 nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122)) #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN3JPH13PhysicsSystem12RestoreStateERNS_13StateRecorderEPKNS_19StateRecorderFilterE(ptr noundef nonnull align 16 dereferenceable(1172) %0, ptr noundef nonnull align 8 dereferenceable(18) %1, ptr noundef %2) #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca %"class.JPH::Array.3", align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %17 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #7
  store i8 15, ptr %8, align 1, !tbaa !9
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN3JPH8StreamIn4ReadINS_19EStateRecorderStateETnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS4_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 1 dereferenceable(1) %8)
  %19 = load i8, ptr %8, align 1, !tbaa !9
  %20 = zext i8 %19 to i32
  %21 = and i32 %20, 1
  %22 = icmp ne i32 %21, 0
  br i1 %22, label %23, label %28

23:                                               ; preds = %3
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %17, i32 0, i32 22
  call void @_ZN3JPH8StreamIn4ReadIfTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS3_(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 4 dereferenceable(4) %25)
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %17, i32 0, i32 21
  call void @_ZN3JPH8StreamIn4ReadERNS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 16 dereferenceable(16) %27)
  br label %28

28:                                               ; preds = %23, %3
  %29 = load i8, ptr %8, align 1, !tbaa !9
  %30 = zext i8 %29 to i32
  %31 = and i32 %30, 2
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %33, label %116

33:                                               ; preds = %28
  %34 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %17, i32 0, i32 2
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = call noundef zeroext i1 @_ZN3JPH11BodyManager12RestoreStateERNS_13StateRecorderE(ptr noundef nonnull align 8 dereferenceable(297) %34, ptr noundef nonnull align 8 dereferenceable(18) %35)
  br i1 %36, label %38, label %37

37:                                               ; preds = %33
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %140

38:                                               ; preds = %33
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = call noundef zeroext i1 @_ZNK3JPH13StateRecorder10IsLastPartEv(ptr noundef nonnull align 8 dereferenceable(18) %39)
  br i1 %40, label %41, label %115

41:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #7
  call void @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %42 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %17, i32 0, i32 2
  %43 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH11BodyManager9GetBodiesEv(ptr noundef nonnull align 8 dereferenceable(297) %42)
          to label %44 unwind label %56

44:                                               ; preds = %41
  store ptr %43, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %45 = load ptr, ptr %11, align 8, !tbaa !5
  %46 = invoke noundef ptr @_ZN3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %45)
          to label %47 unwind label %60

47:                                               ; preds = %44
  store ptr %46, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %48 = load ptr, ptr %11, align 8, !tbaa !5
  %49 = invoke noundef ptr @_ZN3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %48)
          to label %50 unwind label %64

50:                                               ; preds = %47
  store ptr %49, ptr %15, align 8, !tbaa !5
  br label %51

51:                                               ; preds = %88, %50
  %52 = load ptr, ptr %14, align 8, !tbaa !5
  %53 = load ptr, ptr %15, align 8, !tbaa !5
  %54 = icmp ne ptr %52, %53
  br i1 %54, label %68, label %55

55:                                               ; preds = %51
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %94

56:                                               ; preds = %41
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %12, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %13, align 4
  br label %93

60:                                               ; preds = %44
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %12, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %13, align 4
  br label %92

64:                                               ; preds = %47
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %12, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %13, align 4
  br label %91

68:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %69 = load ptr, ptr %14, align 8, !tbaa !5
  %70 = load ptr, ptr %69, align 8, !tbaa !5
  store ptr %70, ptr %16, align 8, !tbaa !5
  %71 = load ptr, ptr %16, align 8, !tbaa !5
  %72 = invoke noundef zeroext i1 @_ZN3JPH11BodyManager19sIsValidBodyPointerEPKNS_4BodyE(ptr noundef %71)
          to label %73 unwind label %83

73:                                               ; preds = %68
  br i1 %72, label %74, label %87

74:                                               ; preds = %73
  %75 = load ptr, ptr %16, align 8, !tbaa !5
  %76 = invoke noundef zeroext i1 @_ZNK3JPH4Body14IsInBroadPhaseEv(ptr noundef nonnull align 16 dereferenceable(122) %75)
          to label %77 unwind label %83

77:                                               ; preds = %74
  br i1 %76, label %78, label %87

78:                                               ; preds = %77
  %79 = load ptr, ptr %16, align 8, !tbaa !5
  %80 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122) %79)
          to label %81 unwind label %83

81:                                               ; preds = %78
  invoke void @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 4 dereferenceable(4) %80)
          to label %82 unwind label %83

82:                                               ; preds = %81
  br label %87

83:                                               ; preds = %81, %78, %74, %68
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %12, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %91

87:                                               ; preds = %82, %77, %73
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %88

88:                                               ; preds = %87
  %89 = load ptr, ptr %14, align 8, !tbaa !5
  %90 = getelementptr inbounds ptr, ptr %89, i32 1
  store ptr %90, ptr %14, align 8, !tbaa !5
  br label %51

91:                                               ; preds = %83, %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %92

92:                                               ; preds = %91, %60
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %93

93:                                               ; preds = %92, %56
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %114

94:                                               ; preds = %55
  %95 = invoke noundef zeroext i1 @_ZNK3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %96 unwind label %109

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

97:                                               ; preds = %96
  %98 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %17, i32 0, i32 9
  %99 = load ptr, ptr %98, align 16, !tbaa !11
  %100 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef 0)
          to label %101 unwind label %109

101:                                              ; preds = %97
  %102 = invoke noundef i64 @_ZNK3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %103 unwind label %109

103:                                              ; preds = %101
  %104 = trunc i64 %102 to i32
  %105 = load ptr, ptr %99, align 8, !tbaa !43
  %106 = getelementptr inbounds ptr, ptr %105, i64 19
  %107 = load ptr, ptr %106, align 8
  invoke void %107(ptr noundef nonnull align 8 dereferenceable(16) %99, ptr noundef %100, i32 noundef %104, i1 noundef zeroext true)
          to label %108 unwind label %109

108:                                              ; preds = %103
  br label %113

109:                                              ; preds = %103, %101, %97, %94
  %110 = landingpad { ptr, i32 }
          cleanup
  %111 = extractvalue { ptr, i32 } %110, 0
  store ptr %111, ptr %12, align 8
  %112 = extractvalue { ptr, i32 } %110, 1
  store i32 %112, ptr %13, align 4
  br label %114

113:                                              ; preds = %108, %96
  call void @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #7
  br label %115

114:                                              ; preds = %109, %93
  call void @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #7
  br label %142

115:                                              ; preds = %113, %38
  br label %116

116:                                              ; preds = %115, %28
  %117 = load i8, ptr %8, align 1, !tbaa !9
  %118 = zext i8 %117 to i32
  %119 = and i32 %118, 4
  %120 = icmp ne i32 %119, 0
  br i1 %120, label %121, label %128

121:                                              ; preds = %116
  %122 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %17, i32 0, i32 15
  %123 = load ptr, ptr %6, align 8, !tbaa !5
  %124 = load ptr, ptr %7, align 8, !tbaa !5
  %125 = call noundef zeroext i1 @_ZN3JPH24ContactConstraintManager12RestoreStateERNS_13StateRecorderEPKNS_19StateRecorderFilterE(ptr noundef nonnull align 8 dereferenceable(248) %122, ptr noundef nonnull align 8 dereferenceable(18) %123, ptr noundef %124)
  br i1 %125, label %127, label %126

126:                                              ; preds = %121
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %140

127:                                              ; preds = %121
  br label %128

128:                                              ; preds = %127, %116
  %129 = load i8, ptr %8, align 1, !tbaa !9
  %130 = zext i8 %129 to i32
  %131 = and i32 %130, 8
  %132 = icmp ne i32 %131, 0
  br i1 %132, label %133, label %139

133:                                              ; preds = %128
  %134 = getelementptr inbounds %"class.JPH::PhysicsSystem", ptr %17, i32 0, i32 16
  %135 = load ptr, ptr %6, align 8, !tbaa !5
  %136 = call noundef zeroext i1 @_ZN3JPH17ConstraintManager12RestoreStateERNS_13StateRecorderE(ptr noundef nonnull align 8 dereferenceable(80) %134, ptr noundef nonnull align 8 dereferenceable(18) %135)
  br i1 %136, label %138, label %137

137:                                              ; preds = %133
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %140

138:                                              ; preds = %133
  br label %139

139:                                              ; preds = %138, %128
  store i1 true, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %140

140:                                              ; preds = %139, %137, %126, %37
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #7
  %141 = load i1, ptr %4, align 1
  ret i1 %141

142:                                              ; preds = %114
  %143 = load ptr, ptr %12, align 8
  %144 = load i32, ptr %13, align 4
  %145 = insertvalue { ptr, i32 } poison, ptr %143, 0
  %146 = insertvalue { ptr, i32 } %145, i32 %144, 1
  resume { ptr, i32 } %146
}

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

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

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

declare noundef zeroext i1 @_ZN3JPH11BodyManager12RestoreStateERNS_13StateRecorderE(ptr noundef nonnull align 8 dereferenceable(297), ptr noundef nonnull align 8 dereferenceable(18)) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH13StateRecorder10IsLastPartEv(ptr noundef nonnull align 8 dereferenceable(18)) #2 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH11BodyManager19sIsValidBodyPointerEPKNS_4BodyE(ptr noundef) #1 align 2

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

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

declare noundef zeroext i1 @_ZN3JPH24ContactConstraintManager12RestoreStateERNS_13StateRecorderEPKNS_19StateRecorderFilterE(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef nonnull align 8 dereferenceable(18), ptr noundef) #6

declare noundef zeroext i1 @_ZN3JPH17ConstraintManager12RestoreStateERNS_13StateRecorderE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(18)) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #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 = { 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 = { "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, !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 = !{!"_ZTSN3JPH19EStateRecorderStateE", !7, i64 0}
!11 = !{!12, !6, i64 432}
!12 = !{!"_ZTSN3JPH13PhysicsSystemE", !6, i64 0, !6, i64 8, !13, i64 16, !25, i64 320, !27, i64 336, !28, i64 352, !28, i64 376, !29, i64 400, !29, i64 416, !6, i64 432, !6, i64 440, !6, i64 448, !30, i64 456, !32, i64 488, !34, i64 576, !37, i64 824, !39, i64 904, !40, i64 1016, !17, i64 1080, !41, i64 1128, !42, i64 1152, !33, i64 1168}
!13 = !{!"_ZTSN3JPH11BodyManagerE", !14, i64 0, !16, i64 24, !15, i64 32, !17, i64 40, !21, i64 88, !22, i64 104, !17, i64 128, !7, i64 176, !7, i64 192, !16, i64 200, !17, i64 208, !23, i64 256, !6, i64 280, !6, i64 288, !24, i64 296}
!14 = !{!"_ZTSN3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEEE", !15, i64 0, !15, i64 8, !6, i64 16}
!15 = !{!"long", !7, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!"_ZTSN3JPH5MutexE", !18, i64 0, !20, i64 40}
!18 = !{!"_ZTSSt5mutex", !19, i64 0}
!19 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!20 = !{!"_ZTSNSt6thread2idE", !15, i64 0}
!21 = !{!"_ZTSN3JPH10MutexArrayINS_11SharedMutexEEE", !6, i64 0, !16, i64 8}
!22 = !{!"_ZTSN3JPH5ArrayIhNS_12STLAllocatorIhEEEE", !15, i64 0, !15, i64 8, !6, i64 16}
!23 = !{!"_ZTSN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEEE", !15, i64 0, !15, i64 8, !6, i64 16}
!24 = !{!"bool", !7, i64 0}
!25 = !{!"_ZTSN3JPH23BodyLockInterfaceNoLockE", !26, i64 0}
!26 = !{!"_ZTSN3JPH17BodyLockInterfaceE", !6, i64 8}
!27 = !{!"_ZTSN3JPH24BodyLockInterfaceLockingE", !26, i64 0}
!28 = !{!"_ZTSN3JPH13BodyInterfaceE", !6, i64 0, !6, i64 8, !6, i64 16}
!29 = !{!"_ZTSN3JPH16NarrowPhaseQueryE", !6, i64 0, !6, i64 8}
!30 = !{!"_ZTSSt8functionIFvRKN3JPH4BodyES3_RKNS0_5Mat44ES6_RNS0_20CollideShapeSettingsERNS0_18CollisionCollectorINS0_18CollideShapeResultENS0_36CollisionCollectorTraitsCollideShapeEEERKNS0_11ShapeFilterEEE", !31, i64 0, !6, i64 24}
!31 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!32 = !{!"_ZTSN3JPH15PhysicsSettingsE", !16, i64 0, !16, i64 4, !16, i64 8, !33, i64 12, !33, i64 16, !33, i64 20, !33, i64 24, !33, i64 28, !33, i64 32, !33, i64 36, !33, i64 40, !33, i64 44, !33, i64 48, !33, i64 52, !16, i64 56, !16, i64 60, !33, i64 64, !33, i64 68, !33, i64 72, !24, i64 76, !24, i64 77, !24, i64 78, !24, i64 79, !24, i64 80, !24, i64 81, !24, i64 82}
!33 = !{!"float", !7, i64 0}
!34 = !{!"_ZTSN3JPH24ContactConstraintManagerE", !7, i64 8, !16, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !16, i64 232, !35, i64 236, !6, i64 240}
!35 = !{!"_ZTSSt6atomicIjE", !36, i64 0}
!36 = !{!"_ZTSSt13__atomic_baseIjE", !16, i64 0}
!37 = !{!"_ZTSN3JPH17ConstraintManagerE", !6, i64 0, !38, i64 8, !17, i64 32}
!38 = !{!"_ZTSN3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEEE", !15, i64 0, !15, i64 8, !6, i64 16}
!39 = !{!"_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, !16, i64 88, !16, i64 92, !16, i64 96, !16, i64 100, !16, i64 104, !16, i64 108}
!40 = !{!"_ZTSN3JPH19LargeIslandSplitterE", !16, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !16, i64 32, !35, i64 36, !16, i64 40, !6, i64 48, !35, i64 56}
!41 = !{!"_ZTSN3JPH5ArrayIPNS_19PhysicsStepListenerENS_12STLAllocatorIS2_EEEE", !15, i64 0, !15, i64 8, !6, i64 16}
!42 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!43 = !{!44, !44, i64 0}
!44 = !{!"vtable pointer", !8, i64 0}


; 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::Array.3" = type { i64, i64, ptr }

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN3JPH13PhysicsSystem12RestoreStateERNS_13StateRecorderEPKNS_19StateRecorderFilterE(ptr noundef nonnull align 16 dereferenceable(1172) %0, ptr noundef nonnull align 8 dereferenceable(18) %1, ptr noundef %2) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i8, align 1
  %5 = alloca %"class.JPH::Array.3", align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #7
  store i8 15, ptr %4, align 1, !tbaa !5
  call void @_ZN3JPH8StreamIn4ReadINS_19EStateRecorderStateETnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS4_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 1 dereferenceable(1) %4)
  %6 = load i8, ptr %4, align 1, !tbaa !5
  %7 = and i8 %6, 1
  %.not = icmp eq i8 %7, 0
  br i1 %.not, label %11, label %8

8:                                                ; preds = %3
  %9 = getelementptr inbounds i8, ptr %0, i64 1168
  call void @_ZN3JPH8StreamIn4ReadIfTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS3_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %10 = getelementptr inbounds i8, ptr %0, i64 1152
  call void @_ZN3JPH8StreamIn4ReadERNS_4Vec3E(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 16 dereferenceable(16) %10)
  %.pre = load i8, ptr %4, align 1, !tbaa !5
  br label %11

11:                                               ; preds = %8, %3
  %12 = phi i8 [ %.pre, %8 ], [ %6, %3 ]
  %13 = and i8 %12, 2
  %.not23 = icmp eq i8 %13, 0
  br i1 %.not23, label %48, label %14

14:                                               ; preds = %11
  %15 = getelementptr inbounds i8, ptr %0, i64 16
  %16 = call noundef zeroext i1 @_ZN3JPH11BodyManager12RestoreStateERNS_13StateRecorderE(ptr noundef nonnull align 8 dereferenceable(297) %15, ptr noundef nonnull align 8 dereferenceable(18) %1)
  br i1 %16, label %17, label %61

17:                                               ; preds = %14
  %18 = call noundef zeroext i1 @_ZNK3JPH13StateRecorder10IsLastPartEv(ptr noundef nonnull align 8 dereferenceable(18) %1)
  br i1 %18, label %19, label %48

19:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #7
  call void @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  %20 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH11BodyManager9GetBodiesEv(ptr noundef nonnull align 8 dereferenceable(297) %15)
  %21 = call noundef ptr @_ZN3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %20)
  %22 = call noundef ptr @_ZN3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %20)
  %.not2428 = icmp eq ptr %21, %22
  br i1 %.not2428, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %32, %19
  %23 = call noundef zeroext i1 @_ZNK3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  br i1 %23, label %46, label %34

.lr.ph:                                           ; preds = %19, %32
  %.02029 = phi ptr [ %33, %32 ], [ %21, %19 ]
  %24 = load ptr, ptr %.02029, align 8, !tbaa !9
  %25 = call noundef zeroext i1 @_ZN3JPH11BodyManager19sIsValidBodyPointerEPKNS_4BodyE(ptr noundef %24)
  br i1 %25, label %26, label %32

26:                                               ; preds = %.lr.ph
  %27 = call noundef zeroext i1 @_ZNK3JPH4Body14IsInBroadPhaseEv(ptr noundef nonnull align 16 dereferenceable(122) %24)
  br i1 %27, label %28, label %32

28:                                               ; preds = %26
  %29 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122) %24)
  invoke void @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(4) %29)
          to label %32 unwind label %30

30:                                               ; preds = %28
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %47

32:                                               ; preds = %28, %26, %.lr.ph
  %33 = getelementptr inbounds i8, ptr %.02029, i64 8
  %.not24 = icmp eq ptr %33, %22
  br i1 %.not24, label %._crit_edge, label %.lr.ph

34:                                               ; preds = %._crit_edge
  %35 = getelementptr inbounds i8, ptr %0, i64 432
  %36 = load ptr, ptr %35, align 16, !tbaa !11
  %37 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef 0)
          to label %38 unwind label %44

38:                                               ; preds = %34
  %39 = call noundef i64 @_ZNK3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %40 = trunc i64 %39 to i32
  %41 = load ptr, ptr %36, align 8, !tbaa !43
  %42 = getelementptr inbounds i8, ptr %41, i64 152
  %43 = load ptr, ptr %42, align 8
  invoke void %43(ptr noundef nonnull align 8 dereferenceable(16) %36, ptr noundef nonnull %37, i32 noundef %40, i1 noundef zeroext true)
          to label %46 unwind label %44

44:                                               ; preds = %38, %34
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %47

46:                                               ; preds = %38, %._crit_edge
  call void @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  br label %48

47:                                               ; preds = %44, %30
  %.pn = phi { ptr, i32 } [ %31, %30 ], [ %45, %44 ]
  call void @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #7
  resume { ptr, i32 } %.pn

48:                                               ; preds = %17, %46, %11
  %49 = load i8, ptr %4, align 1, !tbaa !5
  %50 = and i8 %49, 4
  %.not25 = icmp eq i8 %50, 0
  br i1 %.not25, label %54, label %51

51:                                               ; preds = %48
  %52 = getelementptr inbounds i8, ptr %0, i64 576
  %53 = call noundef zeroext i1 @_ZN3JPH24ContactConstraintManager12RestoreStateERNS_13StateRecorderEPKNS_19StateRecorderFilterE(ptr noundef nonnull align 8 dereferenceable(248) %52, ptr noundef nonnull align 8 dereferenceable(18) %1, ptr noundef %2)
  br i1 %53, label %._crit_edge30, label %61

._crit_edge30:                                    ; preds = %51
  %.pre31 = load i8, ptr %4, align 1, !tbaa !5
  br label %54

54:                                               ; preds = %._crit_edge30, %48
  %55 = phi i8 [ %.pre31, %._crit_edge30 ], [ %49, %48 ]
  %56 = and i8 %55, 8
  %.not26 = icmp eq i8 %56, 0
  br i1 %.not26, label %60, label %57

57:                                               ; preds = %54
  %58 = getelementptr inbounds i8, ptr %0, i64 824
  %59 = call noundef zeroext i1 @_ZN3JPH17ConstraintManager12RestoreStateERNS_13StateRecorderE(ptr noundef nonnull align 8 dereferenceable(80) %58, ptr noundef nonnull align 8 dereferenceable(18) %1)
  br i1 %59, label %60, label %61

60:                                               ; preds = %57, %54
  br label %61

61:                                               ; preds = %57, %51, %14, %60
  %.0 = phi i1 [ true, %60 ], [ false, %14 ], [ false, %51 ], [ false, %57 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #7
  ret i1 %.0
}

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

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

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

declare noundef zeroext i1 @_ZN3JPH11BodyManager12RestoreStateERNS_13StateRecorderE(ptr noundef nonnull align 8 dereferenceable(297), ptr noundef nonnull align 8 dereferenceable(18)) local_unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH13StateRecorder10IsLastPartEv(ptr noundef nonnull align 8 dereferenceable(18)) local_unnamed_addr #2 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH11BodyManager19sIsValidBodyPointerEPKNS_4BodyE(ptr noundef) local_unnamed_addr #1 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 #1 align 2

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

declare noundef zeroext i1 @_ZN3JPH24ContactConstraintManager12RestoreStateERNS_13StateRecorderEPKNS_19StateRecorderFilterE(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef nonnull align 8 dereferenceable(18), ptr noundef) local_unnamed_addr #6

declare noundef zeroext i1 @_ZN3JPH17ConstraintManager12RestoreStateERNS_13StateRecorderE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(18)) local_unnamed_addr #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #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 = { 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 = { "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, !6, i64 0}
!6 = !{!"_ZTSN3JPH19EStateRecorderStateE", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 432}
!12 = !{!"_ZTSN3JPH13PhysicsSystemE", !10, i64 0, !10, i64 8, !13, i64 16, !25, i64 320, !27, i64 336, !28, i64 352, !28, i64 376, !29, i64 400, !29, i64 416, !10, i64 432, !10, i64 440, !10, i64 448, !30, i64 456, !32, i64 488, !34, i64 576, !37, i64 824, !39, i64 904, !40, i64 1016, !17, i64 1080, !41, i64 1128, !42, i64 1152, !33, i64 1168}
!13 = !{!"_ZTSN3JPH11BodyManagerE", !14, i64 0, !16, i64 24, !15, i64 32, !17, i64 40, !21, i64 88, !22, i64 104, !17, i64 128, !7, i64 176, !7, i64 192, !16, i64 200, !17, i64 208, !23, i64 256, !10, i64 280, !10, i64 288, !24, i64 296}
!14 = !{!"_ZTSN3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEEE", !15, i64 0, !15, i64 8, !10, i64 16}
!15 = !{!"long", !7, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!"_ZTSN3JPH5MutexE", !18, i64 0, !20, i64 40}
!18 = !{!"_ZTSSt5mutex", !19, i64 0}
!19 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!20 = !{!"_ZTSNSt6thread2idE", !15, i64 0}
!21 = !{!"_ZTSN3JPH10MutexArrayINS_11SharedMutexEEE", !10, i64 0, !16, i64 8}
!22 = !{!"_ZTSN3JPH5ArrayIhNS_12STLAllocatorIhEEEE", !15, i64 0, !15, i64 8, !10, i64 16}
!23 = !{!"_ZTSN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEEE", !15, i64 0, !15, i64 8, !10, i64 16}
!24 = !{!"bool", !7, i64 0}
!25 = !{!"_ZTSN3JPH23BodyLockInterfaceNoLockE", !26, i64 0}
!26 = !{!"_ZTSN3JPH17BodyLockInterfaceE", !10, i64 8}
!27 = !{!"_ZTSN3JPH24BodyLockInterfaceLockingE", !26, i64 0}
!28 = !{!"_ZTSN3JPH13BodyInterfaceE", !10, i64 0, !10, i64 8, !10, i64 16}
!29 = !{!"_ZTSN3JPH16NarrowPhaseQueryE", !10, i64 0, !10, i64 8}
!30 = !{!"_ZTSSt8functionIFvRKN3JPH4BodyES3_RKNS0_5Mat44ES6_RNS0_20CollideShapeSettingsERNS0_18CollisionCollectorINS0_18CollideShapeResultENS0_36CollisionCollectorTraitsCollideShapeEEERKNS0_11ShapeFilterEEE", !31, i64 0, !10, i64 24}
!31 = !{!"_ZTSSt14_Function_base", !7, i64 0, !10, i64 16}
!32 = !{!"_ZTSN3JPH15PhysicsSettingsE", !16, i64 0, !16, i64 4, !16, i64 8, !33, i64 12, !33, i64 16, !33, i64 20, !33, i64 24, !33, i64 28, !33, i64 32, !33, i64 36, !33, i64 40, !33, i64 44, !33, i64 48, !33, i64 52, !16, i64 56, !16, i64 60, !33, i64 64, !33, i64 68, !33, i64 72, !24, i64 76, !24, i64 77, !24, i64 78, !24, i64 79, !24, i64 80, !24, i64 81, !24, i64 82}
!33 = !{!"float", !7, i64 0}
!34 = !{!"_ZTSN3JPH24ContactConstraintManagerE", !7, i64 8, !16, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !10, i64 224, !16, i64 232, !35, i64 236, !10, i64 240}
!35 = !{!"_ZTSSt6atomicIjE", !36, i64 0}
!36 = !{!"_ZTSSt13__atomic_baseIjE", !16, i64 0}
!37 = !{!"_ZTSN3JPH17ConstraintManagerE", !10, i64 0, !38, i64 8, !17, i64 32}
!38 = !{!"_ZTSN3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEEE", !15, i64 0, !15, i64 8, !10, i64 16}
!39 = !{!"_ZTSN3JPH13IslandBuilderE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !16, i64 88, !16, i64 92, !16, i64 96, !16, i64 100, !16, i64 104, !16, i64 108}
!40 = !{!"_ZTSN3JPH19LargeIslandSplitterE", !16, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !16, i64 32, !35, i64 36, !16, i64 40, !10, i64 48, !35, i64 56}
!41 = !{!"_ZTSN3JPH5ArrayIPNS_19PhysicsStepListenerENS_12STLAllocatorIS2_EEEE", !15, i64 0, !15, i64 8, !10, i64 16}
!42 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!43 = !{!44, !44, i64 0}
!44 = !{!"vtable pointer", !8, i64 0}


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