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

; 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::Vec3" = type { %union.anon.0 }
%union.anon.0 = type { <4 x float> }
%"class.JPH::SoftBodyMotionProperties" = type <{ %"class.JPH::MotionProperties.base", [2 x i8], %"class.JPH::RefConst", %"class.JPH::Array", %"class.JPH::Array.1", %"class.JPH::Array.4", %"class.JPH::Array.7", %"class.JPH::AABox", %"class.JPH::AABox", i32, i32, float, float, i8, %"struct.std::atomic", i8, i8, [12 x i8] }>
%"class.JPH::MotionProperties.base" = type <{ %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Quat", %"class.JPH::Float3", %"class.JPH::Float3", float, float, float, float, float, float, i32, i32, i8, i8, i8, i8, i8, [3 x i8], [3 x %"class.JPH::Sphere"], float, i8, i8 }>
%"class.JPH::Quat" = type { %"class.JPH::Vec4" }
%"class.JPH::Vec4" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::Float3" = type { float, float, float }
%"class.JPH::Sphere" = type { %"class.JPH::Float3", float }
%"class.JPH::RefConst" = type { ptr }
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::Array.1" = type { i64, i64, ptr }
%"class.JPH::Array.4" = type { i64, i64, ptr }
%"class.JPH::Array.7" = type { i64, i64, ptr }
%"class.JPH::AABox" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i8 }
%"class.JPH::SoftBodySharedSettings" = type { %"class.JPH::RefTarget", %"class.JPH::Array.13", %"class.JPH::Array.16", %"class.JPH::Array.19", %"class.JPH::Array.22", %"class.JPH::Array.25", %"class.JPH::Array.28", %"class.JPH::Array.31", %"class.JPH::Array.34", %"class.JPH::Array.37", float, %"class.JPH::Array.40", %"class.JPH::Array.43", %"class.JPH::Array.46" }
%"class.JPH::RefTarget" = type { %"struct.std::atomic.11" }
%"struct.std::atomic.11" = type { %"struct.std::__atomic_base.12" }
%"struct.std::__atomic_base.12" = type { i32 }
%"class.JPH::Array.13" = type { i64, i64, ptr }
%"class.JPH::Array.16" = type { i64, i64, ptr }
%"class.JPH::Array.19" = type { i64, i64, ptr }
%"class.JPH::Array.22" = type { i64, i64, ptr }
%"class.JPH::Array.25" = type { i64, i64, ptr }
%"class.JPH::Array.28" = type { i64, i64, ptr }
%"class.JPH::Array.31" = type { i64, i64, ptr }
%"class.JPH::Array.34" = type { i64, i64, ptr }
%"class.JPH::Array.37" = type { i64, i64, ptr }
%"class.JPH::Array.40" = type { i64, i64, ptr }
%"class.JPH::Array.43" = type { i64, i64, ptr }
%"class.JPH::Array.46" = type { i64, i64, ptr }
%"class.JPH::SoftBodyUpdateContext" = type <{ ptr, ptr, ptr, ptr, %"class.JPH::Mat44", %"class.JPH::Vec3", %"class.JPH::Vec3", float, float, %"struct.std::atomic.49", %"struct.std::atomic.11", %"struct.std::atomic.11", %"struct.std::atomic.11", %"struct.std::atomic.11", %"struct.std::atomic.11", %"struct.std::atomic.11", %"struct.std::atomic.11", [8 x i8], %"class.JPH::Vec3", i32, [12 x i8] }>
%"class.JPH::Mat44" = type { [4 x %"class.JPH::Vec4"] }
%"struct.std::atomic.49" = type { i32 }
%"class.JPH::SoftBodySharedSettings::Skinned" = type { i32, [4 x %"class.JPH::SoftBodySharedSettings::SkinWeight"], float, float, float, i32 }
%"class.JPH::SoftBodySharedSettings::SkinWeight" = type { i32, float }
%"class.JPH::SoftBodyVertex" = type { %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Plane", i32, i8, float, float }
%"class.JPH::Plane" = type { %"class.JPH::Vec4" }
%"struct.JPH::SoftBodyMotionProperties::SkinState" = type { %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3" }

; 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZN3JPH6SquareIfEET_S1_(float noundef) #2

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

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

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef, double, double) #4

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) #4 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3mlEf(ptr noundef nonnull align 16 dereferenceable(16), float noundef) #4 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) #4 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK3JPH4Vec38LengthSqEv(ptr noundef nonnull align 16 dereferenceable(16)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4sqrtf(float noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH24SoftBodyMotionProperties20ApplySkinConstraintsERKNS_21SoftBodyUpdateContextEjj(ptr noundef nonnull align 16 dereferenceable(372) %0, ptr noundef nonnull align 16 dereferenceable(196) %1, i32 noundef %2, i32 noundef %3) #5 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca float, align 4
  %18 = alloca %"class.JPH::Vec3", align 16
  %19 = alloca %"class.JPH::Vec3", align 16
  %20 = alloca %"class.JPH::Vec3", align 16
  %21 = alloca %"class.JPH::Vec3", align 16
  %22 = alloca %"class.JPH::Vec3", align 16
  %23 = alloca %"class.JPH::Vec3", align 16
  %24 = alloca %"class.JPH::Vec3", align 16
  %25 = alloca %"class.JPH::Vec3", align 16
  %26 = alloca %"class.JPH::Vec3", align 16
  %27 = alloca float, align 4
  %28 = alloca float, align 4
  %29 = alloca %"class.JPH::Vec3", align 16
  %30 = alloca %"class.JPH::Vec3", align 16
  %31 = alloca %"class.JPH::Vec3", align 16
  %32 = alloca %"class.JPH::Vec3", align 16
  %33 = alloca %"class.JPH::Vec3", align 16
  %34 = alloca float, align 4
  %35 = alloca float, align 4
  %36 = alloca %"class.JPH::Vec3", align 16
  %37 = alloca %"class.JPH::Vec3", align 16
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !9
  %38 = load ptr, ptr %5, align 8
  %39 = getelementptr inbounds %"class.JPH::SoftBodyMotionProperties", ptr %38, i32 0, i32 2
  %40 = call noundef ptr @_ZNK3JPH8RefConstINS_22SoftBodySharedSettingsEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %39)
  %41 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings", ptr %40, i32 0, i32 6
  %42 = call noundef zeroext i1 @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings7SkinnedENS_12STLAllocatorIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %41)
  br i1 %42, label %47, label %43

43:                                               ; preds = %4
  %44 = getelementptr inbounds %"class.JPH::SoftBodyMotionProperties", ptr %38, i32 0, i32 15
  %45 = load i8, ptr %44, align 2, !tbaa !11, !range !33, !noundef !34
  %46 = trunc i8 %45 to i1
  br i1 %46, label %48, label %47

47:                                               ; preds = %43, %4
  br label %318

48:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %49 = getelementptr inbounds %"class.JPH::SoftBodyMotionProperties", ptr %38, i32 0, i32 16
  %50 = load i8, ptr %49, align 1, !tbaa !35, !range !33, !noundef !34
  %51 = trunc i8 %50 to i1
  br i1 %51, label %52, label %61

52:                                               ; preds = %48
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = getelementptr inbounds %"class.JPH::SoftBodyUpdateContext", ptr %53, i32 0, i32 14
  %55 = call noundef i32 @_ZNKSt13__atomic_baseIjE4loadESt12memory_order(ptr noundef nonnull align 4 dereferenceable(4) %54, i32 noundef 0) #6
  %56 = uitofp i32 %55 to float
  %57 = getelementptr inbounds %"class.JPH::SoftBodyMotionProperties", ptr %38, i32 0, i32 9
  %58 = load i32, ptr %57, align 16, !tbaa !36
  %59 = uitofp i32 %58 to float
  %60 = fdiv float %56, %59
  br label %62

61:                                               ; preds = %48
  br label %62

62:                                               ; preds = %61, %52
  %63 = phi float [ %60, %52 ], [ 1.000000e+00, %61 ]
  store float %63, ptr %9, align 4, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %64 = load float, ptr %9, align 4, !tbaa !37
  %65 = fsub float 1.000000e+00, %64
  store float %65, ptr %10, align 4, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %66 = getelementptr inbounds %"class.JPH::SoftBodyMotionProperties", ptr %38, i32 0, i32 3
  %67 = call noundef ptr @_ZN3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %66)
  store ptr %67, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %68 = getelementptr inbounds %"class.JPH::SoftBodyMotionProperties", ptr %38, i32 0, i32 6
  %69 = call noundef ptr @_ZN3JPH5ArrayINS_24SoftBodyMotionProperties9SkinStateENS_12STLAllocatorIS2_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %68)
  store ptr %69, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %70 = getelementptr inbounds %"class.JPH::SoftBodyMotionProperties", ptr %38, i32 0, i32 2
  %71 = call noundef ptr @_ZNK3JPH8RefConstINS_22SoftBodySharedSettingsEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %70)
  %72 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings", ptr %71, i32 0, i32 6
  %73 = call noundef ptr @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings7SkinnedENS_12STLAllocatorIS2_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %72)
  %74 = load i32, ptr %7, align 4, !tbaa !9
  %75 = zext i32 %74 to i64
  %76 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings::Skinned", ptr %73, i64 %75
  store ptr %76, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %77 = getelementptr inbounds %"class.JPH::SoftBodyMotionProperties", ptr %38, i32 0, i32 2
  %78 = call noundef ptr @_ZNK3JPH8RefConstINS_22SoftBodySharedSettingsEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %77)
  %79 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings", ptr %78, i32 0, i32 6
  %80 = call noundef ptr @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings7SkinnedENS_12STLAllocatorIS2_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %79)
  %81 = load i32, ptr %8, align 4, !tbaa !9
  %82 = zext i32 %81 to i64
  %83 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings::Skinned", ptr %80, i64 %82
  store ptr %83, ptr %14, align 8, !tbaa !5
  br label %84

84:                                               ; preds = %314, %62
  %85 = load ptr, ptr %13, align 8, !tbaa !5
  %86 = load ptr, ptr %14, align 8, !tbaa !5
  %87 = icmp ult ptr %85, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %317

89:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %90 = load ptr, ptr %11, align 8, !tbaa !5
  %91 = load ptr, ptr %13, align 8, !tbaa !5
  %92 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings::Skinned", ptr %91, i32 0, i32 0
  %93 = load i32, ptr %92, align 4, !tbaa !38
  %94 = zext i32 %93 to i64
  %95 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %90, i64 %94
  store ptr %95, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %96 = load ptr, ptr %12, align 8, !tbaa !5
  %97 = load ptr, ptr %13, align 8, !tbaa !5
  %98 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings::Skinned", ptr %97, i32 0, i32 0
  %99 = load i32, ptr %98, align 4, !tbaa !38
  %100 = zext i32 %99 to i64
  %101 = getelementptr inbounds %"struct.JPH::SoftBodyMotionProperties::SkinState", ptr %96, i64 %100
  store ptr %101, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %102 = load ptr, ptr %13, align 8, !tbaa !5
  %103 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings::Skinned", ptr %102, i32 0, i32 2
  %104 = load float, ptr %103, align 4, !tbaa !40
  %105 = getelementptr inbounds %"class.JPH::SoftBodyMotionProperties", ptr %38, i32 0, i32 12
  %106 = load float, ptr %105, align 4, !tbaa !41
  %107 = fmul float %104, %106
  store float %107, ptr %17, align 4, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #6
  %108 = load float, ptr %10, align 4, !tbaa !37
  %109 = load ptr, ptr %16, align 8, !tbaa !5
  %110 = getelementptr inbounds %"struct.JPH::SoftBodyMotionProperties::SkinState", ptr %109, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %20, ptr align 16 %110, i64 16, i1 false), !tbaa.struct !42
  %111 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %112 = load double, ptr %111, align 16
  %113 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %114 = load double, ptr %113, align 8
  %115 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %108, double %112, double %114)
  %116 = getelementptr inbounds %"class.JPH::Vec3", ptr %19, i32 0, i32 0
  %117 = getelementptr inbounds %union.anon.0, ptr %116, i32 0, i32 0
  %118 = getelementptr inbounds { double, double }, ptr %117, i32 0, i32 0
  %119 = extractvalue { double, double } %115, 0
  store double %119, ptr %118, align 16
  %120 = getelementptr inbounds { double, double }, ptr %117, i32 0, i32 1
  %121 = extractvalue { double, double } %115, 1
  store double %121, ptr %120, align 8
  %122 = load float, ptr %9, align 4, !tbaa !37
  %123 = load ptr, ptr %16, align 8, !tbaa !5
  %124 = getelementptr inbounds %"struct.JPH::SoftBodyMotionProperties::SkinState", ptr %123, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %22, ptr align 16 %124, i64 16, i1 false), !tbaa.struct !42
  %125 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 0
  %126 = load double, ptr %125, align 16
  %127 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 1
  %128 = load double, ptr %127, align 8
  %129 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %122, double %126, double %128)
  %130 = getelementptr inbounds %"class.JPH::Vec3", ptr %21, i32 0, i32 0
  %131 = getelementptr inbounds %union.anon.0, ptr %130, i32 0, i32 0
  %132 = getelementptr inbounds { double, double }, ptr %131, i32 0, i32 0
  %133 = extractvalue { double, double } %129, 0
  store double %133, ptr %132, align 16
  %134 = getelementptr inbounds { double, double }, ptr %131, i32 0, i32 1
  %135 = extractvalue { double, double } %129, 1
  store double %135, ptr %134, align 8
  %136 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 0
  %137 = load double, ptr %136, align 16
  %138 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 1
  %139 = load double, ptr %138, align 8
  %140 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %19, double %137, double %139)
  %141 = getelementptr inbounds %"class.JPH::Vec3", ptr %18, i32 0, i32 0
  %142 = getelementptr inbounds %union.anon.0, ptr %141, i32 0, i32 0
  %143 = getelementptr inbounds { double, double }, ptr %142, i32 0, i32 0
  %144 = extractvalue { double, double } %140, 0
  store double %144, ptr %143, align 16
  %145 = getelementptr inbounds { double, double }, ptr %142, i32 0, i32 1
  %146 = extractvalue { double, double } %140, 1
  store double %146, ptr %145, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #6
  %147 = load float, ptr %17, align 4, !tbaa !37
  %148 = fcmp ogt float %147, 0.000000e+00
  br i1 %148, label %149, label %310

149:                                              ; preds = %89
  %150 = load ptr, ptr %13, align 8, !tbaa !5
  %151 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings::Skinned", ptr %150, i32 0, i32 3
  %152 = load float, ptr %151, align 4, !tbaa !44
  %153 = load float, ptr %17, align 4, !tbaa !37
  %154 = fcmp olt float %152, %153
  br i1 %154, label %155, label %260

155:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #6
  %156 = load ptr, ptr %16, align 8, !tbaa !5
  %157 = getelementptr inbounds %"struct.JPH::SoftBodyMotionProperties::SkinState", ptr %156, i32 0, i32 2
  %158 = load ptr, ptr %13, align 8, !tbaa !5
  %159 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings::Skinned", ptr %158, i32 0, i32 3
  %160 = load float, ptr %159, align 4, !tbaa !44
  %161 = load ptr, ptr %13, align 8, !tbaa !5
  %162 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings::Skinned", ptr %161, i32 0, i32 4
  %163 = load float, ptr %162, align 4, !tbaa !45
  %164 = fadd float %160, %163
  %165 = call { double, double } @_ZNK3JPH4Vec3mlEf(ptr noundef nonnull align 16 dereferenceable(16) %157, float noundef %164)
  %166 = getelementptr inbounds %"class.JPH::Vec3", ptr %24, i32 0, i32 0
  %167 = getelementptr inbounds %union.anon.0, ptr %166, i32 0, i32 0
  %168 = getelementptr inbounds { double, double }, ptr %167, i32 0, i32 0
  %169 = extractvalue { double, double } %165, 0
  store double %169, ptr %168, align 16
  %170 = getelementptr inbounds { double, double }, ptr %167, i32 0, i32 1
  %171 = extractvalue { double, double } %165, 1
  store double %171, ptr %170, align 8
  %172 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 0
  %173 = load double, ptr %172, align 16
  %174 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 1
  %175 = load double, ptr %174, align 8
  %176 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %18, double %173, double %175)
  %177 = getelementptr inbounds %"class.JPH::Vec3", ptr %23, i32 0, i32 0
  %178 = getelementptr inbounds %union.anon.0, ptr %177, i32 0, i32 0
  %179 = getelementptr inbounds { double, double }, ptr %178, i32 0, i32 0
  %180 = extractvalue { double, double } %176, 0
  store double %180, ptr %179, align 16
  %181 = getelementptr inbounds { double, double }, ptr %178, i32 0, i32 1
  %182 = extractvalue { double, double } %176, 1
  store double %182, ptr %181, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %25) #6
  %183 = load ptr, ptr %15, align 8, !tbaa !5
  %184 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %183, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %26, ptr align 16 %23, i64 16, i1 false), !tbaa.struct !42
  %185 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 0
  %186 = load double, ptr %185, align 16
  %187 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 1
  %188 = load double, ptr %187, align 8
  %189 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %184, double %186, double %188)
  %190 = getelementptr inbounds %"class.JPH::Vec3", ptr %25, i32 0, i32 0
  %191 = getelementptr inbounds %union.anon.0, ptr %190, i32 0, i32 0
  %192 = getelementptr inbounds { double, double }, ptr %191, i32 0, i32 0
  %193 = extractvalue { double, double } %189, 0
  store double %193, ptr %192, align 16
  %194 = getelementptr inbounds { double, double }, ptr %191, i32 0, i32 1
  %195 = extractvalue { double, double } %189, 1
  store double %195, ptr %194, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  %196 = call noundef float @_ZNK3JPH4Vec38LengthSqEv(ptr noundef nonnull align 16 dereferenceable(16) %25)
  store float %196, ptr %27, align 4, !tbaa !37
  %197 = load float, ptr %27, align 4, !tbaa !37
  %198 = load ptr, ptr %13, align 8, !tbaa !5
  %199 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings::Skinned", ptr %198, i32 0, i32 4
  %200 = load float, ptr %199, align 4, !tbaa !45
  %201 = call noundef float @_ZN3JPH6SquareIfEET_S1_(float noundef %200)
  %202 = fcmp olt float %197, %201
  br i1 %202, label %203, label %259

203:                                              ; preds = %155
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #6
  %204 = load float, ptr %27, align 4, !tbaa !37
  %205 = call noundef float @_ZSt4sqrtf(float noundef %204)
  store float %205, ptr %28, align 4, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 16, ptr %29) #6
  %206 = load float, ptr %28, align 4, !tbaa !37
  %207 = fcmp ogt float %206, 0.000000e+00
  br i1 %207, label %208, label %232

208:                                              ; preds = %203
  %209 = load ptr, ptr %13, align 8, !tbaa !5
  %210 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings::Skinned", ptr %209, i32 0, i32 4
  %211 = load float, ptr %210, align 4, !tbaa !45
  %212 = load float, ptr %28, align 4, !tbaa !37
  %213 = fdiv float %211, %212
  %214 = call { double, double } @_ZNK3JPH4Vec3mlEf(ptr noundef nonnull align 16 dereferenceable(16) %25, float noundef %213)
  %215 = getelementptr inbounds %"class.JPH::Vec3", ptr %30, i32 0, i32 0
  %216 = getelementptr inbounds %union.anon.0, ptr %215, i32 0, i32 0
  %217 = getelementptr inbounds { double, double }, ptr %216, i32 0, i32 0
  %218 = extractvalue { double, double } %214, 0
  store double %218, ptr %217, align 16
  %219 = getelementptr inbounds { double, double }, ptr %216, i32 0, i32 1
  %220 = extractvalue { double, double } %214, 1
  store double %220, ptr %219, align 8
  %221 = getelementptr inbounds { double, double }, ptr %30, i32 0, i32 0
  %222 = load double, ptr %221, align 16
  %223 = getelementptr inbounds { double, double }, ptr %30, i32 0, i32 1
  %224 = load double, ptr %223, align 8
  %225 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %23, double %222, double %224)
  %226 = getelementptr inbounds %"class.JPH::Vec3", ptr %29, i32 0, i32 0
  %227 = getelementptr inbounds %union.anon.0, ptr %226, i32 0, i32 0
  %228 = getelementptr inbounds { double, double }, ptr %227, i32 0, i32 0
  %229 = extractvalue { double, double } %225, 0
  store double %229, ptr %228, align 16
  %230 = getelementptr inbounds { double, double }, ptr %227, i32 0, i32 1
  %231 = extractvalue { double, double } %225, 1
  store double %231, ptr %230, align 8
  br label %256

232:                                              ; preds = %203
  %233 = load ptr, ptr %16, align 8, !tbaa !5
  %234 = getelementptr inbounds %"struct.JPH::SoftBodyMotionProperties::SkinState", ptr %233, i32 0, i32 2
  %235 = load ptr, ptr %13, align 8, !tbaa !5
  %236 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings::Skinned", ptr %235, i32 0, i32 4
  %237 = load float, ptr %236, align 4, !tbaa !45
  %238 = call { double, double } @_ZNK3JPH4Vec3mlEf(ptr noundef nonnull align 16 dereferenceable(16) %234, float noundef %237)
  %239 = getelementptr inbounds %"class.JPH::Vec3", ptr %31, i32 0, i32 0
  %240 = getelementptr inbounds %union.anon.0, ptr %239, i32 0, i32 0
  %241 = getelementptr inbounds { double, double }, ptr %240, i32 0, i32 0
  %242 = extractvalue { double, double } %238, 0
  store double %242, ptr %241, align 16
  %243 = getelementptr inbounds { double, double }, ptr %240, i32 0, i32 1
  %244 = extractvalue { double, double } %238, 1
  store double %244, ptr %243, align 8
  %245 = getelementptr inbounds { double, double }, ptr %31, i32 0, i32 0
  %246 = load double, ptr %245, align 16
  %247 = getelementptr inbounds { double, double }, ptr %31, i32 0, i32 1
  %248 = load double, ptr %247, align 8
  %249 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %23, double %246, double %248)
  %250 = getelementptr inbounds %"class.JPH::Vec3", ptr %29, i32 0, i32 0
  %251 = getelementptr inbounds %union.anon.0, ptr %250, i32 0, i32 0
  %252 = getelementptr inbounds { double, double }, ptr %251, i32 0, i32 0
  %253 = extractvalue { double, double } %249, 0
  store double %253, ptr %252, align 16
  %254 = getelementptr inbounds { double, double }, ptr %251, i32 0, i32 1
  %255 = extractvalue { double, double } %249, 1
  store double %255, ptr %254, align 8
  br label %256

256:                                              ; preds = %232, %208
  %257 = load ptr, ptr %15, align 8, !tbaa !5
  %258 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %257, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %258, ptr align 16 %29, i64 16, i1 false), !tbaa.struct !42
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #6
  br label %259

259:                                              ; preds = %256, %155
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #6
  br label %260

260:                                              ; preds = %259, %149
  %261 = load float, ptr %17, align 4, !tbaa !37
  %262 = fcmp olt float %261, 0x47EFFFFFE0000000
  br i1 %262, label %263, label %309

263:                                              ; preds = %260
  call void @llvm.lifetime.start.p0(i64 16, ptr %32) #6
  %264 = load ptr, ptr %15, align 8, !tbaa !5
  %265 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %264, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %33, ptr align 16 %18, i64 16, i1 false), !tbaa.struct !42
  %266 = getelementptr inbounds { double, double }, ptr %33, i32 0, i32 0
  %267 = load double, ptr %266, align 16
  %268 = getelementptr inbounds { double, double }, ptr %33, i32 0, i32 1
  %269 = load double, ptr %268, align 8
  %270 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %265, double %267, double %269)
  %271 = getelementptr inbounds %"class.JPH::Vec3", ptr %32, i32 0, i32 0
  %272 = getelementptr inbounds %union.anon.0, ptr %271, i32 0, i32 0
  %273 = getelementptr inbounds { double, double }, ptr %272, i32 0, i32 0
  %274 = extractvalue { double, double } %270, 0
  store double %274, ptr %273, align 16
  %275 = getelementptr inbounds { double, double }, ptr %272, i32 0, i32 1
  %276 = extractvalue { double, double } %270, 1
  store double %276, ptr %275, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #6
  %277 = call noundef float @_ZNK3JPH4Vec38LengthSqEv(ptr noundef nonnull align 16 dereferenceable(16) %32)
  store float %277, ptr %34, align 4, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #6
  %278 = load float, ptr %17, align 4, !tbaa !37
  %279 = call noundef float @_ZN3JPH6SquareIfEET_S1_(float noundef %278)
  store float %279, ptr %35, align 4, !tbaa !37
  %280 = load float, ptr %34, align 4, !tbaa !37
  %281 = load float, ptr %35, align 4, !tbaa !37
  %282 = fcmp ogt float %280, %281
  br i1 %282, label %283, label %308

283:                                              ; preds = %263
  call void @llvm.lifetime.start.p0(i64 16, ptr %36) #6
  %284 = load float, ptr %35, align 4, !tbaa !37
  %285 = load float, ptr %34, align 4, !tbaa !37
  %286 = fdiv float %284, %285
  %287 = call noundef float @_ZSt4sqrtf(float noundef %286)
  %288 = call { double, double } @_ZNK3JPH4Vec3mlEf(ptr noundef nonnull align 16 dereferenceable(16) %32, float noundef %287)
  %289 = getelementptr inbounds %"class.JPH::Vec3", ptr %37, i32 0, i32 0
  %290 = getelementptr inbounds %union.anon.0, ptr %289, i32 0, i32 0
  %291 = getelementptr inbounds { double, double }, ptr %290, i32 0, i32 0
  %292 = extractvalue { double, double } %288, 0
  store double %292, ptr %291, align 16
  %293 = getelementptr inbounds { double, double }, ptr %290, i32 0, i32 1
  %294 = extractvalue { double, double } %288, 1
  store double %294, ptr %293, align 8
  %295 = getelementptr inbounds { double, double }, ptr %37, i32 0, i32 0
  %296 = load double, ptr %295, align 16
  %297 = getelementptr inbounds { double, double }, ptr %37, i32 0, i32 1
  %298 = load double, ptr %297, align 8
  %299 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %18, double %296, double %298)
  %300 = getelementptr inbounds %"class.JPH::Vec3", ptr %36, i32 0, i32 0
  %301 = getelementptr inbounds %union.anon.0, ptr %300, i32 0, i32 0
  %302 = getelementptr inbounds { double, double }, ptr %301, i32 0, i32 0
  %303 = extractvalue { double, double } %299, 0
  store double %303, ptr %302, align 16
  %304 = getelementptr inbounds { double, double }, ptr %301, i32 0, i32 1
  %305 = extractvalue { double, double } %299, 1
  store double %305, ptr %304, align 8
  %306 = load ptr, ptr %15, align 8, !tbaa !5
  %307 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %306, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %307, ptr align 16 %36, i64 16, i1 false), !tbaa.struct !42
  call void @llvm.lifetime.end.p0(i64 16, ptr %36) #6
  br label %308

308:                                              ; preds = %283, %263
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %32) #6
  br label %309

309:                                              ; preds = %308, %260
  br label %313

310:                                              ; preds = %89
  %311 = load ptr, ptr %15, align 8, !tbaa !5
  %312 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %311, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %312, ptr align 16 %18, i64 16, i1 false), !tbaa.struct !42
  br label %313

313:                                              ; preds = %310, %309
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %314

314:                                              ; preds = %313
  %315 = load ptr, ptr %13, align 8, !tbaa !5
  %316 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings::Skinned", ptr %315, i32 1
  store ptr %316, ptr %13, align 8, !tbaa !5
  br label %84, !llvm.loop !46

317:                                              ; preds = %88
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %318

318:                                              ; preds = %317, %47
  ret void
}

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNKSt13__atomic_baseIjE4loadESt12memory_order(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #2 align 2

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 = { 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 = { 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, !20, i64 370}
!12 = !{!"_ZTSN3JPH24SoftBodyMotionPropertiesE", !13, i64 0, !24, i64 184, !25, i64 192, !27, i64 216, !28, i64 240, !29, i64 264, !30, i64 288, !30, i64 320, !10, i64 352, !10, i64 356, !18, i64 360, !18, i64 364, !20, i64 368, !31, i64 369, !20, i64 370, !20, i64 371}
!13 = !{!"_ZTSN3JPH16MotionPropertiesE", !14, i64 0, !14, i64 16, !14, i64 32, !15, i64 48, !17, i64 64, !17, i64 76, !18, i64 88, !18, i64 92, !18, i64 96, !18, i64 100, !18, i64 104, !18, i64 108, !10, i64 112, !10, i64 116, !19, i64 120, !20, i64 121, !21, i64 122, !7, i64 123, !7, i64 124, !7, i64 128, !18, i64 176, !22, i64 180, !23, i64 181}
!14 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!15 = !{!"_ZTSN3JPH4QuatE", !16, i64 0}
!16 = !{!"_ZTSN3JPH4Vec4E", !7, i64 0}
!17 = !{!"_ZTSN3JPH6Float3E", !18, i64 0, !18, i64 4, !18, i64 8}
!18 = !{!"float", !7, i64 0}
!19 = !{!"_ZTSN3JPH14EMotionQualityE", !7, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = !{!"_ZTSN3JPH12EAllowedDOFsE", !7, i64 0}
!22 = !{!"_ZTSN3JPH9EBodyTypeE", !7, i64 0}
!23 = !{!"_ZTSN3JPH11EMotionTypeE", !7, i64 0}
!24 = !{!"_ZTSN3JPH8RefConstINS_22SoftBodySharedSettingsEEE", !6, i64 0}
!25 = !{!"_ZTSN3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEEE", !26, i64 0, !26, i64 8, !6, i64 16}
!26 = !{!"long", !7, i64 0}
!27 = !{!"_ZTSN3JPH5ArrayINS_24SoftBodyMotionProperties14CollidingShapeENS_12STLAllocatorIS2_EEEE", !26, i64 0, !26, i64 8, !6, i64 16}
!28 = !{!"_ZTSN3JPH5ArrayINS_24SoftBodyMotionProperties15CollidingSensorENS_12STLAllocatorIS2_EEEE", !26, i64 0, !26, i64 8, !6, i64 16}
!29 = !{!"_ZTSN3JPH5ArrayINS_24SoftBodyMotionProperties9SkinStateENS_12STLAllocatorIS2_EEEE", !26, i64 0, !26, i64 8, !6, i64 16}
!30 = !{!"_ZTSN3JPH5AABoxE", !14, i64 0, !14, i64 16}
!31 = !{!"_ZTSSt6atomicIbE", !32, i64 0}
!32 = !{!"_ZTSSt13__atomic_baseIbE", !20, i64 0}
!33 = !{i8 0, i8 2}
!34 = !{}
!35 = !{!12, !20, i64 371}
!36 = !{!12, !10, i64 352}
!37 = !{!18, !18, i64 0}
!38 = !{!39, !10, i64 0}
!39 = !{!"_ZTSN3JPH22SoftBodySharedSettings7SkinnedE", !10, i64 0, !7, i64 4, !18, i64 36, !18, i64 40, !18, i64 44, !10, i64 48}
!40 = !{!39, !18, i64 36}
!41 = !{!12, !18, i64 364}
!42 = !{i64 0, i64 16, !43}
!43 = !{!7, !7, i64 0}
!44 = !{!39, !18, i64 40}
!45 = !{!39, !18, i64 44}
!46 = distinct !{!46, !47}
!47 = !{!"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::Vec3" = type { %union.anon.0 }
%union.anon.0 = type { <4 x float> }
%"class.JPH::SoftBodySharedSettings::Skinned" = type { i32, [4 x %"class.JPH::SoftBodySharedSettings::SkinWeight"], float, float, float, i32 }
%"class.JPH::SoftBodySharedSettings::SkinWeight" = type { i32, float }
%"class.JPH::SoftBodyVertex" = type { %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Plane", i32, i8, float, float }
%"class.JPH::Plane" = type { %"class.JPH::Vec4" }
%"class.JPH::Vec4" = type { %union.anon }
%union.anon = type { <4 x float> }
%"struct.JPH::SoftBodyMotionProperties::SkinState" = type { %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3" }

; 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZN3JPH6SquareIfEET_S1_(float noundef) local_unnamed_addr #2

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

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

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef, double, double) local_unnamed_addr #4

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) local_unnamed_addr #4 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3mlEf(ptr noundef nonnull align 16 dereferenceable(16), float noundef) local_unnamed_addr #4 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) local_unnamed_addr #4 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK3JPH4Vec38LengthSqEv(ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4sqrtf(float noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH24SoftBodyMotionProperties20ApplySkinConstraintsERKNS_21SoftBodyUpdateContextEjj(ptr noundef nonnull align 16 dereferenceable(372) %0, ptr noundef nonnull align 16 dereferenceable(196) %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #5 align 2 {
  %5 = alloca %"class.JPH::Vec3", align 16
  %6 = alloca %"class.JPH::Vec3", align 16
  %7 = alloca %"class.JPH::Vec3", align 16
  %8 = alloca %"class.JPH::Vec3", align 16
  %9 = alloca %"class.JPH::Vec3", align 16
  %10 = getelementptr inbounds i8, ptr %0, i64 184
  %11 = tail call noundef ptr @_ZNK3JPH8RefConstINS_22SoftBodySharedSettingsEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
  %12 = getelementptr inbounds i8, ptr %11, i64 128
  %13 = tail call noundef zeroext i1 @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings7SkinnedENS_12STLAllocatorIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  br i1 %13, label %.loopexit, label %14

14:                                               ; preds = %4
  %15 = getelementptr inbounds i8, ptr %0, i64 370
  %16 = load i8, ptr %15, align 2, !tbaa !5, !range !31, !noundef !32
  %17 = trunc nuw i8 %16 to i1
  br i1 %17, label %18, label %.loopexit

18:                                               ; preds = %14
  %19 = getelementptr inbounds i8, ptr %0, i64 371
  %20 = load i8, ptr %19, align 1, !tbaa !33, !range !31, !noundef !32
  %21 = trunc nuw i8 %20 to i1
  br i1 %21, label %22, label %30

22:                                               ; preds = %18
  %23 = getelementptr inbounds i8, ptr %1, i64 156
  %24 = tail call noundef i32 @_ZNKSt13__atomic_baseIjE4loadESt12memory_order(ptr noundef nonnull align 4 dereferenceable(4) %23, i32 noundef 0) #6
  %25 = uitofp i32 %24 to float
  %26 = getelementptr inbounds i8, ptr %0, i64 352
  %27 = load i32, ptr %26, align 16, !tbaa !34
  %28 = uitofp i32 %27 to float
  %29 = fdiv float %25, %28
  br label %30

30:                                               ; preds = %18, %22
  %31 = phi float [ %29, %22 ], [ 1.000000e+00, %18 ]
  %32 = fsub float 1.000000e+00, %31
  %33 = getelementptr inbounds i8, ptr %0, i64 192
  %34 = tail call noundef ptr @_ZN3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %33)
  %35 = getelementptr inbounds i8, ptr %0, i64 264
  %36 = tail call noundef ptr @_ZN3JPH5ArrayINS_24SoftBodyMotionProperties9SkinStateENS_12STLAllocatorIS2_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %35)
  %37 = tail call noundef ptr @_ZNK3JPH8RefConstINS_22SoftBodySharedSettingsEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
  %38 = getelementptr inbounds i8, ptr %37, i64 128
  %39 = tail call noundef ptr @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings7SkinnedENS_12STLAllocatorIS2_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %38)
  %40 = zext i32 %2 to i64
  %41 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings::Skinned", ptr %39, i64 %40
  %42 = tail call noundef ptr @_ZNK3JPH8RefConstINS_22SoftBodySharedSettingsEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
  %43 = getelementptr inbounds i8, ptr %42, i64 128
  %44 = tail call noundef ptr @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings7SkinnedENS_12STLAllocatorIS2_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %43)
  %45 = zext i32 %3 to i64
  %46 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings::Skinned", ptr %44, i64 %45
  %47 = icmp ult ptr %41, %46
  br i1 %47, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %30
  %48 = getelementptr inbounds i8, ptr %0, i64 364
  %49 = getelementptr inbounds i8, ptr %6, i64 8
  %50 = getelementptr inbounds i8, ptr %5, i64 8
  %51 = getelementptr inbounds i8, ptr %7, i64 8
  %52 = getelementptr inbounds i8, ptr %8, i64 8
  %53 = getelementptr inbounds i8, ptr %9, i64 8
  br label %54

54:                                               ; preds = %.lr.ph, %133
  %.065 = phi ptr [ %41, %.lr.ph ], [ %134, %133 ]
  %55 = load i32, ptr %.065, align 4, !tbaa !35
  %56 = zext i32 %55 to i64
  %57 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %34, i64 %56
  %58 = getelementptr inbounds %"struct.JPH::SoftBodyMotionProperties::SkinState", ptr %36, i64 %56
  %59 = getelementptr inbounds i8, ptr %.065, i64 36
  %60 = load float, ptr %59, align 4, !tbaa !37
  %61 = load float, ptr %48, align 4, !tbaa !38
  %62 = fmul float %60, %61
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #6
  %.sroa.024.0.copyload = load double, ptr %58, align 16
  %.sroa.225.0..sroa_idx = getelementptr inbounds i8, ptr %58, i64 8
  %.sroa.225.0.copyload = load double, ptr %.sroa.225.0..sroa_idx, align 8, !tbaa !39
  %63 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %32, double %.sroa.024.0.copyload, double %.sroa.225.0.copyload)
  %64 = extractvalue { double, double } %63, 0
  store double %64, ptr %6, align 16
  %65 = extractvalue { double, double } %63, 1
  store double %65, ptr %49, align 8
  %66 = getelementptr inbounds i8, ptr %58, i64 16
  %.sroa.020.0.copyload = load double, ptr %66, align 16
  %.sroa.221.0..sroa_idx = getelementptr inbounds i8, ptr %58, i64 24
  %.sroa.221.0.copyload = load double, ptr %.sroa.221.0..sroa_idx, align 8, !tbaa !39
  %67 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %31, double %.sroa.020.0.copyload, double %.sroa.221.0.copyload)
  %68 = extractvalue { double, double } %67, 0
  %69 = extractvalue { double, double } %67, 1
  %70 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %6, double %68, double %69)
  %71 = extractvalue { double, double } %70, 0
  store double %71, ptr %5, align 16
  %72 = extractvalue { double, double } %70, 1
  store double %72, ptr %50, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  %73 = fcmp ogt float %62, 0.000000e+00
  br i1 %73, label %74, label %131

74:                                               ; preds = %54
  %75 = getelementptr inbounds i8, ptr %.065, i64 40
  %76 = load float, ptr %75, align 4, !tbaa !40
  %77 = fcmp olt float %76, %62
  br i1 %77, label %78, label %111

78:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  %79 = getelementptr inbounds i8, ptr %58, i64 32
  %80 = getelementptr inbounds i8, ptr %.065, i64 44
  %81 = load float, ptr %80, align 4, !tbaa !41
  %82 = fadd float %76, %81
  %83 = call { double, double } @_ZNK3JPH4Vec3mlEf(ptr noundef nonnull align 16 dereferenceable(16) %79, float noundef %82)
  %84 = extractvalue { double, double } %83, 0
  %85 = extractvalue { double, double } %83, 1
  %86 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %5, double %84, double %85)
  %87 = extractvalue { double, double } %86, 0
  store double %87, ptr %7, align 16
  %88 = extractvalue { double, double } %86, 1
  store double %88, ptr %51, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #6
  %89 = getelementptr inbounds i8, ptr %57, i64 16
  %90 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %89, double %87, double %88)
  %91 = extractvalue { double, double } %90, 0
  store double %91, ptr %8, align 16
  %92 = extractvalue { double, double } %90, 1
  store double %92, ptr %52, align 8
  %93 = call noundef float @_ZNK3JPH4Vec38LengthSqEv(ptr noundef nonnull align 16 dereferenceable(16) %8)
  %94 = load float, ptr %80, align 4, !tbaa !41
  %95 = call noundef float @_ZN3JPH6SquareIfEET_S1_(float noundef %94)
  %96 = fcmp olt float %93, %95
  br i1 %96, label %97, label %110

97:                                               ; preds = %78
  %98 = call noundef float @_ZSt4sqrtf(float noundef %93)
  %99 = fcmp ogt float %98, 0.000000e+00
  %100 = load float, ptr %80, align 4, !tbaa !41
  br i1 %99, label %101, label %104

101:                                              ; preds = %97
  %102 = fdiv float %100, %98
  %103 = call { double, double } @_ZNK3JPH4Vec3mlEf(ptr noundef nonnull align 16 dereferenceable(16) %8, float noundef %102)
  br label %106

104:                                              ; preds = %97
  %105 = call { double, double } @_ZNK3JPH4Vec3mlEf(ptr noundef nonnull align 16 dereferenceable(16) %79, float noundef %100)
  br label %106

106:                                              ; preds = %104, %101
  %.sink68 = phi { double, double } [ %105, %104 ], [ %103, %101 ]
  %107 = extractvalue { double, double } %.sink68, 0
  %108 = extractvalue { double, double } %.sink68, 1
  %109 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %7, double %107, double %108)
  %.sroa.5.0 = extractvalue { double, double } %109, 1
  %.sroa.011.0 = extractvalue { double, double } %109, 0
  store double %.sroa.011.0, ptr %89, align 16
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %57, i64 24
  store double %.sroa.5.0, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !39
  br label %110

110:                                              ; preds = %106, %78
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  br label %111

111:                                              ; preds = %110, %74
  %112 = fcmp olt float %62, 0x47EFFFFFE0000000
  br i1 %112, label %113, label %133

113:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #6
  %114 = getelementptr inbounds i8, ptr %57, i64 16
  %.sroa.05.0.copyload = load double, ptr %5, align 16
  %.sroa.26.0.copyload = load double, ptr %50, align 8, !tbaa !39
  %115 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %114, double %.sroa.05.0.copyload, double %.sroa.26.0.copyload)
  %116 = extractvalue { double, double } %115, 0
  store double %116, ptr %9, align 16
  %117 = extractvalue { double, double } %115, 1
  store double %117, ptr %53, align 8
  %118 = call noundef float @_ZNK3JPH4Vec38LengthSqEv(ptr noundef nonnull align 16 dereferenceable(16) %9)
  %119 = call noundef float @_ZN3JPH6SquareIfEET_S1_(float noundef %62)
  %120 = fcmp ogt float %118, %119
  br i1 %120, label %121, label %130

121:                                              ; preds = %113
  %122 = fdiv float %119, %118
  %123 = call noundef float @_ZSt4sqrtf(float noundef %122)
  %124 = call { double, double } @_ZNK3JPH4Vec3mlEf(ptr noundef nonnull align 16 dereferenceable(16) %9, float noundef %123)
  %125 = extractvalue { double, double } %124, 0
  %126 = extractvalue { double, double } %124, 1
  %127 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %5, double %125, double %126)
  %128 = extractvalue { double, double } %127, 0
  %129 = extractvalue { double, double } %127, 1
  store double %128, ptr %114, align 16
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %57, i64 24
  store double %129, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !39
  br label %130

130:                                              ; preds = %121, %113
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  br label %133

131:                                              ; preds = %54
  %132 = getelementptr inbounds i8, ptr %57, i64 16
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %132, ptr noundef nonnull align 16 dereferenceable(16) %5, i64 16, i1 false), !tbaa.struct !42
  br label %133

133:                                              ; preds = %111, %130, %131
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  %134 = getelementptr inbounds i8, ptr %.065, i64 52
  %135 = icmp ult ptr %134, %46
  br i1 %135, label %54, label %.loopexit, !llvm.loop !43

.loopexit:                                        ; preds = %133, %30, %4, %14
  ret void
}

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNKSt13__atomic_baseIjE4loadESt12memory_order(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #2 align 2

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 = { 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 = { 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, !17, i64 370}
!6 = !{!"_ZTSN3JPH24SoftBodyMotionPropertiesE", !7, i64 0, !21, i64 184, !23, i64 192, !25, i64 216, !26, i64 240, !27, i64 264, !28, i64 288, !28, i64 320, !15, i64 352, !15, i64 356, !14, i64 360, !14, i64 364, !17, i64 368, !29, i64 369, !17, i64 370, !17, i64 371}
!7 = !{!"_ZTSN3JPH16MotionPropertiesE", !8, i64 0, !8, i64 16, !8, i64 32, !11, i64 48, !13, i64 64, !13, i64 76, !14, i64 88, !14, i64 92, !14, i64 96, !14, i64 100, !14, i64 104, !14, i64 108, !15, i64 112, !15, i64 116, !16, i64 120, !17, i64 121, !18, i64 122, !9, i64 123, !9, i64 124, !9, i64 128, !14, i64 176, !19, i64 180, !20, i64 181}
!8 = !{!"_ZTSN3JPH4Vec3E", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSN3JPH4QuatE", !12, i64 0}
!12 = !{!"_ZTSN3JPH4Vec4E", !9, i64 0}
!13 = !{!"_ZTSN3JPH6Float3E", !14, i64 0, !14, i64 4, !14, i64 8}
!14 = !{!"float", !9, i64 0}
!15 = !{!"int", !9, i64 0}
!16 = !{!"_ZTSN3JPH14EMotionQualityE", !9, i64 0}
!17 = !{!"bool", !9, i64 0}
!18 = !{!"_ZTSN3JPH12EAllowedDOFsE", !9, i64 0}
!19 = !{!"_ZTSN3JPH9EBodyTypeE", !9, i64 0}
!20 = !{!"_ZTSN3JPH11EMotionTypeE", !9, i64 0}
!21 = !{!"_ZTSN3JPH8RefConstINS_22SoftBodySharedSettingsEEE", !22, i64 0}
!22 = !{!"any pointer", !9, i64 0}
!23 = !{!"_ZTSN3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEEE", !24, i64 0, !24, i64 8, !22, i64 16}
!24 = !{!"long", !9, i64 0}
!25 = !{!"_ZTSN3JPH5ArrayINS_24SoftBodyMotionProperties14CollidingShapeENS_12STLAllocatorIS2_EEEE", !24, i64 0, !24, i64 8, !22, i64 16}
!26 = !{!"_ZTSN3JPH5ArrayINS_24SoftBodyMotionProperties15CollidingSensorENS_12STLAllocatorIS2_EEEE", !24, i64 0, !24, i64 8, !22, i64 16}
!27 = !{!"_ZTSN3JPH5ArrayINS_24SoftBodyMotionProperties9SkinStateENS_12STLAllocatorIS2_EEEE", !24, i64 0, !24, i64 8, !22, i64 16}
!28 = !{!"_ZTSN3JPH5AABoxE", !8, i64 0, !8, i64 16}
!29 = !{!"_ZTSSt6atomicIbE", !30, i64 0}
!30 = !{!"_ZTSSt13__atomic_baseIbE", !17, i64 0}
!31 = !{i8 0, i8 2}
!32 = !{}
!33 = !{!6, !17, i64 371}
!34 = !{!6, !15, i64 352}
!35 = !{!36, !15, i64 0}
!36 = !{!"_ZTSN3JPH22SoftBodySharedSettings7SkinnedE", !15, i64 0, !9, i64 4, !14, i64 36, !14, i64 40, !14, i64 44, !15, i64 48}
!37 = !{!36, !14, i64 36}
!38 = !{!6, !14, i64 364}
!39 = !{!9, !9, i64 0}
!40 = !{!36, !14, i64 40}
!41 = !{!36, !14, i64 44}
!42 = !{i64 0, i64 16, !39}
!43 = distinct !{!43, !44}
!44 = !{!"llvm.loop.mustprogress"}


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