; LLVM IR from ThePhysicsGuys/Physics3D :: Physics3D/externalforces/magnetForce.ll (ZN3P3D11MagnetForce5applyEPNS_14WorldPrototypeE)

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

%"struct.P3D::PositionTemplate" = type { %"struct.P3D::Fix", %"struct.P3D::Fix", %"struct.P3D::Fix" }
%"struct.P3D::Fix" = type { i64 }
%"struct.P3D::Vector" = type { %union.anon }
%union.anon = type { [3 x double] }
%"struct.P3D::Vector.6" = type { %union.anon.7 }
%union.anon.7 = type { [3 x %"struct.P3D::Fix"] }
%"struct.P3D::Motion" = type { %"struct.P3D::TranslationalMotion", %"struct.P3D::RotationalMotion" }
%"struct.P3D::TranslationalMotion" = type { %"struct.P3D::TaylorExpansion" }
%"struct.P3D::TaylorExpansion" = type { %"struct.P3D::Derivatives" }
%"struct.P3D::Derivatives" = type { [2 x %"struct.P3D::Vector"] }
%"struct.P3D::RotationalMotion" = type { %"struct.P3D::TaylorExpansion" }
%"class.P3D::MagnetForce" = type { %"class.P3D::ExternalForce", ptr, %"struct.P3D::Vector", %"struct.P3D::PositionTemplate", double, double }
%"class.P3D::ExternalForce" = type { ptr }
%"class.P3D::Physical" = type { %"class.P3D::RigidBody", ptr, %"class.P3D::UnorderedVector.0" }
%"class.P3D::RigidBody" = type { ptr, %"class.P3D::UnorderedVector", double, %"struct.P3D::Vector", %"class.P3D::SymmetricMatrix" }
%"class.P3D::UnorderedVector" = type { %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<P3D::AttachedPart, std::allocator<P3D::AttachedPart>>::_Vector_impl" }
%"struct.std::_Vector_base<P3D::AttachedPart, std::allocator<P3D::AttachedPart>>::_Vector_impl" = type { %"struct.std::_Vector_base<P3D::AttachedPart, std::allocator<P3D::AttachedPart>>::_Vector_impl_data" }
%"struct.std::_Vector_base<P3D::AttachedPart, std::allocator<P3D::AttachedPart>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.P3D::SymmetricMatrix" = type { [6 x double] }
%"class.P3D::UnorderedVector.0" = type { %"class.std::vector.1" }
%"class.std::vector.1" = type { %"struct.std::_Vector_base.2" }
%"struct.std::_Vector_base.2" = type { %"struct.std::_Vector_base<P3D::ConnectedPhysical, std::allocator<P3D::ConnectedPhysical>>::_Vector_impl" }
%"struct.std::_Vector_base<P3D::ConnectedPhysical, std::allocator<P3D::ConnectedPhysical>>::_Vector_impl" = type { %"struct.std::_Vector_base<P3D::ConnectedPhysical, std::allocator<P3D::ConnectedPhysical>>::_Vector_impl_data" }
%"struct.std::_Vector_base<P3D::ConnectedPhysical, std::allocator<P3D::ConnectedPhysical>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.P3D::MotorizedPhysical" = type { %"class.P3D::Physical", %"struct.P3D::Vector", %"struct.P3D::Vector", double, %"struct.P3D::Vector", %"class.P3D::SymmetricMatrix", %"class.P3D::SymmetricMatrix", %"struct.P3D::Motion" }

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3P3D11MagnetForce5applyEPNS_14WorldPrototypeE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef %1) unnamed_addr #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"struct.P3D::PositionTemplate", align 8
  %8 = alloca %"struct.P3D::PositionTemplate", align 8
  %9 = alloca %"struct.P3D::Vector", align 8
  %10 = alloca %"struct.P3D::Vector.6", align 8
  %11 = alloca %"struct.P3D::Vector", align 8
  %12 = alloca %"struct.P3D::Motion", align 8
  %13 = alloca %"struct.P3D::Vector", align 8
  %14 = alloca %"struct.P3D::Vector.6", align 8
  %15 = alloca %"struct.P3D::Vector", align 8
  %16 = alloca %"struct.P3D::Vector", align 8
  %17 = alloca %"struct.P3D::Vector", align 8
  %18 = alloca %"struct.P3D::Vector", align 8
  %19 = alloca %"struct.P3D::Vector", align 8
  %20 = alloca %"struct.P3D::Vector.6", align 8
  %21 = alloca %"struct.P3D::Vector", align 8
  %22 = alloca double, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %23 = load ptr, ptr %3, align 8
  %24 = getelementptr inbounds %"class.P3D::MagnetForce", ptr %23, i32 0, i32 1
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %57

27:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %28 = getelementptr inbounds %"class.P3D::MagnetForce", ptr %23, i32 0, i32 1
  %29 = load ptr, ptr %28, align 8, !tbaa !9
  %30 = call noundef ptr @_ZNK3P3D4Part11getPhysicalEv(ptr noundef nonnull align 8 dereferenceable(200) %29)
  store ptr %30, ptr %5, align 8, !tbaa !5
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = icmp ne ptr %31, null
  br i1 %32, label %33, label %56

33:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %"class.P3D::Physical", ptr %34, i32 0, i32 1
  %36 = load ptr, ptr %35, align 8, !tbaa !17
  store ptr %36, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #6
  %37 = getelementptr inbounds %"class.P3D::MagnetForce", ptr %23, i32 0, i32 1
  %38 = load ptr, ptr %37, align 8, !tbaa !9
  %39 = call noundef nonnull align 8 dereferenceable(96) ptr @_ZNK3P3D4Part9getCFrameEv(ptr noundef nonnull align 8 dereferenceable(200) %38)
  %40 = getelementptr inbounds %"class.P3D::MagnetForce", ptr %23, i32 0, i32 2
  call void @_ZNK3P3D12GlobalCFrame13localToGlobalERKNS_6VectorIdLm3EEE(ptr dead_on_unwind writable sret(%"struct.P3D::PositionTemplate") align 8 %7, ptr noundef nonnull align 8 dereferenceable(96) %39, ptr noundef nonnull align 8 dereferenceable(24) %40)
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #6
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZNK3P3D17MotorizedPhysical15getCenterOfMassEv(ptr dead_on_unwind writable sret(%"struct.P3D::PositionTemplate") align 8 %8, ptr noundef nonnull align 8 dereferenceable(416) %41)
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #6
  %42 = getelementptr inbounds %"class.P3D::MagnetForce", ptr %23, i32 0, i32 3
  call void @_ZN3P3DmiINS_3FixILl32EEEEENS_6VectorIT_Lm3EEERKNS_16PositionTemplateIS4_EES9_(ptr dead_on_unwind writable sret(%"struct.P3D::Vector.6") align 8 %10, ptr noundef nonnull align 8 dereferenceable(24) %42, ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @_ZNK3P3D6VectorINS_3FixILl32EEELm3EEcvNS0_IT_Lm3EEEIdEEv(ptr dead_on_unwind writable sret(%"struct.P3D::Vector") align 8 %9, ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 96, ptr %12) #6
  %43 = getelementptr inbounds %"class.P3D::MagnetForce", ptr %23, i32 0, i32 1
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  call void @_ZNK3P3D4Part9getMotionEv(ptr dead_on_unwind writable sret(%"struct.P3D::Motion") align 8 %12, ptr noundef nonnull align 8 dereferenceable(200) %44)
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #6
  call void @_ZN3P3DmiINS_3FixILl32EEEEENS_6VectorIT_Lm3EEERKNS_16PositionTemplateIS4_EES9_(ptr dead_on_unwind writable sret(%"struct.P3D::Vector.6") align 8 %14, ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  call void @_ZNK3P3D6VectorINS_3FixILl32EEELm3EEcvNS0_IT_Lm3EEEIdEEv(ptr dead_on_unwind writable sret(%"struct.P3D::Vector") align 8 %13, ptr noundef nonnull align 8 dereferenceable(24) %14) #6
  call void @_ZNK3P3D6Motion18getVelocityOfPointENS_6VectorIdLm3EEE(ptr dead_on_unwind writable sret(%"struct.P3D::Vector") align 8 %11, ptr noundef nonnull align 8 dereferenceable(96) %12, ptr noundef byval(%"struct.P3D::Vector") align 8 %13)
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 96, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #6
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %"class.P3D::MotorizedPhysical", ptr %45, i32 0, i32 3
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #6
  %47 = getelementptr inbounds %"class.P3D::MagnetForce", ptr %23, i32 0, i32 4
  call void @_ZN3P3DmlIddLm3EEENS_6VectorIDTmlixfp_Li0Efp0_EXT1_EEERKNS1_IT_XT1_EEERKT0_(ptr dead_on_unwind writable sret(%"struct.P3D::Vector") align 8 %17, ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(8) %47) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #6
  %48 = getelementptr inbounds %"class.P3D::MagnetForce", ptr %23, i32 0, i32 5
  call void @_ZN3P3DmlIddLm3EEENS_6VectorIDTmlixfp_Li0Efp0_EXT1_EEERKNS1_IT_XT1_EEERKT0_(ptr dead_on_unwind writable sret(%"struct.P3D::Vector") align 8 %18, ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(8) %48) #6
  call void @_ZN3P3DmiIddLm3EEENS_6VectorIDTmiixfp_Li0Eixfp0_Li0EEXT1_EEERKNS1_IT_XT1_EEERKNS1_IT0_XT1_EEE(ptr dead_on_unwind writable sret(%"struct.P3D::Vector") align 8 %16, ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(24) %18) #6
  call void @_ZN3P3DmlIddLm3EEENS_6VectorIDTmlfp_ixfp0_Li0EEXT1_EEERKT_RKNS1_IT0_XT1_EEE(ptr dead_on_unwind writable sret(%"struct.P3D::Vector") align 8 %15, ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #6
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #6
  call void @_ZN3P3DmiINS_3FixILl32EEEEENS_6VectorIT_Lm3EEERKNS_16PositionTemplateIS4_EES9_(ptr dead_on_unwind writable sret(%"struct.P3D::Vector.6") align 8 %20, ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  call void @_ZNK3P3D6VectorINS_3FixILl32EEELm3EEcvNS0_IT_Lm3EEEIdEEv(ptr dead_on_unwind writable sret(%"struct.P3D::Vector") align 8 %19, ptr noundef nonnull align 8 dereferenceable(24) %20) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %15, i64 24, i1 false), !tbaa.struct !31
  call void @_ZN3P3D8Physical20applyForceToPhysicalENS_6VectorIdLm3EEES2_(ptr noundef nonnull align 8 dereferenceable(144) %49, ptr noundef byval(%"struct.P3D::Vector") align 8 %19, ptr noundef byval(%"struct.P3D::Vector") align 8 %21)
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  store double 8.000000e-01, ptr %22, align 8, !tbaa !33
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = getelementptr inbounds %"class.P3D::MotorizedPhysical", ptr %50, i32 0, i32 7
  %52 = getelementptr inbounds %"struct.P3D::Motion", ptr %51, i32 0, i32 1
  %53 = getelementptr inbounds %"struct.P3D::RotationalMotion", ptr %52, i32 0, i32 0
  %54 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3P3D15TaylorExpansionINS_6VectorIdLm3EEELm2EEixEm(ptr noundef nonnull align 8 dereferenceable(48) %53, i64 noundef 0)
  %55 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3P3DmLIddLm3EEERNS_6VectorIT_XT1_EEES4_RKT0_(ptr noundef nonnull align 8 dereferenceable(24) %54, ptr noundef nonnull align 8 dereferenceable(8) %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %56

56:                                               ; preds = %33, %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %57

57:                                               ; preds = %56, %2
  ret void
}

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

declare noundef ptr @_ZNK3P3D4Part11getPhysicalEv(ptr noundef nonnull align 8 dereferenceable(200)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(96) ptr @_ZNK3P3D4Part9getCFrameEv(ptr noundef nonnull align 8 dereferenceable(200)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK3P3D12GlobalCFrame13localToGlobalERKNS_6VectorIdLm3EEE(ptr dead_on_unwind noalias writable sret(%"struct.P3D::PositionTemplate") align 8, ptr noundef nonnull align 8 dereferenceable(96), ptr noundef nonnull align 8 dereferenceable(24)) #5 align 2

declare void @_ZNK3P3D17MotorizedPhysical15getCenterOfMassEv(ptr dead_on_unwind writable sret(%"struct.P3D::PositionTemplate") align 8, ptr noundef nonnull align 8 dereferenceable(416)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3DmiINS_3FixILl32EEEEENS_6VectorIT_Lm3EEERKNS_16PositionTemplateIS4_EES9_(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Vector.6") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK3P3D6VectorINS_3FixILl32EEELm3EEcvNS0_IT_Lm3EEEIdEEv(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

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

declare void @_ZNK3P3D4Part9getMotionEv(ptr dead_on_unwind writable sret(%"struct.P3D::Motion") align 8, ptr noundef nonnull align 8 dereferenceable(200)) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK3P3D6Motion18getVelocityOfPointENS_6VectorIdLm3EEE(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(96), ptr noundef byval(%"struct.P3D::Vector") align 8) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3DmlIddLm3EEENS_6VectorIDTmlfp_ixfp0_Li0EEXT1_EEERKT_RKNS1_IT0_XT1_EEE(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(24)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3DmiIddLm3EEENS_6VectorIDTmiixfp_Li0Eixfp0_Li0EEXT1_EEERKNS1_IT_XT1_EEERKNS1_IT0_XT1_EEE(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3DmlIddLm3EEENS_6VectorIDTmlixfp_Li0Efp0_EXT1_EEERKNS1_IT_XT1_EEERKT0_(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #4

declare void @_ZN3P3D8Physical20applyForceToPhysicalENS_6VectorIdLm3EEES2_(ptr noundef nonnull align 8 dereferenceable(144), ptr noundef byval(%"struct.P3D::Vector") align 8, ptr noundef byval(%"struct.P3D::Vector") align 8) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN3P3DmLIddLm3EEERNS_6VectorIT_XT1_EEES4_RKT0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN3P3D15TaylorExpansionINS_6VectorIdLm3EEELm2EEixEm(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef) #1 align 2

attributes #0 = { nocallback nofree 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"_ZTSN3P3D11MagnetForceE", !11, i64 0, !6, i64 8, !12, i64 16, !13, i64 40, !16, i64 64, !16, i64 72}
!11 = !{!"_ZTSN3P3D13ExternalForceE"}
!12 = !{!"_ZTSN3P3D6VectorIdLm3EEE", !7, i64 0}
!13 = !{!"_ZTSN3P3D16PositionTemplateINS_3FixILl32EEEEE", !14, i64 0, !14, i64 8, !14, i64 16}
!14 = !{!"_ZTSN3P3D3FixILl32EEE", !15, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!18, !6, i64 112}
!18 = !{!"_ZTSN3P3D8PhysicalE", !19, i64 0, !6, i64 112, !26, i64 120}
!19 = !{!"_ZTSN3P3D9RigidBodyE", !6, i64 0, !20, i64 8, !16, i64 32, !12, i64 40, !25, i64 64}
!20 = !{!"_ZTSN3P3D15UnorderedVectorINS_12AttachedPartEEE", !21, i64 0}
!21 = !{!"_ZTSSt6vectorIN3P3D12AttachedPartESaIS1_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseIN3P3D12AttachedPartESaIS1_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIN3P3D12AttachedPartESaIS1_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIN3P3D12AttachedPartESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!25 = !{!"_ZTSN3P3D15SymmetricMatrixIdLm3EEE", !7, i64 0}
!26 = !{!"_ZTSN3P3D15UnorderedVectorINS_17ConnectedPhysicalEEE", !27, i64 0}
!27 = !{!"_ZTSSt6vectorIN3P3D17ConnectedPhysicalESaIS1_EE", !28, i64 0}
!28 = !{!"_ZTSSt12_Vector_baseIN3P3D17ConnectedPhysicalESaIS1_EE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIN3P3D17ConnectedPhysicalESaIS1_EE12_Vector_implE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIN3P3D17ConnectedPhysicalESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!31 = !{i64 0, i64 24, !32}
!32 = !{!7, !7, i64 0}
!33 = !{!16, !16, 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"

%"struct.P3D::PositionTemplate" = type { %"struct.P3D::Fix", %"struct.P3D::Fix", %"struct.P3D::Fix" }
%"struct.P3D::Fix" = type { i64 }
%"struct.P3D::Vector" = type { %union.anon }
%union.anon = type { [3 x double] }
%"struct.P3D::Vector.6" = type { %union.anon.7 }
%union.anon.7 = type { [3 x %"struct.P3D::Fix"] }
%"struct.P3D::Motion" = type { %"struct.P3D::TranslationalMotion", %"struct.P3D::RotationalMotion" }
%"struct.P3D::TranslationalMotion" = type { %"struct.P3D::TaylorExpansion" }
%"struct.P3D::TaylorExpansion" = type { %"struct.P3D::Derivatives" }
%"struct.P3D::Derivatives" = type { [2 x %"struct.P3D::Vector"] }
%"struct.P3D::RotationalMotion" = type { %"struct.P3D::TaylorExpansion" }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3P3D11MagnetForce5applyEPNS_14WorldPrototypeE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr nocapture noundef readnone %1) unnamed_addr #0 align 2 {
  %3 = alloca %"struct.P3D::PositionTemplate", align 8
  %4 = alloca %"struct.P3D::PositionTemplate", align 8
  %5 = alloca %"struct.P3D::Vector", align 8
  %6 = alloca %"struct.P3D::Vector.6", align 8
  %7 = alloca %"struct.P3D::Vector", align 8
  %8 = alloca %"struct.P3D::Motion", align 8
  %9 = alloca %"struct.P3D::Vector", align 8
  %10 = alloca %"struct.P3D::Vector.6", align 8
  %11 = alloca %"struct.P3D::Vector", align 8
  %12 = alloca %"struct.P3D::Vector", align 8
  %13 = alloca %"struct.P3D::Vector", align 8
  %14 = alloca %"struct.P3D::Vector", align 8
  %15 = alloca %"struct.P3D::Vector", align 8
  %16 = alloca %"struct.P3D::Vector.6", align 8
  %17 = alloca double, align 8
  %18 = getelementptr inbounds i8, ptr %0, i64 8
  %19 = load ptr, ptr %18, align 8, !tbaa !5
  %.not = icmp eq ptr %19, null
  br i1 %.not, label %36, label %20

20:                                               ; preds = %2
  %21 = tail call noundef ptr @_ZNK3P3D4Part11getPhysicalEv(ptr noundef nonnull align 8 dereferenceable(200) %19)
  %.not8 = icmp eq ptr %21, null
  br i1 %.not8, label %36, label %22

22:                                               ; preds = %20
  %23 = getelementptr inbounds i8, ptr %21, i64 112
  %24 = load ptr, ptr %23, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #5
  %25 = load ptr, ptr %18, align 8, !tbaa !5
  %26 = tail call noundef nonnull align 8 dereferenceable(96) ptr @_ZNK3P3D4Part9getCFrameEv(ptr noundef nonnull align 8 dereferenceable(200) %25)
  %27 = getelementptr inbounds i8, ptr %0, i64 16
  call void @_ZNK3P3D12GlobalCFrame13localToGlobalERKNS_6VectorIdLm3EEE(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::PositionTemplate") align 8 %3, ptr noundef nonnull align 8 dereferenceable(96) %26, ptr noundef nonnull align 8 dereferenceable(24) %27)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  call void @_ZNK3P3D17MotorizedPhysical15getCenterOfMassEv(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::PositionTemplate") align 8 %4, ptr noundef nonnull align 8 dereferenceable(416) %24)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  %28 = getelementptr inbounds i8, ptr %0, i64 40
  call void @_ZN3P3DmiINS_3FixILl32EEEEENS_6VectorIT_Lm3EEERKNS_16PositionTemplateIS4_EES9_(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Vector.6") align 8 %6, ptr noundef nonnull align 8 dereferenceable(24) %28, ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @_ZNK3P3D6VectorINS_3FixILl32EEELm3EEcvNS0_IT_Lm3EEEIdEEv(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Vector") align 8 %5, ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %8) #5
  %29 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZNK3P3D4Part9getMotionEv(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Motion") align 8 %8, ptr noundef nonnull align 8 dereferenceable(200) %29)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #5
  call void @_ZN3P3DmiINS_3FixILl32EEEEENS_6VectorIT_Lm3EEERKNS_16PositionTemplateIS4_EES9_(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Vector.6") align 8 %10, ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @_ZNK3P3D6VectorINS_3FixILl32EEELm3EEcvNS0_IT_Lm3EEEIdEEv(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Vector") align 8 %9, ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  call void @_ZNK3P3D6Motion18getVelocityOfPointENS_6VectorIdLm3EEE(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Vector") align 8 %7, ptr noundef nonnull align 8 dereferenceable(96) %8, ptr noundef nonnull byval(%"struct.P3D::Vector") align 8 %9)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #5
  %30 = getelementptr inbounds i8, ptr %24, i64 192
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #5
  %31 = getelementptr inbounds i8, ptr %0, i64 64
  call void @_ZN3P3DmlIddLm3EEENS_6VectorIDTmlixfp_Li0Efp0_EXT1_EEERKNS1_IT_XT1_EEERKT0_(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Vector") align 8 %13, ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(8) %31) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #5
  %32 = getelementptr inbounds i8, ptr %0, i64 72
  call void @_ZN3P3DmlIddLm3EEENS_6VectorIDTmlixfp_Li0Efp0_EXT1_EEERKNS1_IT_XT1_EEERKT0_(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Vector") align 8 %14, ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(8) %32) #5
  call void @_ZN3P3DmiIddLm3EEENS_6VectorIDTmiixfp_Li0Eixfp0_Li0EEXT1_EEERKNS1_IT_XT1_EEERKNS1_IT0_XT1_EEE(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Vector") align 8 %12, ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  call void @_ZN3P3DmlIddLm3EEENS_6VectorIDTmlfp_ixfp0_Li0EEXT1_EEERKT_RKNS1_IT0_XT1_EEE(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Vector") align 8 %11, ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %16) #5
  call void @_ZN3P3DmiINS_3FixILl32EEEEENS_6VectorIT_Lm3EEERKNS_16PositionTemplateIS4_EES9_(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Vector.6") align 8 %16, ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @_ZNK3P3D6VectorINS_3FixILl32EEELm3EEcvNS0_IT_Lm3EEEIdEEv(ptr dead_on_unwind nonnull writable sret(%"struct.P3D::Vector") align 8 %15, ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  call void @_ZN3P3D8Physical20applyForceToPhysicalENS_6VectorIdLm3EEES2_(ptr noundef nonnull align 8 dereferenceable(144) %24, ptr noundef nonnull byval(%"struct.P3D::Vector") align 8 %15, ptr noundef nonnull byval(%"struct.P3D::Vector") align 8 %11)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #5
  store double 8.000000e-01, ptr %17, align 8, !tbaa !30
  %33 = getelementptr inbounds i8, ptr %24, i64 368
  %34 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3P3D15TaylorExpansionINS_6VectorIdLm3EEELm2EEixEm(ptr noundef nonnull align 8 dereferenceable(48) %33, i64 noundef 0)
  %35 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3P3DmLIddLm3EEERNS_6VectorIT_XT1_EEES4_RKT0_(ptr noundef nonnull align 8 dereferenceable(24) %34, ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  br label %36

36:                                               ; preds = %20, %22, %2
  ret void
}

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

declare noundef ptr @_ZNK3P3D4Part11getPhysicalEv(ptr noundef nonnull align 8 dereferenceable(200)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(96) ptr @_ZNK3P3D4Part9getCFrameEv(ptr noundef nonnull align 8 dereferenceable(200)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK3P3D12GlobalCFrame13localToGlobalERKNS_6VectorIdLm3EEE(ptr dead_on_unwind noalias writable sret(%"struct.P3D::PositionTemplate") align 8, ptr noundef nonnull align 8 dereferenceable(96), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

declare void @_ZNK3P3D17MotorizedPhysical15getCenterOfMassEv(ptr dead_on_unwind writable sret(%"struct.P3D::PositionTemplate") align 8, ptr noundef nonnull align 8 dereferenceable(416)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3DmiINS_3FixILl32EEEEENS_6VectorIT_Lm3EEERKNS_16PositionTemplateIS4_EES9_(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Vector.6") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK3P3D6VectorINS_3FixILl32EEELm3EEcvNS0_IT_Lm3EEEIdEEv(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

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

declare void @_ZNK3P3D4Part9getMotionEv(ptr dead_on_unwind writable sret(%"struct.P3D::Motion") align 8, ptr noundef nonnull align 8 dereferenceable(200)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK3P3D6Motion18getVelocityOfPointENS_6VectorIdLm3EEE(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(96), ptr noundef byval(%"struct.P3D::Vector") align 8) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3DmlIddLm3EEENS_6VectorIDTmlfp_ixfp0_Li0EEXT1_EEERKT_RKNS1_IT0_XT1_EEE(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3DmiIddLm3EEENS_6VectorIDTmiixfp_Li0Eixfp0_Li0EEXT1_EEERKNS1_IT_XT1_EEERKNS1_IT0_XT1_EEE(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3DmlIddLm3EEENS_6VectorIDTmlixfp_Li0Efp0_EXT1_EEERKNS1_IT_XT1_EEERKT0_(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Vector") align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

declare void @_ZN3P3D8Physical20applyForceToPhysicalENS_6VectorIdLm3EEES2_(ptr noundef nonnull align 8 dereferenceable(144), ptr noundef byval(%"struct.P3D::Vector") align 8, ptr noundef byval(%"struct.P3D::Vector") align 8) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN3P3DmLIddLm3EEERNS_6VectorIT_XT1_EEES4_RKT0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN3P3D15TaylorExpansionINS_6VectorIdLm3EEELm2EEixEm(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef) local_unnamed_addr #0 align 2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !8, i64 8}
!6 = !{!"_ZTSN3P3D11MagnetForceE", !7, i64 0, !8, i64 8, !11, i64 16, !12, i64 40, !15, i64 64, !15, i64 72}
!7 = !{!"_ZTSN3P3D13ExternalForceE"}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSN3P3D6VectorIdLm3EEE", !9, i64 0}
!12 = !{!"_ZTSN3P3D16PositionTemplateINS_3FixILl32EEEEE", !13, i64 0, !13, i64 8, !13, i64 16}
!13 = !{!"_ZTSN3P3D3FixILl32EEE", !14, i64 0}
!14 = !{!"long", !9, i64 0}
!15 = !{!"double", !9, i64 0}
!16 = !{!17, !8, i64 112}
!17 = !{!"_ZTSN3P3D8PhysicalE", !18, i64 0, !8, i64 112, !25, i64 120}
!18 = !{!"_ZTSN3P3D9RigidBodyE", !8, i64 0, !19, i64 8, !15, i64 32, !11, i64 40, !24, i64 64}
!19 = !{!"_ZTSN3P3D15UnorderedVectorINS_12AttachedPartEEE", !20, i64 0}
!20 = !{!"_ZTSSt6vectorIN3P3D12AttachedPartESaIS1_EE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseIN3P3D12AttachedPartESaIS1_EE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIN3P3D12AttachedPartESaIS1_EE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIN3P3D12AttachedPartESaIS1_EE17_Vector_impl_dataE", !8, i64 0, !8, i64 8, !8, i64 16}
!24 = !{!"_ZTSN3P3D15SymmetricMatrixIdLm3EEE", !9, i64 0}
!25 = !{!"_ZTSN3P3D15UnorderedVectorINS_17ConnectedPhysicalEEE", !26, i64 0}
!26 = !{!"_ZTSSt6vectorIN3P3D17ConnectedPhysicalESaIS1_EE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseIN3P3D17ConnectedPhysicalESaIS1_EE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIN3P3D17ConnectedPhysicalESaIS1_EE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIN3P3D17ConnectedPhysicalESaIS1_EE17_Vector_impl_dataE", !8, i64 0, !8, i64 8, !8, i64 16}
!30 = !{!15, !15, i64 0}


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass