; 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"

%"struct.JPH::AssertLastParam" = type { i8 }
%"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::SoftBodySharedSettings::LRA" = type { [2 x 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" }

@.str = external hidden unnamed_addr constant [35 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [35 x i8], align 1

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

; 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 i64 @_ZNK3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEE4sizeEv(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 } @_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 } @_ZNK3JPH4Vec3dvEf(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 @_ZN3JPH24SoftBodyMotionProperties19ApplyLRAConstraintsEjj(ptr noundef nonnull align 16 dereferenceable(372) %0, i32 noundef %1, i32 noundef %2) #5 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %"struct.JPH::AssertLastParam", align 1
  %11 = alloca %"struct.JPH::AssertLastParam", align 1
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca %"class.JPH::Vec3", align 16
  %15 = alloca %"class.JPH::Vec3", align 16
  %16 = alloca %"class.JPH::Vec3", align 16
  %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
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !9
  %21 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %22 = getelementptr inbounds %"class.JPH::SoftBodyMotionProperties", ptr %21, i32 0, i32 3
  %23 = call noundef ptr @_ZN3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %22)
  store ptr %23, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %24 = getelementptr inbounds %"class.JPH::SoftBodyMotionProperties", ptr %21, i32 0, i32 2
  %25 = call noundef ptr @_ZNK3JPH8RefConstINS_22SoftBodySharedSettingsEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %24)
  %26 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings", ptr %25, i32 0, i32 8
  %27 = call noundef ptr @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings3LRAENS_12STLAllocatorIS2_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %26)
  %28 = load i32, ptr %5, align 4, !tbaa !9
  %29 = zext i32 %28 to i64
  %30 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings::LRA", ptr %27, i64 %29
  store ptr %30, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %31 = getelementptr inbounds %"class.JPH::SoftBodyMotionProperties", ptr %21, i32 0, i32 2
  %32 = call noundef ptr @_ZNK3JPH8RefConstINS_22SoftBodySharedSettingsEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %31)
  %33 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings", ptr %32, i32 0, i32 8
  %34 = call noundef ptr @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings3LRAENS_12STLAllocatorIS2_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %33)
  %35 = load i32, ptr %6, align 4, !tbaa !9
  %36 = zext i32 %35 to i64
  %37 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings::LRA", ptr %34, i64 %36
  store ptr %37, ptr %9, align 8, !tbaa !5
  br label %38

38:                                               ; preds = %144, %3
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = load ptr, ptr %9, align 8, !tbaa !5
  %41 = icmp ult ptr %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %147

43:                                               ; preds = %38
  br label %44

44:                                               ; preds = %43
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings::LRA", ptr %45, i32 0, i32 0
  %47 = getelementptr inbounds [2 x i32], ptr %46, i64 0, i64 0
  %48 = load i32, ptr %47, align 4, !tbaa !9
  %49 = zext i32 %48 to i64
  %50 = getelementptr inbounds %"class.JPH::SoftBodyMotionProperties", ptr %21, i32 0, i32 3
  %51 = call noundef i64 @_ZNK3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %50)
  %52 = icmp ult i64 %49, %51
  br i1 %52, label %56, label %53

53:                                               ; preds = %44
  %54 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 585)
  br i1 %54, label %55, label %56

55:                                               ; preds = %53
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #7, !srcloc !11
  br label %56

56:                                               ; preds = %55, %53, %44
  br label %57

57:                                               ; preds = %56
  br label %58

58:                                               ; preds = %57
  br label %59

59:                                               ; preds = %58
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  %61 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings::LRA", ptr %60, i32 0, i32 0
  %62 = getelementptr inbounds [2 x i32], ptr %61, i64 0, i64 1
  %63 = load i32, ptr %62, align 4, !tbaa !9
  %64 = zext i32 %63 to i64
  %65 = getelementptr inbounds %"class.JPH::SoftBodyMotionProperties", ptr %21, i32 0, i32 3
  %66 = call noundef i64 @_ZNK3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %65)
  %67 = icmp ult i64 %64, %66
  br i1 %67, label %71, label %68

68:                                               ; preds = %59
  %69 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 586)
  br i1 %69, label %70, label %71

