; 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::Ref.96" = type { ptr }
%"class.JPH::Ragdoll" = type { %"class.JPH::RefTarget.76", %"class.JPH::RefConst.77", %"class.JPH::Array.78", %"class.JPH::Array.81", ptr }
%"class.JPH::RefTarget.76" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::RefConst.77" = type { ptr }
%"class.JPH::Array.78" = type { i64, i64, ptr }
%"class.JPH::Array.81" = type { i64, i64, ptr }
%"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" }
%"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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef 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 ptr @_ZNK3JPH5ArrayINS_15RagdollSettings4PartENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK3JPH5ArrayINS_15RagdollSettings4PartENS_12STLAllocatorIS2_EEE3endEv(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 ptr @_ZNK3JPH3RefINS_25TwoBodyConstraintSettingsEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #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 @_ZNK3JPH5ArrayINS_15RagdollSettings20AdditionalConstraintENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZNK3JPH15RagdollSettings13CreateRagdollEjmPNS_13PhysicsSystemE(ptr noundef nonnull align 8 dereferenceable(112) %0, i32 noundef %1, i64 noundef %2, ptr noundef %3) #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca %"class.JPH::Ref.96", align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca %"class.JPH::Ref.96", align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i64 %2, ptr %8, align 8, !tbaa !11
  store ptr %3, ptr %9, align 8, !tbaa !5
  %31 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %32 = call noundef ptr @_ZN3JPH7RagdollnwEm(i64 noundef 72)
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  invoke void @_ZN3JPH7RagdollC2EPNS_13PhysicsSystemE(ptr noundef nonnull align 8 dereferenceable(72) %32, ptr noundef %33)
          to label %34 unwind label %65

34:                                               ; preds = %4
  store ptr %32, ptr %10, align 8, !tbaa !5
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  %36 = getelementptr inbounds %"class.JPH::Ragdoll", ptr %35, i32 0, i32 1
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH8RefConstINS_15RagdollSettingsEEaSEPKS1_(ptr noundef nonnull align 8 dereferenceable(8) %36, ptr noundef %31)
  %38 = load ptr, ptr %10, align 8, !tbaa !5
  %39 = getelementptr inbounds %"class.JPH::Ragdoll", ptr %38, i32 0, i32 2
  %40 = getelementptr inbounds %"class.JPH::RagdollSettings", ptr %31, i32 0, i32 2
  %41 = call noundef i64 @_ZNK3JPH5ArrayINS_15RagdollSettings4PartENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %40)
  call void @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %39, i64 noundef %41)
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = getelementptr inbounds %"class.JPH::Ragdoll", ptr %42, i32 0, i32 3
  %44 = getelementptr inbounds %"class.JPH::RagdollSettings", ptr %31, i32 0, i32 2
  %45 = call noundef i64 @_ZNK3JPH5ArrayINS_15RagdollSettings4PartENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %44)
  %46 = getelementptr inbounds %"class.JPH::RagdollSettings", ptr %31, i32 0, i32 3
  %47 = call noundef i64 @_ZNK3JPH5ArrayINS_15RagdollSettings20AdditionalConstraintENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %46)
  %48 = add i64 %45, %47
  call void @_ZN3JPH5ArrayINS_3RefINS_17TwoBodyConstraintEEENS_12STLAllocatorIS3_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %43, i64 noundef %48)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH13PhysicsSystem16GetBodyInterfaceEv(ptr noundef nonnull align 16 dereferenceable(1172) %49)
  store ptr %50, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %51 = getelementptr inbounds %"class.JPH::RagdollSettings", ptr %31, i32 0, i32 2
  %52 = call noundef i64 @_ZNK3JPH5ArrayINS_15RagdollSettings4PartENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %51)
  %53 = mul i64 %52, 8
  %54 = alloca i8, i64 %53, align 16
  store ptr %54, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 0, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %55 = getelementptr inbounds %"class.JPH::RagdollSettings", ptr %31, i32 0, i32 2
  store ptr %55, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %56 = load ptr, ptr %16, align 8, !tbaa !5
  %57 = call noundef ptr @_ZNK3JPH5ArrayINS_15RagdollSettings4PartENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %56)
  store ptr %57, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %58 = load ptr, ptr %16, align 8, !tbaa !5
  %59 = call noundef ptr @_ZNK3JPH5ArrayINS_15RagdollSettings4PartENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %58)
  store ptr %59, ptr %18, align 8, !tbaa !5
  br label %60

