; LLVM IR from jrouwe/JoltPhysics :: Jolt/Physics/Vehicle (VehicleConstraint)

; 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::Body" = type <{ %"class.JPH::Vec3", %"class.JPH::Quat", %"class.JPH::AABox", %"class.JPH::RefConst.20", ptr, i64, %"class.JPH::CollisionGroup", float, float, %"class.JPH::BodyID", i16, i8, %"class.JPH::BroadPhaseLayer", i8, %"struct.std::atomic.22", [6 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.19 }
%union.anon.19 = type { <4 x float> }
%"class.JPH::AABox" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"class.JPH::RefConst.20" = type { ptr }
%"class.JPH::CollisionGroup" = type { %"class.JPH::RefConst.21", i32, i32 }
%"class.JPH::RefConst.21" = type { ptr }
%"class.JPH::BodyID" = type { i32 }
%"class.JPH::BroadPhaseLayer" = type { i8 }
%"struct.std::atomic.22" = type { %"struct.std::__atomic_base.23" }
%"struct.std::__atomic_base.23" = type { i8 }
%"class.JPH::VehicleConstraint" = type <{ %"class.JPH::Constraint", %"class.JPH::PhysicsStepListener", i8, [7 x i8], %"class.JPH::Vec3", ptr, [8 x i8], %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Array.14", %"class.JPH::Array.2", ptr, i8, [3 x i8], i32, i32, i32, float, float, %"class.JPH::Vec3", %"class.JPH::AngleConstraintPart", %"class.JPH::RefConst", %"class.std::function", %"class.std::function.17", %"class.std::function.17", %"class.std::function.17", [8 x i8] }>
%"class.JPH::Constraint" = type { ptr, %"class.JPH::RefTarget.13", i32, i32, i8, i8, i8, i64 }
%"class.JPH::RefTarget.13" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::PhysicsStepListener" = type { ptr }
%"class.JPH::Array.14" = type { i64, i64, ptr }
%"class.JPH::Array.2" = type { i64, i64, ptr }
%"class.JPH::AngleConstraintPart" = type { %"class.JPH::Vec3", %"class.JPH::Vec3", float, %"class.JPH::SpringPart", float }
%"class.JPH::SpringPart" = type { float, float }
%"class.JPH::RefConst" = type { ptr }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%"class.std::function.17" = type { %"class.std::_Function_base", ptr }

@_ZN3JPH4Body13sFixedToWorldE = external global %"class.JPH::Body", align 16

; 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: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Vec35CrossES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH17VehicleConstraint38CalculatePitchRollConstraintPropertiesERKNS_5Mat44E(ptr noundef nonnull align 16 dereferenceable(408) %0, ptr noundef nonnull align 16 dereferenceable(64) %1) #4 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.JPH::Vec3", align 16
  %6 = alloca %"class.JPH::Vec3", align 16
  %7 = alloca %"class.JPH::Vec3", align 16
  %8 = alloca %"class.JPH::Vec3", align 16
  %9 = alloca %"class.JPH::Vec3", align 16
  %10 = alloca float, align 4
  %11 = alloca %"class.JPH::Vec3", align 16
  %12 = alloca %"class.JPH::Vec3", align 16
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %13 = load ptr, ptr %3, align 8
  %14 = getelementptr inbounds %"class.JPH::VehicleConstraint", ptr %13, i32 0, i32 18
  %15 = load float, ptr %14, align 8, !tbaa !9
  %16 = fcmp ogt float %15, -1.000000e+00
  br i1 %16, label %17, label %81

17:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #7
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %"class.JPH::VehicleConstraint", ptr %13, i32 0, i32 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %6, ptr align 16 %19, i64 16, i1 false), !tbaa.struct !29
  %20 = getelementptr inbounds { double, double }, ptr %6, i32 0, i32 0
  %21 = load double, ptr %20, align 16
  %22 = getelementptr inbounds { double, double }, ptr %6, i32 0, i32 1
  %23 = load double, ptr %22, align 8
  %24 = call { double, double } @_ZNK3JPH5Mat4411Multiply3x3ENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %18, double %21, double %23)
  %25 = getelementptr inbounds %"class.JPH::Vec3", ptr %5, i32 0, i32 0
  %26 = getelementptr inbounds %union.anon, ptr %25, i32 0, i32 0
  %27 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 0
  %28 = extractvalue { double, double } %24, 0
  store double %28, ptr %27, align 16
  %29 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 1
  %30 = extractvalue { double, double } %24, 1
  store double %30, ptr %29, align 8
  %31 = getelementptr inbounds %"class.JPH::VehicleConstraint", ptr %13, i32 0, i32 9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %7, ptr align 16 %5, i64 16, i1 false), !tbaa.struct !29
  %32 = getelementptr inbounds { double, double }, ptr %7, i32 0, i32 0
  %33 = load double, ptr %32, align 16
  %34 = getelementptr inbounds { double, double }, ptr %7, i32 0, i32 1
  %35 = load double, ptr %34, align 8
  %36 = call noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %31, double %33, double %35)
  %37 = getelementptr inbounds %"class.JPH::VehicleConstraint", ptr %13, i32 0, i32 19
  store float %36, ptr %37, align 4, !tbaa !31
  %38 = getelementptr inbounds %"class.JPH::VehicleConstraint", ptr %13, i32 0, i32 19
  %39 = load float, ptr %38, align 4, !tbaa !31
  %40 = getelementptr inbounds %"class.JPH::VehicleConstraint", ptr %13, i32 0, i32 18
  %41 = load float, ptr %40, align 8, !tbaa !9
  %42 = fcmp olt float %39, %41
  br i1 %42, label %43, label %78

43:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #7
  %44 = getelementptr inbounds %"class.JPH::VehicleConstraint", ptr %13, i32 0, i32 9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %9, ptr align 16 %5, i64 16, i1 false), !tbaa.struct !29
  %45 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 0
  %46 = load double, ptr %45, align 16
  %47 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 1
  %48 = load double, ptr %47, align 8
  %49 = call { double, double } @_ZNK3JPH4Vec35CrossES0_(ptr noundef nonnull align 16 dereferenceable(16) %44, double %46, double %48)
  %50 = getelementptr inbounds %"class.JPH::Vec3", ptr %8, i32 0, i32 0
  %51 = getelementptr inbounds %union.anon, ptr %50, i32 0, i32 0
  %52 = getelementptr inbounds { double, double }, ptr %51, i32 0, i32 0
  %53 = extractvalue { double, double } %49, 0
  store double %53, ptr %52, align 16
  %54 = getelementptr inbounds { double, double }, ptr %51, i32 0, i32 1
  %55 = extractvalue { double, double } %49, 1
  store double %55, ptr %54, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %56 = call noundef float @_ZNK3JPH4Vec36LengthEv(ptr noundef nonnull align 16 dereferenceable(16) %8)
  store float %56, ptr %10, align 4, !tbaa !32
  %57 = load float, ptr %10, align 4, !tbaa !32
  %58 = fcmp ogt float %57, 0.000000e+00
  br i1 %58, label %59, label %69

59:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #7
  %60 = load float, ptr %10, align 4, !tbaa !32
  %61 = call { double, double } @_ZNK3JPH4Vec3dvEf(ptr noundef nonnull align 16 dereferenceable(16) %8, float noundef %60)
  %62 = getelementptr inbounds %"class.JPH::Vec3", ptr %11, i32 0, i32 0
  %63 = getelementptr inbounds %union.anon, ptr %62, i32 0, i32 0
  %64 = getelementptr inbounds { double, double }, ptr %63, i32 0, i32 0
  %65 = extractvalue { double, double } %61, 0
  store double %65, ptr %64, align 16
  %66 = getelementptr inbounds { double, double }, ptr %63, i32 0, i32 1
  %67 = extractvalue { double, double } %61, 1
  store double %67, ptr %66, align 8
  %68 = getelementptr inbounds %"class.JPH::VehicleConstraint", ptr %13, i32 0, i32 20
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %68, ptr align 16 %11, i64 16, i1 false), !tbaa.struct !29
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  br label %69

69:                                               ; preds = %59, %43
  %70 = getelementptr inbounds %"class.JPH::VehicleConstraint", ptr %13, i32 0, i32 21
  %71 = getelementptr inbounds %"class.JPH::VehicleConstraint", ptr %13, i32 0, i32 5
  %72 = load ptr, ptr %71, align 16, !tbaa !33
  %73 = getelementptr inbounds %"class.JPH::VehicleConstraint", ptr %13, i32 0, i32 20
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %12, ptr align 16 %73, i64 16, i1 false), !tbaa.struct !29
  %74 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 0
  %75 = load double, ptr %74, align 16
  %76 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 1
  %77 = load double, ptr %76, align 8
  call void @_ZN3JPH19AngleConstraintPart29CalculateConstraintPropertiesERKNS_4BodyES3_NS_4Vec3Ef(ptr noundef nonnull align 16 dereferenceable(48) %70, ptr noundef nonnull align 16 dereferenceable(122) %72, ptr noundef nonnull align 16 dereferenceable(122) @_ZN3JPH4Body13sFixedToWorldE, double %75, double %77, float noundef 0.000000e+00)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #7
  br label %80

78:                                               ; preds = %17
  %79 = getelementptr inbounds %"class.JPH::VehicleConstraint", ptr %13, i32 0, i32 21
  call void @_ZN3JPH19AngleConstraintPart10DeactivateEv(ptr noundef nonnull align 16 dereferenceable(48) %79)
  br label %80

80:                                               ; preds = %78, %69
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #7
  br label %83

81:                                               ; preds = %2
  %82 = getelementptr inbounds %"class.JPH::VehicleConstraint", ptr %13, i32 0, i32 21
  call void @_ZN3JPH19AngleConstraintPart10DeactivateEv(ptr noundef nonnull align 16 dereferenceable(48) %82)
  br label %83

83:                                               ; preds = %81, %80
  ret void
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH19AngleConstraintPart29CalculateConstraintPropertiesERKNS_4BodyES3_NS_4Vec3Ef(ptr noundef nonnull align 16 dereferenceable(48), ptr noundef nonnull align 16 dereferenceable(122), ptr noundef nonnull align 16 dereferenceable(122), double, double, float noundef) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH19AngleConstraintPart10DeactivateEv(ptr noundef nonnull align 16 dereferenceable(48)) #6 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress 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 = { 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 #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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !22, i64 200}
!10 = !{!"_ZTSN3JPH17VehicleConstraintE", !11, i64 0, !18, i64 32, !16, i64 40, !19, i64 48, !6, i64 64, !19, i64 80, !19, i64 96, !19, i64 112, !20, i64 128, !21, i64 152, !6, i64 176, !16, i64 184, !15, i64 188, !15, i64 192, !15, i64 196, !22, i64 200, !22, i64 204, !19, i64 208, !23, i64 224, !25, i64 272, !26, i64 280, !28, i64 312, !28, i64 344, !28, i64 376}
!11 = !{!"_ZTSN3JPH10ConstraintE", !12, i64 8, !15, i64 12, !15, i64 16, !7, i64 20, !7, i64 21, !16, i64 22, !17, i64 24}
!12 = !{!"_ZTSN3JPH9RefTargetINS_10ConstraintEEE", !13, i64 0}
!13 = !{!"_ZTSSt6atomicIjE", !14, i64 0}
!14 = !{!"_ZTSSt13__atomic_baseIjE", !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_ZTSN3JPH19PhysicsStepListenerE"}
!19 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!20 = !{!"_ZTSN3JPH5ArrayIPNS_5WheelENS_12STLAllocatorIS2_EEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!21 = !{!"_ZTSN3JPH5ArrayINS_18VehicleAntiRollBarENS_12STLAllocatorIS1_EEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!22 = !{!"float", !7, i64 0}
!23 = !{!"_ZTSN3JPH19AngleConstraintPartE", !19, i64 0, !19, i64 16, !22, i64 32, !24, i64 36, !22, i64 44}
!24 = !{!"_ZTSN3JPH10SpringPartE", !22, i64 0, !22, i64 4}
!25 = !{!"_ZTSN3JPH8RefConstINS_22VehicleCollisionTesterEEE", !6, i64 0}
!26 = !{!"_ZTSSt8functionIFvjRfS0_RKN3JPH4BodyERKNS1_10SubShapeIDEEE", !27, i64 0, !6, i64 24}
!27 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!28 = !{!"_ZTSSt8functionIFvRN3JPH17VehicleConstraintERKNS0_26PhysicsStepListenerContextEEE", !27, i64 0, !6, i64 24}
!29 = !{i64 0, i64 16, !30}
!30 = !{!7, !7, i64 0}
!31 = !{!10, !22, i64 204}
!32 = !{!22, !22, i64 0}
!33 = !{!10, !6, i64 64}


; 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::Body" = type <{ %"class.JPH::Vec3", %"class.JPH::Quat", %"class.JPH::AABox", %"class.JPH::RefConst.20", ptr, i64, %"class.JPH::CollisionGroup", float, float, %"class.JPH::BodyID", i16, i8, %"class.JPH::BroadPhaseLayer", i8, %"struct.std::atomic.22", [6 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.19 }
%union.anon.19 = type { <4 x float> }
%"class.JPH::AABox" = type { %"class.JPH::Vec3", %"class.JPH::Vec3" }
%"class.JPH::RefConst.20" = type { ptr }
%"class.JPH::CollisionGroup" = type { %"class.JPH::RefConst.21", i32, i32 }
%"class.JPH::RefConst.21" = type { ptr }
%"class.JPH::BodyID" = type { i32 }
%"class.JPH::BroadPhaseLayer" = type { i8 }
%"struct.std::atomic.22" = type { %"struct.std::__atomic_base.23" }
%"struct.std::__atomic_base.23" = type { i8 }

@_ZN3JPH4Body13sFixedToWorldE = external global %"class.JPH::Body", align 16

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

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

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

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH5Mat4411Multiply3x3ENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64), double, double) local_unnamed_addr #1 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 #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH17VehicleConstraint38CalculatePitchRollConstraintPropertiesERKNS_5Mat44E(ptr noundef nonnull align 16 dereferenceable(408) %0, ptr noundef nonnull align 16 dereferenceable(64) %1) local_unnamed_addr #3 align 2 {
  %3 = alloca %"class.JPH::Vec3", align 16
  %4 = getelementptr inbounds i8, ptr %0, i64 200
  %5 = load float, ptr %4, align 8, !tbaa !5
  %6 = fcmp ogt float %5, -1.000000e+00
  br i1 %6, label %7, label %35

