; LLVM IR from jrouwe/JoltPhysics :: Jolt/Physics/Body (BodyManager)

; 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::UniqueLock" = type <{ ptr, ptr, i32, [4 x i8] }>
%"struct.JPH::AssertLastParam" = type { i8 }
%"class.JPH::BodyManager" = type <{ %"class.JPH::Array", i32, [4 x i8], i64, %"class.JPH::Mutex", %"class.JPH::MutexArray", %"class.JPH::Array.0", %"class.JPH::Mutex", [2 x ptr], [2 x %"struct.std::atomic"], i32, [4 x i8], %"class.JPH::Mutex", %"class.JPH::Array.3", ptr, ptr, i8, [7 x i8] }>
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::MutexArray" = type <{ ptr, i32, [4 x i8] }>
%"class.JPH::Array.0" = type { i64, i64, ptr }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::Mutex" = type { %"class.std::mutex", %"class.std::thread::id" }
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::thread::id" = type { i64 }
%"class.JPH::Array.3" = type { i64, i64, ptr }
%"class.JPH::MotionProperties" = 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, [10 x i8] }>
%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::Quat" = type { %"class.JPH::Vec4" }
%"class.JPH::Vec4" = type { %union.anon.6 }
%union.anon.6 = type { <4 x float> }
%"class.JPH::Float3" = type { float, float, float }
%"class.JPH::Sphere" = type { %"class.JPH::Float3", float }

@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [21 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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH10UniqueLockINS_5MutexEEC2ERS1_PKNS_11BodyManagerENS_17EPhysicsLockTypesE(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef nonnull align 8 dereferenceable(48), ptr noundef, i32 noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH10UniqueLockINS_5MutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(20)) 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) #3

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH11BodyManager16SetMotionQualityERNS_4BodyENS_14EMotionQualityE(ptr noundef nonnull align 8 dereferenceable(297) %0, ptr noundef nonnull align 16 dereferenceable(122) %1, i8 noundef zeroext %2) #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca ptr, align 8
  %8 = alloca %"class.JPH::UniqueLock", align 8
  %9 = alloca %"struct.JPH::AssertLastParam", align 1
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i8, align 1
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i8 %2, ptr %6, align 1, !tbaa !9
  %13 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = call noundef ptr @_ZN3JPH4Body28GetMotionPropertiesUncheckedEv(ptr noundef nonnull align 16 dereferenceable(122) %14)
  store ptr %15, ptr %7, align 8, !tbaa !5
  %16 = load ptr, ptr %7, align 8, !tbaa !5
  %17 = icmp ne ptr %16, null
  br i1 %17, label %18, label %76

18:                                               ; preds = %3
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  %20 = call noundef zeroext i8 @_ZNK3JPH16MotionProperties16GetMotionQualityEv(ptr noundef nonnull align 16 dereferenceable(182) %19)
  %21 = load i8, ptr %6, align 1, !tbaa !9
  %22 = icmp ne i8 %20, %21
  br i1 %22, label %23, label %76

23:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #5
  %24 = getelementptr inbounds %"class.JPH::BodyManager", ptr %13, i32 0, i32 7
  call void @_ZN3JPH10UniqueLockINS_5MutexEEC2ERS1_PKNS_11BodyManagerENS_17EPhysicsLockTypesE(ptr noundef nonnull align 8 dereferenceable(20) %8, ptr noundef nonnull align 8 dereferenceable(48) %24, ptr noundef %13, i32 noundef 32)
  br label %25

25:                                               ; preds = %23
  %26 = getelementptr inbounds %"class.JPH::BodyManager", ptr %13, i32 0, i32 16
  %27 = load i8, ptr %26, align 8, !tbaa !11, !range !24, !noundef !25
  %28 = trunc i8 %27 to i1
  br i1 %28, label %29, label %37

29:                                               ; preds = %25
  %30 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.15, ptr noundef @.str.1, i32 noundef 627)
          to label %31 unwind label %33

31:                                               ; preds = %29
  br i1 %30, label %32, label %37

32:                                               ; preds = %31
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !26
  br label %37

33:                                               ; preds = %29
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %10, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %11, align 4
  br label %75

37:                                               ; preds = %32, %31, %25
  br label %38

38:                                               ; preds = %37
  br label %39

39:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #5
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = invoke noundef zeroext i1 @_ZNK3JPH4Body8IsActiveEv(ptr noundef nonnull align 16 dereferenceable(122) %40)
          to label %42 unwind label %55