60:                                               ; preds = %135, %34
  %61 = load ptr, ptr %17, align 8, !tbaa !5
  %62 = load ptr, ptr %18, align 8, !tbaa !5
  %63 = icmp ne ptr %61, %62
  br i1 %63, label %69, label %64

64:                                               ; preds = %60
  store i32 2, ptr %19, align 4
  br label %138

65:                                               ; preds = %4
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %11, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %12, align 4
  call void @_ZN3JPH7RagdolldlEPv(ptr noundef %32) #8
  br label %193

69:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %70 = load ptr, ptr %17, align 8, !tbaa !5
  store ptr %70, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %71 = load ptr, ptr %13, align 8, !tbaa !5
  %72 = load ptr, ptr %20, align 8, !tbaa !5
  %73 = call noundef ptr @_ZN3JPH13BodyInterface10CreateBodyERKNS_20BodyCreationSettingsE(ptr noundef nonnull align 8 dereferenceable(24) %71, ptr noundef nonnull align 16 dereferenceable(256) %72)
  store ptr %73, ptr %21, align 8, !tbaa !5
  %74 = load ptr, ptr %21, align 8, !tbaa !5
  %75 = icmp eq ptr %74, null
  br i1 %75, label %76, label %81

76:                                               ; preds = %69
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  %78 = icmp eq ptr %77, null
  br i1 %78, label %80, label %79

79:                                               ; preds = %76
  call void @_ZN3JPH7RagdollD1Ev(ptr noundef nonnull align 8 dereferenceable(72) %77) #8
  call void @_ZN3JPH7RagdolldlEPv(ptr noundef %77) #8
  br label %80

80:                                               ; preds = %79, %76
  store ptr null, ptr %5, align 8
  store i32 1, ptr %19, align 4
  br label %129

81:                                               ; preds = %69
  %82 = load ptr, ptr %21, align 8, !tbaa !5
  %83 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN3JPH4Body17GetCollisionGroupEv(ptr noundef nonnull align 16 dereferenceable(122) %82)
  %84 = load i32, ptr %7, align 4, !tbaa !9
  call void @_ZN3JPH14CollisionGroup10SetGroupIDEj(ptr noundef nonnull align 8 dereferenceable(16) %83, i32 noundef %84)
  %85 = load ptr, ptr %21, align 8, !tbaa !5
  %86 = load i64, ptr %8, align 8, !tbaa !11
  call void @_ZN3JPH4Body11SetUserDataEm(ptr noundef nonnull align 16 dereferenceable(122) %85, i64 noundef %86)
  %87 = load ptr, ptr %21, align 8, !tbaa !5
  %88 = load ptr, ptr %14, align 8, !tbaa !5
  %89 = load i32, ptr %15, align 4, !tbaa !9
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds ptr, ptr %88, i64 %90
  store ptr %87, ptr %91, align 8, !tbaa !5
  %92 = load ptr, ptr %20, align 8, !tbaa !5
  %93 = getelementptr inbounds %"class.JPH::RagdollSettings::Part", ptr %92, i32 0, i32 1
  %94 = call noundef zeroext i1 @_ZNK3JPH3RefINS_25TwoBodyConstraintSettingsEEneEPKS1_(ptr noundef nonnull align 8 dereferenceable(8) %93, ptr noundef null)
  br i1 %94, label %95, label %122

95:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %96 = load ptr, ptr %14, align 8, !tbaa !5
  %97 = getelementptr inbounds %"class.JPH::RagdollSettings", ptr %31, i32 0, i32 1
  %98 = call noundef ptr @_ZNK3JPH3RefINS_8SkeletonEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %97)
  %99 = load i32, ptr %15, align 4, !tbaa !9
  %100 = call noundef nonnull align 8 dereferenceable(68) ptr @_ZN3JPH8Skeleton8GetJointEi(ptr noundef nonnull align 8 dereferenceable(32) %98, i32 noundef %99)
  %101 = getelementptr inbounds %"class.JPH::Skeleton::Joint", ptr %100, i32 0, i32 2
  %102 = load i32, ptr %101, align 8, !tbaa !13
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds ptr, ptr %96, i64 %103
  %105 = load ptr, ptr %104, align 8, !tbaa !5
  store ptr %105, ptr %22, align 8, !tbaa !5
  %106 = load ptr, ptr %10, align 8, !tbaa !5
  %107 = getelementptr inbounds %"class.JPH::Ragdoll", ptr %106, i32 0, i32 3
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  %108 = load ptr, ptr %20, align 8, !tbaa !5
  %109 = getelementptr inbounds %"class.JPH::RagdollSettings::Part", ptr %108, i32 0, i32 1
  %110 = call noundef ptr @_ZNK3JPH3RefINS_25TwoBodyConstraintSettingsEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %109)
  %111 = load ptr, ptr %22, align 8, !tbaa !5
  %112 = load ptr, ptr %21, align 8, !tbaa !5
  %113 = load ptr, ptr %110, align 8, !tbaa !17
  %114 = getelementptr inbounds ptr, ptr %113, i64 6
  %115 = load ptr, ptr %114, align 8
  %116 = call noundef ptr %115(ptr noundef nonnull align 8 dereferenceable(40) %110, ptr noundef nonnull align 16 dereferenceable(122) %111, ptr noundef nonnull align 16 dereferenceable(122) %112)
  call void @_ZN3JPH3RefINS_17TwoBodyConstraintEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef %116)
  invoke void @_ZN3JPH5ArrayINS_3RefINS_17TwoBodyConstraintEEENS_12STLAllocatorIS3_EEE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24) %107, ptr noundef nonnull align 8 dereferenceable(8) %23)
          to label %117 unwind label %118

117:                                              ; preds = %95
  call void @_ZN3JPH3RefINS_17TwoBodyConstraintEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  br label %122

118:                                              ; preds = %95
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %11, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %12, align 4
  call void @_ZN3JPH3RefINS_17TwoBodyConstraintEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  br label %192

122:                                              ; preds = %117, %81
  %123 = load ptr, ptr %10, align 8, !tbaa !5
  %124 = getelementptr inbounds %"class.JPH::Ragdoll", ptr %123, i32 0, i32 2
  %125 = load ptr, ptr %21, align 8, !tbaa !5
  %126 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122) %125)
  call void @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %124, ptr noundef nonnull align 4 dereferenceable(4) %126)
  %127 = load i32, ptr %15, align 4, !tbaa !9
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %15, align 4, !tbaa !9
  store i32 0, ptr %19, align 4
  br label %129

129:                                              ; preds = %122, %80
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  %130 = load i32, ptr %19, align 4
  switch i32 %130, label %132 [
    i32 0, label %131
  ]

131:                                              ; preds = %129
  store i32 0, ptr %19, align 4
  br label %132

132:                                              ; preds = %131, %129
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  %133 = load i32, ptr %19, align 4
  switch i32 %133, label %138 [
    i32 0, label %134
  ]

134:                                              ; preds = %132
  br label %135

135:                                              ; preds = %134
  %136 = load ptr, ptr %17, align 8, !tbaa !5
  %137 = getelementptr inbounds %"class.JPH::RagdollSettings::Part", ptr %136, i32 1
  store ptr %137, ptr %17, align 8, !tbaa !5
  br label %60

138:                                              ; preds = %132, %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  %139 = load i32, ptr %19, align 4
  switch i32 %139, label %190 [
    i32 2, label %140
  ]

140:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  %141 = getelementptr inbounds %"class.JPH::RagdollSettings", ptr %31, i32 0, i32 3
  store ptr %141, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %142 = load ptr, ptr %24, align 8, !tbaa !5
  %143 = call noundef ptr @_ZNK3JPH5ArrayINS_15RagdollSettings20AdditionalConstraintENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %142)
  store ptr %143, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %144 = load ptr, ptr %24, align 8, !tbaa !5
  %145 = call noundef ptr @_ZNK3JPH5ArrayINS_15RagdollSettings20AdditionalConstraintENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %144)
  store ptr %145, ptr %26, align 8, !tbaa !5
  br label %146

146:                                              ; preds = %181, %140
  %147 = load ptr, ptr %25, align 8, !tbaa !5
  %148 = load ptr, ptr %26, align 8, !tbaa !5
  %149 = icmp ne ptr %147, %148
  br i1 %149, label %151, label %150

150:                                              ; preds = %146
  store i32 4, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  br label %188

151:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  %152 = load ptr, ptr %25, align 8, !tbaa !5
  store ptr %152, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #8
  %153 = load ptr, ptr %14, align 8, !tbaa !5
  %154 = load ptr, ptr %27, align 8, !tbaa !5
  %155 = getelementptr inbounds %"class.JPH::RagdollSettings::AdditionalConstraint", ptr %154, i32 0, i32 0
  %156 = getelementptr inbounds [2 x i32], ptr %155, i64 0, i64 0
  %157 = load i32, ptr %156, align 8, !tbaa !9
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds ptr, ptr %153, i64 %158
  %160 = load ptr, ptr %159, align 8, !tbaa !5
  store ptr %160, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #8
  %161 = load ptr, ptr %14, align 8, !tbaa !5
  %162 = load ptr, ptr %27, align 8, !tbaa !5
  %163 = getelementptr inbounds %"class.JPH::RagdollSettings::AdditionalConstraint", ptr %162, i32 0, i32 0
  %164 = getelementptr inbounds [2 x i32], ptr %163, i64 0, i64 1
  %165 = load i32, ptr %164, align 4, !tbaa !9
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds ptr, ptr %161, i64 %166
  %168 = load ptr, ptr %167, align 8, !tbaa !5
  store ptr %168, ptr %29, align 8, !tbaa !5
  %169 = load ptr, ptr %10, align 8, !tbaa !5
  %170 = getelementptr inbounds %"class.JPH::Ragdoll", ptr %169, i32 0, i32 3
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #8
  %171 = load ptr, ptr %27, align 8, !tbaa !5
  %172 = getelementptr inbounds %"class.JPH::RagdollSettings::AdditionalConstraint", ptr %171, i32 0, i32 1
  %173 = call noundef ptr @_ZNK3JPH3RefINS_25TwoBodyConstraintSettingsEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %172)
  %174 = load ptr, ptr %28, align 8, !tbaa !5
  %175 = load ptr, ptr %29, align 8, !tbaa !5
  %176 = load ptr, ptr %173, align 8, !tbaa !17
  %177 = getelementptr inbounds ptr, ptr %176, i64 6
  %178 = load ptr, ptr %177, align 8
  %179 = call noundef ptr %178(ptr noundef nonnull align 8 dereferenceable(40) %173, ptr noundef nonnull align 16 dereferenceable(122) %174, ptr noundef nonnull align 16 dereferenceable(122) %175)
  call void @_ZN3JPH3RefINS_17TwoBodyConstraintEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef %179)
  invoke void @_ZN3JPH5ArrayINS_3RefINS_17TwoBodyConstraintEEENS_12STLAllocatorIS3_EEE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24) %170, ptr noundef nonnull align 8 dereferenceable(8) %30)
          to label %180 unwind label %184

180:                                              ; preds = %151
  call void @_ZN3JPH3RefINS_17TwoBodyConstraintEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %30) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  br label %181

181:                                              ; preds = %180
  %182 = load ptr, ptr %25, align 8, !tbaa !5
  %183 = getelementptr inbounds %"class.JPH::RagdollSettings::AdditionalConstraint", ptr %182, i32 1
  store ptr %183, ptr %25, align 8, !tbaa !5
  br label %146

184:                                              ; preds = %151
  %185 = landingpad { ptr, i32 }
          cleanup
  %186 = extractvalue { ptr, i32 } %185, 0
  store ptr %186, ptr %11, align 8
  %187 = extractvalue { ptr, i32 } %185, 1
  store i32 %187, ptr %12, align 4
  call void @_ZN3JPH3RefINS_17TwoBodyConstraintEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %30) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  br label %192

188:                                              ; preds = %150
  %189 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %189, ptr %5, align 8
  store i32 1, ptr %19, align 4
  br label %190

190:                                              ; preds = %188, %138
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  %191 = load ptr, ptr %5, align 8
  ret ptr %191

192:                                              ; preds = %184, %118
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  br label %193

193:                                              ; preds = %192, %65
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  br label %194

194:                                              ; preds = %193
  %195 = load ptr, ptr %11, align 8
  %196 = load i32, ptr %12, align 4
  %197 = insertvalue { ptr, i32 } poison, ptr %195, 0
  %198 = insertvalue { ptr, i32 } %197, i32 %196, 1
  resume { ptr, i32 } %198
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef ptr @_ZN3JPH7RagdollnwEm(i64 noundef) #3 align 2

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH7RagdolldlEPv(ptr noundef) #4 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH13PhysicsSystem16GetBodyInterfaceEv(ptr noundef nonnull align 16 dereferenceable(1172)) #6 align 2

declare noundef ptr @_ZN3JPH13BodyInterface10CreateBodyERKNS_20BodyCreationSettingsE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 16 dereferenceable(256)) #7

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN3JPH4Body17GetCollisionGroupEv(ptr noundef nonnull align 16 dereferenceable(122)) #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH14CollisionGroup10SetGroupIDEj(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH4Body11SetUserDataEm(ptr noundef nonnull align 16 dereferenceable(122), i64 noundef) #6 align 2

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

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

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

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

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

declare void @_ZN3JPH7RagdollD1Ev(ptr)

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 = { alwaysinline 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 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { "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 #8 = { 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, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !10, i64 64}
!14 = !{!"_ZTSN3JPH8Skeleton5JointE", !15, i64 0, !15, i64 32, !10, i64 64}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEEE", !16, i64 0, !12, i64 8, !7, i64 16}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEE12_Alloc_hiderE", !6, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"vtable pointer", !8, i64 0}


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

%"class.JPH::Ref.96" = type { ptr }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef 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 ptr @_ZNK3JPH5ArrayINS_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 @_ZNK3JPH5ArrayINS_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 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 ptr @_ZNK3JPH3RefINS_25TwoBodyConstraintSettingsEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) 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 @_ZNK3JPH5ArrayINS_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 @_ZNK3JPH5ArrayINS_15RagdollSettings20AdditionalConstraintENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZNK3JPH15RagdollSettings13CreateRagdollEjmPNS_13PhysicsSystemE(ptr noundef nonnull align 8 dereferenceable(112) %0, i32 noundef %1, i64 noundef %2, ptr noundef %3) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.JPH::Ref.96", align 8
  %6 = alloca %"class.JPH::Ref.96", align 8
  %7 = tail call noundef ptr @_ZN3JPH7RagdollnwEm(i64 noundef 72)
  invoke void @_ZN3JPH7RagdollC2EPNS_13PhysicsSystemE(ptr noundef nonnull align 8 dereferenceable(72) %7, ptr noundef %3)
          to label %8 unwind label %26

8:                                                ; preds = %4
  %9 = getelementptr inbounds i8, ptr %7, i64 8
  %10 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH8RefConstINS_15RagdollSettingsEEaSEPKS1_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull %0)
  %11 = getelementptr inbounds i8, ptr %7, i64 16
  %12 = getelementptr inbounds i8, ptr %0, i64 16
  %13 = tail call noundef i64 @_ZNK3JPH5ArrayINS_15RagdollSettings4PartENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  tail call void @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %13)
  %14 = getelementptr inbounds i8, ptr %7, i64 40
  %15 = tail call noundef i64 @_ZNK3JPH5ArrayINS_15RagdollSettings4PartENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %16 = getelementptr inbounds i8, ptr %0, i64 40
  %17 = tail call noundef i64 @_ZNK3JPH5ArrayINS_15RagdollSettings20AdditionalConstraintENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
  %18 = add i64 %17, %15
  tail call void @_ZN3JPH5ArrayINS_3RefINS_17TwoBodyConstraintEEENS_12STLAllocatorIS3_EEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %18)
  %19 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH13PhysicsSystem16GetBodyInterfaceEv(ptr noundef nonnull align 16 dereferenceable(1172) %3)
  %20 = tail call noundef i64 @_ZNK3JPH5ArrayINS_15RagdollSettings4PartENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %21 = shl i64 %20, 3
  %22 = alloca i8, i64 %21, align 16
  %23 = tail call noundef ptr @_ZNK3JPH5ArrayINS_15RagdollSettings4PartENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %24 = tail call noundef ptr @_ZNK3JPH5ArrayINS_15RagdollSettings4PartENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %.not71 = icmp eq ptr %23, %24
  br i1 %.not71, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %8
  %25 = getelementptr inbounds i8, ptr %0, i64 8
  br label %28

