; 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::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"] }
%"class.JPH::Vec4" = type { %union.anon }
%union.anon = type { <4 x float> }
%"struct.std::atomic.49" = type { i32 }
%"struct.std::atomic.11" = type { %"struct.std::__atomic_base.12" }
%"struct.std::__atomic_base.12" = type { i32 }
%"class.JPH::Vec3" = type { %union.anon.0 }
%union.anon.0 = type { <4 x float> }
%"struct.JPH::AssertLastParam" = type { i8 }
%"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::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 }

@.str.1 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [24 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: mustprogress uwtable
declare dso_local void @_ZN3JPH24SoftBodyMotionProperties24DetermineCollidingShapesERKNS_21SoftBodyUpdateContextERKNS_13PhysicsSystemERKNS_17BodyLockInterfaceE(ptr noundef nonnull align 16 dereferenceable(372), ptr noundef nonnull align 16 dereferenceable(196), ptr noundef nonnull align 16 dereferenceable(1172), ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH24SoftBodyMotionProperties25UpdateRigidBodyVelocitiesERKNS_21SoftBodyUpdateContextERNS_13BodyInterfaceE(ptr noundef nonnull align 16 dereferenceable(372), ptr noundef nonnull align 16 dereferenceable(196), ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH24SoftBodyMotionProperties23InitializeUpdateContextEfRNS_4BodyERKNS_13PhysicsSystemERNS_21SoftBodyUpdateContextE(ptr noundef nonnull align 16 dereferenceable(372), float noundef, ptr noundef nonnull align 16 dereferenceable(122), ptr noundef nonnull align 16 dereferenceable(1172), ptr noundef nonnull align 16 dereferenceable(196)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN3JPH24SoftBodyMotionProperties14ParallelUpdateERNS_21SoftBodyUpdateContextERKNS_15PhysicsSettingsE(ptr noundef nonnull align 16 dereferenceable(372), ptr noundef nonnull align 16 dereferenceable(196), ptr noundef nonnull align 4 dereferenceable(83)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH24SoftBodyMotionProperties12CustomUpdateEfRNS_4BodyERNS_13PhysicsSystemE(ptr noundef nonnull align 16 dereferenceable(372) %0, float noundef %1, ptr noundef nonnull align 16 dereferenceable(122) %2, ptr noundef nonnull align 16 dereferenceable(1172) %3) #2 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca float, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"class.JPH::SoftBodyUpdateContext", align 16
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca %"struct.JPH::AssertLastParam", align 1
  %13 = alloca %"class.JPH::Vec3", align 16
  %14 = alloca %"class.JPH::Vec3", align 16
  %15 = alloca %"class.JPH::Vec3", align 16
  store ptr %0, ptr %5, align 8, !tbaa !5
  store float %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %16 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 208, ptr %9) #8
  call void @_ZN3JPH21SoftBodyUpdateContextC2Ev(ptr noundef nonnull align 16 dereferenceable(196) %9) #8
  %17 = load float, ptr %6, align 4, !tbaa !9
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN3JPH24SoftBodyMotionProperties23InitializeUpdateContextEfRNS_4BodyERKNS_13PhysicsSystemERNS_21SoftBodyUpdateContextE(ptr noundef nonnull align 16 dereferenceable(372) %16, float noundef %17, ptr noundef nonnull align 16 dereferenceable(122) %18, ptr noundef nonnull align 16 dereferenceable(1172) %19, ptr noundef nonnull align 16 dereferenceable(196) %9)
  %20 = load ptr, ptr %8, align 8, !tbaa !5
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3JPH13PhysicsSystem20GetBodyLockInterfaceEv(ptr noundef nonnull align 16 dereferenceable(1172) %21)
  call void @_ZN3JPH24SoftBodyMotionProperties24DetermineCollidingShapesERKNS_21SoftBodyUpdateContextERKNS_13PhysicsSystemERKNS_17BodyLockInterfaceE(ptr noundef nonnull align 16 dereferenceable(372) %16, ptr noundef nonnull align 16 dereferenceable(196) %9, ptr noundef nonnull align 16 dereferenceable(1172) %20, ptr noundef nonnull align 8 dereferenceable(16) %22)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  %24 = call noundef nonnull align 4 dereferenceable(83) ptr @_ZNK3JPH13PhysicsSystem18GetPhysicsSettingsEv(ptr noundef nonnull align 16 dereferenceable(1172) %23)
  store ptr %24, ptr %11, align 8, !tbaa !5
  br label %25

25:                                               ; preds = %29, %4
  %26 = load ptr, ptr %11, align 8, !tbaa !5
  %27 = call noundef i32 @_ZN3JPH24SoftBodyMotionProperties14ParallelUpdateERNS_21SoftBodyUpdateContextERKNS_15PhysicsSettingsE(ptr noundef nonnull align 16 dereferenceable(372) %16, ptr noundef nonnull align 16 dereferenceable(196) %9, ptr noundef nonnull align 4 dereferenceable(83) %26)
  store i32 %27, ptr %10, align 4, !tbaa !11
  %28 = icmp eq i32 %27, 2
  br i1 %28, label %29, label %30

29:                                               ; preds = %25
  br label %25, !llvm.loop !13

30:                                               ; preds = %25
  br label %31

31:                                               ; preds = %30
  %32 = load i32, ptr %10, align 4, !tbaa !11
  %33 = icmp eq i32 %32, 4
  br i1 %33, label %37, label %34

34:                                               ; preds = %31
  %35 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.11, ptr noundef @.str.1, i32 noundef 1134)
  br i1 %35, label %36, label %37

36:                                               ; preds = %34
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #8, !srcloc !15
  br label %37

37:                                               ; preds = %36, %34, %31
  br label %38

38:                                               ; preds = %37
  br label %39

39:                                               ; preds = %38
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH13PhysicsSystem16GetBodyInterfaceEv(ptr noundef nonnull align 16 dereferenceable(1172) %40)
  call void @_ZN3JPH24SoftBodyMotionProperties25UpdateRigidBodyVelocitiesERKNS_21SoftBodyUpdateContextERNS_13BodyInterfaceE(ptr noundef nonnull align 16 dereferenceable(372) %16, ptr noundef nonnull align 16 dereferenceable(196) %9, ptr noundef nonnull align 8 dereferenceable(24) %41)
  %42 = getelementptr inbounds %"class.JPH::SoftBodyMotionProperties", ptr %16, i32 0, i32 13
  %43 = load i8, ptr %42, align 16, !tbaa !16, !range !38, !noundef !39
  %44 = trunc i8 %43 to i1
  br i1 %44, label %45, label %74

45:                                               ; preds = %39
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH13PhysicsSystem16GetBodyInterfaceEv(ptr noundef nonnull align 16 dereferenceable(1172) %46)
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122) %48)
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #8
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = call { double, double } @_ZNK3JPH4Body11GetPositionEv(ptr noundef nonnull align 16 dereferenceable(122) %50)
  %52 = getelementptr inbounds %"class.JPH::Vec3", ptr %14, i32 0, i32 0
  %53 = getelementptr inbounds %union.anon.0, ptr %52, i32 0, i32 0
  %54 = getelementptr inbounds { double, double }, ptr %53, i32 0, i32 0
  %55 = extractvalue { double, double } %51, 0
  store double %55, ptr %54, align 16
  %56 = getelementptr inbounds { double, double }, ptr %53, i32 0, i32 1
  %57 = extractvalue { double, double } %51, 1
  store double %57, ptr %56, align 8
  %58 = getelementptr inbounds %"class.JPH::SoftBodyUpdateContext", ptr %9, i32 0, i32 18
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %15, ptr align 16 %58, i64 16, i1 false), !tbaa.struct !40
  %59 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 0
  %60 = load double, ptr %59, align 16
  %61 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 1
  %62 = load double, ptr %61, align 8
  %63 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %14, double %60, double %62)
  %64 = getelementptr inbounds %"class.JPH::Vec3", ptr %13, i32 0, i32 0
  %65 = getelementptr inbounds %union.anon.0, ptr %64, i32 0, i32 0
  %66 = getelementptr inbounds { double, double }, ptr %65, i32 0, i32 0
  %67 = extractvalue { double, double } %63, 0
  store double %67, ptr %66, align 16
  %68 = getelementptr inbounds { double, double }, ptr %65, i32 0, i32 1
  %69 = extractvalue { double, double } %63, 1
  store double %69, ptr %68, align 8
  %70 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 0
  %71 = load double, ptr %70, align 16
  %72 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 1
  %73 = load double, ptr %72, align 8
  call void @_ZN3JPH13BodyInterface11SetPositionERKNS_6BodyIDENS_4Vec3ENS_11EActivationE(ptr noundef nonnull align 8 dereferenceable(24) %47, ptr noundef nonnull align 4 dereferenceable(4) %49, double %71, double %73, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #8
  br label %74

74:                                               ; preds = %45, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 208, ptr %9) #8
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH21SoftBodyUpdateContextC2Ev(ptr noundef nonnull align 16 dereferenceable(196)) unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3JPH13PhysicsSystem20GetBodyLockInterfaceEv(ptr noundef nonnull align 16 dereferenceable(1172)) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(83) ptr @_ZNK3JPH13PhysicsSystem18GetPhysicsSettingsEv(ptr noundef nonnull align 16 dereferenceable(1172)) #6 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 void @_ZN3JPH13BodyInterface11SetPositionERKNS_6BodyIDENS_4Vec3ENS_11EActivationE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4), double, double, i32 noundef) #7

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

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

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


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