42:                                               ; preds = %39
  %43 = zext i1 %41 to i8
  store i8 %43, ptr %12, align 1, !tbaa !27
  %44 = load i8, ptr %12, align 1, !tbaa !27, !range !24, !noundef !25
  %45 = trunc i8 %44 to i1
  br i1 %45, label %46, label %59

46:                                               ; preds = %42
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = invoke noundef zeroext i8 @_ZNK3JPH16MotionProperties16GetMotionQualityEv(ptr noundef nonnull align 16 dereferenceable(182) %47)
          to label %49 unwind label %55

49:                                               ; preds = %46
  %50 = icmp eq i8 %48, 1
  br i1 %50, label %51, label %59

51:                                               ; preds = %49
  %52 = getelementptr inbounds %"class.JPH::BodyManager", ptr %13, i32 0, i32 10
  %53 = load i32, ptr %52, align 8, !tbaa !28
  %54 = add i32 %53, -1
  store i32 %54, ptr %52, align 8, !tbaa !28
  br label %59

55:                                               ; preds = %65, %46, %39
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %10, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #5
  br label %75

59:                                               ; preds = %51, %49, %42
  %60 = load i8, ptr %6, align 1, !tbaa !9
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = getelementptr inbounds %"class.JPH::MotionProperties", ptr %61, i32 0, i32 14
  store i8 %60, ptr %62, align 8, !tbaa !29
  %63 = load i8, ptr %12, align 1, !tbaa !27, !range !24, !noundef !25
  %64 = trunc i8 %63 to i1
  br i1 %64, label %65, label %74

65:                                               ; preds = %59
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = invoke noundef zeroext i8 @_ZNK3JPH16MotionProperties16GetMotionQualityEv(ptr noundef nonnull align 16 dereferenceable(182) %66)
          to label %68 unwind label %55

68:                                               ; preds = %65
  %69 = icmp eq i8 %67, 1
  br i1 %69, label %70, label %74

70:                                               ; preds = %68
  %71 = getelementptr inbounds %"class.JPH::BodyManager", ptr %13, i32 0, i32 10
  %72 = load i32, ptr %71, align 8, !tbaa !28
  %73 = add i32 %72, 1
  store i32 %73, ptr %71, align 8, !tbaa !28
  br label %74

74:                                               ; preds = %70, %68, %59
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #5
  call void @_ZN3JPH10UniqueLockINS_5MutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #5
  br label %76

75:                                               ; preds = %55, %33
  call void @_ZN3JPH10UniqueLockINS_5MutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %77

76:                                               ; preds = %74, %18, %3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  ret void

77:                                               ; preds = %75
  %78 = load ptr, ptr %10, align 8
  %79 = load i32, ptr %11, align 4
  %80 = insertvalue { ptr, i32 } poison, ptr %78, 0
  %81 = insertvalue { ptr, i32 } %80, i32 %79, 1
  resume { ptr, i32 } %81
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_ZNK3JPH16MotionProperties16GetMotionQualityEv(ptr noundef nonnull align 16 dereferenceable(182)) #2 align 2

