; LLVM IR from jrouwe/JoltPhysics :: Jolt/Physics/Constraints (ConstraintManager)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.JPH::UniqueLock" = type <{ ptr, ptr, i32, [4 x i8] }>
%"class.JPH::Array.0" = type { i64, i64, ptr }
%"class.JPH::ConstraintManager" = type { ptr, %"class.JPH::Array", %"class.JPH::Mutex" }
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::Mutex" = type { %"class.std::mutex", %"class.std::thread::id" }
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::thread::id" = type { i64 }
%"class.JPH::Ref" = type { ptr }
%"class.JPH::Constraint" = type { ptr, %"class.JPH::RefTarget", i32, i32, i8, i8, i8, i64 }
%"class.JPH::RefTarget" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }

; 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: mustprogress uwtable
declare dso_local void @_ZN3JPH10UniqueLockINS_5MutexEEC2ERS1_PKNS_11BodyManagerENS_17EPhysicsLockTypesE(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef nonnull align 8 dereferenceable(48), ptr noundef, i32 noundef) unnamed_addr #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH17ConstraintManager9SaveStateERNS_13StateRecorderEPKNS_19StateRecorderFilterE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 8 dereferenceable(18) %1, ptr noundef %2) #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.JPH::UniqueLock", align 8
  %8 = alloca %"class.JPH::Array.0", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = 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
  %26 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #5
  %27 = getelementptr inbounds %"class.JPH::ConstraintManager", ptr %26, i32 0, i32 2
  %28 = getelementptr inbounds %"class.JPH::ConstraintManager", ptr %26, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8, !tbaa !9
  call void @_ZN3JPH10UniqueLockINS_5MutexEEC2ERS1_PKNS_11BodyManagerENS_17EPhysicsLockTypesE(ptr noundef nonnull align 8 dereferenceable(20) %7, ptr noundef nonnull align 8 dereferenceable(48) %27, ptr noundef %29, i32 noundef 16)
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = icmp ne ptr %30, null
  br i1 %31, label %32, label %148

32:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #5
  call void @_ZN3JPH5ArrayIPNS_10ConstraintENS_12STLAllocatorIS2_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  %33 = getelementptr inbounds %"class.JPH::ConstraintManager", ptr %26, i32 0, i32 1
  %34 = invoke noundef i64 @_ZNK3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %33)
          to label %35 unwind label %49

35:                                               ; preds = %32
  invoke void @_ZN3JPH5ArrayIPNS_10ConstraintENS_12STLAllocatorIS2_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %34)
          to label %36 unwind label %49

36:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %37 = getelementptr inbounds %"class.JPH::ConstraintManager", ptr %26, i32 0, i32 1
  store ptr %37, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %38 = load ptr, ptr %11, align 8, !tbaa !5
  %39 = invoke noundef ptr @_ZNK3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %38)
          to label %40 unwind label %53

40:                                               ; preds = %36
  store ptr %39, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %41 = load ptr, ptr %11, align 8, !tbaa !5
  %42 = invoke noundef ptr @_ZNK3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %41)
          to label %43 unwind label %57

43:                                               ; preds = %40
  store ptr %42, ptr %13, align 8, !tbaa !5
  br label %44

44:                                               ; preds = %86, %43
  %45 = load ptr, ptr %12, align 8, !tbaa !5
  %46 = load ptr, ptr %13, align 8, !tbaa !5
  %47 = icmp ne ptr %45, %46
  br i1 %47, label %61, label %48

48:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %92

49:                                               ; preds = %35, %32
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %9, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %10, align 4
  br label %147

53:                                               ; preds = %36
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %9, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %10, align 4
  br label %91

57:                                               ; preds = %40
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %9, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %10, align 4
  br label %90

61:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %62 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %62, ptr %14, align 8, !tbaa !5
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = load ptr, ptr %14, align 8, !tbaa !5
  %65 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNK3JPH3RefINS_10ConstraintEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %64)
          to label %66 unwind label %77

66:                                               ; preds = %61
  %67 = load ptr, ptr %63, align 8, !tbaa !17
  %68 = getelementptr inbounds ptr, ptr %67, i64 3
  %69 = load ptr, ptr %68, align 8
  %70 = invoke noundef zeroext i1 %69(ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef nonnull align 8 dereferenceable(32) %65)
          to label %71 unwind label %77

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

72:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %73 = load ptr, ptr %14, align 8, !tbaa !5
  %74 = invoke noundef ptr @_ZNK3JPH3RefINS_10ConstraintEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %73)
          to label %75 unwind label %81

75:                                               ; preds = %72
  store ptr %74, ptr %15, align 8, !tbaa !5
  invoke void @_ZN3JPH5ArrayIPNS_10ConstraintENS_12STLAllocatorIS2_EEE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %76 unwind label %81

76:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %85

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

81:                                               ; preds = %75, %72
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %9, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %89

85:                                               ; preds = %76, %71
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %86

86:                                               ; preds = %85
  %87 = load ptr, ptr %12, align 8, !tbaa !5
  %88 = getelementptr inbounds %"class.JPH::Ref", ptr %87, i32 1
  store ptr %88, ptr %12, align 8, !tbaa !5
  br label %44

89:                                               ; preds = %81, %77
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %90

90:                                               ; preds = %89, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %91

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

92:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %93 = invoke noundef i64 @_ZNK3JPH5ArrayIPNS_10ConstraintENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %94 unwind label %110

94:                                               ; preds = %92
  %95 = trunc i64 %93 to i32
  store i32 %95, ptr %16, align 4, !tbaa !19
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = getelementptr inbounds i8, ptr %96, i64 8
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %97, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %98 unwind label %110

98:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  store ptr %8, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %99 = load ptr, ptr %17, align 8, !tbaa !5
  %100 = invoke noundef ptr @_ZN3JPH5ArrayIPNS_10ConstraintENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %99)
          to label %101 unwind label %114

101:                                              ; preds = %98
  store ptr %100, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %102 = load ptr, ptr %17, align 8, !tbaa !5
  %103 = invoke noundef ptr @_ZN3JPH5ArrayIPNS_10ConstraintENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %102)
          to label %104 unwind label %118

104:                                              ; preds = %101
  store ptr %103, ptr %19, align 8, !tbaa !5
  br label %105

105:                                              ; preds = %136, %104
  %106 = load ptr, ptr %18, align 8, !tbaa !5
  %107 = load ptr, ptr %19, align 8, !tbaa !5
  %108 = icmp ne ptr %106, %107
  br i1 %108, label %122, label %109

109:                                              ; preds = %105
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %145

110:                                              ; preds = %94, %92
  %111 = landingpad { ptr, i32 }
          cleanup
  %112 = extractvalue { ptr, i32 } %111, 0
  store ptr %112, ptr %9, align 8
  %113 = extractvalue { ptr, i32 } %111, 1
  store i32 %113, ptr %10, align 4
  br label %146

114:                                              ; preds = %98
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %9, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %10, align 4
  br label %144

118:                                              ; preds = %101
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %9, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %10, align 4
  br label %143

122:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %123 = load ptr, ptr %18, align 8, !tbaa !5
  %124 = load ptr, ptr %123, align 8, !tbaa !5
  store ptr %124, ptr %20, align 8, !tbaa !5
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  %126 = getelementptr inbounds i8, ptr %125, i64 8
  %127 = load ptr, ptr %20, align 8, !tbaa !5
  %128 = getelementptr inbounds %"class.JPH::Constraint", ptr %127, i32 0, i32 2
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %126, ptr noundef nonnull align 4 dereferenceable(4) %128)
          to label %129 unwind label %139

129:                                              ; preds = %122
  %130 = load ptr, ptr %20, align 8, !tbaa !5
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  %132 = load ptr, ptr %130, align 8, !tbaa !17
  %133 = getelementptr inbounds ptr, ptr %132, i64 13
  %134 = load ptr, ptr %133, align 8
  invoke void %134(ptr noundef nonnull align 8 dereferenceable(32) %130, ptr noundef nonnull align 8 dereferenceable(18) %131)
          to label %135 unwind label %139

135:                                              ; preds = %129
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %136

136:                                              ; preds = %135
  %137 = load ptr, ptr %18, align 8, !tbaa !5
  %138 = getelementptr inbounds ptr, ptr %137, i32 1
  store ptr %138, ptr %18, align 8, !tbaa !5
  br label %105

139:                                              ; preds = %129, %122
  %140 = landingpad { ptr, i32 }
          cleanup
  %141 = extractvalue { ptr, i32 } %140, 0
  store ptr %141, ptr %9, align 8
  %142 = extractvalue { ptr, i32 } %140, 1
  store i32 %142, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %143

143:                                              ; preds = %139, %118
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %144

144:                                              ; preds = %143, %114
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %146

145:                                              ; preds = %109
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @_ZN3JPH5ArrayIPNS_10ConstraintENS_12STLAllocatorIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #5
  br label %208

146:                                              ; preds = %144, %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %147

147:                                              ; preds = %146, %91, %49
  call void @_ZN3JPH5ArrayIPNS_10ConstraintENS_12STLAllocatorIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #5
  br label %209

148:                                              ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %149 = getelementptr inbounds %"class.JPH::ConstraintManager", ptr %26, i32 0, i32 1
  %150 = invoke noundef i64 @_ZNK3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %149)
          to label %151 unwind label %168

151:                                              ; preds = %148
  %152 = trunc i64 %150 to i32
  store i32 %152, ptr %21, align 4, !tbaa !19
  %153 = load ptr, ptr %5, align 8, !tbaa !5
  %154 = getelementptr inbounds i8, ptr %153, i64 8
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %154, ptr noundef nonnull align 4 dereferenceable(4) %21)
          to label %155 unwind label %168

155:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %156 = getelementptr inbounds %"class.JPH::ConstraintManager", ptr %26, i32 0, i32 1
  store ptr %156, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %157 = load ptr, ptr %22, align 8, !tbaa !5
  %158 = invoke noundef ptr @_ZNK3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %157)
          to label %159 unwind label %172

159:                                              ; preds = %155
  store ptr %158, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %160 = load ptr, ptr %22, align 8, !tbaa !5
  %161 = invoke noundef ptr @_ZNK3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %160)
          to label %162 unwind label %176

162:                                              ; preds = %159
  store ptr %161, ptr %24, align 8, !tbaa !5
  br label %163

163:                                              ; preds = %197, %162
  %164 = load ptr, ptr %23, align 8, !tbaa !5
  %165 = load ptr, ptr %24, align 8, !tbaa !5
  %166 = icmp ne ptr %164, %165
  br i1 %166, label %180, label %167

167:                                              ; preds = %163
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  br label %206

168:                                              ; preds = %151, %148
  %169 = landingpad { ptr, i32 }
          cleanup
  %170 = extractvalue { ptr, i32 } %169, 0
  store ptr %170, ptr %9, align 8
  %171 = extractvalue { ptr, i32 } %169, 1
  store i32 %171, ptr %10, align 4
  br label %207

172:                                              ; preds = %155
  %173 = landingpad { ptr, i32 }
          cleanup
  %174 = extractvalue { ptr, i32 } %173, 0
  store ptr %174, ptr %9, align 8
  %175 = extractvalue { ptr, i32 } %173, 1
  store i32 %175, ptr %10, align 4
  br label %205

176:                                              ; preds = %159
  %177 = landingpad { ptr, i32 }
          cleanup
  %178 = extractvalue { ptr, i32 } %177, 0
  store ptr %178, ptr %9, align 8
  %179 = extractvalue { ptr, i32 } %177, 1
  store i32 %179, ptr %10, align 4
  br label %204

180:                                              ; preds = %163
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %181 = load ptr, ptr %23, align 8, !tbaa !5
  store ptr %181, ptr %25, align 8, !tbaa !5
  %182 = load ptr, ptr %5, align 8, !tbaa !5
  %183 = getelementptr inbounds i8, ptr %182, i64 8
  %184 = load ptr, ptr %25, align 8, !tbaa !5
  %185 = invoke noundef ptr @_ZNK3JPH3RefINS_10ConstraintEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %184)
          to label %186 unwind label %200

186:                                              ; preds = %180
  %187 = getelementptr inbounds %"class.JPH::Constraint", ptr %185, i32 0, i32 2
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %183, ptr noundef nonnull align 4 dereferenceable(4) %187)
          to label %188 unwind label %200

188:                                              ; preds = %186
  %189 = load ptr, ptr %25, align 8, !tbaa !5
  %190 = invoke noundef ptr @_ZNK3JPH3RefINS_10ConstraintEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %189)
          to label %191 unwind label %200

191:                                              ; preds = %188
  %192 = load ptr, ptr %5, align 8, !tbaa !5
  %193 = load ptr, ptr %190, align 8, !tbaa !17
  %194 = getelementptr inbounds ptr, ptr %193, i64 13
  %195 = load ptr, ptr %194, align 8
  invoke void %195(ptr noundef nonnull align 8 dereferenceable(32) %190, ptr noundef nonnull align 8 dereferenceable(18) %192)
          to label %196 unwind label %200

196:                                              ; preds = %191
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  br label %197

197:                                              ; preds = %196
  %198 = load ptr, ptr %23, align 8, !tbaa !5
  %199 = getelementptr inbounds %"class.JPH::Ref", ptr %198, i32 1
  store ptr %199, ptr %23, align 8, !tbaa !5
  br label %163

200:                                              ; preds = %191, %188, %186, %180
  %201 = landingpad { ptr, i32 }
          cleanup
  %202 = extractvalue { ptr, i32 } %201, 0
  store ptr %202, ptr %9, align 8
  %203 = extractvalue { ptr, i32 } %201, 1
  store i32 %203, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  br label %204

204:                                              ; preds = %200, %176
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  br label %205

205:                                              ; preds = %204, %172
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  br label %207

206:                                              ; preds = %167
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %208

207:                                              ; preds = %205, %168
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %209

208:                                              ; preds = %206, %145
  call void @_ZN3JPH10UniqueLockINS_5MutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #5
  ret void

209:                                              ; preds = %207, %147
  call void @_ZN3JPH10UniqueLockINS_5MutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #5
  br label %210

210:                                              ; preds = %209
  %211 = load ptr, ptr %9, align 8
  %212 = load i32, ptr %10, align 4
  %213 = insertvalue { ptr, i32 } poison, ptr %211, 0
  %214 = insertvalue { ptr, i32 } %213, i32 %212, 1
  resume { ptr, i32 } %214
}

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

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

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

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

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

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

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

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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, !6, i64 0}
!10 = !{!"_ZTSN3JPH17ConstraintManagerE", !6, i64 0, !11, i64 8, !13, i64 32}
!11 = !{!"_ZTSN3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEEE", !12, i64 0, !12, i64 8, !6, i64 16}
!12 = !{!"long", !7, i64 0}
!13 = !{!"_ZTSN3JPH5MutexE", !14, i64 0, !16, i64 40}
!14 = !{!"_ZTSSt5mutex", !15, i64 0}
!15 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!16 = !{!"_ZTSNSt6thread2idE", !12, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"vtable pointer", !8, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"int", !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.JPH::UniqueLock" = type <{ ptr, ptr, i32, [4 x i8] }>
%"class.JPH::Array.0" = type { i64, i64, ptr }

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH17ConstraintManager9SaveStateERNS_13StateRecorderEPKNS_19StateRecorderFilterE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 8 dereferenceable(18) %1, ptr noundef %2) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.JPH::UniqueLock", align 8
  %5 = alloca %"class.JPH::Array.0", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  %9 = getelementptr inbounds i8, ptr %0, i64 32
  %10 = load ptr, ptr %0, align 8, !tbaa !5
  call void @_ZN3JPH10UniqueLockINS_5MutexEEC2ERS1_PKNS_11BodyManagerENS_17EPhysicsLockTypesE(ptr noundef nonnull align 8 dereferenceable(20) %4, ptr noundef nonnull align 8 dereferenceable(48) %9, ptr noundef %10, i32 noundef 16)
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %54, label %11

11:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  call void @_ZN3JPH5ArrayIPNS_10ConstraintENS_12STLAllocatorIS2_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  %13 = call noundef i64 @_ZNK3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  invoke void @_ZN3JPH5ArrayIPNS_10ConstraintENS_12STLAllocatorIS2_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %13)
          to label %14 unwind label %20

14:                                               ; preds = %11
  %15 = call noundef ptr @_ZNK3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %16 = call noundef ptr @_ZNK3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %.not4553 = icmp eq ptr %15, %16
  br i1 %.not4553, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %35, %14
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  %17 = call noundef i64 @_ZNK3JPH5ArrayIPNS_10ConstraintENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %18 = trunc i64 %17 to i32
  store i32 %18, ptr %7, align 4, !tbaa !16
  %19 = getelementptr inbounds i8, ptr %1, i64 8
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %37 unwind label %40

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

.lr.ph:                                           ; preds = %14, %35
  %.04054 = phi ptr [ %36, %35 ], [ %15, %14 ]
  %22 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK3JPH3RefINS_10ConstraintEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %.04054)
  %23 = load ptr, ptr %2, align 8, !tbaa !18
  %24 = getelementptr inbounds i8, ptr %23, i64 24
  %25 = load ptr, ptr %24, align 8
  %26 = invoke noundef zeroext i1 %25(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(32) %22)
          to label %27 unwind label %31

27:                                               ; preds = %.lr.ph
  br i1 %26, label %28, label %35

28:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %29 = call noundef ptr @_ZNK3JPH3RefINS_10ConstraintEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %.04054)
  store ptr %29, ptr %6, align 8, !tbaa !20
  invoke void @_ZN3JPH5ArrayIPNS_10ConstraintENS_12STLAllocatorIS2_EEE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %30 unwind label %33

30:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br label %35

31:                                               ; preds = %.lr.ph
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %53

33:                                               ; preds = %28
  %34 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br label %53

35:                                               ; preds = %30, %27
  %36 = getelementptr inbounds i8, ptr %.04054, i64 8
  %.not45 = icmp eq ptr %36, %16
  br i1 %.not45, label %._crit_edge, label %.lr.ph

37:                                               ; preds = %._crit_edge
  %38 = call noundef ptr @_ZN3JPH5ArrayIPNS_10ConstraintENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %39 = call noundef ptr @_ZN3JPH5ArrayIPNS_10ConstraintENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %.not4655 = icmp eq ptr %38, %39
  br i1 %.not4655, label %._crit_edge59, label %.lr.ph58

._crit_edge59:                                    ; preds = %48, %37
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  call void @_ZN3JPH5ArrayIPNS_10ConstraintENS_12STLAllocatorIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  br label %76

40:                                               ; preds = %._crit_edge
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %52

.lr.ph58:                                         ; preds = %37, %48
  %.04156 = phi ptr [ %49, %48 ], [ %38, %37 ]
  %42 = load ptr, ptr %.04156, align 8, !tbaa !20
  %43 = getelementptr inbounds i8, ptr %42, i64 12
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 4 dereferenceable(4) %43)
          to label %44 unwind label %50

44:                                               ; preds = %.lr.ph58
  %45 = load ptr, ptr %42, align 8, !tbaa !18
  %46 = getelementptr inbounds i8, ptr %45, i64 104
  %47 = load ptr, ptr %46, align 8
  invoke void %47(ptr noundef nonnull align 8 dereferenceable(32) %42, ptr noundef nonnull align 8 dereferenceable(18) %1)
          to label %48 unwind label %50

48:                                               ; preds = %44
  %49 = getelementptr inbounds i8, ptr %.04156, i64 8
  %.not46 = icmp eq ptr %49, %39
  br i1 %.not46, label %._crit_edge59, label %.lr.ph58

50:                                               ; preds = %44, %.lr.ph58
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %52

52:                                               ; preds = %50, %40
  %.pn47 = phi { ptr, i32 } [ %51, %50 ], [ %41, %40 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  br label %53

53:                                               ; preds = %31, %33, %52, %20
  %.pn49.pn = phi { ptr, i32 } [ %.pn47, %52 ], [ %21, %20 ], [ %34, %33 ], [ %32, %31 ]
  call void @_ZN3JPH5ArrayIPNS_10ConstraintENS_12STLAllocatorIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  br label %77

54:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  %55 = getelementptr inbounds i8, ptr %0, i64 8
  %56 = call noundef i64 @_ZNK3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %55)
  %57 = trunc i64 %56 to i32
  store i32 %57, ptr %8, align 4, !tbaa !16
  %58 = getelementptr inbounds i8, ptr %1, i64 8
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %58, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %59 unwind label %62

59:                                               ; preds = %54
  %60 = call noundef ptr @_ZNK3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %55)
  %61 = call noundef ptr @_ZNK3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %55)
  %.not4360 = icmp eq ptr %60, %61
  br i1 %.not4360, label %._crit_edge64, label %.lr.ph63

._crit_edge64:                                    ; preds = %71, %59
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  br label %76

62:                                               ; preds = %54
  %63 = landingpad { ptr, i32 }
          cleanup
  br label %75

.lr.ph63:                                         ; preds = %59, %71
  %.03961 = phi ptr [ %72, %71 ], [ %60, %59 ]
  %64 = call noundef ptr @_ZNK3JPH3RefINS_10ConstraintEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %.03961)
  %65 = getelementptr inbounds i8, ptr %64, i64 12
  invoke void @_ZN3JPH9StreamOut5WriteIjTnNSt9enable_ifIXsr3stdE23is_trivially_copyable_vIT_EEbE4typeELb1EEEvRKS3_(ptr noundef nonnull align 8 dereferenceable(8) %58, ptr noundef nonnull align 4 dereferenceable(4) %65)
          to label %66 unwind label %73

66:                                               ; preds = %.lr.ph63
  %67 = call noundef ptr @_ZNK3JPH3RefINS_10ConstraintEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %.03961)
  %68 = load ptr, ptr %67, align 8, !tbaa !18
  %69 = getelementptr inbounds i8, ptr %68, i64 104
  %70 = load ptr, ptr %69, align 8
  invoke void %70(ptr noundef nonnull align 8 dereferenceable(32) %67, ptr noundef nonnull align 8 dereferenceable(18) %1)
          to label %71 unwind label %73

71:                                               ; preds = %66
  %72 = getelementptr inbounds i8, ptr %.03961, i64 8
  %.not43 = icmp eq ptr %72, %61
  br i1 %.not43, label %._crit_edge64, label %.lr.ph63

73:                                               ; preds = %66, %.lr.ph63
  %74 = landingpad { ptr, i32 }
          cleanup
  br label %75

75:                                               ; preds = %73, %62
  %.pn = phi { ptr, i32 } [ %74, %73 ], [ %63, %62 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  br label %77

76:                                               ; preds = %._crit_edge64, %._crit_edge59
  call void @_ZN3JPH10UniqueLockINS_5MutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  ret void

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

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

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

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

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

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

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

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

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

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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, !7, i64 0}
!6 = !{!"_ZTSN3JPH17ConstraintManagerE", !7, i64 0, !10, i64 8, !12, i64 32}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEEE", !11, i64 0, !11, i64 8, !7, i64 16}
!11 = !{!"long", !8, i64 0}
!12 = !{!"_ZTSN3JPH5MutexE", !13, i64 0, !15, i64 40}
!13 = !{!"_ZTSSt5mutex", !14, i64 0}
!14 = !{!"_ZTSSt12__mutex_base", !8, i64 0}
!15 = !{!"_ZTSNSt6thread2idE", !11, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !8, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"vtable pointer", !9, i64 0}
!20 = !{!7, !7, i64 0}


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