; LLVM IR from zig-gamedev/zphysics :: libs/Jolt/Physics/Constraints (ContactConstraintManager)

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

%"struct.JPH::AssertLastParam" = type { i8 }
%"class.JPH::ContactConstraintManager::ContactAllocator" = type { %"class.JPH::LFHMAllocatorContext.base", i32, i32, i32 }
%"class.JPH::LFHMAllocatorContext.base" = type <{ ptr, i32, i32, i32 }>
%"class.JPH::Array" = type { i64, i64, ptr }
%"struct.JPH::BodyPair" = type { %"class.JPH::BodyID", %"class.JPH::BodyID" }
%"class.JPH::BodyID" = type { i32 }
%"class.JPH::Array.7" = type { i64, i64, ptr }
%"class.JPH::SubShapeIDPair" = type { %"class.JPH::BodyID", %"class.JPH::SubShapeID", %"class.JPH::BodyID", %"class.JPH::SubShapeID" }
%"class.JPH::SubShapeID" = type { i32 }
%"class.JPH::ContactConstraintManager::ManifoldCache" = type <{ %"class.JPH::LFHMAllocator", %"class.JPH::LockFreeHashMap", %"class.JPH::LockFreeHashMap.0", i8, [7 x i8] }>
%"class.JPH::LFHMAllocator" = type { ptr, i32, %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::LockFreeHashMap" = type { ptr, %"struct.std::atomic", ptr, i32, i32 }
%"class.JPH::LockFreeHashMap.0" = type { ptr, %"struct.std::atomic", ptr, i32, i32 }
%"class.JPH::ContactConstraintManager::CachedManifold" = type { i32, %"class.JPH::Float3", %"struct.std::atomic.5", i16, [1 x %"class.JPH::ContactConstraintManager::CachedContactPoint"] }
%"class.JPH::Float3" = type { float, float, float }
%"struct.std::atomic.5" = type { %"struct.std::__atomic_base.6" }
%"struct.std::__atomic_base.6" = type { i16 }
%"class.JPH::ContactConstraintManager::CachedContactPoint" = type { %"class.JPH::Float3", %"class.JPH::Float3", float, %"class.JPH::Vector" }
%"class.JPH::Vector" = type { [2 x float] }
%"class.JPH::ContactConstraintManager::CachedBodyPair" = type { %"class.JPH::Float3", %"class.JPH::Float3", i32 }

@.str.1 = external hidden unnamed_addr constant [113 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [14 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: 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) #2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN3JPH24ContactConstraintManager13ManifoldCache6CreateERNS0_16ContactAllocatorERKNS_14SubShapeIDPairEmi(ptr noundef nonnull align 8 dereferenceable(81), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 4 dereferenceable(16), i64 noundef, i32 noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(56) ptr @_ZN3JPH15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValue8GetValueEv(ptr noundef nonnull align 4 dereferenceable(76)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH24ContactConstraintManager13ManifoldCache8ToHandleEPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS0_14CachedManifoldEE8KeyValueE(ptr noundef nonnull align 8 dereferenceable(81), ptr noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN3JPH24ContactConstraintManager13ManifoldCache6CreateERNS0_16ContactAllocatorERKNS_8BodyPairEm(ptr noundef nonnull align 8 dereferenceable(81), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(56) ptr @_ZNK3JPH15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValue8GetValueEv(ptr noundef nonnull align 4 dereferenceable(76)) #4 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(16) ptr @_ZNK3JPH15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValue6GetKeyEv(ptr noundef nonnull align 4 dereferenceable(76)) #4 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3JPH15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValue6GetKeyEv(ptr noundef nonnull align 8 dereferenceable(40)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(28) ptr @_ZNK3JPH15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValue8GetValueEv(ptr noundef nonnull align 8 dereferenceable(40)) #4 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN3JPH24ContactConstraintManager13ManifoldCache12RestoreStateERKS1_RNS_13StateRecorderE(ptr noundef nonnull align 8 dereferenceable(81) %0, ptr noundef nonnull align 8 dereferenceable(81) %1, ptr noundef nonnull align 8 dereferenceable(17) %2) #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"struct.JPH::AssertLastParam", align 1
  %8 = alloca i8, align 1
  %9 = alloca %"class.JPH::ContactConstraintManager::ContactAllocator", align 8
  %10 = alloca %"class.JPH::Array", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %"struct.JPH::BodyPair", align 8
  %17 = alloca i64, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca %"class.JPH::Array.7", align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca %"class.JPH::SubShapeIDPair", align 4
  %25 = alloca i64, align 8
  %26 = alloca i16, align 2
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca i32, align 4
  %30 = alloca %"class.JPH::Array.7", align 8
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca %"class.JPH::SubShapeIDPair", align 4
  %34 = alloca i64, align 8
  %35 = alloca ptr, align 8
  %36 = alloca ptr, align 8
  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
  br label %38

38:                                               ; preds = %3
  %39 = getelementptr inbounds %"class.JPH::ContactConstraintManager::ManifoldCache", ptr %37, i32 0, i32 3
  %40 = load i8, ptr %39, align 8, !tbaa !9, !range !18, !noundef !19
  %41 = trunc i8 %40 to i1
  br i1 %41, label %42, label %45

42:                                               ; preds = %38
  %43 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 475)
  br i1 %43, label %44, label %45

44:                                               ; preds = %42
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #6, !srcloc !20
  br label %45

45:                                               ; preds = %44, %42, %38
  br label %46

46:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #6
  store i8 1, ptr %8, align 1, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #6
  call void @_ZN3JPH24ContactConstraintManager13ManifoldCache19GetContactAllocatorEv(ptr dead_on_unwind writable sret(%"class.JPH::ContactConstraintManager::ContactAllocator") align 8 %9, ptr noundef nonnull align 8 dereferenceable(81) %37)
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #6
  call void @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValueENS_12STLAllocatorIS8_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = invoke noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(17) %47)
          to label %49 unwind label %53

49:                                               ; preds = %46
  br i1 %48, label %50, label %57

50:                                               ; preds = %49
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @_ZNK3JPH24ContactConstraintManager13ManifoldCache21GetAllBodyPairsSortedERNS_5ArrayIPKNS_15LockFreeHashMapINS_8BodyPairENS0_14CachedBodyPairEE8KeyValueENS_12STLAllocatorIS9_EEEE(ptr noundef nonnull align 8 dereferenceable(81) %51, ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %52 unwind label %53

52:                                               ; preds = %50
  br label %57

53:                                               ; preds = %50, %46
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %11, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %12, align 4
  br label %452

57:                                               ; preds = %52, %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = invoke noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(17) %58)
          to label %60 unwind label %65

60:                                               ; preds = %57
  br i1 %59, label %61, label %69

61:                                               ; preds = %60
  %62 = invoke noundef i64 @_ZNK3JPH5ArrayIPKNS_15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValueENS_12STLAllocatorIS8_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %63 unwind label %65

63:                                               ; preds = %61
  %64 = trunc i64 %62 to i32
  store i32 %64, ptr %13, align 4, !tbaa !22
  br label %69

65:                                               ; preds = %69, %61, %57
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %11, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %12, align 4
  br label %451

69:                                               ; preds = %63, %60
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN3JPH8StreamIn4ReadIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS3_(ptr noundef nonnull align 8 dereferenceable(8) %70, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %71 unwind label %65

71:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !22
  br label %72

72:                                               ; preds = %341, %71
  %73 = load i32, ptr %14, align 4, !tbaa !22
  %74 = load i32, ptr %13, align 4, !tbaa !22
  %75 = icmp ult i32 %73, %74
  br i1 %75, label %77, label %76

76:                                               ; preds = %72
  store i32 4, ptr %15, align 4
  br label %350

77:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  invoke void @_ZN3JPH8BodyPairC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %78 unwind label %96

78:                                               ; preds = %77
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = invoke noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(17) %79)
          to label %81 unwind label %96

81:                                               ; preds = %78
  br i1 %80, label %82, label %100

82:                                               ; preds = %81
  %83 = load i32, ptr %14, align 4, !tbaa !22
  %84 = zext i32 %83 to i64
  %85 = invoke noundef i64 @_ZNK3JPH5ArrayIPKNS_15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValueENS_12STLAllocatorIS8_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %86 unwind label %96

86:                                               ; preds = %82
  %87 = icmp ult i64 %84, %85
  br i1 %87, label %88, label %100

88:                                               ; preds = %86
  %89 = load i32, ptr %14, align 4, !tbaa !22
  %90 = zext i32 %89 to i64
  %91 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValueENS_12STLAllocatorIS8_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %90)
          to label %92 unwind label %96

92:                                               ; preds = %88
  %93 = load ptr, ptr %91, align 8, !tbaa !5
  %94 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3JPH15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValue6GetKeyEv(ptr noundef nonnull align 8 dereferenceable(40) %93)
          to label %95 unwind label %96

95:                                               ; preds = %92
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %94, i64 8, i1 false), !tbaa.struct !23
  br label %100

96:                                               ; preds = %100, %92, %88, %82, %78, %77
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %11, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %12, align 4
  br label %349

