; LLVM IR from zig-gamedev/zphysics :: libs/Jolt/Physics/Character (CharacterVirtual)

; 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::CharacterVirtual" = type <{ %"class.JPH::CharacterBase", ptr, ptr, i8, [3 x i8], float, i32, i32, float, float, float, i32, float, float, i8, [3 x i8], float, float, [12 x i8], %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Quat", %"class.JPH::Vec3", %"class.JPH::Array.2", float, i8, [3 x i8], i64, %"class.JPH::BodyID", [4 x i8] }>
%"class.JPH::CharacterBase" = type { ptr, %"class.JPH::RefTarget", ptr, %"class.JPH::RefConst", %"class.JPH::Vec3", %"class.JPH::Plane", float, i32, %"class.JPH::BodyID", %"class.JPH::SubShapeID", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::RefConst.1", i64 }
%"class.JPH::RefTarget" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::RefConst" = type { ptr }
%"class.JPH::Plane" = type { %"class.JPH::Vec4" }
%"class.JPH::Vec4" = type { %union.anon.0 }
%union.anon.0 = type { <4 x float> }
%"class.JPH::SubShapeID" = type { i32 }
%"class.JPH::RefConst.1" = type { ptr }
%"class.JPH::Quat" = type { %"class.JPH::Vec4" }
%"class.JPH::Array.2" = type { i64, i64, ptr }
%"class.JPH::BodyID" = type { i32 }

; 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH13PhysicsSystem16GetBodyInterfaceEv(ptr noundef nonnull align 16 dereferenceable(1140)) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH16CharacterVirtual24UpdateInnerBodyTransformEv(ptr noundef nonnull align 16 dereferenceable(332)) #4 align 2

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef, double, double) #6

declare void @_ZN3JPH13BodyInterface10AddImpulseERKNS_6BodyIDENS_4Vec3ES4_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4), double, double, double, double) #7

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH16CharacterVirtual23UpdateSupportingContactEbRNS_13TempAllocatorE(ptr noundef nonnull align 16 dereferenceable(332), i1 noundef zeroext, ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3JPH16CharacterVirtual9MoveShapeERNS_4Vec3ES1_fPNS_5ArrayINS0_7ContactENS_12STLAllocatorIS4_EEEERKNS_21BroadPhaseLayerFilterERKNS_17ObjectLayerFilterERKNS_10BodyFilterERKNS_11ShapeFilterERNS_13TempAllocatorE(ptr noundef nonnull align 16 dereferenceable(332), ptr noundef nonnull align 16 dereferenceable(16), double, double, float noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH16CharacterVirtual6UpdateEfNS_4Vec3ERKNS_21BroadPhaseLayerFilterERKNS_17ObjectLayerFilterERKNS_10BodyFilterERKNS_11ShapeFilterERNS_13TempAllocatorE(ptr noundef nonnull align 16 dereferenceable(332) %0, float noundef %1, double %2, double %3, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(12) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #4 align 2 {
  %10 = alloca %"class.JPH::Vec3", align 16
  %11 = alloca ptr, align 8
  %12 = alloca float, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca %"class.JPH::Vec3", align 16
  %19 = alloca float, align 4
  %20 = alloca %"class.JPH::Vec3", align 16
  %21 = alloca %"class.JPH::Vec3", align 16
  %22 = alloca %"class.JPH::Vec3", align 16
  %23 = alloca %"class.JPH::Vec3", align 16
  %24 = alloca %"class.JPH::Vec3", align 16
  %25 = getelementptr inbounds { double, double }, ptr %10, i32 0, i32 0
  store double %2, ptr %25, align 16
  %26 = getelementptr inbounds { double, double }, ptr %10, i32 0, i32 1
  store double %3, ptr %26, align 8
  store ptr %0, ptr %11, align 8, !tbaa !5
  store float %1, ptr %12, align 4, !tbaa !9
  store ptr %4, ptr %13, align 8, !tbaa !5
  store ptr %5, ptr %14, align 8, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !5
  store ptr %7, ptr %16, align 8, !tbaa !5
  store ptr %8, ptr %17, align 8, !tbaa !5
  %27 = load ptr, ptr %11, align 8
  %28 = load float, ptr %12, align 4, !tbaa !9
  %29 = fcmp ole float %28, 0.000000e+00
  br i1 %29, label %30, label %31

30:                                               ; preds = %9
  br label %98

31:                                               ; preds = %9
  %32 = load float, ptr %12, align 4, !tbaa !9
  %33 = getelementptr inbounds %"class.JPH::CharacterVirtual", ptr %27, i32 0, i32 24
  store float %32, ptr %33, align 8, !tbaa !11
  %34 = getelementptr inbounds %"class.JPH::CharacterVirtual", ptr %27, i32 0, i32 20
  %35 = getelementptr inbounds %"class.JPH::CharacterVirtual", ptr %27, i32 0, i32 22
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %18, ptr align 16 %35, i64 16, i1 false), !tbaa.struct !31
  %36 = load float, ptr %12, align 4, !tbaa !9
  %37 = getelementptr inbounds %"class.JPH::CharacterVirtual", ptr %27, i32 0, i32 23
  %38 = load ptr, ptr %13, align 8, !tbaa !5
  %39 = load ptr, ptr %14, align 8, !tbaa !5
  %40 = load ptr, ptr %15, align 8, !tbaa !5
  %41 = load ptr, ptr %16, align 8, !tbaa !5
  %42 = load ptr, ptr %17, align 8, !tbaa !5
  %43 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %44 = load double, ptr %43, align 16
  %45 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %46 = load double, ptr %45, align 8
  call void @_ZNK3JPH16CharacterVirtual9MoveShapeERNS_4Vec3ES1_fPNS_5ArrayINS0_7ContactENS_12STLAllocatorIS4_EEEERKNS_21BroadPhaseLayerFilterERKNS_17ObjectLayerFilterERKNS_10BodyFilterERKNS_11ShapeFilterERNS_13TempAllocatorE(ptr noundef nonnull align 16 dereferenceable(332) %27, ptr noundef nonnull align 16 dereferenceable(16) %34, double %44, double %46, float noundef %36, ptr noundef %37, ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef nonnull align 8 dereferenceable(8) %40, ptr noundef nonnull align 8 dereferenceable(12) %41, ptr noundef nonnull align 8 dereferenceable(8) %42)
  %47 = load ptr, ptr %17, align 8, !tbaa !5
  call void @_ZN3JPH16CharacterVirtual23UpdateSupportingContactEbRNS_13TempAllocatorE(ptr noundef nonnull align 16 dereferenceable(332) %27, i1 noundef zeroext false, ptr noundef nonnull align 8 dereferenceable(8) %47)
  call void @_ZN3JPH16CharacterVirtual24UpdateInnerBodyTransformEv(ptr noundef nonnull align 16 dereferenceable(332) %27)
  %48 = getelementptr inbounds %"class.JPH::CharacterBase", ptr %27, i32 0, i32 8
  %49 = call noundef zeroext i1 @_ZNK3JPH6BodyID9IsInvalidEv(ptr noundef nonnull align 4 dereferenceable(4) %48)
  br i1 %49, label %98, label %50

50:                                               ; preds = %31
  %51 = getelementptr inbounds %"class.JPH::CharacterVirtual", ptr %27, i32 0, i32 16
  %52 = load float, ptr %51, align 4, !tbaa !33
  %53 = fcmp ogt float %52, 0.000000e+00
  br i1 %53, label %54, label %98

54:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %55 = getelementptr inbounds %"class.JPH::CharacterBase", ptr %27, i32 0, i32 11
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %20, ptr align 16 %10, i64 16, i1 false), !tbaa.struct !31
  %56 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %57 = load double, ptr %56, align 16
  %58 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %59 = load double, ptr %58, align 8
  %60 = call noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %55, double %57, double %59)
  store float %60, ptr %19, align 4, !tbaa !9
  %61 = load float, ptr %19, align 4, !tbaa !9
  %62 = fcmp olt float %61, 0.000000e+00
  br i1 %62, label %63, label %97

63:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #8
  %64 = getelementptr inbounds %"class.JPH::CharacterVirtual", ptr %27, i32 0, i32 16
  %65 = load float, ptr %64, align 4, !tbaa !33
  %66 = load float, ptr %19, align 4, !tbaa !9
  %67 = fmul float %65, %66
  %68 = call noundef float @_ZNK3JPH4Vec36LengthEv(ptr noundef nonnull align 16 dereferenceable(16) %10)
  %69 = fdiv float %67, %68
  %70 = load float, ptr %12, align 4, !tbaa !9
  %71 = fmul float %69, %70
  %72 = fneg float %71
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %22, ptr align 16 %10, i64 16, i1 false), !tbaa.struct !31
  %73 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 0
  %74 = load double, ptr %73, align 16
  %75 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 1
  %76 = load double, ptr %75, align 8
  %77 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %72, double %74, double %76)
  %78 = getelementptr inbounds %"class.JPH::Vec3", ptr %21, i32 0, i32 0
  %79 = getelementptr inbounds %union.anon, ptr %78, i32 0, i32 0
  %80 = getelementptr inbounds { double, double }, ptr %79, i32 0, i32 0
  %81 = extractvalue { double, double } %77, 0
  store double %81, ptr %80, align 16
  %82 = getelementptr inbounds { double, double }, ptr %79, i32 0, i32 1
  %83 = extractvalue { double, double } %77, 1
  store double %83, ptr %82, align 8
  %84 = getelementptr inbounds %"class.JPH::CharacterBase", ptr %27, i32 0, i32 2
  %85 = load ptr, ptr %84, align 16, !tbaa !34
  %86 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH13PhysicsSystem16GetBodyInterfaceEv(ptr noundef nonnull align 16 dereferenceable(1140) %85)
  %87 = getelementptr inbounds %"class.JPH::CharacterBase", ptr %27, i32 0, i32 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %23, ptr align 16 %21, i64 16, i1 false), !tbaa.struct !31
  %88 = getelementptr inbounds %"class.JPH::CharacterBase", ptr %27, i32 0, i32 10
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %24, ptr align 16 %88, i64 16, i1 false), !tbaa.struct !31
  %89 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 0
  %90 = load double, ptr %89, align 16
  %91 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 1
  %92 = load double, ptr %91, align 8
  %93 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 0
  %94 = load double, ptr %93, align 16
  %95 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 1
  %96 = load double, ptr %95, align 8
  call void @_ZN3JPH13BodyInterface10AddImpulseERKNS_6BodyIDENS_4Vec3ES4_(ptr noundef nonnull align 8 dereferenceable(24) %86, ptr noundef nonnull align 4 dereferenceable(4) %87, double %90, double %92, double %94, double %96)
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #8
  br label %97

97:                                               ; preds = %63, %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %98

98:                                               ; preds = %97, %50, %31, %30
  ret void
}

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK3JPH4Vec36LengthEv(ptr noundef nonnull align 16 dereferenceable(16)) #5 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 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 = { 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 = { 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 = { 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 #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, !10, i64 312}
!12 = !{!"_ZTSN3JPH16CharacterVirtualE", !13, i64 0, !6, i64 144, !6, i64 152, !27, i64 160, !10, i64 164, !17, i64 168, !17, i64 172, !10, i64 176, !10, i64 180, !10, i64 184, !17, i64 188, !10, i64 192, !10, i64 196, !28, i64 200, !10, i64 204, !10, i64 208, !19, i64 224, !19, i64 240, !29, i64 256, !19, i64 272, !30, i64 288, !10, i64 312, !28, i64 316, !26, i64 320, !23, i64 328}
!13 = !{!"_ZTSN3JPH13CharacterBaseE", !14, i64 8, !6, i64 16, !18, i64 24, !19, i64 32, !20, i64 48, !10, i64 64, !22, i64 68, !23, i64 72, !24, i64 76, !19, i64 80, !19, i64 96, !19, i64 112, !25, i64 128, !26, i64 136}
!14 = !{!"_ZTSN3JPH9RefTargetINS_13CharacterBaseEEE", !15, i64 0}
!15 = !{!"_ZTSSt6atomicIjE", !16, i64 0}
!16 = !{!"_ZTSSt13__atomic_baseIjE", !17, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!"_ZTSN3JPH8RefConstINS_5ShapeEEE", !6, i64 0}
!19 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!20 = !{!"_ZTSN3JPH5PlaneE", !21, i64 0}
!21 = !{!"_ZTSN3JPH4Vec4E", !7, i64 0}
!22 = !{!"_ZTSN3JPH13CharacterBase12EGroundStateE", !7, i64 0}
!23 = !{!"_ZTSN3JPH6BodyIDE", !17, i64 0}
!24 = !{!"_ZTSN3JPH10SubShapeIDE", !17, i64 0}
!25 = !{!"_ZTSN3JPH8RefConstINS_15PhysicsMaterialEEE", !6, i64 0}
!26 = !{!"long", !7, i64 0}
!27 = !{!"_ZTSN3JPH13EBackFaceModeE", !7, i64 0}
!28 = !{!"bool", !7, i64 0}
!29 = !{!"_ZTSN3JPH4QuatE", !21, i64 0}
!30 = !{!"_ZTSN3JPH5ArrayINS_16CharacterVirtual7ContactENS_12STLAllocatorIS2_EEEE", !26, i64 0, !26, i64 8, !6, i64 16}
!31 = !{i64 0, i64 16, !32}
!32 = !{!7, !7, i64 0}
!33 = !{!12, !10, i64 204}
!34 = !{!13, !6, i64 16}


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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH13PhysicsSystem16GetBodyInterfaceEv(ptr noundef nonnull align 16 dereferenceable(1140)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH6BodyID9IsInvalidEv(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH16CharacterVirtual24UpdateInnerBodyTransformEv(ptr noundef nonnull align 16 dereferenceable(332)) local_unnamed_addr #2 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) local_unnamed_addr #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef, double, double) local_unnamed_addr #4

declare void @_ZN3JPH13BodyInterface10AddImpulseERKNS_6BodyIDENS_4Vec3ES4_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4), double, double, double, double) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH16CharacterVirtual23UpdateSupportingContactEbRNS_13TempAllocatorE(ptr noundef nonnull align 16 dereferenceable(332), i1 noundef zeroext, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3JPH16CharacterVirtual9MoveShapeERNS_4Vec3ES1_fPNS_5ArrayINS0_7ContactENS_12STLAllocatorIS4_EEEERKNS_21BroadPhaseLayerFilterERKNS_17ObjectLayerFilterERKNS_10BodyFilterERKNS_11ShapeFilterERNS_13TempAllocatorE(ptr noundef nonnull align 16 dereferenceable(332), ptr noundef nonnull align 16 dereferenceable(16), double, double, float noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH16CharacterVirtual6UpdateEfNS_4Vec3ERKNS_21BroadPhaseLayerFilterERKNS_17ObjectLayerFilterERKNS_10BodyFilterERKNS_11ShapeFilterERNS_13TempAllocatorE(ptr noundef nonnull align 16 dereferenceable(332) %0, float noundef %1, double %2, double %3, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(12) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) local_unnamed_addr #2 align 2 {
  %10 = alloca %"class.JPH::Vec3", align 16
  store double %2, ptr %10, align 16
  %11 = getelementptr inbounds i8, ptr %10, i64 8
  store double %3, ptr %11, align 8
  %12 = fcmp ugt float %1, 0.000000e+00
  br i1 %12, label %13, label %42

13:                                               ; preds = %9
  %14 = getelementptr inbounds i8, ptr %0, i64 312
  store float %1, ptr %14, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %0, i64 240
  %16 = getelementptr inbounds i8, ptr %0, i64 272
  %.sroa.09.0.copyload = load double, ptr %16, align 16
  %.sroa.210.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 280
  %.sroa.210.0.copyload = load double, ptr %.sroa.210.0..sroa_idx, align 8, !tbaa !29
  %17 = getelementptr inbounds i8, ptr %0, i64 288
  tail call void @_ZNK3JPH16CharacterVirtual9MoveShapeERNS_4Vec3ES1_fPNS_5ArrayINS0_7ContactENS_12STLAllocatorIS4_EEEERKNS_21BroadPhaseLayerFilterERKNS_17ObjectLayerFilterERKNS_10BodyFilterERKNS_11ShapeFilterERNS_13TempAllocatorE(ptr noundef nonnull align 16 dereferenceable(332) %0, ptr noundef nonnull align 16 dereferenceable(16) %15, double %.sroa.09.0.copyload, double %.sroa.210.0.copyload, float noundef %1, ptr noundef nonnull %17, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(12) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
  tail call void @_ZN3JPH16CharacterVirtual23UpdateSupportingContactEbRNS_13TempAllocatorE(ptr noundef nonnull align 16 dereferenceable(332) %0, i1 noundef zeroext false, ptr noundef nonnull align 8 dereferenceable(8) %8)
  tail call void @_ZN3JPH16CharacterVirtual24UpdateInnerBodyTransformEv(ptr noundef nonnull align 16 dereferenceable(332) %0)
  %18 = getelementptr inbounds i8, ptr %0, i64 72
  %19 = tail call noundef zeroext i1 @_ZNK3JPH6BodyID9IsInvalidEv(ptr noundef nonnull align 4 dereferenceable(4) %18)
  br i1 %19, label %42, label %20

20:                                               ; preds = %13
  %21 = getelementptr inbounds i8, ptr %0, i64 204
  %22 = load float, ptr %21, align 4, !tbaa !30
  %23 = fcmp ogt float %22, 0.000000e+00
  br i1 %23, label %24, label %42

24:                                               ; preds = %20
  %25 = getelementptr inbounds i8, ptr %0, i64 96
  %26 = tail call noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %25, double %2, double %3)
  %27 = fcmp olt float %26, 0.000000e+00
  br i1 %27, label %28, label %42

28:                                               ; preds = %24
  %29 = load float, ptr %21, align 4, !tbaa !30
  %30 = call noundef float @_ZNK3JPH4Vec36LengthEv(ptr noundef nonnull align 16 dereferenceable(16) %10)
  %31 = fneg float %29
  %32 = fmul float %26, %31
  %33 = fdiv float %32, %30
  %34 = fmul float %33, %1
  %.sroa.03.0.copyload = load double, ptr %10, align 16
  %.sroa.24.0.copyload = load double, ptr %11, align 8, !tbaa !29
  %35 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef %34, double %.sroa.03.0.copyload, double %.sroa.24.0.copyload)
  %36 = extractvalue { double, double } %35, 0
  %37 = extractvalue { double, double } %35, 1
  %38 = getelementptr inbounds i8, ptr %0, i64 16
  %39 = load ptr, ptr %38, align 16, !tbaa !31
  %40 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH13PhysicsSystem16GetBodyInterfaceEv(ptr noundef nonnull align 16 dereferenceable(1140) %39)
  %41 = getelementptr inbounds i8, ptr %0, i64 80
  %.sroa.0.0.copyload = load double, ptr %41, align 16
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 88
  %.sroa.2.0.copyload = load double, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !29
  call void @_ZN3JPH13BodyInterface10AddImpulseERKNS_6BodyIDENS_4Vec3ES4_(ptr noundef nonnull align 8 dereferenceable(24) %40, ptr noundef nonnull align 4 dereferenceable(4) %18, double %36, double %37, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload)
  br label %42

42:                                               ; preds = %24, %28, %9, %20, %13
  ret void
}

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK3JPH4Vec36LengthEv(ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #3 align 2

attributes #0 = { 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 = { 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 = { 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "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" }

!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, !19, i64 312}
!6 = !{!"_ZTSN3JPH16CharacterVirtualE", !7, i64 0, !14, i64 144, !14, i64 152, !25, i64 160, !19, i64 164, !11, i64 168, !11, i64 172, !19, i64 176, !19, i64 180, !19, i64 184, !11, i64 188, !19, i64 192, !19, i64 196, !26, i64 200, !19, i64 204, !19, i64 208, !16, i64 224, !16, i64 240, !27, i64 256, !16, i64 272, !28, i64 288, !19, i64 312, !26, i64 316, !24, i64 320, !21, i64 328}
!7 = !{!"_ZTSN3JPH13CharacterBaseE", !8, i64 8, !14, i64 16, !15, i64 24, !16, i64 32, !17, i64 48, !19, i64 64, !20, i64 68, !21, i64 72, !22, i64 76, !16, i64 80, !16, i64 96, !16, i64 112, !23, i64 128, !24, i64 136}
!8 = !{!"_ZTSN3JPH9RefTargetINS_13CharacterBaseEEE", !9, i64 0}
!9 = !{!"_ZTSSt6atomicIjE", !10, i64 0}
!10 = !{!"_ZTSSt13__atomic_baseIjE", !11, i64 0}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"any pointer", !12, i64 0}
!15 = !{!"_ZTSN3JPH8RefConstINS_5ShapeEEE", !14, i64 0}
!16 = !{!"_ZTSN3JPH4Vec3E", !12, i64 0}
!17 = !{!"_ZTSN3JPH5PlaneE", !18, i64 0}
!18 = !{!"_ZTSN3JPH4Vec4E", !12, i64 0}
!19 = !{!"float", !12, i64 0}
!20 = !{!"_ZTSN3JPH13CharacterBase12EGroundStateE", !12, i64 0}
!21 = !{!"_ZTSN3JPH6BodyIDE", !11, i64 0}
!22 = !{!"_ZTSN3JPH10SubShapeIDE", !11, i64 0}
!23 = !{!"_ZTSN3JPH8RefConstINS_15PhysicsMaterialEEE", !14, i64 0}
!24 = !{!"long", !12, i64 0}
!25 = !{!"_ZTSN3JPH13EBackFaceModeE", !12, i64 0}
!26 = !{!"bool", !12, i64 0}
!27 = !{!"_ZTSN3JPH4QuatE", !18, i64 0}
!28 = !{!"_ZTSN3JPH5ArrayINS_16CharacterVirtual7ContactENS_12STLAllocatorIS2_EEEE", !24, i64 0, !24, i64 8, !14, i64 16}
!29 = !{!12, !12, i64 0}
!30 = !{!6, !19, i64 204}
!31 = !{!7, !14, i64 16}


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