7:                                                ; preds = %2
  %8 = getelementptr inbounds i8, ptr %0, i64 96
  %.sroa.07.0.copyload = load double, ptr %8, align 16
  %.sroa.28.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 104
  %.sroa.28.0.copyload = load double, ptr %.sroa.28.0..sroa_idx, align 8, !tbaa !28
  %9 = tail call { double, double } @_ZNK3JPH5Mat4411Multiply3x3ENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(64) %1, double %.sroa.07.0.copyload, double %.sroa.28.0.copyload)
  %10 = extractvalue { double, double } %9, 0
  %11 = extractvalue { double, double } %9, 1
  %12 = getelementptr inbounds i8, ptr %0, i64 112
  %13 = tail call noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %12, double %10, double %11)
  %14 = getelementptr inbounds i8, ptr %0, i64 204
  store float %13, ptr %14, align 4, !tbaa !29
  %15 = load float, ptr %4, align 8, !tbaa !5
  %16 = fcmp olt float %13, %15
  br i1 %16, label %17, label %33

17:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #6
  %18 = tail call { double, double } @_ZNK3JPH4Vec35CrossES0_(ptr noundef nonnull align 16 dereferenceable(16) %12, double %10, double %11)
  %19 = extractvalue { double, double } %18, 0
  store double %19, ptr %3, align 16
  %20 = getelementptr inbounds i8, ptr %3, i64 8
  %21 = extractvalue { double, double } %18, 1
  store double %21, ptr %20, align 8
  %22 = call noundef float @_ZNK3JPH4Vec36LengthEv(ptr noundef nonnull align 16 dereferenceable(16) %3)
  %23 = fcmp ogt float %22, 0.000000e+00
  br i1 %23, label %24, label %._crit_edge

._crit_edge:                                      ; preds = %17
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 208
  %.sroa.0.0.copyload.pre = load double, ptr %.phi.trans.insert, align 16
  %.sroa.2.0..sroa_idx.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 216
  %.sroa.2.0.copyload.pre = load double, ptr %.sroa.2.0..sroa_idx.phi.trans.insert, align 8, !tbaa !28
  br label %29

24:                                               ; preds = %17
  %25 = call { double, double } @_ZNK3JPH4Vec3dvEf(ptr noundef nonnull align 16 dereferenceable(16) %3, float noundef %22)
  %26 = extractvalue { double, double } %25, 0
  %27 = extractvalue { double, double } %25, 1
  %28 = getelementptr inbounds i8, ptr %0, i64 208
  store double %26, ptr %28, align 16
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 216
  store double %27, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !28
  br label %29

29:                                               ; preds = %._crit_edge, %24
  %.sroa.2.0.copyload = phi double [ %.sroa.2.0.copyload.pre, %._crit_edge ], [ %27, %24 ]
  %.sroa.0.0.copyload = phi double [ %.sroa.0.0.copyload.pre, %._crit_edge ], [ %26, %24 ]
  %30 = getelementptr inbounds i8, ptr %0, i64 224
  %31 = getelementptr inbounds i8, ptr %0, i64 64
  %32 = load ptr, ptr %31, align 16, !tbaa !30
  call void @_ZN3JPH19AngleConstraintPart29CalculateConstraintPropertiesERKNS_4BodyES3_NS_4Vec3Ef(ptr noundef nonnull align 16 dereferenceable(48) %30, ptr noundef nonnull align 16 dereferenceable(122) %32, ptr noundef nonnull align 16 dereferenceable(122) @_ZN3JPH4Body13sFixedToWorldE, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload, float noundef 0.000000e+00)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  br label %37

33:                                               ; preds = %7
  %34 = getelementptr inbounds i8, ptr %0, i64 224
  tail call void @_ZN3JPH19AngleConstraintPart10DeactivateEv(ptr noundef nonnull align 16 dereferenceable(48) %34)
  br label %37

35:                                               ; preds = %2
  %36 = getelementptr inbounds i8, ptr %0, i64 224
  tail call void @_ZN3JPH19AngleConstraintPart10DeactivateEv(ptr noundef nonnull align 16 dereferenceable(48) %36)
  br label %37

37:                                               ; preds = %29, %33, %35
  ret void
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH19AngleConstraintPart29CalculateConstraintPropertiesERKNS_4BodyES3_NS_4Vec3Ef(ptr noundef nonnull align 16 dereferenceable(48), ptr noundef nonnull align 16 dereferenceable(122), ptr noundef nonnull align 16 dereferenceable(122), double, double, float noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH19AngleConstraintPart10DeactivateEv(ptr noundef nonnull align 16 dereferenceable(48)) local_unnamed_addr #5 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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, !21, i64 200}
!6 = !{!"_ZTSN3JPH17VehicleConstraintE", !7, i64 0, !16, i64 32, !14, i64 40, !17, i64 48, !18, i64 64, !17, i64 80, !17, i64 96, !17, i64 112, !19, i64 128, !20, i64 152, !18, i64 176, !14, i64 184, !11, i64 188, !11, i64 192, !11, i64 196, !21, i64 200, !21, i64 204, !17, i64 208, !22, i64 224, !24, i64 272, !25, i64 280, !27, i64 312, !27, i64 344, !27, i64 376}
!7 = !{!"_ZTSN3JPH10ConstraintE", !8, i64 8, !11, i64 12, !11, i64 16, !12, i64 20, !12, i64 21, !14, i64 22, !15, i64 24}
!8 = !{!"_ZTSN3JPH9RefTargetINS_10ConstraintEEE", !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 = !{!"bool", !12, i64 0}
!15 = !{!"long", !12, i64 0}
!16 = !{!"_ZTSN3JPH19PhysicsStepListenerE"}
!17 = !{!"_ZTSN3JPH4Vec3E", !12, i64 0}
!18 = !{!"any pointer", !12, i64 0}
!19 = !{!"_ZTSN3JPH5ArrayIPNS_5WheelENS_12STLAllocatorIS2_EEEE", !15, i64 0, !15, i64 8, !18, i64 16}
!20 = !{!"_ZTSN3JPH5ArrayINS_18VehicleAntiRollBarENS_12STLAllocatorIS1_EEEE", !15, i64 0, !15, i64 8, !18, i64 16}
!21 = !{!"float", !12, i64 0}
!22 = !{!"_ZTSN3JPH19AngleConstraintPartE", !17, i64 0, !17, i64 16, !21, i64 32, !23, i64 36, !21, i64 44}
!23 = !{!"_ZTSN3JPH10SpringPartE", !21, i64 0, !21, i64 4}
!24 = !{!"_ZTSN3JPH8RefConstINS_22VehicleCollisionTesterEEE", !18, i64 0}
!25 = !{!"_ZTSSt8functionIFvjRfS0_RKN3JPH4BodyERKNS1_10SubShapeIDEEE", !26, i64 0, !18, i64 24}
!26 = !{!"_ZTSSt14_Function_base", !12, i64 0, !18, i64 16}
!27 = !{!"_ZTSSt8functionIFvRN3JPH17VehicleConstraintERKNS0_26PhysicsStepListenerContextEEE", !26, i64 0, !18, i64 24}
!28 = !{!12, !12, i64 0}
!29 = !{!6, !21, i64 204}
!30 = !{!6, !18, i64 64}


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