100:                                              ; preds = %95, %86, %81
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN3JPH8StreamIn4ReadINS_8BodyPairETnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS4_(ptr noundef nonnull align 8 dereferenceable(8) %101, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %102 unwind label %96

102:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %103 = invoke noundef i64 @_ZNK3JPH8BodyPair7GetHashEv(ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %104 unwind label %111

104:                                              ; preds = %102
  store i64 %103, ptr %17, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %105 = load i64, ptr %17, align 8, !tbaa !24
  %106 = invoke noundef ptr @_ZN3JPH24ContactConstraintManager13ManifoldCache6CreateERNS0_16ContactAllocatorERKNS_8BodyPairEm(ptr noundef nonnull align 8 dereferenceable(81) %37, ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(8) %16, i64 noundef %105)
          to label %107 unwind label %115

107:                                              ; preds = %104
  store ptr %106, ptr %18, align 8, !tbaa !5
  %108 = load ptr, ptr %18, align 8, !tbaa !5
  %109 = icmp eq ptr %108, null
  br i1 %109, label %110, label %119

110:                                              ; preds = %107
  store i8 0, ptr %8, align 1, !tbaa !21
  store i32 4, ptr %15, align 4
  br label %338

111:                                              ; preds = %102
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %11, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %12, align 4
  br label %348

115:                                              ; preds = %104
  %116 = landingpad { ptr, i32 }
          cleanup
  %117 = extractvalue { ptr, i32 } %116, 0
  store ptr %117, ptr %11, align 8
  %118 = extractvalue { ptr, i32 } %116, 1
  store i32 %118, ptr %12, align 4
  br label %347

119:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %120 = load ptr, ptr %18, align 8, !tbaa !5
  %121 = invoke noundef nonnull align 4 dereferenceable(28) ptr @_ZN3JPH15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValue8GetValueEv(ptr noundef nonnull align 8 dereferenceable(40) %120)
          to label %122 unwind label %141

122:                                              ; preds = %119
  store ptr %121, ptr %19, align 8, !tbaa !5
  %123 = load ptr, ptr %6, align 8, !tbaa !5
  %124 = invoke noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(17) %123)
          to label %125 unwind label %141

125:                                              ; preds = %122
  br i1 %124, label %126, label %145

126:                                              ; preds = %125
  %127 = load i32, ptr %14, align 4, !tbaa !22
  %128 = zext i32 %127 to i64
  %129 = invoke noundef i64 @_ZNK3JPH5ArrayIPKNS_15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValueENS_12STLAllocatorIS8_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %130 unwind label %141

130:                                              ; preds = %126
  %131 = icmp ult i64 %128, %129
  br i1 %131, label %132, label %145

132:                                              ; preds = %130
  %133 = load ptr, ptr %19, align 8, !tbaa !5
  %134 = load i32, ptr %14, align 4, !tbaa !22
  %135 = zext i32 %134 to i64
  %136 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValueENS_12STLAllocatorIS8_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %135)
          to label %137 unwind label %141

137:                                              ; preds = %132
  %138 = load ptr, ptr %136, align 8, !tbaa !5
  %139 = invoke noundef nonnull align 4 dereferenceable(28) ptr @_ZNK3JPH15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValue8GetValueEv(ptr noundef nonnull align 8 dereferenceable(40) %138)
          to label %140 unwind label %141

140:                                              ; preds = %137
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %133, ptr align 4 %139, i64 28, i1 false)
  br label %145

141:                                              ; preds = %145, %137, %132, %126, %122, %119
  %142 = landingpad { ptr, i32 }
          cleanup
  %143 = extractvalue { ptr, i32 } %142, 0
  store ptr %143, ptr %11, align 8
  %144 = extractvalue { ptr, i32 } %142, 1
  store i32 %144, ptr %12, align 4
  br label %346

145:                                              ; preds = %140, %130, %125
  %146 = load ptr, ptr %19, align 8, !tbaa !5
  %147 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN3JPH24ContactConstraintManager14CachedBodyPair12RestoreStateERNS_13StateRecorderE(ptr noundef nonnull align 4 dereferenceable(28) %146, ptr noundef nonnull align 8 dereferenceable(17) %147)
          to label %148 unwind label %141

148:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #6
  call void @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #6
  %149 = load ptr, ptr %6, align 8, !tbaa !5
  %150 = invoke noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(17) %149)
          to label %151 unwind label %162

151:                                              ; preds = %148
  br i1 %150, label %152, label %166

152:                                              ; preds = %151
  %153 = load ptr, ptr %5, align 8, !tbaa !5
  %154 = load i32, ptr %14, align 4, !tbaa !22
  %155 = zext i32 %154 to i64
  %156 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValueENS_12STLAllocatorIS8_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %155)
          to label %157 unwind label %162

157:                                              ; preds = %152
  %158 = load ptr, ptr %156, align 8, !tbaa !5
  %159 = invoke noundef nonnull align 4 dereferenceable(28) ptr @_ZNK3JPH15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValue8GetValueEv(ptr noundef nonnull align 8 dereferenceable(40) %158)
          to label %160 unwind label %162

160:                                              ; preds = %157
  invoke void @_ZNK3JPH24ContactConstraintManager13ManifoldCache21GetAllManifoldsSortedERKNS0_14CachedBodyPairERNS_5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS0_14CachedManifoldEE8KeyValueENS_12STLAllocatorISC_EEEE(ptr noundef nonnull align 8 dereferenceable(81) %153, ptr noundef nonnull align 4 dereferenceable(28) %159, ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %161 unwind label %162

161:                                              ; preds = %160
  br label %166

162:                                              ; preds = %160, %157, %152, %148
  %163 = landingpad { ptr, i32 }
          cleanup
  %164 = extractvalue { ptr, i32 } %163, 0
  store ptr %164, ptr %11, align 8
  %165 = extractvalue { ptr, i32 } %163, 1
  store i32 %165, ptr %12, align 4
  br label %345

166:                                              ; preds = %161, %151
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %167 = load ptr, ptr %6, align 8, !tbaa !5
  %168 = invoke noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(17) %167)
          to label %169 unwind label %174

169:                                              ; preds = %166
  br i1 %168, label %170, label %178

170:                                              ; preds = %169
  %171 = invoke noundef i64 @_ZNK3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %172 unwind label %174

172:                                              ; preds = %170
  %173 = trunc i64 %171 to i32
  store i32 %173, ptr %21, align 4, !tbaa !22
  br label %178

174:                                              ; preds = %178, %170, %166
  %175 = landingpad { ptr, i32 }
          cleanup
  %176 = extractvalue { ptr, i32 } %175, 0
  store ptr %176, ptr %11, align 8
  %177 = extractvalue { ptr, i32 } %175, 1
  store i32 %177, ptr %12, align 4
  br label %344

178:                                              ; preds = %172, %169
  %179 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN3JPH8StreamIn4ReadIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS3_(ptr noundef nonnull align 8 dereferenceable(8) %179, ptr noundef nonnull align 4 dereferenceable(4) %21)
          to label %180 unwind label %174

180:                                              ; preds = %178
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  store i32 -1, ptr %22, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  store i32 0, ptr %23, align 4, !tbaa !22
  br label %181

181:                                              ; preds = %325, %180
  %182 = load i32, ptr %23, align 4, !tbaa !22
  %183 = load i32, ptr %21, align 4, !tbaa !22
  %184 = icmp ult i32 %182, %183
  br i1 %184, label %186, label %185

185:                                              ; preds = %181
  store i32 7, ptr %15, align 4
  br label %333

186:                                              ; preds = %181
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #6
  invoke void @_ZN3JPH14SubShapeIDPairC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %24)
          to label %187 unwind label %205

187:                                              ; preds = %186
  %188 = load ptr, ptr %6, align 8, !tbaa !5
  %189 = invoke noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(17) %188)
          to label %190 unwind label %205

190:                                              ; preds = %187
  br i1 %189, label %191, label %209

191:                                              ; preds = %190
  %192 = load i32, ptr %23, align 4, !tbaa !22
  %193 = zext i32 %192 to i64
  %194 = invoke noundef i64 @_ZNK3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %195 unwind label %205

195:                                              ; preds = %191
  %196 = icmp ult i64 %193, %194
  br i1 %196, label %197, label %209

197:                                              ; preds = %195
  %198 = load i32, ptr %23, align 4, !tbaa !22
  %199 = zext i32 %198 to i64
  %200 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %199)
          to label %201 unwind label %205

201:                                              ; preds = %197
  %202 = load ptr, ptr %200, align 8, !tbaa !5
  %203 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZNK3JPH15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValue6GetKeyEv(ptr noundef nonnull align 4 dereferenceable(76) %202)
          to label %204 unwind label %205

204:                                              ; preds = %201
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 4 %203, i64 16, i1 false), !tbaa.struct !26
  br label %209

205:                                              ; preds = %209, %201, %197, %191, %187, %186
  %206 = landingpad { ptr, i32 }
          cleanup
  %207 = extractvalue { ptr, i32 } %206, 0
  store ptr %207, ptr %11, align 8
  %208 = extractvalue { ptr, i32 } %206, 1
  store i32 %208, ptr %12, align 4
  br label %332

209:                                              ; preds = %204, %195, %190
  %210 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN3JPH8StreamIn4ReadINS_14SubShapeIDPairETnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS4_(ptr noundef nonnull align 8 dereferenceable(8) %210, ptr noundef nonnull align 4 dereferenceable(16) %24)
          to label %211 unwind label %205

211:                                              ; preds = %209
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %212 = invoke noundef i64 @_ZNK3JPH14SubShapeIDPair7GetHashEv(ptr noundef nonnull align 4 dereferenceable(16) %24)
          to label %213 unwind label %233

213:                                              ; preds = %211
  store i64 %212, ptr %25, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 2, ptr %26) #6
  %214 = load ptr, ptr %6, align 8, !tbaa !5
  %215 = invoke noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(17) %214)
          to label %216 unwind label %237

216:                                              ; preds = %213
  br i1 %215, label %217, label %241

217:                                              ; preds = %216
  %218 = load i32, ptr %23, align 4, !tbaa !22
  %219 = zext i32 %218 to i64
  %220 = invoke noundef i64 @_ZNK3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %221 unwind label %237

221:                                              ; preds = %217
  %222 = icmp ult i64 %219, %220
  br i1 %222, label %223, label %241

223:                                              ; preds = %221
  %224 = load i32, ptr %23, align 4, !tbaa !22
  %225 = zext i32 %224 to i64
  %226 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %225)
          to label %227 unwind label %237

227:                                              ; preds = %223
  %228 = load ptr, ptr %226, align 8, !tbaa !5
  %229 = invoke noundef nonnull align 4 dereferenceable(56) ptr @_ZNK3JPH15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValue8GetValueEv(ptr noundef nonnull align 4 dereferenceable(76) %228)
          to label %230 unwind label %237

230:                                              ; preds = %227
  %231 = getelementptr inbounds %"class.JPH::ContactConstraintManager::CachedManifold", ptr %229, i32 0, i32 3
  %232 = load i16, ptr %231, align 2, !tbaa !27
  store i16 %232, ptr %26, align 2, !tbaa !34
  br label %241

233:                                              ; preds = %211
  %234 = landingpad { ptr, i32 }
          cleanup
  %235 = extractvalue { ptr, i32 } %234, 0
  store ptr %235, ptr %11, align 8
  %236 = extractvalue { ptr, i32 } %234, 1
  store i32 %236, ptr %12, align 4
  br label %331

237:                                              ; preds = %241, %227, %223, %217, %213
  %238 = landingpad { ptr, i32 }
          cleanup
  %239 = extractvalue { ptr, i32 } %238, 0
  store ptr %239, ptr %11, align 8
  %240 = extractvalue { ptr, i32 } %238, 1
  store i32 %240, ptr %12, align 4
  br label %330

241:                                              ; preds = %230, %221, %216
  %242 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN3JPH8StreamIn4ReadItTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS3_(ptr noundef nonnull align 8 dereferenceable(8) %242, ptr noundef nonnull align 2 dereferenceable(2) %26)
          to label %243 unwind label %237

243:                                              ; preds = %241
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  %244 = load i64, ptr %25, align 8, !tbaa !24
  %245 = load i16, ptr %26, align 2, !tbaa !34
  %246 = zext i16 %245 to i32
  %247 = invoke noundef ptr @_ZN3JPH24ContactConstraintManager13ManifoldCache6CreateERNS0_16ContactAllocatorERKNS_14SubShapeIDPairEmi(ptr noundef nonnull align 8 dereferenceable(81) %37, ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 4 dereferenceable(16) %24, i64 noundef %244, i32 noundef %246)
          to label %248 unwind label %252

248:                                              ; preds = %243
  store ptr %247, ptr %27, align 8, !tbaa !5
  %249 = load ptr, ptr %27, align 8, !tbaa !5
  %250 = icmp eq ptr %249, null
  br i1 %250, label %251, label %256

251:                                              ; preds = %248
  store i8 0, ptr %8, align 1, !tbaa !21
  store i32 7, ptr %15, align 4
  br label %322

252:                                              ; preds = %243
  %253 = landingpad { ptr, i32 }
          cleanup
  %254 = extractvalue { ptr, i32 } %253, 0
  store ptr %254, ptr %11, align 8
  %255 = extractvalue { ptr, i32 } %253, 1
  store i32 %255, ptr %12, align 4
  br label %329

256:                                              ; preds = %248
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  %257 = load ptr, ptr %27, align 8, !tbaa !5
  %258 = invoke noundef nonnull align 4 dereferenceable(56) ptr @_ZN3JPH15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValue8GetValueEv(ptr noundef nonnull align 4 dereferenceable(76) %257)
          to label %259 unwind label %286

259:                                              ; preds = %256
  store ptr %258, ptr %28, align 8, !tbaa !5
  %260 = load ptr, ptr %6, align 8, !tbaa !5
  %261 = invoke noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(17) %260)
          to label %262 unwind label %286

262:                                              ; preds = %259
  br i1 %261, label %263, label %290

263:                                              ; preds = %262
  %264 = load i32, ptr %23, align 4, !tbaa !22
  %265 = zext i32 %264 to i64
  %266 = invoke noundef i64 @_ZNK3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %267 unwind label %286

267:                                              ; preds = %263
  %268 = icmp ult i64 %265, %266
  br i1 %268, label %269, label %290

269:                                              ; preds = %267
  %270 = load ptr, ptr %28, align 8, !tbaa !5
  %271 = load i32, ptr %23, align 4, !tbaa !22
  %272 = zext i32 %271 to i64
  %273 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %272)
          to label %274 unwind label %286

274:                                              ; preds = %269
  %275 = load ptr, ptr %273, align 8, !tbaa !5
  %276 = invoke noundef nonnull align 4 dereferenceable(56) ptr @_ZNK3JPH15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValue8GetValueEv(ptr noundef nonnull align 4 dereferenceable(76) %275)
          to label %277 unwind label %286

277:                                              ; preds = %274
  %278 = load i16, ptr %26, align 2, !tbaa !34
  %279 = zext i16 %278 to i32
  %280 = invoke noundef i32 @_ZN3JPH24ContactConstraintManager14CachedManifold21sGetRequiredTotalSizeEi(i32 noundef %279)
          to label %281 unwind label %286

281:                                              ; preds = %277
  %282 = sext i32 %280 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %270, ptr align 4 %276, i64 %282, i1 false)
  %283 = load i16, ptr %26, align 2, !tbaa !34
  %284 = load ptr, ptr %28, align 8, !tbaa !5
  %285 = getelementptr inbounds %"class.JPH::ContactConstraintManager::CachedManifold", ptr %284, i32 0, i32 3
  store i16 %283, ptr %285, align 2, !tbaa !27
  br label %290

286:                                              ; preds = %293, %290, %277, %274, %269, %263, %259, %256
  %287 = landingpad { ptr, i32 }
          cleanup
  %288 = extractvalue { ptr, i32 } %287, 0
  store ptr %288, ptr %11, align 8
  %289 = extractvalue { ptr, i32 } %287, 1
  store i32 %289, ptr %12, align 4
  br label %328

290:                                              ; preds = %281, %267, %262
  %291 = load ptr, ptr %28, align 8, !tbaa !5
  %292 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN3JPH24ContactConstraintManager14CachedManifold12RestoreStateERNS_13StateRecorderE(ptr noundef nonnull align 4 dereferenceable(56) %291, ptr noundef nonnull align 8 dereferenceable(17) %292)
          to label %293 unwind label %286

293:                                              ; preds = %290
  %294 = load i32, ptr %22, align 4, !tbaa !22
  %295 = load ptr, ptr %28, align 8, !tbaa !5
  %296 = getelementptr inbounds %"class.JPH::ContactConstraintManager::CachedManifold", ptr %295, i32 0, i32 0
  store i32 %294, ptr %296, align 4, !tbaa !35
  %297 = load ptr, ptr %27, align 8, !tbaa !5
  %298 = invoke noundef i32 @_ZNK3JPH24ContactConstraintManager13ManifoldCache8ToHandleEPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS0_14CachedManifoldEE8KeyValueE(ptr noundef nonnull align 8 dereferenceable(81) %37, ptr noundef %297)
          to label %299 unwind label %286

299:                                              ; preds = %293
  store i32 %298, ptr %22, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #6
  store i32 0, ptr %29, align 4, !tbaa !22
  br label %300

300:                                              ; preds = %314, %299
  %301 = load i32, ptr %29, align 4, !tbaa !22
  %302 = load i16, ptr %26, align 2, !tbaa !34
  %303 = zext i16 %302 to i32
  %304 = icmp ult i32 %301, %303
  br i1 %304, label %306, label %305

305:                                              ; preds = %300
  store i32 10, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #6
  br label %321

306:                                              ; preds = %300
  %307 = load ptr, ptr %28, align 8, !tbaa !5
  %308 = getelementptr inbounds %"class.JPH::ContactConstraintManager::CachedManifold", ptr %307, i32 0, i32 4
  %309 = load i32, ptr %29, align 4, !tbaa !22
  %310 = zext i32 %309 to i64
  %311 = getelementptr inbounds [1 x %"class.JPH::ContactConstraintManager::CachedContactPoint"], ptr %308, i64 0, i64 %310
  %312 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN3JPH24ContactConstraintManager18CachedContactPoint12RestoreStateERNS_13StateRecorderE(ptr noundef nonnull align 4 dereferenceable(36) %311, ptr noundef nonnull align 8 dereferenceable(17) %312)
          to label %313 unwind label %317

