; 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::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::Vec3" = type { %union.anon.0 }
%union.anon.0 = type { <4 x float> }
%"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 }

@.str.1 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [58 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK3JPH8RefConstINS_22SoftBodySharedSettingsEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; 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: mustprogress uwtable
declare dso_local void @_ZN3JPH24SoftBodyMotionProperties44ApplyCollisionConstraintsAndUpdateVelocitiesERKNS_21SoftBodyUpdateContextE(ptr noundef nonnull align 16 dereferenceable(372), ptr noundef nonnull align 16 dereferenceable(196)) #3 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH24SoftBodyMotionProperties12ProcessGroupERKNS_21SoftBodyUpdateContextEj(ptr noundef nonnull align 16 dereferenceable(372), ptr noundef nonnull align 16 dereferenceable(196), i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3JPH24SoftBodyMotionProperties24ParallelApplyConstraintsERNS_21SoftBodyUpdateContextERKNS_15PhysicsSettingsE(ptr noundef nonnull align 16 dereferenceable(372) %0, ptr noundef nonnull align 16 dereferenceable(196) %1, ptr noundef nonnull align 4 dereferenceable(83) %2) #3 align 2 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"struct.JPH::AssertLastParam", align 1
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %14 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %15 = getelementptr inbounds %"class.JPH::SoftBodyMotionProperties", ptr %14, i32 0, i32 2
  %16 = call noundef ptr @_ZNK3JPH8RefConstINS_22SoftBodySharedSettingsEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15)
  %17 = getelementptr inbounds %"class.JPH::SoftBodySharedSettings", ptr %16, i32 0, i32 12
  %18 = call noundef i64 @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings11UpdateGroupENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %17)
  %19 = trunc i64 %18 to i32
  store i32 %19, ptr %8, align 4, !tbaa !9
  br label %20

20:                                               ; preds = %3
  %21 = load i32, ptr %8, align 4, !tbaa !9
  %22 = icmp ugt i32 %21, 0
  br i1 %22, label %26, label %23

23:                                               ; preds = %20
  %24 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jS1_NS_15AssertLastParamE(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 946, ptr noundef @.str.5)
  br i1 %24, label %25, label %26

25:                                               ; preds = %23
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #6, !srcloc !11
  br label %26

26:                                               ; preds = %25, %23, %20
  br label %27

27:                                               ; preds = %26
  br label %28

28:                                               ; preds = %27
  %29 = load i32, ptr %8, align 4, !tbaa !9
  %30 = add i32 %29, -1
  store i32 %30, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = getelementptr inbounds %"class.JPH::SoftBodyUpdateContext", ptr %31, i32 0, i32 15
  %33 = call noundef i32 @_ZNKSt13__atomic_baseIjE4loadESt12memory_order(ptr noundef nonnull align 4 dereferenceable(4) %32, i32 noundef 0) #6
  store i32 %33, ptr %10, align 4, !tbaa !9
  %34 = load i32, ptr %10, align 4, !tbaa !9
  %35 = load i32, ptr %8, align 4, !tbaa !9
  %36 = icmp ult i32 %34, %35
  br i1 %36, label %43, label %37

37:                                               ; preds = %28
  %38 = load i32, ptr %8, align 4, !tbaa !9
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %40, label %99

40:                                               ; preds = %37
  %41 = load i32, ptr %10, align 4, !tbaa !9
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %43, label %99

43:                                               ; preds = %40, %28
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = getelementptr inbounds %"class.JPH::SoftBodyUpdateContext", ptr %44, i32 0, i32 15
  %46 = call noundef i32 @_ZNSt13__atomic_baseIjE9fetch_addEjSt12memory_order(ptr noundef nonnull align 4 dereferenceable(4) %45, i32 noundef 1, i32 noundef 2) #6
  store i32 %46, ptr %10, align 4, !tbaa !9
  %47 = load i32, ptr %10, align 4, !tbaa !9
  %48 = load i32, ptr %8, align 4, !tbaa !9
  %49 = icmp ult i32 %47, %48
  br i1 %49, label %56, label %50

50:                                               ; preds = %43
  %51 = load i32, ptr %8, align 4, !tbaa !9
  %52 = icmp eq i32 %51, 0
  br i1 %52, label %53, label %98

53:                                               ; preds = %50
  %54 = load i32, ptr %10, align 4, !tbaa !9
  %55 = icmp eq i32 %54, 0
  br i1 %55, label %56, label %98

56:                                               ; preds = %53, %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !9
  %57 = load i32, ptr %8, align 4, !tbaa !9
  %58 = icmp ugt i32 %57, 0
  br i1 %58, label %59, label %66

59:                                               ; preds = %56
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = load i32, ptr %10, align 4, !tbaa !9
  call void @_ZN3JPH24SoftBodyMotionProperties12ProcessGroupERKNS_21SoftBodyUpdateContextEj(ptr noundef nonnull align 16 dereferenceable(372) %14, ptr noundef nonnull align 16 dereferenceable(196) %60, i32 noundef %61)
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = getelementptr inbounds %"class.JPH::SoftBodyUpdateContext", ptr %62, i32 0, i32 16
  %64 = call noundef i32 @_ZNSt13__atomic_baseIjE9fetch_addEjSt12memory_order(ptr noundef nonnull align 4 dereferenceable(4) %63, i32 noundef 1, i32 noundef 4) #6
  %65 = add i32 %64, 1
  store i32 %65, ptr %11, align 4, !tbaa !9
  br label %66

66:                                               ; preds = %59, %56
  %67 = load i32, ptr %11, align 4, !tbaa !9
  %68 = load i32, ptr %8, align 4, !tbaa !9
  %69 = icmp uge i32 %67, %68
  br i1 %69, label %70, label %96

70:                                               ; preds = %66
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = load i32, ptr %8, align 4, !tbaa !9
  call void @_ZN3JPH24SoftBodyMotionProperties12ProcessGroupERKNS_21SoftBodyUpdateContextEj(ptr noundef nonnull align 16 dereferenceable(372) %14, ptr noundef nonnull align 16 dereferenceable(196) %71, i32 noundef %72)
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN3JPH24SoftBodyMotionProperties44ApplyCollisionConstraintsAndUpdateVelocitiesERKNS_21SoftBodyUpdateContextE(ptr noundef nonnull align 16 dereferenceable(372) %14, ptr noundef nonnull align 16 dereferenceable(196) %73)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = getelementptr inbounds %"class.JPH::SoftBodyUpdateContext", ptr %74, i32 0, i32 14
  %76 = call noundef i32 @_ZNSt13__atomic_baseIjE9fetch_addEjSt12memory_order(ptr noundef nonnull align 4 dereferenceable(4) %75, i32 noundef 1, i32 noundef 0) #6
  store i32 %76, ptr %12, align 4, !tbaa !9
  %77 = load i32, ptr %12, align 4, !tbaa !9
  %78 = getelementptr inbounds %"class.JPH::SoftBodyMotionProperties", ptr %14, i32 0, i32 9
  %79 = load i32, ptr %78, align 16, !tbaa !12
  %80 = icmp ult i32 %77, %79
  br i1 %80, label %81, label %87

81:                                               ; preds = %70
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN3JPH24SoftBodyMotionProperties18StartNextIterationERKNS_21SoftBodyUpdateContextE(ptr noundef nonnull align 16 dereferenceable(372) %14, ptr noundef nonnull align 16 dereferenceable(196) %82)
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = getelementptr inbounds %"class.JPH::SoftBodyUpdateContext", ptr %83, i32 0, i32 16
  call void @_ZNSt13__atomic_baseIjE5storeEjSt12memory_order(ptr noundef nonnull align 4 dereferenceable(4) %84, i32 noundef 0, i32 noundef 3) #6
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  %86 = getelementptr inbounds %"class.JPH::SoftBodyUpdateContext", ptr %85, i32 0, i32 15
  call void @_ZNSt13__atomic_baseIjE5storeEjSt12memory_order(ptr noundef nonnull align 4 dereferenceable(4) %86, i32 noundef 0, i32 noundef 3) #6
  br label %92