26:                                               ; preds = %4
  %27 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN3JPH7RagdolldlEPv(ptr noundef %7) #8
  br label %77

28:                                               ; preds = %.lr.ph, %52
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %52 ]
  %.06272 = phi ptr [ %23, %.lr.ph ], [ %54, %52 ]
  %29 = call noundef ptr @_ZN3JPH13BodyInterface10CreateBodyERKNS_20BodyCreationSettingsE(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 16 dereferenceable(256) %.06272)
  %.not66 = icmp eq ptr %29, null
  br i1 %.not66, label %55, label %30

30:                                               ; preds = %28
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN3JPH4Body17GetCollisionGroupEv(ptr noundef nonnull align 16 dereferenceable(122) %29)
  call void @_ZN3JPH14CollisionGroup10SetGroupIDEj(ptr noundef nonnull align 8 dereferenceable(16) %31, i32 noundef %1)
  call void @_ZN3JPH4Body11SetUserDataEm(ptr noundef nonnull align 16 dereferenceable(122) %29, i64 noundef %2)
  %32 = getelementptr inbounds ptr, ptr %22, i64 %indvars.iv
  store ptr %29, ptr %32, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %.06272, i64 256
  %34 = call noundef zeroext i1 @_ZNK3JPH3RefINS_25TwoBodyConstraintSettingsEEneEPKS1_(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef null)
  br i1 %34, label %35, label %52

35:                                               ; preds = %30
  %36 = call noundef ptr @_ZNK3JPH3RefINS_8SkeletonEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %25)
  %37 = trunc nuw nsw i64 %indvars.iv to i32
  %38 = call noundef nonnull align 8 dereferenceable(68) ptr @_ZN3JPH8Skeleton8GetJointEi(ptr noundef nonnull align 8 dereferenceable(32) %36, i32 noundef %37)
  %39 = getelementptr inbounds i8, ptr %38, i64 64
  %40 = load i32, ptr %39, align 8, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds ptr, ptr %22, i64 %41
  %43 = load ptr, ptr %42, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %44 = call noundef ptr @_ZNK3JPH3RefINS_25TwoBodyConstraintSettingsEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %33)
  %45 = load ptr, ptr %44, align 8, !tbaa !15
  %46 = getelementptr inbounds i8, ptr %45, i64 48
  %47 = load ptr, ptr %46, align 8
  %48 = call noundef ptr %47(ptr noundef nonnull align 8 dereferenceable(40) %44, ptr noundef nonnull align 16 dereferenceable(122) %43, ptr noundef nonnull align 16 dereferenceable(122) %29)
  call void @_ZN3JPH3RefINS_17TwoBodyConstraintEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef %48)
  invoke void @_ZN3JPH5ArrayINS_3RefINS_17TwoBodyConstraintEEENS_12STLAllocatorIS3_EEE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %49 unwind label %50

49:                                               ; preds = %35
  call void @_ZN3JPH3RefINS_17TwoBodyConstraintEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  br label %52

50:                                               ; preds = %35
  %51 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3JPH3RefINS_17TwoBodyConstraintEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  br label %77

52:                                               ; preds = %49, %30
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122) %29)
  call void @_ZN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 4 dereferenceable(4) %53)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %54 = getelementptr inbounds i8, ptr %.06272, i64 272
  %.not = icmp eq ptr %54, %24
  br i1 %.not, label %.critedge, label %28

55:                                               ; preds = %28
  call void @_ZN3JPH7RagdollD1Ev(ptr noundef nonnull align 8 dereferenceable(72) %7) #8
  call void @_ZN3JPH7RagdolldlEPv(ptr noundef nonnull %7) #8
  br label %.loopexit

.critedge:                                        ; preds = %52, %8
  %56 = call noundef ptr @_ZNK3JPH5ArrayINS_15RagdollSettings20AdditionalConstraintENS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
  %57 = call noundef ptr @_ZNK3JPH5ArrayINS_15RagdollSettings20AdditionalConstraintENS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
  %.not6774 = icmp eq ptr %56, %57
  br i1 %.not6774, label %.loopexit, label %.lr.ph76

.lr.ph76:                                         ; preds = %.critedge, %73
  %.06175 = phi ptr [ %74, %73 ], [ %56, %.critedge ]
  %58 = load i32, ptr %.06175, align 8, !tbaa !17
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds ptr, ptr %22, i64 %59
  %61 = load ptr, ptr %60, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %.06175, i64 4
  %63 = load i32, ptr %62, align 4, !tbaa !17
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds ptr, ptr %22, i64 %64
  %66 = load ptr, ptr %65, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  %67 = getelementptr inbounds i8, ptr %.06175, i64 8
  %68 = call noundef ptr @_ZNK3JPH3RefINS_25TwoBodyConstraintSettingsEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %67)
  %69 = load ptr, ptr %68, align 8, !tbaa !15
  %70 = getelementptr inbounds i8, ptr %69, i64 48
  %71 = load ptr, ptr %70, align 8
  %72 = call noundef ptr %71(ptr noundef nonnull align 8 dereferenceable(40) %68, ptr noundef nonnull align 16 dereferenceable(122) %61, ptr noundef nonnull align 16 dereferenceable(122) %66)
  call void @_ZN3JPH3RefINS_17TwoBodyConstraintEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef %72)
  invoke void @_ZN3JPH5ArrayINS_3RefINS_17TwoBodyConstraintEEENS_12STLAllocatorIS3_EEE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %73 unwind label %75

73:                                               ; preds = %.lr.ph76
  call void @_ZN3JPH3RefINS_17TwoBodyConstraintEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  %74 = getelementptr inbounds i8, ptr %.06175, i64 16
  %.not67 = icmp eq ptr %74, %57
  br i1 %.not67, label %.loopexit, label %.lr.ph76

75:                                               ; preds = %.lr.ph76
  %76 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3JPH3RefINS_17TwoBodyConstraintEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  br label %77

.loopexit:                                        ; preds = %73, %.critedge, %55
  %.3 = phi ptr [ null, %55 ], [ %7, %.critedge ], [ %7, %73 ]
  ret ptr %.3

77:                                               ; preds = %50, %75, %26
  %.pn.pn = phi { ptr, i32 } [ %27, %26 ], [ %76, %75 ], [ %51, %50 ]
  resume { ptr, i32 } %.pn.pn
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef ptr @_ZN3JPH7RagdollnwEm(i64 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH7RagdolldlEPv(ptr noundef) local_unnamed_addr #4 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH13PhysicsSystem16GetBodyInterfaceEv(ptr noundef nonnull align 16 dereferenceable(1172)) local_unnamed_addr #6 align 2

declare noundef ptr @_ZN3JPH13BodyInterface10CreateBodyERKNS_20BodyCreationSettingsE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 16 dereferenceable(256)) local_unnamed_addr #7

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN3JPH4Body17GetCollisionGroupEv(ptr noundef nonnull align 16 dereferenceable(122)) local_unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH14CollisionGroup10SetGroupIDEj(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH4Body11SetUserDataEm(ptr noundef nonnull align 16 dereferenceable(122), i64 noundef) local_unnamed_addr #6 align 2

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

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

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

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

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

declare void @_ZN3JPH7RagdollD1Ev(ptr) local_unnamed_addr

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 = { alwaysinline 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 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { "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 #8 = { 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, !14, i64 64}
!10 = !{!"_ZTSN3JPH8Skeleton5JointE", !11, i64 0, !11, i64 32, !14, i64 64}
!11 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEEE", !12, i64 0, !13, i64 8, !7, i64 16}
!12 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEE12_Alloc_hiderE", !6, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !8, i64 0}
!17 = !{!14, !14, i64 0}


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