313:                                              ; preds = %306
  br label %314

314:                                              ; preds = %313
  %315 = load i32, ptr %29, align 4, !tbaa !22
  %316 = add i32 %315, 1
  store i32 %316, ptr %29, align 4, !tbaa !22
  br label %300, !llvm.loop !36

317:                                              ; preds = %306
  %318 = landingpad { ptr, i32 }
          cleanup
  %319 = extractvalue { ptr, i32 } %318, 0
  store ptr %319, ptr %11, align 8
  %320 = extractvalue { ptr, i32 } %318, 1
  store i32 %320, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #6
  br label %328

321:                                              ; preds = %305
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  store i32 0, ptr %15, align 4
  br label %322

322:                                              ; preds = %321, %251
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #6
  %323 = load i32, ptr %15, align 4
  switch i32 %323, label %333 [
    i32 0, label %324
  ]

324:                                              ; preds = %322
  br label %325

325:                                              ; preds = %324
  %326 = load i32, ptr %23, align 4, !tbaa !22
  %327 = add i32 %326, 1
  store i32 %327, ptr %23, align 4, !tbaa !22
  br label %181, !llvm.loop !38

328:                                              ; preds = %317, %286
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  br label %329

329:                                              ; preds = %328, %252
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  br label %330

330:                                              ; preds = %329, %237
  call void @llvm.lifetime.end.p0(i64 2, ptr %26) #6
  br label %331

331:                                              ; preds = %330, %233
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  br label %332

332:                                              ; preds = %331, %205
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  br label %344

333:                                              ; preds = %322, %185
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %334

334:                                              ; preds = %333
  %335 = load i32, ptr %22, align 4, !tbaa !22
  %336 = load ptr, ptr %19, align 8, !tbaa !5
  %337 = getelementptr inbounds %"class.JPH::ContactConstraintManager::CachedBodyPair", ptr %336, i32 0, i32 2
  store i32 %335, ptr %337, align 4, !tbaa !39
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  store i32 0, ptr %15, align 4
  br label %338

338:                                              ; preds = %334, %110
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  %339 = load i32, ptr %15, align 4
  switch i32 %339, label %350 [
    i32 0, label %340
  ]

340:                                              ; preds = %338
  br label %341

341:                                              ; preds = %340
  %342 = load i32, ptr %14, align 4, !tbaa !22
  %343 = add i32 %342, 1
  store i32 %343, ptr %14, align 4, !tbaa !22
  br label %72, !llvm.loop !41

344:                                              ; preds = %332, %174
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %345

345:                                              ; preds = %344, %162
  call void @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #6
  br label %346

346:                                              ; preds = %345, %141
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %347

347:                                              ; preds = %346, %115
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %348

348:                                              ; preds = %347, %111
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %349

349:                                              ; preds = %348, %96
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %451

350:                                              ; preds = %338, %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %351

351:                                              ; preds = %350
  call void @llvm.lifetime.start.p0(i64 24, ptr %30) #6
  call void @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %30) #6
  %352 = load ptr, ptr %6, align 8, !tbaa !5
  %353 = invoke noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(17) %352)
          to label %354 unwind label %358

354:                                              ; preds = %351
  br i1 %353, label %355, label %362

355:                                              ; preds = %354
  %356 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @_ZNK3JPH24ContactConstraintManager13ManifoldCache24GetAllCCDManifoldsSortedERNS_5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS0_14CachedManifoldEE8KeyValueENS_12STLAllocatorIS9_EEEE(ptr noundef nonnull align 8 dereferenceable(81) %356, ptr noundef nonnull align 8 dereferenceable(24) %30)
          to label %357 unwind label %358

357:                                              ; preds = %355
  br label %362

358:                                              ; preds = %355, %351
  %359 = landingpad { ptr, i32 }
          cleanup
  %360 = extractvalue { ptr, i32 } %359, 0
  store ptr %360, ptr %11, align 8
  %361 = extractvalue { ptr, i32 } %359, 1
  store i32 %361, ptr %12, align 4
  br label %450

362:                                              ; preds = %357, %354
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #6
  %363 = load ptr, ptr %6, align 8, !tbaa !5
  %364 = invoke noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(17) %363)
          to label %365 unwind label %370

365:                                              ; preds = %362
  br i1 %364, label %366, label %374

366:                                              ; preds = %365
  %367 = invoke noundef i64 @_ZNK3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %30)
          to label %368 unwind label %370

368:                                              ; preds = %366
  %369 = trunc i64 %367 to i32
  store i32 %369, ptr %31, align 4, !tbaa !22
  br label %374

370:                                              ; preds = %374, %366, %362
  %371 = landingpad { ptr, i32 }
          cleanup
  %372 = extractvalue { ptr, i32 } %371, 0
  store ptr %372, ptr %11, align 8
  %373 = extractvalue { ptr, i32 } %371, 1
  store i32 %373, ptr %12, align 4
  br label %449

374:                                              ; preds = %368, %365
  %375 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN3JPH8StreamIn4ReadIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS3_(ptr noundef nonnull align 8 dereferenceable(8) %375, ptr noundef nonnull align 4 dereferenceable(4) %31)
          to label %376 unwind label %370

376:                                              ; preds = %374
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #6
  store i32 0, ptr %32, align 4, !tbaa !22
  br label %377

377:                                              ; preds = %434, %376
  %378 = load i32, ptr %32, align 4, !tbaa !22
  %379 = load i32, ptr %31, align 4, !tbaa !22
  %380 = icmp ult i32 %378, %379
  br i1 %380, label %382, label %381

381:                                              ; preds = %377
  store i32 13, ptr %15, align 4
  br label %444

382:                                              ; preds = %377
  call void @llvm.lifetime.start.p0(i64 16, ptr %33) #6
  invoke void @_ZN3JPH14SubShapeIDPairC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %33)
          to label %383 unwind label %401

383:                                              ; preds = %382
  %384 = load ptr, ptr %6, align 8, !tbaa !5
  %385 = invoke noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(17) %384)
          to label %386 unwind label %401

386:                                              ; preds = %383
  br i1 %385, label %387, label %405

387:                                              ; preds = %386
  %388 = load i32, ptr %32, align 4, !tbaa !22
  %389 = zext i32 %388 to i64
  %390 = invoke noundef i64 @_ZNK3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %30)
          to label %391 unwind label %401

391:                                              ; preds = %387
  %392 = icmp ult i64 %389, %390
  br i1 %392, label %393, label %405

393:                                              ; preds = %391
  %394 = load i32, ptr %32, align 4, !tbaa !22
  %395 = zext i32 %394 to i64
  %396 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef %395)
          to label %397 unwind label %401

397:                                              ; preds = %393
  %398 = load ptr, ptr %396, align 8, !tbaa !5
  %399 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZNK3JPH15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValue6GetKeyEv(ptr noundef nonnull align 4 dereferenceable(76) %398)
          to label %400 unwind label %401

400:                                              ; preds = %397
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %33, ptr align 4 %399, i64 16, i1 false), !tbaa.struct !26
  br label %405

401:                                              ; preds = %405, %397, %393, %387, %383, %382
  %402 = landingpad { ptr, i32 }
          cleanup
  %403 = extractvalue { ptr, i32 } %402, 0
  store ptr %403, ptr %11, align 8
  %404 = extractvalue { ptr, i32 } %402, 1
  store i32 %404, ptr %12, align 4
  br label %443

405:                                              ; preds = %400, %391, %386
  %406 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN3JPH8StreamIn4ReadINS_14SubShapeIDPairETnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS4_(ptr noundef nonnull align 8 dereferenceable(8) %406, ptr noundef nonnull align 4 dereferenceable(16) %33)
          to label %407 unwind label %401

407:                                              ; preds = %405
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #6
  %408 = invoke noundef i64 @_ZNK3JPH14SubShapeIDPair7GetHashEv(ptr noundef nonnull align 4 dereferenceable(16) %33)
          to label %409 unwind label %416

409:                                              ; preds = %407
  store i64 %408, ptr %34, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #6
  %410 = load i64, ptr %34, align 8, !tbaa !24
  %411 = invoke noundef ptr @_ZN3JPH24ContactConstraintManager13ManifoldCache6CreateERNS0_16ContactAllocatorERKNS_14SubShapeIDPairEmi(ptr noundef nonnull align 8 dereferenceable(81) %37, ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 4 dereferenceable(16) %33, i64 noundef %410, i32 noundef 0)
          to label %412 unwind label %420

412:                                              ; preds = %409
  store ptr %411, ptr %35, align 8, !tbaa !5
  %413 = load ptr, ptr %35, align 8, !tbaa !5
  %414 = icmp eq ptr %413, null
  br i1 %414, label %415, label %424

415:                                              ; preds = %412
  store i8 0, ptr %8, align 1, !tbaa !21
  store i32 13, ptr %15, align 4
  br label %431

416:                                              ; preds = %407
  %417 = landingpad { ptr, i32 }
          cleanup
  %418 = extractvalue { ptr, i32 } %417, 0
  store ptr %418, ptr %11, align 8
  %419 = extractvalue { ptr, i32 } %417, 1
  store i32 %419, ptr %12, align 4
  br label %442