70:                                               ; preds = %68
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #7, !srcloc !12
  br label %71

71:                                               ; preds = %70, %68, %59
  br label %72

72:                                               ; preds = %71
  br label %73

73:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = load ptr, ptr %8, align 8, !tbaa !5
  %76 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings::LRA", ptr %75, i32 0, i32 0
  %77 = getelementptr inbounds [2 x i32], ptr %76, i64 0, i64 0
  %78 = load i32, ptr %77, align 4, !tbaa !9
  %79 = zext i32 %78 to i64
  %80 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %74, i64 %79
  store ptr %80, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = load ptr, ptr %8, align 8, !tbaa !5
  %83 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings::LRA", ptr %82, i32 0, i32 0
  %84 = getelementptr inbounds [2 x i32], ptr %83, i64 0, i64 1
  %85 = load i32, ptr %84, align 4, !tbaa !9
  %86 = zext i32 %85 to i64
  %87 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %81, i64 %86
  store ptr %87, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #7
  %88 = load ptr, ptr %12, align 8, !tbaa !5
  %89 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %88, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %14, ptr align 16 %89, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #7
  %90 = load ptr, ptr %13, align 8, !tbaa !5
  %91 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %90, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %16, ptr align 16 %14, i64 16, i1 false), !tbaa.struct !13
  %92 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %93 = load double, ptr %92, align 16
  %94 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 1
  %95 = load double, ptr %94, align 8
  %96 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %91, double %93, double %95)
  %97 = getelementptr inbounds %"class.JPH::Vec3", ptr %15, i32 0, i32 0
  %98 = getelementptr inbounds %union.anon.0, ptr %97, i32 0, i32 0
  %99 = getelementptr inbounds { double, double }, ptr %98, i32 0, i32 0
  %100 = extractvalue { double, double } %96, 0
  store double %100, ptr %99, align 16
  %101 = getelementptr inbounds { double, double }, ptr %98, i32 0, i32 1
  %102 = extractvalue { double, double } %96, 1
  store double %102, ptr %101, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %103 = call noundef float @_ZNK3JPH4Vec38LengthSqEv(ptr noundef nonnull align 16 dereferenceable(16) %15)
  store float %103, ptr %17, align 4, !tbaa !15
  %104 = load float, ptr %17, align 4, !tbaa !15
  %105 = load ptr, ptr %8, align 8, !tbaa !5
  %106 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings::LRA", ptr %105, i32 0, i32 1
  %107 = load float, ptr %106, align 4, !tbaa !17
  %108 = call noundef float @_ZN3JPH6SquareIfEET_S1_(float noundef %107)
  %109 = fcmp ogt float %104, %108
  br i1 %109, label %110, label %143

110:                                              ; preds = %73
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #7
  %111 = load ptr, ptr %8, align 8, !tbaa !5
  %112 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings::LRA", ptr %111, i32 0, i32 1
  %113 = load float, ptr %112, align 4, !tbaa !17
  %114 = call { double, double } @_ZNK3JPH4Vec3mlEf(ptr noundef nonnull align 16 dereferenceable(16) %15, float noundef %113)
  %115 = getelementptr inbounds %"class.JPH::Vec3", ptr %20, i32 0, i32 0
  %116 = getelementptr inbounds %union.anon.0, ptr %115, i32 0, i32 0
  %117 = getelementptr inbounds { double, double }, ptr %116, i32 0, i32 0
  %118 = extractvalue { double, double } %114, 0
  store double %118, ptr %117, align 16
  %119 = getelementptr inbounds { double, double }, ptr %116, i32 0, i32 1
  %120 = extractvalue { double, double } %114, 1
  store double %120, ptr %119, align 8
  %121 = load float, ptr %17, align 4, !tbaa !15
  %122 = call noundef float @_ZSt4sqrtf(float noundef %121)
  %123 = call { double, double } @_ZNK3JPH4Vec3dvEf(ptr noundef nonnull align 16 dereferenceable(16) %20, float noundef %122)
  %124 = getelementptr inbounds %"class.JPH::Vec3", ptr %19, i32 0, i32 0
  %125 = getelementptr inbounds %union.anon.0, ptr %124, i32 0, i32 0
  %126 = getelementptr inbounds { double, double }, ptr %125, i32 0, i32 0
  %127 = extractvalue { double, double } %123, 0
  store double %127, ptr %126, align 16
  %128 = getelementptr inbounds { double, double }, ptr %125, i32 0, i32 1
  %129 = extractvalue { double, double } %123, 1
  store double %129, ptr %128, align 8
  %130 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %131 = load double, ptr %130, align 16
  %132 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  %133 = load double, ptr %132, align 8
  %134 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %14, double %131, double %133)
  %135 = getelementptr inbounds %"class.JPH::Vec3", ptr %18, i32 0, i32 0
  %136 = getelementptr inbounds %union.anon.0, ptr %135, i32 0, i32 0
  %137 = getelementptr inbounds { double, double }, ptr %136, i32 0, i32 0
  %138 = extractvalue { double, double } %134, 0
  store double %138, ptr %137, align 16
  %139 = getelementptr inbounds { double, double }, ptr %136, i32 0, i32 1
  %140 = extractvalue { double, double } %134, 1
  store double %140, ptr %139, align 8
  %141 = load ptr, ptr %13, align 8, !tbaa !5
  %142 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %141, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %142, ptr align 16 %18, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #7
  br label %143

