; 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] }>
%"struct.JPH::AssertLastParam" = type { i8 }
%"class.JPH::Ref" = type { 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::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 }

@.str = external hidden unnamed_addr constant [68 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [99 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: mustprogress uwtable
define dso_local void @_ZN3JPH17ConstraintManager3AddEPPNS_10ConstraintEi(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef %1, i32 noundef %2) #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.JPH::UniqueLock", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %"struct.JPH::AssertLastParam", align 1
  %14 = alloca %"class.JPH::Ref", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  %15 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #5
  %16 = getelementptr inbounds %"class.JPH::ConstraintManager", ptr %15, i32 0, i32 2
  %17 = getelementptr inbounds %"class.JPH::ConstraintManager", ptr %15, i32 0, i32 0
  %18 = load ptr, ptr %17, align 8, !tbaa !11
  call void @_ZN3JPH10UniqueLockINS_5MutexEEC2ERS1_PKNS_11BodyManagerENS_17EPhysicsLockTypesE(ptr noundef nonnull align 8 dereferenceable(20) %7, ptr noundef nonnull align 8 dereferenceable(48) %16, ptr noundef %18, i32 noundef 16)
  %19 = getelementptr inbounds %"class.JPH::ConstraintManager", ptr %15, i32 0, i32 1
  %20 = getelementptr inbounds %"class.JPH::ConstraintManager", ptr %15, i32 0, i32 1
  %21 = invoke noundef i64 @_ZNK3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %22 unwind label %37

22:                                               ; preds = %3
  %23 = load i32, ptr %6, align 4, !tbaa !9
  %24 = sext i32 %23 to i64
  %25 = add i64 %21, %24
  invoke void @_ZN3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %25)
          to label %26 unwind label %37

26:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %27, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = load i32, ptr %6, align 4, !tbaa !9
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds ptr, ptr %28, i64 %30
  store ptr %31, ptr %11, align 8, !tbaa !5
  br label %32

32:                                               ; preds = %70, %26
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  %34 = load ptr, ptr %11, align 8, !tbaa !5
  %35 = icmp ult ptr %33, %34
  br i1 %35, label %41, label %36

36:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %83

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

41:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = load ptr, ptr %42, align 8, !tbaa !5
  store ptr %43, ptr %12, align 8, !tbaa !5
  br label %44

44:                                               ; preds = %41
  %45 = load ptr, ptr %12, align 8, !tbaa !5
  %46 = getelementptr inbounds %"class.JPH::Constraint", ptr %45, i32 0, i32 2
  %47 = load i32, ptr %46, align 4, !tbaa !19
  %48 = icmp eq i32 %47, -1
  br i1 %48, label %57, label %49

49:                                               ; preds = %44
  %50 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 28)
          to label %51 unwind label %53

51:                                               ; preds = %49
  br i1 %50, label %52, label %57

52:                                               ; preds = %51
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !25
  br label %57

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

57:                                               ; preds = %52, %51, %44
  br label %58

58:                                               ; preds = %57
  br label %59

59:                                               ; preds = %58
  %60 = getelementptr inbounds %"class.JPH::ConstraintManager", ptr %15, i32 0, i32 1
  %61 = invoke noundef i64 @_ZNK3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %60)
          to label %62 unwind label %53

62:                                               ; preds = %59
  %63 = trunc i64 %61 to i32
  %64 = load ptr, ptr %12, align 8, !tbaa !5
  %65 = getelementptr inbounds %"class.JPH::Constraint", ptr %64, i32 0, i32 2
  store i32 %63, ptr %65, align 4, !tbaa !19
  %66 = getelementptr inbounds %"class.JPH::ConstraintManager", ptr %15, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %67 = load ptr, ptr %12, align 8, !tbaa !5
  invoke void @_ZN3JPH3RefINS_10ConstraintEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef %67)
          to label %68 unwind label %73

68:                                               ; preds = %62
  invoke void @_ZN3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24) %66, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %69 unwind label %77

69:                                               ; preds = %68
  call void @_ZN3JPH3RefINS_10ConstraintEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %70

70:                                               ; preds = %69
  %71 = load ptr, ptr %10, align 8, !tbaa !5
  %72 = getelementptr inbounds ptr, ptr %71, i32 1
  store ptr %72, ptr %10, align 8, !tbaa !5
  br label %32, !llvm.loop !26

73:                                               ; preds = %62
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %8, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %9, align 4
  br label %81

77:                                               ; preds = %68
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %8, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %9, align 4
  call void @_ZN3JPH3RefINS_10ConstraintEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  br label %81

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

82:                                               ; preds = %81, %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %84

83:                                               ; preds = %36
  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

84:                                               ; preds = %82, %37
  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 %85

85:                                               ; preds = %84
  %86 = load ptr, ptr %8, align 8
  %87 = load i32, ptr %9, align 4
  %88 = insertvalue { ptr, i32 } poison, ptr %86, 0
  %89 = insertvalue { ptr, i32 } %88, i32 %87, 1
  resume { ptr, i32 } %89
}

; 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 uwtable
declare dso_local void @_ZN3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 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)) #3 align 2

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTSN3JPH17ConstraintManagerE", !6, i64 0, !13, i64 8, !15, i64 32}
!13 = !{!"_ZTSN3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEEE", !14, i64 0, !14, i64 8, !6, i64 16}
!14 = !{!"long", !7, i64 0}
!15 = !{!"_ZTSN3JPH5MutexE", !16, i64 0, !18, i64 40}
!16 = !{!"_ZTSSt5mutex", !17, i64 0}
!17 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!18 = !{!"_ZTSNSt6thread2idE", !14, i64 0}
!19 = !{!20, !10, i64 12}
!20 = !{!"_ZTSN3JPH10ConstraintE", !21, i64 8, !10, i64 12, !10, i64 16, !7, i64 20, !7, i64 21, !24, i64 22, !14, i64 24}
!21 = !{!"_ZTSN3JPH9RefTargetINS_10ConstraintEEE", !22, i64 0}
!22 = !{!"_ZTSSt6atomicIjE", !23, i64 0}
!23 = !{!"_ZTSSt13__atomic_baseIjE", !10, i64 0}
!24 = !{!"bool", !7, i64 0}
!25 = !{i64 2157752977}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


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

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

@.str = external hidden unnamed_addr constant [68 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [99 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH17ConstraintManager3AddEPPNS_10ConstraintEi(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef readonly %1, i32 noundef %2) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.JPH::UniqueLock", align 8
  %5 = alloca %"class.JPH::Ref", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  %6 = getelementptr inbounds i8, ptr %0, i64 32
  %7 = 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) %6, ptr noundef %7, i32 noundef 16)
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = call noundef i64 @_ZNK3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  %10 = sext i32 %2 to i64
  %11 = add i64 %9, %10
  invoke void @_ZN3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %11)
          to label %12 unwind label %15

12:                                               ; preds = %3
  %13 = getelementptr inbounds ptr, ptr %1, i64 %10
  %14 = icmp sgt i32 %2, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %31, %12
  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

15:                                               ; preds = %3
  %16 = landingpad { ptr, i32 }
          cleanup
  br label %39

.lr.ph:                                           ; preds = %12, %31
  %.01620 = phi ptr [ %32, %31 ], [ %1, %12 ]
  %17 = load ptr, ptr %.01620, align 8, !tbaa !16
  %18 = getelementptr inbounds i8, ptr %17, i64 12
  %19 = load i32, ptr %18, align 4, !tbaa !17
  %20 = icmp eq i32 %19, -1
  br i1 %20, label %27, label %21

21:                                               ; preds = %.lr.ph
  %22 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 28)
          to label %23 unwind label %25

23:                                               ; preds = %21
  br i1 %22, label %24, label %27

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

25:                                               ; preds = %21
  %26 = landingpad { ptr, i32 }
          cleanup
  br label %39

27:                                               ; preds = %24, %23, %.lr.ph
  %28 = call noundef i64 @_ZNK3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  %29 = trunc i64 %28 to i32
  store i32 %29, ptr %18, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  invoke void @_ZN3JPH3RefINS_10ConstraintEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull %17)
          to label %30 unwind label %34

30:                                               ; preds = %27
  invoke void @_ZN3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %31 unwind label %36

31:                                               ; preds = %30
  call void @_ZN3JPH3RefINS_10ConstraintEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  %32 = getelementptr inbounds i8, ptr %.01620, i64 8
  %33 = icmp ult ptr %32, %13
  br i1 %33, label %.lr.ph, label %._crit_edge, !llvm.loop !25

34:                                               ; preds = %27
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %38

36:                                               ; preds = %30
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3JPH3RefINS_10ConstraintEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  br label %38

38:                                               ; preds = %36, %34
  %.pn = phi { ptr, i32 } [ %37, %36 ], [ %35, %34 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %39

39:                                               ; preds = %25, %38, %15
  %.pn.pn.pn = phi { ptr, i32 } [ %16, %15 ], [ %.pn, %38 ], [ %26, %25 ]
  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 } %.pn.pn.pn
}

; 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 uwtable
declare dso_local void @_ZN3JPH5ArrayINS_3RefINS_10ConstraintEEENS_12STLAllocatorIS3_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 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 #3 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH10UniqueLockINS_5MutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #4 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 = { 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 = !{!7, !7, i64 0}
!17 = !{!18, !22, i64 12}
!18 = !{!"_ZTSN3JPH10ConstraintE", !19, i64 8, !22, i64 12, !22, i64 16, !8, i64 20, !8, i64 21, !23, i64 22, !11, i64 24}
!19 = !{!"_ZTSN3JPH9RefTargetINS_10ConstraintEEE", !20, i64 0}
!20 = !{!"_ZTSSt6atomicIjE", !21, i64 0}
!21 = !{!"_ZTSSt13__atomic_baseIjE", !22, i64 0}
!22 = !{!"int", !8, i64 0}
!23 = !{!"bool", !8, i64 0}
!24 = !{i64 2157752977}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


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