420:                                              ; preds = %409
  %421 = landingpad { ptr, i32 }
          cleanup
  %422 = extractvalue { ptr, i32 } %421, 0
  store ptr %422, ptr %11, align 8
  %423 = extractvalue { ptr, i32 } %421, 1
  store i32 %423, ptr %12, align 4
  br label %441

424:                                              ; preds = %412
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #6
  %425 = load ptr, ptr %35, align 8, !tbaa !5
  %426 = invoke noundef nonnull align 4 dereferenceable(56) ptr @_ZN3JPH15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValue8GetValueEv(ptr noundef nonnull align 4 dereferenceable(76) %425)
          to label %427 unwind label %437

427:                                              ; preds = %424
  store ptr %426, ptr %36, align 8, !tbaa !5
  %428 = load ptr, ptr %36, align 8, !tbaa !5
  %429 = getelementptr inbounds %"class.JPH::ContactConstraintManager::CachedManifold", ptr %428, i32 0, i32 2
  %430 = call noundef zeroext i16 @_ZNSt13__atomic_baseItEoREt(ptr noundef nonnull align 2 dereferenceable(2) %429, i16 noundef zeroext 2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #6
  store i32 0, ptr %15, align 4
  br label %431

431:                                              ; preds = %427, %415
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %33) #6
  %432 = load i32, ptr %15, align 4
  switch i32 %432, label %444 [
    i32 0, label %433
  ]

433:                                              ; preds = %431
  br label %434

434:                                              ; preds = %433
  %435 = load i32, ptr %32, align 4, !tbaa !22
  %436 = add i32 %435, 1
  store i32 %436, ptr %32, align 4, !tbaa !22
  br label %377, !llvm.loop !42

437:                                              ; preds = %424
  %438 = landingpad { ptr, i32 }
          cleanup
  %439 = extractvalue { ptr, i32 } %438, 0
  store ptr %439, ptr %11, align 8
  %440 = extractvalue { ptr, i32 } %438, 1
  store i32 %440, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #6
  br label %441

441:                                              ; preds = %437, %420
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #6
  br label %442

442:                                              ; preds = %441, %416
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #6
  br label %443

443:                                              ; preds = %442, %401
  call void @llvm.lifetime.end.p0(i64 16, ptr %33) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #6
  br label %449

444:                                              ; preds = %431, %381
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #6
  br label %445

445:                                              ; preds = %444
  %446 = getelementptr inbounds %"class.JPH::ContactConstraintManager::ManifoldCache", ptr %37, i32 0, i32 3
  store i8 1, ptr %446, align 8, !tbaa !9
  %447 = load i8, ptr %8, align 1, !tbaa !21, !range !18, !noundef !19
  %448 = trunc i8 %447 to i1
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #6
  call void @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %30) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValueENS_12STLAllocatorIS8_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #6
  ret i1 %448

449:                                              ; preds = %443, %370
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #6
  br label %450

450:                                              ; preds = %449, %358
  call void @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %30) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %30) #6
  br label %451

451:                                              ; preds = %450, %349, %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %452

452:                                              ; preds = %451, %53
  call void @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValueENS_12STLAllocatorIS8_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #6
  br label %453

453:                                              ; preds = %452
  %454 = load ptr, ptr %11, align 8
  %455 = load i32, ptr %12, align 4
  %456 = insertvalue { ptr, i32 } poison, ptr %454, 0
  %457 = insertvalue { ptr, i32 } %456, i32 %455, 1
  resume { ptr, i32 } %457
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH24ContactConstraintManager13ManifoldCache19GetContactAllocatorEv(ptr dead_on_unwind noalias writable sret(%"class.JPH::ContactConstraintManager::ContactAllocator") align 8, ptr noundef nonnull align 8 dereferenceable(81)) #3 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK3JPH8BodyPair7GetHashEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(28) ptr @_ZN3JPH15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValue8GetValueEv(ptr noundef nonnull align 8 dereferenceable(40)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH14SubShapeIDPairC2Ev(ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN3JPH24ContactConstraintManager14CachedManifold21sGetRequiredTotalSizeEi(i32 noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZNSt13__atomic_baseItEoREt(ptr noundef nonnull align 2 dereferenceable(2), i16 noundef zeroext) #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 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 #5 = { 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 #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !17, i64 80}
!10 = !{!"_ZTSN3JPH24ContactConstraintManager13ManifoldCacheE", !11, i64 0, !15, i64 16, !16, i64 48, !17, i64 80}
!11 = !{!"_ZTSN3JPH13LFHMAllocatorE", !6, i64 0, !12, i64 8, !13, i64 12}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_ZTSSt6atomicIjE", !14, i64 0}
!14 = !{!"_ZTSSt13__atomic_baseIjE", !12, i64 0}
!15 = !{!"_ZTSN3JPH15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEEE", !6, i64 0, !13, i64 8, !6, i64 16, !12, i64 24, !12, i64 28}
!16 = !{!"_ZTSN3JPH15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEEE", !6, i64 0, !13, i64 8, !6, i64 16, !12, i64 24, !12, i64 28}
!17 = !{!"bool", !7, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{i64 2158728324}
!21 = !{!17, !17, i64 0}
!22 = !{!12, !12, i64 0}
!23 = !{i64 0, i64 4, !22, i64 4, i64 4, !22}
!24 = !{!25, !25, i64 0}
!25 = !{!"long", !7, i64 0}
!26 = !{i64 0, i64 4, !22, i64 4, i64 4, !22, i64 8, i64 4, !22, i64 12, i64 4, !22}
!27 = !{!28, !33, i64 18}
!28 = !{!"_ZTSN3JPH24ContactConstraintManager14CachedManifoldE", !12, i64 0, !29, i64 4, !31, i64 16, !33, i64 18, !7, i64 20}
!29 = !{!"_ZTSN3JPH6Float3E", !30, i64 0, !30, i64 4, !30, i64 8}
!30 = !{!"float", !7, i64 0}
!31 = !{!"_ZTSSt6atomicItE", !32, i64 0}
!32 = !{!"_ZTSSt13__atomic_baseItE", !33, i64 0}
!33 = !{!"short", !7, i64 0}
!34 = !{!33, !33, i64 0}
!35 = !{!28, !12, i64 0}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = distinct !{!38, !37}
!39 = !{!40, !12, i64 24}
!40 = !{!"_ZTSN3JPH24ContactConstraintManager14CachedBodyPairE", !29, i64 0, !29, i64 12, !12, i64 24}
!41 = distinct !{!41, !37}
!42 = distinct !{!42, !37}


; 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::ContactConstraintManager::ContactAllocator" = type { %"class.JPH::LFHMAllocatorContext.base", i32, i32, i32 }
%"class.JPH::LFHMAllocatorContext.base" = type <{ ptr, i32, i32, i32 }>
%"class.JPH::Array" = type { i64, i64, ptr }
%"struct.JPH::BodyPair" = type { %"class.JPH::BodyID", %"class.JPH::BodyID" }
%"class.JPH::BodyID" = type { i32 }
%"class.JPH::Array.7" = type { i64, i64, ptr }
%"class.JPH::SubShapeIDPair" = type { %"class.JPH::BodyID", %"class.JPH::SubShapeID", %"class.JPH::BodyID", %"class.JPH::SubShapeID" }
%"class.JPH::SubShapeID" = type { i32 }
%"class.JPH::ContactConstraintManager::CachedContactPoint" = type { %"class.JPH::Float3", %"class.JPH::Float3", float, %"class.JPH::Vector" }
%"class.JPH::Float3" = type { float, float, float }
%"class.JPH::Vector" = type { [2 x float] }

@.str.1 = external hidden unnamed_addr constant [113 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [14 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: mustprogress 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) #2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN3JPH24ContactConstraintManager13ManifoldCache6CreateERNS0_16ContactAllocatorERKNS_14SubShapeIDPairEmi(ptr noundef nonnull align 8 dereferenceable(81), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 4 dereferenceable(16), i64 noundef, i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(56) ptr @_ZN3JPH15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValue8GetValueEv(ptr noundef nonnull align 4 dereferenceable(76)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH24ContactConstraintManager13ManifoldCache8ToHandleEPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS0_14CachedManifoldEE8KeyValueE(ptr noundef nonnull align 8 dereferenceable(81), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN3JPH24ContactConstraintManager13ManifoldCache6CreateERNS0_16ContactAllocatorERKNS_8BodyPairEm(ptr noundef nonnull align 8 dereferenceable(81), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(56) ptr @_ZNK3JPH15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValue8GetValueEv(ptr noundef nonnull align 4 dereferenceable(76)) local_unnamed_addr #4 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(16) ptr @_ZNK3JPH15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValue6GetKeyEv(ptr noundef nonnull align 4 dereferenceable(76)) local_unnamed_addr #4 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3JPH15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValue6GetKeyEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(28) ptr @_ZNK3JPH15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValue8GetValueEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #4 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN3JPH24ContactConstraintManager13ManifoldCache12RestoreStateERKS1_RNS_13StateRecorderE(ptr noundef nonnull align 8 dereferenceable(81) %0, ptr noundef nonnull align 8 dereferenceable(81) %1, ptr noundef nonnull align 8 dereferenceable(17) %2) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.JPH::ContactConstraintManager::ContactAllocator", align 8
  %5 = alloca %"class.JPH::Array", align 8
  %6 = alloca i32, align 4
  %7 = alloca %"struct.JPH::BodyPair", align 8
  %8 = alloca %"class.JPH::Array.7", align 8
  %9 = alloca i32, align 4
  %10 = alloca %"class.JPH::SubShapeIDPair", align 4
  %11 = alloca i16, align 2
  %12 = alloca %"class.JPH::Array.7", align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.JPH::SubShapeIDPair", align 4
  %15 = getelementptr inbounds i8, ptr %0, i64 80
  %16 = load i8, ptr %15, align 8, !tbaa !5, !range !17, !noundef !18
  %17 = trunc nuw i8 %16 to i1
  br i1 %17, label %18, label %21

18:                                               ; preds = %3
  %19 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 475)
  br i1 %19, label %20, label %21

20:                                               ; preds = %18
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #6, !srcloc !19
  br label %21

21:                                               ; preds = %3, %18, %20
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #6
  call void @_ZN3JPH24ContactConstraintManager13ManifoldCache19GetContactAllocatorEv(ptr dead_on_unwind nonnull writable sret(%"class.JPH::ContactConstraintManager::ContactAllocator") align 8 %4, ptr noundef nonnull align 8 dereferenceable(81) %0)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  call void @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValueENS_12STLAllocatorIS8_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %22 = call noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(17) %2)
  br i1 %22, label %23, label %26

23:                                               ; preds = %21
  invoke void @_ZNK3JPH24ContactConstraintManager13ManifoldCache21GetAllBodyPairsSortedERNS_5ArrayIPKNS_15LockFreeHashMapINS_8BodyPairENS0_14CachedBodyPairEE8KeyValueENS_12STLAllocatorIS9_EEEE(ptr noundef nonnull align 8 dereferenceable(81) %1, ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %26 unwind label %24

24:                                               ; preds = %23
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %220

26:                                               ; preds = %23, %21
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %27 = call noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(17) %2)
  br i1 %27, label %28, label %33

28:                                               ; preds = %26
  %29 = call noundef i64 @_ZNK3JPH5ArrayIPKNS_15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValueENS_12STLAllocatorIS8_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %30 = trunc i64 %29 to i32
  store i32 %30, ptr %6, align 4, !tbaa !20
  br label %33

31:                                               ; preds = %33
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %219

33:                                               ; preds = %28, %26
  invoke void @_ZN3JPH8StreamIn4ReadIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS3_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %.preheader150 unwind label %31

.preheader150:                                    ; preds = %33
  %34 = load i32, ptr %6, align 4, !tbaa !20
  %.not169 = icmp eq i32 %34, 0
  br i1 %.not169, label %.loopexit151, label %.lr.ph165

.lr.ph165:                                        ; preds = %.preheader150, %.loopexit149
  %indvars.iv185 = phi i64 [ %indvars.iv.next186, %.loopexit149 ], [ 0, %.preheader150 ]
  %.0164 = phi i1 [ %.3, %.loopexit149 ], [ true, %.preheader150 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  invoke void @_ZN3JPH8BodyPairC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %35 unwind label %46

35:                                               ; preds = %.lr.ph165
  %36 = call noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(17) %2)
  br i1 %36, label %37, label %48

37:                                               ; preds = %35
  %38 = call noundef i64 @_ZNK3JPH5ArrayIPKNS_15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValueENS_12STLAllocatorIS8_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %39 = icmp ugt i64 %38, %indvars.iv185
  br i1 %39, label %40, label %48

40:                                               ; preds = %37
  %41 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValueENS_12STLAllocatorIS8_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv185)
          to label %42 unwind label %46

42:                                               ; preds = %40
  %43 = load ptr, ptr %41, align 8, !tbaa !21
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK3JPH15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValue6GetKeyEv(ptr noundef nonnull align 8 dereferenceable(40) %43)
  %45 = load i64, ptr %44, align 8
  store i64 %45, ptr %7, align 8
  br label %48

46:                                               ; preds = %48, %40, %.lr.ph165
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %173

48:                                               ; preds = %42, %37, %35
  invoke void @_ZN3JPH8StreamIn4ReadINS_8BodyPairETnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS4_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %49 unwind label %46

49:                                               ; preds = %48
  %50 = invoke noundef i64 @_ZNK3JPH8BodyPair7GetHashEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %51 unwind label %54

51:                                               ; preds = %49
  %52 = invoke noundef ptr @_ZN3JPH24ContactConstraintManager13ManifoldCache6CreateERNS0_16ContactAllocatorERKNS_8BodyPairEm(ptr noundef nonnull align 8 dereferenceable(81) %0, ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(8) %7, i64 noundef %50)
          to label %53 unwind label %56

53:                                               ; preds = %51
  %.not132 = icmp eq ptr %52, null
  br i1 %.not132, label %.thread143, label %58

.thread143:                                       ; preds = %53
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %.loopexit151

54:                                               ; preds = %49
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %173

56:                                               ; preds = %51
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %173

58:                                               ; preds = %53
  %59 = call noundef nonnull align 4 dereferenceable(28) ptr @_ZN3JPH15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValue8GetValueEv(ptr noundef nonnull align 8 dereferenceable(40) %52)
  %60 = call noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(17) %2)
  br i1 %60, label %61, label %71

61:                                               ; preds = %58
  %62 = call noundef i64 @_ZNK3JPH5ArrayIPKNS_15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValueENS_12STLAllocatorIS8_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %63 = icmp ugt i64 %62, %indvars.iv185
  br i1 %63, label %64, label %71

64:                                               ; preds = %61
  %65 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValueENS_12STLAllocatorIS8_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv185)
          to label %66 unwind label %69

66:                                               ; preds = %64
  %67 = load ptr, ptr %65, align 8, !tbaa !21
  %68 = call noundef nonnull align 4 dereferenceable(28) ptr @_ZNK3JPH15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValue8GetValueEv(ptr noundef nonnull align 8 dereferenceable(40) %67)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %59, ptr noundef nonnull align 4 dereferenceable(28) %68, i64 28, i1 false)
  br label %71

69:                                               ; preds = %71, %64
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %173

71:                                               ; preds = %66, %61, %58
  invoke void @_ZN3JPH24ContactConstraintManager14CachedBodyPair12RestoreStateERNS_13StateRecorderE(ptr noundef nonnull align 4 dereferenceable(28) %59, ptr noundef nonnull align 8 dereferenceable(17) %2)
          to label %72 unwind label %69

72:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #6
  call void @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  %73 = call noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(17) %2)
  br i1 %73, label %74, label %81

74:                                               ; preds = %72
  %75 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValueENS_12STLAllocatorIS8_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv185)
          to label %76 unwind label %79

76:                                               ; preds = %74
  %77 = load ptr, ptr %75, align 8, !tbaa !21
  %78 = call noundef nonnull align 4 dereferenceable(28) ptr @_ZNK3JPH15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValue8GetValueEv(ptr noundef nonnull align 8 dereferenceable(40) %77)
  invoke void @_ZNK3JPH24ContactConstraintManager13ManifoldCache21GetAllManifoldsSortedERKNS0_14CachedBodyPairERNS_5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS0_14CachedManifoldEE8KeyValueENS_12STLAllocatorISC_EEEE(ptr noundef nonnull align 8 dereferenceable(81) %1, ptr noundef nonnull align 4 dereferenceable(28) %78, ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %81 unwind label %79

79:                                               ; preds = %76, %74
  %80 = landingpad { ptr, i32 }
          cleanup
  br label %172

81:                                               ; preds = %76, %72
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #6
  %82 = call noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(17) %2)
  br i1 %82, label %83, label %88

83:                                               ; preds = %81
  %84 = call noundef i64 @_ZNK3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  %85 = trunc i64 %84 to i32
  store i32 %85, ptr %9, align 4, !tbaa !20
  br label %88

86:                                               ; preds = %88
  %87 = landingpad { ptr, i32 }
          cleanup
  br label %171

88:                                               ; preds = %83, %81
  invoke void @_ZN3JPH8StreamIn4ReadIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS3_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %.preheader148 unwind label %86

.preheader148:                                    ; preds = %88
  %89 = load i32, ptr %9, align 4, !tbaa !20
  %.not170 = icmp eq i32 %89, 0
  br i1 %.not170, label %.loopexit149, label %.lr.ph162

.lr.ph162:                                        ; preds = %.preheader148, %._crit_edge
  %indvars.iv182 = phi i64 [ %indvars.iv.next183, %._crit_edge ], [ 0, %.preheader148 ]
  %.0108161 = phi i32 [ %151, %._crit_edge ], [ -1, %.preheader148 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #6
  invoke void @_ZN3JPH14SubShapeIDPairC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %10)
          to label %90 unwind label %100

90:                                               ; preds = %.lr.ph162
  %91 = call noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(17) %2)
  br i1 %91, label %92, label %102

92:                                               ; preds = %90
  %93 = call noundef i64 @_ZNK3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  %94 = icmp ugt i64 %93, %indvars.iv182
  br i1 %94, label %95, label %102

95:                                               ; preds = %92
  %96 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %indvars.iv182)
          to label %97 unwind label %100

97:                                               ; preds = %95
  %98 = load ptr, ptr %96, align 8, !tbaa !21
  %99 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZNK3JPH15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValue6GetKeyEv(ptr noundef nonnull align 4 dereferenceable(76) %98)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(16) %99, i64 16, i1 false), !tbaa.struct !22
  br label %102

100:                                              ; preds = %102, %95, %.lr.ph162
  %101 = landingpad { ptr, i32 }
          cleanup
  br label %166

102:                                              ; preds = %97, %92, %90
  invoke void @_ZN3JPH8StreamIn4ReadINS_14SubShapeIDPairETnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS4_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(16) %10)
          to label %103 unwind label %100

103:                                              ; preds = %102
  %104 = invoke noundef i64 @_ZNK3JPH14SubShapeIDPair7GetHashEv(ptr noundef nonnull align 4 dereferenceable(16) %10)
          to label %105 unwind label %117

105:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %11) #6
  %106 = call noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(17) %2)
  br i1 %106, label %107, label %121

107:                                              ; preds = %105
  %108 = call noundef i64 @_ZNK3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  %109 = icmp ugt i64 %108, %indvars.iv182
  br i1 %109, label %110, label %121

110:                                              ; preds = %107
  %111 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %indvars.iv182)
          to label %112 unwind label %119

112:                                              ; preds = %110
  %113 = load ptr, ptr %111, align 8, !tbaa !21
  %114 = call noundef nonnull align 4 dereferenceable(56) ptr @_ZNK3JPH15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValue8GetValueEv(ptr noundef nonnull align 4 dereferenceable(76) %113)
  %115 = getelementptr inbounds i8, ptr %114, i64 18
  %116 = load i16, ptr %115, align 2, !tbaa !23
  store i16 %116, ptr %11, align 2, !tbaa !30
  br label %121

117:                                              ; preds = %103
  %118 = landingpad { ptr, i32 }
          cleanup
  br label %166

119:                                              ; preds = %121, %110
  %120 = landingpad { ptr, i32 }
          cleanup
  br label %165

121:                                              ; preds = %112, %107, %105
  invoke void @_ZN3JPH8StreamIn4ReadItTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS3_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 2 dereferenceable(2) %11)
          to label %122 unwind label %119

122:                                              ; preds = %121
  %123 = load i16, ptr %11, align 2, !tbaa !30
  %124 = zext i16 %123 to i32
  %125 = invoke noundef ptr @_ZN3JPH24ContactConstraintManager13ManifoldCache6CreateERNS0_16ContactAllocatorERKNS_14SubShapeIDPairEmi(ptr noundef nonnull align 8 dereferenceable(81) %0, ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 4 dereferenceable(16) %10, i64 noundef %104, i32 noundef %124)
          to label %126 unwind label %127

126:                                              ; preds = %122
  %.not = icmp eq ptr %125, null
  br i1 %.not, label %.thread, label %129

.thread:                                          ; preds = %126
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #6
  br label %.loopexit149

127:                                              ; preds = %122
  %128 = landingpad { ptr, i32 }
          cleanup
  br label %165

129:                                              ; preds = %126
  %130 = call noundef nonnull align 4 dereferenceable(56) ptr @_ZN3JPH15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValue8GetValueEv(ptr noundef nonnull align 4 dereferenceable(76) %125)
  %131 = call noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(17) %2)
  br i1 %131, label %132, label %149

132:                                              ; preds = %129
  %133 = call noundef i64 @_ZNK3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  %134 = icmp ugt i64 %133, %indvars.iv182
  br i1 %134, label %135, label %149

135:                                              ; preds = %132
  %136 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %indvars.iv182)
          to label %137 unwind label %147

137:                                              ; preds = %135
  %138 = load ptr, ptr %136, align 8, !tbaa !21
  %139 = call noundef nonnull align 4 dereferenceable(56) ptr @_ZNK3JPH15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValue8GetValueEv(ptr noundef nonnull align 4 dereferenceable(76) %138)
  %140 = load i16, ptr %11, align 2, !tbaa !30
  %141 = zext i16 %140 to i32
  %142 = invoke noundef i32 @_ZN3JPH24ContactConstraintManager14CachedManifold21sGetRequiredTotalSizeEi(i32 noundef %141)
          to label %143 unwind label %147

143:                                              ; preds = %137
  %144 = sext i32 %142 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %130, ptr nonnull align 4 %139, i64 %144, i1 false)
  %145 = load i16, ptr %11, align 2, !tbaa !30
  %146 = getelementptr inbounds i8, ptr %130, i64 18
  store i16 %145, ptr %146, align 2, !tbaa !23
  br label %149

147:                                              ; preds = %150, %149, %137, %135
  %148 = landingpad { ptr, i32 }
          cleanup
  br label %165

149:                                              ; preds = %143, %132, %129
  invoke void @_ZN3JPH24ContactConstraintManager14CachedManifold12RestoreStateERNS_13StateRecorderE(ptr noundef nonnull align 4 dereferenceable(56) %130, ptr noundef nonnull align 8 dereferenceable(17) %2)
          to label %150 unwind label %147

150:                                              ; preds = %149
  store i32 %.0108161, ptr %130, align 4, !tbaa !31
  %151 = invoke noundef i32 @_ZNK3JPH24ContactConstraintManager13ManifoldCache8ToHandleEPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS0_14CachedManifoldEE8KeyValueE(ptr noundef nonnull align 8 dereferenceable(81) %0, ptr noundef nonnull %125)
          to label %.preheader147 unwind label %147

.preheader147:                                    ; preds = %150
  %152 = load i16, ptr %11, align 2, !tbaa !30
  %.not171 = icmp eq i16 %152, 0
  br i1 %.not171, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader147
  %153 = getelementptr inbounds i8, ptr %130, i64 20
  br label %154

154:                                              ; preds = %.lr.ph, %156
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %156 ]
  %155 = getelementptr inbounds [1 x %"class.JPH::ContactConstraintManager::CachedContactPoint"], ptr %153, i64 0, i64 %indvars.iv
  invoke void @_ZN3JPH24ContactConstraintManager18CachedContactPoint12RestoreStateERNS_13StateRecorderE(ptr noundef nonnull align 4 dereferenceable(36) %155, ptr noundef nonnull align 8 dereferenceable(17) %2)
          to label %156 unwind label %160

156:                                              ; preds = %154
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %157 = load i16, ptr %11, align 2, !tbaa !30
  %158 = zext i16 %157 to i64
  %159 = icmp ult i64 %indvars.iv.next, %158
  br i1 %159, label %154, label %._crit_edge, !llvm.loop !32

160:                                              ; preds = %154
  %161 = landingpad { ptr, i32 }
          cleanup
  br label %165

._crit_edge:                                      ; preds = %156, %.preheader147
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #6
  %indvars.iv.next183 = add nuw nsw i64 %indvars.iv182, 1
  %162 = load i32, ptr %9, align 4, !tbaa !20
  %163 = zext i32 %162 to i64
  %164 = icmp ult i64 %indvars.iv.next183, %163
  br i1 %164, label %.lr.ph162, label %.loopexit149, !llvm.loop !34

165:                                              ; preds = %127, %160, %147, %119
  %.pn.pn.pn = phi { ptr, i32 } [ %120, %119 ], [ %128, %127 ], [ %161, %160 ], [ %148, %147 ]
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %11) #6
  br label %166

166:                                              ; preds = %117, %165, %100
  %.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %101, %100 ], [ %.pn.pn.pn, %165 ], [ %118, %117 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #6
  br label %171

.loopexit149:                                     ; preds = %._crit_edge, %.preheader148, %.thread
  %.2110 = phi i32 [ %.0108161, %.thread ], [ -1, %.preheader148 ], [ %151, %._crit_edge ]
  %.3 = phi i1 [ false, %.thread ], [ %.0164, %.preheader148 ], [ %.0164, %._crit_edge ]
  %167 = getelementptr inbounds i8, ptr %59, i64 24
  store i32 %.2110, ptr %167, align 4, !tbaa !35
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  call void @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  %indvars.iv.next186 = add nuw nsw i64 %indvars.iv185, 1
  %168 = load i32, ptr %6, align 4, !tbaa !20
  %169 = zext i32 %168 to i64
  %170 = icmp ult i64 %indvars.iv.next186, %169
  br i1 %170, label %.lr.ph165, label %.loopexit151, !llvm.loop !37

171:                                              ; preds = %166, %86
  %.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn, %166 ], [ %87, %86 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  br label %172

172:                                              ; preds = %171, %79
  %.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn.pn, %171 ], [ %80, %79 ]
  call void @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  br label %173

173:                                              ; preds = %54, %69, %172, %56, %46
  %.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %47, %46 ], [ %55, %54 ], [ %57, %56 ], [ %.pn.pn.pn.pn.pn.pn.pn, %172 ], [ %70, %69 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %219

.loopexit151:                                     ; preds = %.loopexit149, %.preheader150, %.thread143
  %.5 = phi i1 [ false, %.thread143 ], [ true, %.preheader150 ], [ %.3, %.loopexit149 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #6
  call void @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #6
  %174 = call noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(17) %2)
  br i1 %174, label %175, label %178

175:                                              ; preds = %.loopexit151
  invoke void @_ZNK3JPH24ContactConstraintManager13ManifoldCache24GetAllCCDManifoldsSortedERNS_5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS0_14CachedManifoldEE8KeyValueENS_12STLAllocatorIS9_EEEE(ptr noundef nonnull align 8 dereferenceable(81) %1, ptr noundef nonnull align 8 dereferenceable(24) %12)
          to label %178 unwind label %176

176:                                              ; preds = %175
  %177 = landingpad { ptr, i32 }
          cleanup
  br label %218

178:                                              ; preds = %175, %.loopexit151
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #6
  %179 = call noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(17) %2)
  br i1 %179, label %180, label %185