%"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"] }
%"class.JPH::Vec4" = type { %union.anon }
%union.anon = type { <4 x float> }
%"struct.std::atomic.49" = type { i32 }
%"struct.std::atomic.11" = type { %"struct.std::__atomic_base.12" }
%"struct.std::__atomic_base.12" = type { i32 }
%"class.JPH::Vec3" = type { %union.anon.0 }
%union.anon.0 = type { <4 x float> }

@.str.1 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [24 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 uwtable
declare dso_local void @_ZN3JPH24SoftBodyMotionProperties24DetermineCollidingShapesERKNS_21SoftBodyUpdateContextERKNS_13PhysicsSystemERKNS_17BodyLockInterfaceE(ptr noundef nonnull align 16 dereferenceable(372), ptr noundef nonnull align 16 dereferenceable(196), ptr noundef nonnull align 16 dereferenceable(1172), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 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 #2 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 #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH24SoftBodyMotionProperties25UpdateRigidBodyVelocitiesERKNS_21SoftBodyUpdateContextERNS_13BodyInterfaceE(ptr noundef nonnull align 16 dereferenceable(372), ptr noundef nonnull align 16 dereferenceable(196), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH24SoftBodyMotionProperties23InitializeUpdateContextEfRNS_4BodyERKNS_13PhysicsSystemERNS_21SoftBodyUpdateContextE(ptr noundef nonnull align 16 dereferenceable(372), float noundef, ptr noundef nonnull align 16 dereferenceable(122), ptr noundef nonnull align 16 dereferenceable(1172), ptr noundef nonnull align 16 dereferenceable(196)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN3JPH24SoftBodyMotionProperties14ParallelUpdateERNS_21SoftBodyUpdateContextERKNS_15PhysicsSettingsE(ptr noundef nonnull align 16 dereferenceable(372), ptr noundef nonnull align 16 dereferenceable(196), ptr noundef nonnull align 4 dereferenceable(83)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH24SoftBodyMotionProperties12CustomUpdateEfRNS_4BodyERNS_13PhysicsSystemE(ptr noundef nonnull align 16 dereferenceable(372) %0, float noundef %1, ptr noundef nonnull align 16 dereferenceable(122) %2, ptr noundef nonnull align 16 dereferenceable(1172) %3) local_unnamed_addr #1 align 2 {
  %5 = alloca %"class.JPH::SoftBodyUpdateContext", align 16
  %6 = alloca %"class.JPH::Vec3", align 16
  call void @llvm.lifetime.start.p0(i64 208, ptr nonnull %5) #7
  call void @_ZN3JPH21SoftBodyUpdateContextC2Ev(ptr noundef nonnull align 16 dereferenceable(196) %5) #7
  call void @_ZN3JPH24SoftBodyMotionProperties23InitializeUpdateContextEfRNS_4BodyERKNS_13PhysicsSystemERNS_21SoftBodyUpdateContextE(ptr noundef nonnull align 16 dereferenceable(372) %0, float noundef %1, ptr noundef nonnull align 16 dereferenceable(122) %2, ptr noundef nonnull align 16 dereferenceable(1172) %3, ptr noundef nonnull align 16 dereferenceable(196) %5)
  %7 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3JPH13PhysicsSystem20GetBodyLockInterfaceEv(ptr noundef nonnull align 16 dereferenceable(1172) %3)
  call void @_ZN3JPH24SoftBodyMotionProperties24DetermineCollidingShapesERKNS_21SoftBodyUpdateContextERKNS_13PhysicsSystemERKNS_17BodyLockInterfaceE(ptr noundef nonnull align 16 dereferenceable(372) %0, ptr noundef nonnull align 16 dereferenceable(196) %5, ptr noundef nonnull align 16 dereferenceable(1172) %3, ptr noundef nonnull align 8 dereferenceable(16) %7)
  %8 = call noundef nonnull align 4 dereferenceable(83) ptr @_ZNK3JPH13PhysicsSystem18GetPhysicsSettingsEv(ptr noundef nonnull align 16 dereferenceable(1172) %3)
  br label %9

9:                                                ; preds = %9, %4
  %10 = call noundef i32 @_ZN3JPH24SoftBodyMotionProperties14ParallelUpdateERNS_21SoftBodyUpdateContextERKNS_15PhysicsSettingsE(ptr noundef nonnull align 16 dereferenceable(372) %0, ptr noundef nonnull align 16 dereferenceable(196) %5, ptr noundef nonnull align 4 dereferenceable(83) %8)
  switch i32 %10, label %11 [
    i32 2, label %9
    i32 4, label %.loopexit
  ]

11:                                               ; preds = %9
  %12 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.1, i32 noundef 1134)
  br i1 %12, label %13, label %.loopexit

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

.loopexit:                                        ; preds = %9, %13, %11
  %14 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH13PhysicsSystem16GetBodyInterfaceEv(ptr noundef nonnull align 16 dereferenceable(1172) %3)
  call void @_ZN3JPH24SoftBodyMotionProperties25UpdateRigidBodyVelocitiesERKNS_21SoftBodyUpdateContextERNS_13BodyInterfaceE(ptr noundef nonnull align 16 dereferenceable(372) %0, ptr noundef nonnull align 16 dereferenceable(196) %5, ptr noundef nonnull align 8 dereferenceable(24) %14)
  %15 = getelementptr inbounds i8, ptr %0, i64 368
  %16 = load i8, ptr %15, align 16, !tbaa !6, !range !32, !noundef !33
  %17 = trunc nuw i8 %16 to i1
  br i1 %17, label %18, label %29

18:                                               ; preds = %.loopexit
  %19 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH13PhysicsSystem16GetBodyInterfaceEv(ptr noundef nonnull align 16 dereferenceable(1172) %3)
  %20 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122) %2)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  %21 = call { double, double } @_ZNK3JPH4Body11GetPositionEv(ptr noundef nonnull align 16 dereferenceable(122) %2)
  %22 = extractvalue { double, double } %21, 0
  store double %22, ptr %6, align 16
  %23 = getelementptr inbounds i8, ptr %6, i64 8
  %24 = extractvalue { double, double } %21, 1
  store double %24, ptr %23, align 8
  %25 = getelementptr inbounds i8, ptr %5, i64 176
  %.sroa.0.0.copyload = load double, ptr %25, align 16
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 184
  %.sroa.2.0.copyload = load double, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !34
  %26 = call { double, double } @_ZNK3JPH4Vec3plES0_(ptr noundef nonnull align 16 dereferenceable(16) %6, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload)
  %27 = extractvalue { double, double } %26, 0
  %28 = extractvalue { double, double } %26, 1
  call void @_ZN3JPH13BodyInterface11SetPositionERKNS_6BodyIDENS_4Vec3ENS_11EActivationE(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 4 dereferenceable(4) %20, double %27, double %28, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  br label %29

29:                                               ; preds = %18, %.loopexit
  call void @llvm.lifetime.end.p0(i64 208, ptr nonnull %5) #7
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH21SoftBodyUpdateContextC2Ev(ptr noundef nonnull align 16 dereferenceable(196)) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK3JPH13PhysicsSystem20GetBodyLockInterfaceEv(ptr noundef nonnull align 16 dereferenceable(1172)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(83) ptr @_ZNK3JPH13PhysicsSystem18GetPhysicsSettingsEv(ptr noundef nonnull align 16 dereferenceable(1172)) 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 #5 align 2

declare void @_ZN3JPH13BodyInterface11SetPositionERKNS_6BodyIDENS_4Vec3ENS_11EActivationE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4), double, double, i32 noundef) local_unnamed_addr #6