143:                                              ; preds = %110, %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %144

144:                                              ; preds = %143
  %145 = load ptr, ptr %8, align 8, !tbaa !5
  %146 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings::LRA", ptr %145, i32 1
  store ptr %146, ptr %8, align 8, !tbaa !5
  br label %38, !llvm.loop !19

147:                                              ; preds = %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  ret void
}

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

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

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 = { 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 #7 = { 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 = !{i64 2159542080}
!12 = !{i64 2159546520}
!13 = !{i64 0, i64 16, !14}
!14 = !{!7, !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"float", !7, i64 0}
!17 = !{!18, !16, i64 8}
!18 = !{!"_ZTSN3JPH22SoftBodySharedSettings3LRAE", !7, i64 0, !16, i64 8}
!19 = distinct !{!19, !20}
!20 = !{!"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::LRA" = type { [2 x 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> }

@.str = external hidden unnamed_addr constant [35 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [35 x i8], align 1

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

; 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 i64 @_ZNK3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEE4sizeEv(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 } @_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 } @_ZNK3JPH4Vec3dvEf(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 @_ZN3JPH24SoftBodyMotionProperties19ApplyLRAConstraintsEjj(ptr noundef nonnull align 16 dereferenceable(372) %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #5 align 2 {
  %4 = alloca %"class.JPH::Vec3", align 16
  %5 = alloca %"class.JPH::Vec3", align 16
  %6 = alloca %"class.JPH::Vec3", align 16
  %7 = getelementptr inbounds i8, ptr %0, i64 192
  %8 = tail call noundef ptr @_ZN3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %9 = getelementptr inbounds i8, ptr %0, i64 184
  %10 = tail call noundef ptr @_ZNK3JPH8RefConstINS_22SoftBodySharedSettingsEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
  %11 = getelementptr inbounds i8, ptr %10, i64 176
  %12 = tail call noundef ptr @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings3LRAENS_12STLAllocatorIS2_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %11)
  %13 = zext i32 %1 to i64
  %14 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings::LRA", ptr %12, i64 %13
  %15 = tail call noundef ptr @_ZNK3JPH8RefConstINS_22SoftBodySharedSettingsEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
  %16 = getelementptr inbounds i8, ptr %15, i64 176
  %17 = tail call noundef ptr @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings3LRAENS_12STLAllocatorIS2_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
  %18 = zext i32 %2 to i64
  %19 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings::LRA", ptr %17, i64 %18
  %20 = icmp ult ptr %14, %19
  br i1 %20, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %3
  %.sroa.24.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  %21 = getelementptr inbounds i8, ptr %5, i64 8
  %22 = getelementptr inbounds i8, ptr %6, i64 8
  br label %23

._crit_edge:                                      ; preds = %67, %3
  ret void

23:                                               ; preds = %.lr.ph, %67
  %.022 = phi ptr [ %14, %.lr.ph ], [ %68, %67 ]
  %24 = load i32, ptr %.022, align 4, !tbaa !5
  %25 = zext i32 %24 to i64
  %26 = call noundef i64 @_ZNK3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %27 = icmp ugt i64 %26, %25
  br i1 %27, label %31, label %28

28:                                               ; preds = %23
  %29 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 585)
  br i1 %29, label %30, label %31

30:                                               ; preds = %28
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #7, !srcloc !9
  br label %31

31:                                               ; preds = %23, %28, %30
  %32 = getelementptr inbounds i8, ptr %.022, i64 4
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = zext i32 %33 to i64
  %35 = call noundef i64 @_ZNK3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %36 = icmp ugt i64 %35, %34
  br i1 %36, label %40, label %37

37:                                               ; preds = %31
  %38 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 586)
  br i1 %38, label %39, label %40

39:                                               ; preds = %37
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #7, !srcloc !10
  br label %40

40:                                               ; preds = %39, %37, %31
  %41 = load i32, ptr %.022, align 4, !tbaa !5
  %42 = zext i32 %41 to i64
  %43 = load i32, ptr %32, align 4, !tbaa !5
  %44 = zext i32 %43 to i64
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #7
  %45 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %8, i64 %42, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %4, ptr noundef nonnull align 16 dereferenceable(16) %45, i64 16, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #7
  %46 = getelementptr inbounds %"class.JPH::SoftBodyVertex", ptr %8, i64 %44, i32 1
  %.sroa.03.0.copyload = load double, ptr %4, align 16
  %.sroa.24.0.copyload = load double, ptr %.sroa.24.0..sroa_idx, align 8, !tbaa !12
  %47 = call { double, double } @_ZNK3JPH4Vec3miES0_(ptr noundef nonnull align 16 dereferenceable(16) %46, double %.sroa.03.0.copyload, double %.sroa.24.0.copyload)
  %48 = extractvalue { double, double } %47, 0
  store double %48, ptr %5, align 16
  %49 = extractvalue { double, double } %47, 1
  store double %49, ptr %21, align 8
  %50 = call noundef float @_ZNK3JPH4Vec38LengthSqEv(ptr noundef nonnull align 16 dereferenceable(16) %5)
  %51 = getelementptr inbounds i8, ptr %.022, i64 8
  %52 = load float, ptr %51, align 4, !tbaa !13
  %53 = call noundef float @_ZN3JPH6SquareIfEET_S1_(float noundef %52)
  %54 = fcmp ogt float %50, %53
  br i1 %54, label %55, label %67

55:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  %56 = load float, ptr %51, align 4, !tbaa !13
  %57 = call { double, double } @_ZNK3JPH4Vec3mlEf(ptr noundef nonnull align 16 dereferenceable(16) %5, float noundef %56)
  %58 = extractvalue { double, double } %57, 0
  store double %58, ptr %6, align 16
  %59 = extractvalue { double, double } %57, 1
  store double %59, ptr %22, align 8
  %60 = call noundef float @_ZSt4sqrtf(float noundef %50)
  %61 = call { double, double } @_ZNK3JPH4Vec3dvEf(ptr noundef nonnull align 16 dereferenceable(16) %6, float noundef %60)
  %62 = extractvalue { double, double } %61, 0
  %63 = extractvalue { double, double } %61, 1
  %64 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %4, double %62, double %63)
  %65 = extractvalue { double, double } %64, 0
  %66 = extractvalue { double, double } %64, 1
  store double %65, ptr %46, align 16
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %46, i64 8
  store double %66, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  br label %67

67:                                               ; preds = %55, %40
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  %68 = getelementptr inbounds i8, ptr %.022, i64 12
  %69 = icmp ult ptr %68, %19
  br i1 %69, label %23, label %._crit_edge, !llvm.loop !16
}

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

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

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 = { 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 #7 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i64 2159542080}
!10 = !{i64 2159546520}
!11 = !{i64 0, i64 16, !12}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !15, i64 8}
!14 = !{!"_ZTSN3JPH22SoftBodySharedSettings3LRAE", !7, i64 0, !15, i64 8}
!15 = !{!"float", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


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