180:                                              ; preds = %178
  %181 = call noundef i64 @_ZNK3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %182 = trunc i64 %181 to i32
  store i32 %182, ptr %13, align 4, !tbaa !20
  br label %185

183:                                              ; preds = %185
  %184 = landingpad { ptr, i32 }
          cleanup
  br label %217

185:                                              ; preds = %180, %178
  invoke void @_ZN3JPH8StreamIn4ReadIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS3_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %.preheader unwind label %183

.preheader:                                       ; preds = %185
  %186 = load i32, ptr %13, align 4, !tbaa !20
  %.not172 = icmp eq i32 %186, 0
  br i1 %.not172, label %.loopexit, label %.lr.ph168

.lr.ph168:                                        ; preds = %.preheader, %209
  %indvars.iv187 = phi i64 [ %indvars.iv.next188, %209 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #6
  invoke void @_ZN3JPH14SubShapeIDPairC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %14)
          to label %187 unwind label %197

187:                                              ; preds = %.lr.ph168
  %188 = call noundef zeroext i1 @_ZNK3JPH13StateRecorder12IsValidatingEv(ptr noundef nonnull align 8 dereferenceable(17) %2)
  br i1 %188, label %189, label %199

189:                                              ; preds = %187
  %190 = call noundef i64 @_ZNK3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %191 = icmp ugt i64 %190, %indvars.iv187
  br i1 %191, label %192, label %199

192:                                              ; preds = %189
  %193 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %indvars.iv187)
          to label %194 unwind label %197

194:                                              ; preds = %192
  %195 = load ptr, ptr %193, align 8, !tbaa !21
  %196 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZNK3JPH15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValue6GetKeyEv(ptr noundef nonnull align 4 dereferenceable(76) %195)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %14, ptr noundef nonnull align 4 dereferenceable(16) %196, i64 16, i1 false), !tbaa.struct !22
  br label %199

197:                                              ; preds = %199, %192, %.lr.ph168
  %198 = landingpad { ptr, i32 }
          cleanup
  br label %216

199:                                              ; preds = %194, %189, %187
  invoke void @_ZN3JPH8StreamIn4ReadINS_14SubShapeIDPairETnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRS4_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(16) %14)
          to label %200 unwind label %197

200:                                              ; preds = %199
  %201 = invoke noundef i64 @_ZNK3JPH14SubShapeIDPair7GetHashEv(ptr noundef nonnull align 4 dereferenceable(16) %14)
          to label %202 unwind label %205

202:                                              ; preds = %200
  %203 = invoke noundef ptr @_ZN3JPH24ContactConstraintManager13ManifoldCache6CreateERNS0_16ContactAllocatorERKNS_14SubShapeIDPairEmi(ptr noundef nonnull align 8 dereferenceable(81) %0, ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 4 dereferenceable(16) %14, i64 noundef %201, i32 noundef 0)
          to label %204 unwind label %207

204:                                              ; preds = %202
  %.not140 = icmp eq ptr %203, null
  br i1 %.not140, label %.thread145, label %209

.thread145:                                       ; preds = %204
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #6
  br label %.loopexit

205:                                              ; preds = %200
  %206 = landingpad { ptr, i32 }
          cleanup
  br label %216

207:                                              ; preds = %202
  %208 = landingpad { ptr, i32 }
          cleanup
  br label %216

209:                                              ; preds = %204
  %210 = call noundef nonnull align 4 dereferenceable(56) ptr @_ZN3JPH15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValue8GetValueEv(ptr noundef nonnull align 4 dereferenceable(76) %203)
  %211 = getelementptr inbounds i8, ptr %210, i64 16
  %212 = call noundef zeroext i16 @_ZNSt13__atomic_baseItEoREt(ptr noundef nonnull align 2 dereferenceable(2) %211, i16 noundef zeroext 2) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #6
  %indvars.iv.next188 = add nuw nsw i64 %indvars.iv187, 1
  %213 = load i32, ptr %13, align 4, !tbaa !20
  %214 = zext i32 %213 to i64
  %215 = icmp ult i64 %indvars.iv.next188, %214
  br i1 %215, label %.lr.ph168, label %.loopexit, !llvm.loop !38

216:                                              ; preds = %205, %207, %197
  %.pn133.pn = phi { ptr, i32 } [ %198, %197 ], [ %208, %207 ], [ %206, %205 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #6
  br label %217

.loopexit:                                        ; preds = %209, %.preheader, %.thread145
  %.8 = phi i1 [ false, %.thread145 ], [ %.5, %.preheader ], [ %.5, %209 ]
  store i8 1, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #6
  call void @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValueENS_12STLAllocatorIS8_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #6
  ret i1 %.8

217:                                              ; preds = %216, %183
  %.pn133.pn.pn = phi { ptr, i32 } [ %.pn133.pn, %216 ], [ %184, %183 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #6
  br label %218

218:                                              ; preds = %217, %176
  %.pn133.pn.pn.pn = phi { ptr, i32 } [ %.pn133.pn.pn, %217 ], [ %177, %176 ]
  call void @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEE8KeyValueENS_12STLAllocatorIS8_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #6
  br label %219

219:                                              ; preds = %218, %173, %31
  %.pn133.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn133.pn.pn.pn, %218 ], [ %.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn, %173 ], [ %32, %31 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  br label %220

220:                                              ; preds = %219, %24
  %.pn133.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn133.pn.pn.pn.pn, %219 ], [ %25, %24 ]
  call void @_ZN3JPH5ArrayIPKNS_15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValueENS_12STLAllocatorIS8_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #6
  resume { ptr, i32 } %.pn133.pn.pn.pn.pn.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH24ContactConstraintManager13ManifoldCache19GetContactAllocatorEv(ptr dead_on_unwind noalias writable sret(%"class.JPH::ContactConstraintManager::ContactAllocator") align 8, ptr noundef nonnull align 8 dereferenceable(81)) local_unnamed_addr #3 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK3JPH8BodyPair7GetHashEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(28) ptr @_ZN3JPH15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEE8KeyValue8GetValueEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH14SubShapeIDPairC2Ev(ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN3JPH24ContactConstraintManager14CachedManifold21sGetRequiredTotalSizeEi(i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZNSt13__atomic_baseItEoREt(ptr noundef nonnull align 2 dereferenceable(2), i16 noundef zeroext) local_unnamed_addr #4 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 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 #5 = { 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 #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !16, i64 80}
!6 = !{!"_ZTSN3JPH24ContactConstraintManager13ManifoldCacheE", !7, i64 0, !14, i64 16, !15, i64 48, !16, i64 80}
!7 = !{!"_ZTSN3JPH13LFHMAllocatorE", !8, i64 0, !11, i64 8, !12, i64 12}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"_ZTSSt6atomicIjE", !13, i64 0}
!13 = !{!"_ZTSSt13__atomic_baseIjE", !11, i64 0}
!14 = !{!"_ZTSN3JPH15LockFreeHashMapINS_14SubShapeIDPairENS_24ContactConstraintManager14CachedManifoldEEE", !8, i64 0, !12, i64 8, !8, i64 16, !11, i64 24, !11, i64 28}
!15 = !{!"_ZTSN3JPH15LockFreeHashMapINS_8BodyPairENS_24ContactConstraintManager14CachedBodyPairEEE", !8, i64 0, !12, i64 8, !8, i64 16, !11, i64 24, !11, i64 28}
!16 = !{!"bool", !9, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{i64 2158728324}
!20 = !{!11, !11, i64 0}
!21 = !{!8, !8, i64 0}
!22 = !{i64 0, i64 4, !20, i64 4, i64 4, !20, i64 8, i64 4, !20, i64 12, i64 4, !20}
!23 = !{!24, !29, i64 18}
!24 = !{!"_ZTSN3JPH24ContactConstraintManager14CachedManifoldE", !11, i64 0, !25, i64 4, !27, i64 16, !29, i64 18, !9, i64 20}
!25 = !{!"_ZTSN3JPH6Float3E", !26, i64 0, !26, i64 4, !26, i64 8}
!26 = !{!"float", !9, i64 0}
!27 = !{!"_ZTSSt6atomicItE", !28, i64 0}
!28 = !{!"_ZTSSt13__atomic_baseItE", !29, i64 0}
!29 = !{!"short", !9, i64 0}
!30 = !{!29, !29, i64 0}
!31 = !{!24, !11, i64 0}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = distinct !{!34, !33}
!35 = !{!36, !11, i64 24}
!36 = !{!"_ZTSN3JPH24ContactConstraintManager14CachedBodyPairE", !25, i64 0, !25, i64 12, !11, i64 24}
!37 = distinct !{!37, !33}
!38 = distinct !{!38, !33}


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