87:                                               ; preds = %70
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN3JPH24SoftBodyMotionProperties19UpdateSoftBodyStateERNS_21SoftBodyUpdateContextERKNS_15PhysicsSettingsE(ptr noundef nonnull align 16 dereferenceable(372) %14, ptr noundef nonnull align 16 dereferenceable(196) %88, ptr noundef nonnull align 4 dereferenceable(83) %89)
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = getelementptr inbounds %"class.JPH::SoftBodyUpdateContext", ptr %90, i32 0, i32 9
  call void @_ZNSt6atomicIN3JPH21SoftBodyUpdateContext6EStateEE5storeES2_St12memory_order(ptr noundef nonnull align 4 dereferenceable(4) %91, i32 noundef 3, i32 noundef 3) #6
  store i32 4, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %93

92:                                               ; preds = %81
  store i32 0, ptr %13, align 4
  br label %93

93:                                               ; preds = %92, %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  %94 = load i32, ptr %13, align 4
  switch i32 %94, label %97 [
    i32 0, label %95
  ]

95:                                               ; preds = %93
  br label %96

96:                                               ; preds = %95, %66
  store i32 2, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %97

97:                                               ; preds = %96, %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %100

98:                                               ; preds = %53, %50
  br label %99

99:                                               ; preds = %98, %40, %37
  store i32 1, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %100

100:                                              ; preds = %99, %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  %101 = load i32, ptr %4, align 4
  ret i32 %101
}

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

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

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

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

@.str.1 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [58 x i8], align 1

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH24SoftBodyMotionProperties19UpdateSoftBodyStateERNS_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 #2 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 1, 5) i32 @_ZN3JPH24SoftBodyMotionProperties24ParallelApplyConstraintsERNS_21SoftBodyUpdateContextERKNS_15PhysicsSettingsE(ptr noundef nonnull align 16 dereferenceable(372) %0, ptr noundef nonnull align 16 dereferenceable(196) %1, ptr noundef nonnull align 4 dereferenceable(83) %2) local_unnamed_addr #2 align 2 {
  %4 = getelementptr inbounds i8, ptr %0, i64 184
  %5 = tail call noundef ptr @_ZNK3JPH8RefConstINS_22SoftBodySharedSettingsEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  %6 = getelementptr inbounds i8, ptr %5, i64 256
  %7 = tail call noundef i64 @_ZNK3JPH5ArrayINS_22SoftBodySharedSettings11UpdateGroupENS_12STLAllocatorIS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6)
  %8 = trunc i64 %7 to i32
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %9, label %12

9:                                                ; preds = %3
  %10 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jS1_NS_15AssertLastParamE(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 946, ptr noundef nonnull @.str.5)
  br i1 %10, label %11, label %12

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

12:                                               ; preds = %11, %9, %3
  %13 = add i32 %8, -1
  %14 = getelementptr inbounds i8, ptr %1, i64 160
  %15 = tail call noundef i32 @_ZNKSt13__atomic_baseIjE4loadESt12memory_order(ptr noundef nonnull align 4 dereferenceable(4) %14, i32 noundef 0) #5
  %16 = icmp ult i32 %15, %13
  %17 = or i32 %15, %13
  %or.cond = icmp eq i32 %17, 0
  %or.cond43 = or i1 %16, %or.cond
  br i1 %or.cond43, label %18, label %37

18:                                               ; preds = %12
  %19 = tail call noundef i32 @_ZNSt13__atomic_baseIjE9fetch_addEjSt12memory_order(ptr noundef nonnull align 4 dereferenceable(4) %14, i32 noundef 1, i32 noundef 2) #5
  %20 = icmp ult i32 %19, %13
  %21 = or i32 %19, %13
  %or.cond3 = icmp eq i32 %21, 0
  %or.cond44 = or i1 %20, %or.cond3
  br i1 %or.cond44, label %22, label %37

22:                                               ; preds = %18
  %.not41 = icmp eq i32 %13, 0
  br i1 %.not41, label %27, label %23

