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

; 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::RagdollSettings" = type { %"class.JPH::RefTarget", %"class.JPH::Ref.13", %"class.JPH::Array", %"class.JPH::Array.14", %"class.JPH::Array.17", %"class.JPH::Array.20" }
%"class.JPH::RefTarget" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::Ref.13" = type { ptr }
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::Array.14" = type { i64, i64, ptr }
%"class.JPH::Array.17" = type { i64, i64, ptr }
%"class.JPH::Array.20" = type { i64, i64, ptr }
%"class.JPH::RagdollSettings::Part" = type <{ %"class.JPH::BodyCreationSettings", %"class.JPH::Ref", [8 x i8] }>
%"class.JPH::BodyCreationSettings" = type { %"class.JPH::Vec3", %"class.JPH::Quat", %"class.JPH::Vec3", %"class.JPH::Vec3", i64, i16, %"class.JPH::CollisionGroup", i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, float, float, float, float, float, float, float, i32, i32, i8, float, %"class.JPH::MassProperties", %"class.JPH::RefConst.3", %"class.JPH::RefConst.4" }
%"class.JPH::Quat" = type { %"class.JPH::Vec4" }
%"class.JPH::Vec4" = type { %union.anon.2 }
%union.anon.2 = type { <4 x float> }
%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::CollisionGroup" = type { %"class.JPH::RefConst", i32, i32 }
%"class.JPH::RefConst" = type { ptr }
%"class.JPH::MassProperties" = type { float, %"class.JPH::Mat44" }
%"class.JPH::Mat44" = type { [4 x %"class.JPH::Vec4"] }
%"class.JPH::RefConst.3" = type { ptr }
%"class.JPH::RefConst.4" = type { ptr }
%"class.JPH::Ref" = type { ptr }
%"class.JPH::Skeleton::Joint" = type <{ %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", i32, [4 x i8] }>
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char, std::char_traits<char>, JPH::STLAllocator<char>>::_Alloc_hider", i64, %union.anon.32 }
%"struct.std::__cxx11::basic_string<char, std::char_traits<char>, JPH::STLAllocator<char>>::_Alloc_hider" = type { ptr }
%union.anon.32 = type { i64, [8 x i8] }
%"class.JPH::RagdollSettings::AdditionalConstraint" = type { [2 x i32], %"class.JPH::Ref" }

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(68) ptr @_ZN3JPH8Skeleton8GetJointEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #2 align 2

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH15RagdollSettings37CalculateConstraintIndexToBodyIdxPairEv(ptr noundef nonnull align 8 dereferenceable(112) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %13 = load ptr, ptr %2, align 8
  %14 = getelementptr inbounds %"class.JPH::RagdollSettings", ptr %13, i32 0, i32 5
  call void @_ZN3JPH5ArrayISt4pairIiiENS_12STLAllocatorIS2_EEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %14)
  %15 = getelementptr inbounds %"class.JPH::RagdollSettings", ptr %13, i32 0, i32 5
  %16 = getelementptr inbounds %"class.JPH::RagdollSettings", ptr %13, i32 0, i32 2
  %17 = call noundef i64 @_ZNK3JPH5ArrayINS_15RagdollSettings4PartENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
  %18 = getelementptr inbounds %"class.JPH::RagdollSettings", ptr %13, i32 0, i32 3
  %19 = call noundef i64 @_ZNK3JPH5ArrayINS_15RagdollSettings20AdditionalConstraintENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18)
  %20 = add i64 %17, %19
  call void @_ZN3JPH5ArrayISt4pairIiiENS_12STLAllocatorIS2_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %20)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %21 = getelementptr inbounds %"class.JPH::RagdollSettings", ptr %13, i32 0, i32 2
  store ptr %21, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = call noundef ptr @_ZN3JPH5ArrayINS_15RagdollSettings4PartENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %22)
  store ptr %23, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = call noundef ptr @_ZN3JPH5ArrayINS_15RagdollSettings4PartENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %24)
  store ptr %25, ptr %6, align 8, !tbaa !5
  br label %26

26:                                               ; preds = %48, %1
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = icmp ne ptr %27, %28
  br i1 %29, label %31, label %30

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

31:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %32, ptr %7, align 8, !tbaa !5
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = getelementptr inbounds %"class.JPH::RagdollSettings::Part", ptr %33, i32 0, i32 1
  %35 = call noundef zeroext i1 @_ZNK3JPH3RefINS_25TwoBodyConstraintSettingsEEneEPKS1_(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef null)
  br i1 %35, label %36, label %45

36:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %37 = getelementptr inbounds %"class.JPH::RagdollSettings", ptr %13, i32 0, i32 1
  %38 = call noundef ptr @_ZNK3JPH3RefINS_8SkeletonEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %37)
  %39 = load i32, ptr %3, align 4, !tbaa !9
  %40 = call noundef nonnull align 8 dereferenceable(68) ptr @_ZN3JPH8Skeleton8GetJointEi(ptr noundef nonnull align 8 dereferenceable(32) %38, i32 noundef %39)
  %41 = getelementptr inbounds %"class.JPH::Skeleton::Joint", ptr %40, i32 0, i32 2
  %42 = load i32, ptr %41, align 8, !tbaa !11
  store i32 %42, ptr %8, align 4, !tbaa !9
  %43 = getelementptr inbounds %"class.JPH::RagdollSettings", ptr %13, i32 0, i32 5
  %44 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayISt4pairIiiENS_12STLAllocatorIS2_EEE12emplace_backIJRiS7_EEERS2_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %43, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %45

45:                                               ; preds = %36, %31
  %46 = load i32, ptr %3, align 4, !tbaa !9
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br label %48

48:                                               ; preds = %45
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds %"class.JPH::RagdollSettings::Part", ptr %49, i32 1
  store ptr %50, ptr %5, align 8, !tbaa !5
  br label %26

51:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %52 = getelementptr inbounds %"class.JPH::RagdollSettings", ptr %13, i32 0, i32 3
  store ptr %52, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = call noundef ptr @_ZN3JPH5ArrayINS_15RagdollSettings20AdditionalConstraintENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %53)
  store ptr %54, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = call noundef ptr @_ZN3JPH5ArrayINS_15RagdollSettings20AdditionalConstraintENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %55)
  store ptr %56, ptr %11, align 8, !tbaa !5
  br label %57

57:                                               ; preds = %72, %51
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  %59 = load ptr, ptr %11, align 8, !tbaa !5
  %60 = icmp ne ptr %58, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %75

62:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %63 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %63, ptr %12, align 8, !tbaa !5
  %64 = getelementptr inbounds %"class.JPH::RagdollSettings", ptr %13, i32 0, i32 5
  %65 = load ptr, ptr %12, align 8, !tbaa !5
  %66 = getelementptr inbounds %"class.JPH::RagdollSettings::AdditionalConstraint", ptr %65, i32 0, i32 0
  %67 = getelementptr inbounds [2 x i32], ptr %66, i64 0, i64 0
  %68 = load ptr, ptr %12, align 8, !tbaa !5
  %69 = getelementptr inbounds %"class.JPH::RagdollSettings::AdditionalConstraint", ptr %68, i32 0, i32 0
  %70 = getelementptr inbounds [2 x i32], ptr %69, i64 0, i64 1
  %71 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayISt4pairIiiENS_12STLAllocatorIS2_EEE12emplace_backIJRKiS8_EEERS2_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %64, ptr noundef nonnull align 4 dereferenceable(4) %67, ptr noundef nonnull align 4 dereferenceable(4) %70)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %72

72:                                               ; preds = %62
  %73 = load ptr, ptr %10, align 8, !tbaa !5
  %74 = getelementptr inbounds %"class.JPH::RagdollSettings::AdditionalConstraint", ptr %73, i32 1
  store ptr %74, ptr %10, align 8, !tbaa !5
  br label %57

75:                                               ; preds = %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  ret void
}

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(68) ptr @_ZN3JPH8Skeleton8GetJointEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #2 align 2

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH15RagdollSettings37CalculateConstraintIndexToBodyIdxPairEv(ptr noundef nonnull align 8 dereferenceable(112) %0) local_unnamed_addr #2 align 2 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = getelementptr inbounds i8, ptr %0, i64 88
  tail call void @_ZN3JPH5ArrayISt4pairIiiENS_12STLAllocatorIS2_EEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %5 = getelementptr inbounds i8, ptr %0, i64 16
  %6 = tail call noundef i64 @_ZNK3JPH5ArrayINS_15RagdollSettings4PartENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %7 = getelementptr inbounds i8, ptr %0, i64 40
  %8 = tail call noundef i64 @_ZNK3JPH5ArrayINS_15RagdollSettings20AdditionalConstraintENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %9 = add i64 %8, %6
  tail call void @_ZN3JPH5ArrayISt4pairIiiENS_12STLAllocatorIS2_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %9)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  %10 = tail call noundef ptr @_ZN3JPH5ArrayINS_15RagdollSettings4PartENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %11 = tail call noundef ptr @_ZN3JPH5ArrayINS_15RagdollSettings4PartENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %.not18 = icmp eq ptr %10, %11
  br i1 %.not18, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %1
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  br label %15

._crit_edge:                                      ; preds = %25, %1
  %13 = call noundef ptr @_ZN3JPH5ArrayINS_15RagdollSettings20AdditionalConstraintENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %14 = call noundef ptr @_ZN3JPH5ArrayINS_15RagdollSettings20AdditionalConstraintENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %.not1720 = icmp eq ptr %13, %14
  br i1 %.not1720, label %._crit_edge24, label %.lr.ph23

15:                                               ; preds = %.lr.ph, %25
  %.019 = phi ptr [ %10, %.lr.ph ], [ %28, %25 ]
  %16 = getelementptr inbounds i8, ptr %.019, i64 256
  %17 = call noundef zeroext i1 @_ZNK3JPH3RefINS_25TwoBodyConstraintSettingsEEneEPKS1_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef null)
  br i1 %17, label %18, label %25

18:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  %19 = call noundef ptr @_ZNK3JPH3RefINS_8SkeletonEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12)
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = call noundef nonnull align 8 dereferenceable(68) ptr @_ZN3JPH8Skeleton8GetJointEi(ptr noundef nonnull align 8 dereferenceable(32) %19, i32 noundef %20)
  %22 = getelementptr inbounds i8, ptr %21, i64 64
  %23 = load i32, ptr %22, align 8, !tbaa !9
  store i32 %23, ptr %3, align 4, !tbaa !5
  %24 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayISt4pairIiiENS_12STLAllocatorIS2_EEE12emplace_backIJRiS7_EEERS2_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  br label %25

25:                                               ; preds = %18, %15
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %2, align 4, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %.019, i64 272
  %.not = icmp eq ptr %28, %11
  br i1 %.not, label %._crit_edge, label %15

._crit_edge24:                                    ; preds = %.lr.ph23, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  ret void

.lr.ph23:                                         ; preds = %._crit_edge, %.lr.ph23
  %.01621 = phi ptr [ %31, %.lr.ph23 ], [ %13, %._crit_edge ]
  %29 = getelementptr inbounds i8, ptr %.01621, i64 4
  %30 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayISt4pairIiiENS_12STLAllocatorIS2_EEE12emplace_backIJRKiS8_EEERS2_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(4) %.01621, ptr noundef nonnull align 4 dereferenceable(4) %29)
  %31 = getelementptr inbounds i8, ptr %.01621, i64 16
  %.not17 = icmp eq ptr %31, %14
  br i1 %.not17, label %._crit_edge24, label %.lr.ph23
}

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

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

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

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

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


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