attributes #0 = { 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 = { 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 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 = { 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 = !{!"_ZTSN3JPH14EMotionQualityE", !7, i64 0}
!11 = !{!12, !23, i64 296}
!12 = !{!"_ZTSN3JPH11BodyManagerE", !13, i64 0, !15, i64 24, !14, i64 32, !16, i64 40, !20, i64 88, !21, i64 104, !16, i64 128, !7, i64 176, !7, i64 192, !15, i64 200, !16, i64 208, !22, i64 256, !6, i64 280, !6, i64 288, !23, i64 296}
!13 = !{!"_ZTSN3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEEE", !14, i64 0, !14, i64 8, !6, i64 16}
!14 = !{!"long", !7, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!"_ZTSN3JPH5MutexE", !17, i64 0, !19, i64 40}
!17 = !{!"_ZTSSt5mutex", !18, i64 0}
!18 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!19 = !{!"_ZTSNSt6thread2idE", !14, i64 0}
!20 = !{!"_ZTSN3JPH10MutexArrayINS_11SharedMutexEEE", !6, i64 0, !15, i64 8}
!21 = !{!"_ZTSN3JPH5ArrayIhNS_12STLAllocatorIhEEEE", !14, i64 0, !14, i64 8, !6, i64 16}
!22 = !{!"_ZTSN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEEE", !14, i64 0, !14, i64 8, !6, i64 16}
!23 = !{!"bool", !7, i64 0}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = !{i64 2158738194}
!27 = !{!23, !23, i64 0}
!28 = !{!12, !15, i64 200}
!29 = !{!30, !10, i64 120}
!30 = !{!"_ZTSN3JPH16MotionPropertiesE", !31, i64 0, !31, i64 16, !31, i64 32, !32, i64 48, !34, i64 64, !34, i64 76, !35, i64 88, !35, i64 92, !35, i64 96, !35, i64 100, !35, i64 104, !35, i64 108, !15, i64 112, !15, i64 116, !10, i64 120, !23, i64 121, !36, i64 122, !7, i64 123, !7, i64 124, !7, i64 128, !35, i64 176, !37, i64 180, !38, i64 181}
!31 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!32 = !{!"_ZTSN3JPH4QuatE", !33, i64 0}
!33 = !{!"_ZTSN3JPH4Vec4E", !7, i64 0}
!34 = !{!"_ZTSN3JPH6Float3E", !35, i64 0, !35, i64 4, !35, i64 8}
!35 = !{!"float", !7, i64 0}
!36 = !{!"_ZTSN3JPH12EAllowedDOFsE", !7, i64 0}
!37 = !{!"_ZTSN3JPH9EBodyTypeE", !7, i64 0}
!38 = !{!"_ZTSN3JPH11EMotionTypeE", !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::UniqueLock" = type <{ ptr, ptr, i32, [4 x i8] }>

@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [21 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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH10UniqueLockINS_5MutexEEC2ERS1_PKNS_11BodyManagerENS_17EPhysicsLockTypesE(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef nonnull align 8 dereferenceable(48), ptr noundef, i32 noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH10UniqueLockINS_5MutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(20)) 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH4Body8IsActiveEv(ptr noundef nonnull align 16 dereferenceable(122)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH11BodyManager16SetMotionQualityERNS_4BodyENS_14EMotionQualityE(ptr noundef nonnull align 8 dereferenceable(297) %0, ptr noundef nonnull align 16 dereferenceable(122) %1, i8 noundef zeroext %2) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.JPH::UniqueLock", align 8
  %5 = tail call noundef ptr @_ZN3JPH4Body28GetMotionPropertiesUncheckedEv(ptr noundef nonnull align 16 dereferenceable(122) %1)
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %38, label %6

6:                                                ; preds = %3
  %7 = tail call noundef zeroext i8 @_ZNK3JPH16MotionProperties16GetMotionQualityEv(ptr noundef nonnull align 16 dereferenceable(182) %5)
  %.not14 = icmp eq i8 %7, %2
  br i1 %.not14, label %38, label %8

8:                                                ; preds = %6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  %9 = getelementptr inbounds i8, ptr %0, i64 128
  call void @_ZN3JPH10UniqueLockINS_5MutexEEC2ERS1_PKNS_11BodyManagerENS_17EPhysicsLockTypesE(ptr noundef nonnull align 8 dereferenceable(20) %4, ptr noundef nonnull align 8 dereferenceable(48) %9, ptr noundef nonnull %0, i32 noundef 32)
  %10 = getelementptr inbounds i8, ptr %0, i64 296
  %11 = load i8, ptr %10, align 8, !tbaa !5, !range !21, !noundef !22
  %12 = trunc nuw i8 %11 to i1
  br i1 %12, label %13, label %19

13:                                               ; preds = %8
  %14 = invoke noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.1, i32 noundef 627)
          to label %15 unwind label %17

15:                                               ; preds = %13
  br i1 %14, label %16, label %19

16:                                               ; preds = %15
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !23
  br label %19

17:                                               ; preds = %13
  %18 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3JPH10UniqueLockINS_5MutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  resume { ptr, i32 } %18

19:                                               ; preds = %16, %15, %8
  %20 = call noundef zeroext i1 @_ZNK3JPH4Body8IsActiveEv(ptr noundef nonnull align 16 dereferenceable(122) %1)
  br i1 %20, label %21, label %.critedge

21:                                               ; preds = %19
  %22 = call noundef zeroext i8 @_ZNK3JPH16MotionProperties16GetMotionQualityEv(ptr noundef nonnull align 16 dereferenceable(182) %5)
  %23 = icmp eq i8 %22, 1
  br i1 %23, label %24, label %28

24:                                               ; preds = %21
  %25 = getelementptr inbounds i8, ptr %0, i64 200
  %26 = load i32, ptr %25, align 8, !tbaa !24
  %27 = add i32 %26, -1
  store i32 %27, ptr %25, align 8, !tbaa !24
  br label %28

28:                                               ; preds = %21, %24
  %29 = getelementptr inbounds i8, ptr %5, i64 120
  store i8 %2, ptr %29, align 8, !tbaa !25
  %30 = call noundef zeroext i8 @_ZNK3JPH16MotionProperties16GetMotionQualityEv(ptr noundef nonnull align 16 dereferenceable(182) %5)
  %31 = icmp eq i8 %30, 1
  br i1 %31, label %32, label %37

32:                                               ; preds = %28
  %33 = getelementptr inbounds i8, ptr %0, i64 200
  %34 = load i32, ptr %33, align 8, !tbaa !24
  %35 = add i32 %34, 1
  store i32 %35, ptr %33, align 8, !tbaa !24
  br label %37

.critedge:                                        ; preds = %19
  %36 = getelementptr inbounds i8, ptr %5, i64 120
  store i8 %2, ptr %36, align 8, !tbaa !25
  br label %37

37:                                               ; preds = %.critedge, %32, %28
  call void @_ZN3JPH10UniqueLockINS_5MutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  br label %38

38:                                               ; preds = %37, %6, %3
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_ZNK3JPH16MotionProperties16GetMotionQualityEv(ptr noundef nonnull align 16 dereferenceable(182)) local_unnamed_addr #2 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 = { 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 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 = { 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, !20, i64 296}
!6 = !{!"_ZTSN3JPH11BodyManagerE", !7, i64 0, !12, i64 24, !8, i64 32, !13, i64 40, !17, i64 88, !18, i64 104, !13, i64 128, !9, i64 176, !9, i64 192, !12, i64 200, !13, i64 208, !19, i64 256, !11, i64 280, !11, i64 288, !20, i64 296}
!7 = !{!"_ZTSN3JPH5ArrayIPNS_4BodyENS_12STLAllocatorIS2_EEEE", !8, i64 0, !8, i64 8, !11, i64 16}
!8 = !{!"long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!"int", !9, i64 0}
!13 = !{!"_ZTSN3JPH5MutexE", !14, i64 0, !16, i64 40}
!14 = !{!"_ZTSSt5mutex", !15, i64 0}
!15 = !{!"_ZTSSt12__mutex_base", !9, i64 0}
!16 = !{!"_ZTSNSt6thread2idE", !8, i64 0}
!17 = !{!"_ZTSN3JPH10MutexArrayINS_11SharedMutexEEE", !11, i64 0, !12, i64 8}
!18 = !{!"_ZTSN3JPH5ArrayIhNS_12STLAllocatorIhEEEE", !8, i64 0, !8, i64 8, !11, i64 16}
!19 = !{!"_ZTSN3JPH5ArrayINS_6BodyIDENS_12STLAllocatorIS1_EEEE", !8, i64 0, !8, i64 8, !11, i64 16}
!20 = !{!"bool", !9, i64 0}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{i64 2158738194}
!24 = !{!6, !12, i64 200}
!25 = !{!26, !32, i64 120}
!26 = !{!"_ZTSN3JPH16MotionPropertiesE", !27, i64 0, !27, i64 16, !27, i64 32, !28, i64 48, !30, i64 64, !30, i64 76, !31, i64 88, !31, i64 92, !31, i64 96, !31, i64 100, !31, i64 104, !31, i64 108, !12, i64 112, !12, i64 116, !32, i64 120, !20, i64 121, !33, i64 122, !9, i64 123, !9, i64 124, !9, i64 128, !31, i64 176, !34, i64 180, !35, i64 181}
!27 = !{!"_ZTSN3JPH4Vec3E", !9, i64 0}
!28 = !{!"_ZTSN3JPH4QuatE", !29, i64 0}
!29 = !{!"_ZTSN3JPH4Vec4E", !9, i64 0}
!30 = !{!"_ZTSN3JPH6Float3E", !31, i64 0, !31, i64 4, !31, i64 8}
!31 = !{!"float", !9, i64 0}
!32 = !{!"_ZTSN3JPH14EMotionQualityE", !9, i64 0}
!33 = !{!"_ZTSN3JPH12EAllowedDOFsE", !9, i64 0}
!34 = !{!"_ZTSN3JPH9EBodyTypeE", !9, i64 0}
!35 = !{!"_ZTSN3JPH11EMotionTypeE", !9, i64 0}


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