; 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 #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Body11GetPositionEv(ptr noundef nonnull align 16 dereferenceable(122)) local_unnamed_addr #3 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { 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 #6 = { "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 = !{i64 2159549789}
!6 = !{!7, !18, i64 368}
!7 = !{!"_ZTSN3JPH24SoftBodyMotionPropertiesE", !8, i64 0, !22, i64 184, !24, i64 192, !26, i64 216, !27, i64 240, !28, i64 264, !29, i64 288, !29, i64 320, !16, i64 352, !16, i64 356, !15, i64 360, !15, i64 364, !18, i64 368, !30, i64 369, !18, i64 370, !18, i64 371}
!8 = !{!"_ZTSN3JPH16MotionPropertiesE", !9, i64 0, !9, i64 16, !9, i64 32, !12, i64 48, !14, i64 64, !14, i64 76, !15, i64 88, !15, i64 92, !15, i64 96, !15, i64 100, !15, i64 104, !15, i64 108, !16, i64 112, !16, i64 116, !17, i64 120, !18, i64 121, !19, i64 122, !10, i64 123, !10, i64 124, !10, i64 128, !15, i64 176, !20, i64 180, !21, i64 181}
!9 = !{!"_ZTSN3JPH4Vec3E", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTSN3JPH4QuatE", !13, i64 0}
!13 = !{!"_ZTSN3JPH4Vec4E", !10, i64 0}
!14 = !{!"_ZTSN3JPH6Float3E", !15, i64 0, !15, i64 4, !15, i64 8}
!15 = !{!"float", !10, i64 0}
!16 = !{!"int", !10, i64 0}
!17 = !{!"_ZTSN3JPH14EMotionQualityE", !10, i64 0}
!18 = !{!"bool", !10, i64 0}
!19 = !{!"_ZTSN3JPH12EAllowedDOFsE", !10, i64 0}
!20 = !{!"_ZTSN3JPH9EBodyTypeE", !10, i64 0}
!21 = !{!"_ZTSN3JPH11EMotionTypeE", !10, i64 0}
!22 = !{!"_ZTSN3JPH8RefConstINS_22SoftBodySharedSettingsEEE", !23, i64 0}
!23 = !{!"any pointer", !10, i64 0}
!24 = !{!"_ZTSN3JPH5ArrayINS_14SoftBodyVertexENS_12STLAllocatorIS1_EEEE", !25, i64 0, !25, i64 8, !23, i64 16}
!25 = !{!"long", !10, i64 0}
!26 = !{!"_ZTSN3JPH5ArrayINS_24SoftBodyMotionProperties14CollidingShapeENS_12STLAllocatorIS2_EEEE", !25, i64 0, !25, i64 8, !23, i64 16}
!27 = !{!"_ZTSN3JPH5ArrayINS_24SoftBodyMotionProperties15CollidingSensorENS_12STLAllocatorIS2_EEEE", !25, i64 0, !25, i64 8, !23, i64 16}
!28 = !{!"_ZTSN3JPH5ArrayINS_24SoftBodyMotionProperties9SkinStateENS_12STLAllocatorIS2_EEEE", !25, i64 0, !25, i64 8, !23, i64 16}
!29 = !{!"_ZTSN3JPH5AABoxE", !9, i64 0, !9, i64 16}
!30 = !{!"_ZTSSt6atomicIbE", !31, i64 0}
!31 = !{!"_ZTSSt13__atomic_baseIbE", !18, i64 0}
!32 = !{i8 0, i8 2}
!33 = !{}
!34 = !{!10, !10, i64 0}


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