23:                                               ; preds = %22
  tail call void @_ZN3JPH24SoftBodyMotionProperties12ProcessGroupERKNS_21SoftBodyUpdateContextEj(ptr noundef nonnull align 16 dereferenceable(372) %0, ptr noundef nonnull align 16 dereferenceable(196) %1, i32 noundef %19)
  %24 = getelementptr inbounds i8, ptr %1, i64 164
  %25 = tail call noundef i32 @_ZNSt13__atomic_baseIjE9fetch_addEjSt12memory_order(ptr noundef nonnull align 4 dereferenceable(4) %24, i32 noundef 1, i32 noundef 4) #5
  %26 = add i32 %25, 1
  br label %27

27:                                               ; preds = %23, %22
  %.035 = phi i32 [ %26, %23 ], [ 0, %22 ]
  %.not42 = icmp ult i32 %.035, %13
  br i1 %.not42, label %37, label %28

28:                                               ; preds = %27
  tail call void @_ZN3JPH24SoftBodyMotionProperties12ProcessGroupERKNS_21SoftBodyUpdateContextEj(ptr noundef nonnull align 16 dereferenceable(372) %0, ptr noundef nonnull align 16 dereferenceable(196) %1, i32 noundef %13)
  tail call void @_ZN3JPH24SoftBodyMotionProperties44ApplyCollisionConstraintsAndUpdateVelocitiesERKNS_21SoftBodyUpdateContextE(ptr noundef nonnull align 16 dereferenceable(372) %0, ptr noundef nonnull align 16 dereferenceable(196) %1)
  %29 = getelementptr inbounds i8, ptr %1, i64 156
  %30 = tail call noundef i32 @_ZNSt13__atomic_baseIjE9fetch_addEjSt12memory_order(ptr noundef nonnull align 4 dereferenceable(4) %29, i32 noundef 1, i32 noundef 0) #5
  %31 = getelementptr inbounds i8, ptr %0, i64 352
  %32 = load i32, ptr %31, align 16, !tbaa !6
  %33 = icmp ult i32 %30, %32
  br i1 %33, label %.thread, label %35

.thread:                                          ; preds = %28
  tail call void @_ZN3JPH24SoftBodyMotionProperties18StartNextIterationERKNS_21SoftBodyUpdateContextE(ptr noundef nonnull align 16 dereferenceable(372) %0, ptr noundef nonnull align 16 dereferenceable(196) %1)
  %34 = getelementptr inbounds i8, ptr %1, i64 164
  tail call void @_ZNSt13__atomic_baseIjE5storeEjSt12memory_order(ptr noundef nonnull align 4 dereferenceable(4) %34, i32 noundef 0, i32 noundef 3) #5
  tail call void @_ZNSt13__atomic_baseIjE5storeEjSt12memory_order(ptr noundef nonnull align 4 dereferenceable(4) %14, i32 noundef 0, i32 noundef 3) #5
  br label %37

35:                                               ; preds = %28
  tail call void @_ZN3JPH24SoftBodyMotionProperties19UpdateSoftBodyStateERNS_21SoftBodyUpdateContextERKNS_15PhysicsSettingsE(ptr noundef nonnull align 16 dereferenceable(372) %0, ptr noundef nonnull align 16 dereferenceable(196) %1, ptr noundef nonnull align 4 dereferenceable(83) %2)
  %36 = getelementptr inbounds i8, ptr %1, i64 136
  tail call void @_ZNSt6atomicIN3JPH21SoftBodyUpdateContext6EStateEE5storeES2_St12memory_order(ptr noundef nonnull align 4 dereferenceable(4) %36, i32 noundef 3, i32 noundef 3) #5
  br label %37

37:                                               ; preds = %27, %.thread, %35, %12, %18
  %.2 = phi i32 [ 4, %35 ], [ 1, %18 ], [ 1, %12 ], [ 2, %.thread ], [ 2, %27 ]
  ret i32 %.2
}

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

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

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

attributes #0 = { 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 #1 = { 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 #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 = { 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 = { 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 = { 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 2159547287}
!6 = !{!7, !16, i64 352}
!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}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass