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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.JPH::Vec3" = type { %union.anon }
%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::BodyLockWrite" = type { %"class.JPH::BodyLockBase" }
%"class.JPH::BodyLockBase" = type { ptr, ptr, ptr }
%"class.JPH::BodyID" = type { i32 }
%"class.JPH::BodyInterface" = type { ptr, ptr, ptr }

; 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: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH13BodyLockWriteCI2NS_12BodyLockBaseILb1ENS_4BodyEEEERKNS_17BodyLockInterfaceERKNS_6BodyIDE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(122) ptr @_ZNK3JPH12BodyLockBaseILb1ENS_4BodyEE7GetBodyEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; 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) #3

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

declare void @_ZN3JPH11BodyManager14ActivateBodiesEPKNS_6BodyIDEi(ptr noundef nonnull align 8 dereferenceable(297), ptr noundef, i32 noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH12BodyLockBaseILb1ENS_4BodyEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5 align 2

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

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

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

declare void @_ZN3JPH4Body30SetPositionAndRotationInternalENS_4Vec3ENS_4QuatEb(ptr noundef nonnull align 16 dereferenceable(122), double, double, double, double, i1 noundef zeroext) #4

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH4Vec310IsNearZeroEf(ptr noundef nonnull align 16 dereferenceable(16), float noundef) #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH4Body24SetLinearVelocityClampedENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(122), double, double) #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH4Body25SetAngularVelocityClampedENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(122), double, double) #7 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH13BodyInterface30SetPositionRotationAndVelocityERKNS_6BodyIDENS_4Vec3ENS_4QuatES4_S4_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9) #7 align 2 personality ptr @__gxx_personality_v0 {
  %11 = alloca %"class.JPH::Vec3", align 16
  %12 = alloca %"class.JPH::Quat", align 16
  %13 = alloca %"class.JPH::Vec3", align 16
  %14 = alloca %"class.JPH::Vec3", align 16
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca %"class.JPH::BodyLockWrite", align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca %"class.JPH::Vec3", align 16
  %22 = alloca %"class.JPH::Quat", align 16
  %23 = alloca %"class.JPH::BodyID", align 4
  %24 = alloca %"class.JPH::Vec3", align 16
  %25 = alloca %"class.JPH::Vec3", align 16
  %26 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 0
  store double %2, ptr %26, align 16
  %27 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 1
  store double %3, ptr %27, align 8
  %28 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 0
  store double %4, ptr %28, align 16
  %29 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 1
  store double %5, ptr %29, align 8
  %30 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 0
  store double %6, ptr %30, align 16
  %31 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 1
  store double %7, ptr %31, align 8
  %32 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 0
  store double %8, ptr %32, align 16
  %33 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 1
  store double %9, ptr %33, align 8
  store ptr %0, ptr %15, align 8, !tbaa !5
  store ptr %1, ptr %16, align 8, !tbaa !5
  %34 = load ptr, ptr %15, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #8
  %35 = getelementptr inbounds %"class.JPH::BodyInterface", ptr %34, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8, !tbaa !9
  %37 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN3JPH13BodyLockWriteCI2NS_12BodyLockBaseILb1ENS_4BodyEEEERKNS_17BodyLockInterfaceERKNS_6BodyIDE(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(16) %36, ptr noundef nonnull align 4 dereferenceable(4) %37)
  %38 = invoke noundef zeroext i1 @_ZNK3JPH12BodyLockBaseILb1ENS_4BodyEE9SucceededEv(ptr noundef nonnull align 8 dereferenceable(24) %17)
          to label %39 unwind label %66

39:                                               ; preds = %10
  br i1 %38, label %40, label %112

40:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %41 = invoke noundef nonnull align 16 dereferenceable(122) ptr @_ZNK3JPH12BodyLockBaseILb1ENS_4BodyEE7GetBodyEv(ptr noundef nonnull align 8 dereferenceable(24) %17)
          to label %42 unwind label %70

42:                                               ; preds = %40
  store ptr %41, ptr %20, align 8, !tbaa !5
  %43 = load ptr, ptr %20, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %21, ptr align 16 %11, i64 16, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %22, ptr align 16 %12, i64 16, i1 false), !tbaa.struct !11
  %44 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 0
  %45 = load double, ptr %44, align 16
  %46 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 1
  %47 = load double, ptr %46, align 8
  %48 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 0
  %49 = load double, ptr %48, align 16
  %50 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 1
  %51 = load double, ptr %50, align 8
  invoke void @_ZN3JPH4Body30SetPositionAndRotationInternalENS_4Vec3ENS_4QuatEb(ptr noundef nonnull align 16 dereferenceable(122) %43, double %45, double %47, double %49, double %51, i1 noundef zeroext true)
          to label %52 unwind label %70

52:                                               ; preds = %42
  %53 = load ptr, ptr %20, align 8, !tbaa !5
  %54 = invoke noundef zeroext i1 @_ZNK3JPH4Body14IsInBroadPhaseEv(ptr noundef nonnull align 16 dereferenceable(122) %53)
          to label %55 unwind label %70

55:                                               ; preds = %52
  br i1 %54, label %56, label %78

56:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  %57 = load ptr, ptr %20, align 8, !tbaa !5
  %58 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122) %57)
          to label %59 unwind label %74

59:                                               ; preds = %56
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 4 %58, i64 4, i1 false), !tbaa.struct !13
  %60 = getelementptr inbounds %"class.JPH::BodyInterface", ptr %34, i32 0, i32 2
  %61 = load ptr, ptr %60, align 8, !tbaa !16
  %62 = load ptr, ptr %61, align 8, !tbaa !17
  %63 = getelementptr inbounds ptr, ptr %62, i64 19
  %64 = load ptr, ptr %63, align 8
  invoke void %64(ptr noundef nonnull align 8 dereferenceable(16) %61, ptr noundef %23, i32 noundef 1, i1 noundef zeroext true)
          to label %65 unwind label %74

65:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %78

66:                                               ; preds = %10
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %18, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %19, align 4
  br label %113

70:                                               ; preds = %104, %101, %98, %94, %88, %82, %78, %52, %42, %40
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %18, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %19, align 4
  br label %111

74:                                               ; preds = %59, %56
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %18, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %111

78:                                               ; preds = %65, %55
  %79 = load ptr, ptr %20, align 8, !tbaa !5
  %80 = invoke noundef zeroext i1 @_ZNK3JPH4Body8IsStaticEv(ptr noundef nonnull align 16 dereferenceable(122) %79)
          to label %81 unwind label %70

81:                                               ; preds = %78
  br i1 %80, label %110, label %82

82:                                               ; preds = %81
  %83 = load ptr, ptr %20, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %24, ptr align 16 %13, i64 16, i1 false), !tbaa.struct !11
  %84 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 0
  %85 = load double, ptr %84, align 16
  %86 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 1
  %87 = load double, ptr %86, align 8
  invoke void @_ZN3JPH4Body24SetLinearVelocityClampedENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(122) %83, double %85, double %87)
          to label %88 unwind label %70

88:                                               ; preds = %82
  %89 = load ptr, ptr %20, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %25, ptr align 16 %14, i64 16, i1 false), !tbaa.struct !11
  %90 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 0
  %91 = load double, ptr %90, align 16
  %92 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 1
  %93 = load double, ptr %92, align 8
  invoke void @_ZN3JPH4Body25SetAngularVelocityClampedENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(122) %89, double %91, double %93)
          to label %94 unwind label %70

94:                                               ; preds = %88
  %95 = load ptr, ptr %20, align 8, !tbaa !5
  %96 = invoke noundef zeroext i1 @_ZNK3JPH4Body8IsActiveEv(ptr noundef nonnull align 16 dereferenceable(122) %95)
          to label %97 unwind label %70

97:                                               ; preds = %94
  br i1 %96, label %109, label %98

98:                                               ; preds = %97
  %99 = invoke noundef zeroext i1 @_ZNK3JPH4Vec310IsNearZeroEf(ptr noundef nonnull align 16 dereferenceable(16) %13, float noundef 0x3D71979980000000)
          to label %100 unwind label %70

100:                                              ; preds = %98
  br i1 %99, label %101, label %104

101:                                              ; preds = %100
  %102 = invoke noundef zeroext i1 @_ZNK3JPH4Vec310IsNearZeroEf(ptr noundef nonnull align 16 dereferenceable(16) %14, float noundef 0x3D71979980000000)
          to label %103 unwind label %70

103:                                              ; preds = %101
  br i1 %102, label %109, label %104

104:                                              ; preds = %103, %100
  %105 = getelementptr inbounds %"class.JPH::BodyInterface", ptr %34, i32 0, i32 1
  %106 = load ptr, ptr %105, align 8, !tbaa !19
  %107 = load ptr, ptr %16, align 8, !tbaa !5
  invoke void @_ZN3JPH11BodyManager14ActivateBodiesEPKNS_6BodyIDEi(ptr noundef nonnull align 8 dereferenceable(297) %106, ptr noundef %107, i32 noundef 1)
          to label %108 unwind label %70

108:                                              ; preds = %104
  br label %109

109:                                              ; preds = %108, %103, %97
  br label %110

110:                                              ; preds = %109, %81
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  br label %112

111:                                              ; preds = %74, %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  br label %113

112:                                              ; preds = %110, %39
  call void @_ZN3JPH12BodyLockBaseILb1ENS_4BodyEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #8
  ret void

113:                                              ; preds = %111, %66
  call void @_ZN3JPH12BodyLockBaseILb1ENS_4BodyEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #8
  br label %114

114:                                              ; preds = %113
  %115 = load ptr, ptr %18, align 8
  %116 = load i32, ptr %19, align 4
  %117 = insertvalue { ptr, i32 } poison, ptr %115, 0
  %118 = insertvalue { ptr, i32 } %117, i32 %116, 1
  resume { ptr, i32 } %118
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "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 = { 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 #7 = { 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 #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, !6, i64 0}
!10 = !{!"_ZTSN3JPH13BodyInterfaceE", !6, i64 0, !6, i64 8, !6, i64 16}
!11 = !{i64 0, i64 16, !12}
!12 = !{!7, !7, i64 0}
!13 = !{i64 0, i64 4, !14}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!10, !6, i64 16}
!17 = !{!18, !18, i64 0}
!18 = !{!"vtable pointer", !8, i64 0}
!19 = !{!10, !6, i64 8}


; 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 }
%union.anon = type { <4 x float> }
%"class.JPH::BodyLockWrite" = type { %"class.JPH::BodyLockBase" }
%"class.JPH::BodyLockBase" = type { ptr, ptr, ptr }
%"class.JPH::BodyID" = type { i32 }

; 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: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH13BodyLockWriteCI2NS_12BodyLockBaseILb1ENS_4BodyEEEERKNS_17BodyLockInterfaceERKNS_6BodyIDE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(122) ptr @_ZNK3JPH12BodyLockBaseILb1ENS_4BodyEE7GetBodyEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

declare void @_ZN3JPH11BodyManager14ActivateBodiesEPKNS_6BodyIDEi(ptr noundef nonnull align 8 dereferenceable(297), ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH12BodyLockBaseILb1ENS_4BodyEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

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

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

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

declare void @_ZN3JPH4Body30SetPositionAndRotationInternalENS_4Vec3ENS_4QuatEb(ptr noundef nonnull align 16 dereferenceable(122), double, double, double, double, i1 noundef zeroext) local_unnamed_addr #3

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH4Vec310IsNearZeroEf(ptr noundef nonnull align 16 dereferenceable(16), float noundef) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH4Body24SetLinearVelocityClampedENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(122), double, double) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH4Body25SetAngularVelocityClampedENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(122), double, double) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH13BodyInterface30SetPositionRotationAndVelocityERKNS_6BodyIDENS_4Vec3ENS_4QuatES4_S4_(ptr nocapture noundef nonnull readonly align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(4) %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9) local_unnamed_addr #6 align 2 personality ptr @__gxx_personality_v0 {
  %11 = alloca %"class.JPH::Vec3", align 16
  %12 = alloca %"class.JPH::Vec3", align 16
  %13 = alloca %"class.JPH::BodyLockWrite", align 8
  %14 = alloca %"class.JPH::BodyID", align 4
  store double %6, ptr %11, align 16
  %15 = getelementptr inbounds i8, ptr %11, i64 8
  store double %7, ptr %15, align 8
  store double %8, ptr %12, align 16
  %16 = getelementptr inbounds i8, ptr %12, i64 8
  store double %9, ptr %16, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #7
  %17 = load ptr, ptr %0, align 8, !tbaa !5
  call void @_ZN3JPH13BodyLockWriteCI2NS_12BodyLockBaseILb1ENS_4BodyEEEERKNS_17BodyLockInterfaceERKNS_6BodyIDE(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %18 = call noundef zeroext i1 @_ZNK3JPH12BodyLockBaseILb1ENS_4BodyEE9SucceededEv(ptr noundef nonnull align 8 dereferenceable(24) %13)
  br i1 %18, label %19, label %51

19:                                               ; preds = %10
  %20 = invoke noundef nonnull align 16 dereferenceable(122) ptr @_ZNK3JPH12BodyLockBaseILb1ENS_4BodyEE7GetBodyEv(ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %21 unwind label %33

21:                                               ; preds = %19
  invoke void @_ZN3JPH4Body30SetPositionAndRotationInternalENS_4Vec3ENS_4QuatEb(ptr noundef nonnull align 16 dereferenceable(122) %20, double %2, double %3, double %4, double %5, i1 noundef zeroext true)
          to label %22 unwind label %33

22:                                               ; preds = %21
  %23 = call noundef zeroext i1 @_ZNK3JPH4Body14IsInBroadPhaseEv(ptr noundef nonnull align 16 dereferenceable(122) %20)
  br i1 %23, label %24, label %37

24:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #7
  %25 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122) %20)
  %26 = load i32, ptr %25, align 4, !tbaa !10
  store i32 %26, ptr %14, align 4, !tbaa !10
  %27 = getelementptr inbounds i8, ptr %0, i64 16
  %28 = load ptr, ptr %27, align 8, !tbaa !12
  %29 = load ptr, ptr %28, align 8, !tbaa !13
  %30 = getelementptr inbounds i8, ptr %29, i64 152
  %31 = load ptr, ptr %30, align 8
  invoke void %31(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull %14, i32 noundef 1, i1 noundef zeroext true)
          to label %32 unwind label %35

32:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #7
  br label %37

33:                                               ; preds = %47, %40, %39, %21, %19
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %50

35:                                               ; preds = %24
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #7
  br label %50

37:                                               ; preds = %32, %22
  %38 = call noundef zeroext i1 @_ZNK3JPH4Body8IsStaticEv(ptr noundef nonnull align 16 dereferenceable(122) %20)
  br i1 %38, label %51, label %39

39:                                               ; preds = %37
  invoke void @_ZN3JPH4Body24SetLinearVelocityClampedENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(122) %20, double %6, double %7)
          to label %40 unwind label %33

40:                                               ; preds = %39
  invoke void @_ZN3JPH4Body25SetAngularVelocityClampedENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(122) %20, double %8, double %9)
          to label %41 unwind label %33

41:                                               ; preds = %40
  %42 = call noundef zeroext i1 @_ZNK3JPH4Body8IsActiveEv(ptr noundef nonnull align 16 dereferenceable(122) %20)
  br i1 %42, label %51, label %43

43:                                               ; preds = %41
  %44 = call noundef zeroext i1 @_ZNK3JPH4Vec310IsNearZeroEf(ptr noundef nonnull align 16 dereferenceable(16) %11, float noundef 0x3D71979980000000)
  br i1 %44, label %45, label %47

45:                                               ; preds = %43
  %46 = call noundef zeroext i1 @_ZNK3JPH4Vec310IsNearZeroEf(ptr noundef nonnull align 16 dereferenceable(16) %12, float noundef 0x3D71979980000000)
  br i1 %46, label %51, label %47

47:                                               ; preds = %45, %43
  %48 = getelementptr inbounds i8, ptr %0, i64 8
  %49 = load ptr, ptr %48, align 8, !tbaa !15
  invoke void @_ZN3JPH11BodyManager14ActivateBodiesEPKNS_6BodyIDEi(ptr noundef nonnull align 8 dereferenceable(297) %49, ptr noundef nonnull %1, i32 noundef 1)
          to label %51 unwind label %33

50:                                               ; preds = %35, %33
  %.pn = phi { ptr, i32 } [ %34, %33 ], [ %36, %35 ]
  call void @_ZN3JPH12BodyLockBaseILb1ENS_4BodyEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #7
  resume { ptr, i32 } %.pn

51:                                               ; preds = %37, %47, %45, %41, %10
  call void @_ZN3JPH12BodyLockBaseILb1ENS_4BodyEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #7
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { "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 = { 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 #6 = { 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, !7, i64 0}
!6 = !{!"_ZTSN3JPH13BodyInterfaceE", !7, i64 0, !7, i64 8, !7, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!6, !7, i64 16}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !9, i64 0}
!15 = !{!6, !7, i64 8}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass