; LLVM IR from jrouwe/JoltPhysics :: Jolt/Physics/Constraints (SwingTwistConstraint)

; 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::Ref" = type { ptr }
%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::SwingTwistConstraintSettings" = type { %"class.JPH::TwoBodyConstraintSettings", i32, %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", i8, float, float, float, float, float, %"class.JPH::MotorSettings", %"class.JPH::MotorSettings" }
%"class.JPH::TwoBodyConstraintSettings" = type { %"class.JPH::ConstraintSettings" }
%"class.JPH::ConstraintSettings" = type { %"class.JPH::SerializableObject", %"class.JPH::RefTarget", i8, i32, i32, i32, float, i64 }
%"class.JPH::SerializableObject" = type { ptr }
%"class.JPH::RefTarget" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::MotorSettings" = type { %"class.JPH::SpringSettings", float, float, float, float }
%"class.JPH::SpringSettings" = type { i8, %union.anon.2, float }
%union.anon.2 = type { float }
%"class.JPH::SwingTwistConstraint" = type { %"class.JPH::TwoBodyConstraint", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Quat", %"class.JPH::Quat", float, float, float, float, float, %"class.JPH::MotorSettings", %"class.JPH::MotorSettings", i32, i32, %"class.JPH::Vec3", %"class.JPH::Quat", [3 x %"class.JPH::Vec3"], %"class.JPH::PointConstraintPart", %"class.JPH::SwingTwistConstraintPart", [3 x %"class.JPH::AngleConstraintPart"] }
%"class.JPH::TwoBodyConstraint" = type { %"class.JPH::Constraint", ptr, ptr }
%"class.JPH::Constraint" = type { ptr, %"class.JPH::RefTarget.3", i32, i32, i8, i8, i8, i64 }
%"class.JPH::RefTarget.3" = type { %"struct.std::atomic" }
%"class.JPH::Quat" = type { %"class.JPH::Vec4" }
%"class.JPH::Vec4" = type { %union.anon.4 }
%union.anon.4 = type { <4 x float> }
%"class.JPH::PointConstraintPart" = type { %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Mat44", %"class.JPH::Mat44", %"class.JPH::Mat44", %"class.JPH::Vec3" }
%"class.JPH::Mat44" = type { [4 x %"class.JPH::Vec4"] }
%"class.JPH::SwingTwistConstraintPart" = type { i8, i8, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::AngleConstraintPart", %"class.JPH::AngleConstraintPart", %"class.JPH::AngleConstraintPart" }
%"class.JPH::AngleConstraintPart" = type { %"class.JPH::Vec3", %"class.JPH::Vec3", float, %"class.JPH::SpringPart", float }
%"class.JPH::SpringPart" = type { float, float }

; 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: 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 uwtable
define dso_local void @_ZNK3JPH20SwingTwistConstraint21GetConstraintSettingsEv(ptr dead_on_unwind noalias writable sret(%"class.JPH::Ref") align 8 %0, ptr noundef nonnull align 16 dereferenceable(944) %1) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.JPH::Vec3", align 16
  %9 = alloca %"class.JPH::Vec3", align 16
  %10 = alloca %"class.JPH::Vec3", align 16
  %11 = alloca %"class.JPH::Vec3", align 16
  %12 = alloca %"class.JPH::Vec3", align 16
  %13 = alloca %"class.JPH::Vec3", align 16
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  %14 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  %15 = call noundef ptr @_ZN3JPH28SwingTwistConstraintSettingsnwEm(i64 noundef 224)
  invoke void @_ZN3JPH28SwingTwistConstraintSettingsC2Ev(ptr noundef nonnull align 16 dereferenceable(224) %15)
          to label %16 unwind label %97

16:                                               ; preds = %2
  store ptr %15, ptr %5, align 8, !tbaa !5
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZNK3JPH10Constraint20ToConstraintSettingsERNS_18ConstraintSettingsE(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef nonnull align 8 dereferenceable(40) %17)
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = getelementptr inbounds %"class.JPH::SwingTwistConstraintSettings", ptr %18, i32 0, i32 1
  store i32 0, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #8
  %20 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %14, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %8, ptr align 16 %20, i64 16, i1 false), !tbaa.struct !27
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = getelementptr inbounds %"class.JPH::SwingTwistConstraintSettings", ptr %21, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %22, ptr align 16 %8, i64 16, i1 false), !tbaa.struct !27
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #8
  %23 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %14, i32 0, i32 3
  %24 = call { double, double } @_ZNK3JPH4Quat11RotateAxisXEv(ptr noundef nonnull align 16 dereferenceable(16) %23)
  %25 = getelementptr inbounds %"class.JPH::Vec3", ptr %9, 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 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %"class.JPH::SwingTwistConstraintSettings", ptr %31, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %32, ptr align 16 %9, i64 16, i1 false), !tbaa.struct !27
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #8
  %33 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %14, i32 0, i32 3
  %34 = call { double, double } @_ZNK3JPH4Quat11RotateAxisZEv(ptr noundef nonnull align 16 dereferenceable(16) %33)
  %35 = getelementptr inbounds %"class.JPH::Vec3", ptr %10, i32 0, i32 0
  %36 = getelementptr inbounds %union.anon, ptr %35, i32 0, i32 0
  %37 = getelementptr inbounds { double, double }, ptr %36, i32 0, i32 0
  %38 = extractvalue { double, double } %34, 0
  store double %38, ptr %37, align 16
  %39 = getelementptr inbounds { double, double }, ptr %36, i32 0, i32 1
  %40 = extractvalue { double, double } %34, 1
  store double %40, ptr %39, align 8
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = getelementptr inbounds %"class.JPH::SwingTwistConstraintSettings", ptr %41, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %42, ptr align 16 %10, i64 16, i1 false), !tbaa.struct !27
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #8
  %43 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %14, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %11, ptr align 16 %43, i64 16, i1 false), !tbaa.struct !27
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %"class.JPH::SwingTwistConstraintSettings", ptr %44, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %45, ptr align 16 %11, i64 16, i1 false), !tbaa.struct !27
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #8
  %46 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %14, i32 0, i32 4
  %47 = call { double, double } @_ZNK3JPH4Quat11RotateAxisXEv(ptr noundef nonnull align 16 dereferenceable(16) %46)
  %48 = getelementptr inbounds %"class.JPH::Vec3", ptr %12, i32 0, i32 0
  %49 = getelementptr inbounds %union.anon, ptr %48, i32 0, i32 0
  %50 = getelementptr inbounds { double, double }, ptr %49, i32 0, i32 0
  %51 = extractvalue { double, double } %47, 0
  store double %51, ptr %50, align 16
  %52 = getelementptr inbounds { double, double }, ptr %49, i32 0, i32 1
  %53 = extractvalue { double, double } %47, 1
  store double %53, ptr %52, align 8
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = getelementptr inbounds %"class.JPH::SwingTwistConstraintSettings", ptr %54, i32 0, i32 6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %55, ptr align 16 %12, i64 16, i1 false), !tbaa.struct !27
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #8
  %56 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %14, i32 0, i32 4
  %57 = call { double, double } @_ZNK3JPH4Quat11RotateAxisZEv(ptr noundef nonnull align 16 dereferenceable(16) %56)
  %58 = getelementptr inbounds %"class.JPH::Vec3", ptr %13, i32 0, i32 0
  %59 = getelementptr inbounds %union.anon, ptr %58, i32 0, i32 0
  %60 = getelementptr inbounds { double, double }, ptr %59, i32 0, i32 0
  %61 = extractvalue { double, double } %57, 0
  store double %61, ptr %60, align 16
  %62 = getelementptr inbounds { double, double }, ptr %59, i32 0, i32 1
  %63 = extractvalue { double, double } %57, 1
  store double %63, ptr %62, align 8
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = getelementptr inbounds %"class.JPH::SwingTwistConstraintSettings", ptr %64, i32 0, i32 7
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %65, ptr align 16 %13, i64 16, i1 false), !tbaa.struct !27
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #8
  %66 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %14, i32 0, i32 18
  %67 = call noundef zeroext i8 @_ZNK3JPH24SwingTwistConstraintPart12GetSwingTypeEv(ptr noundef nonnull align 16 dereferenceable(272) %66)
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = getelementptr inbounds %"class.JPH::SwingTwistConstraintSettings", ptr %68, i32 0, i32 8
  store i8 %67, ptr %69, align 16, !tbaa !29
  %70 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %14, i32 0, i32 5
  %71 = load float, ptr %70, align 16, !tbaa !30
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = getelementptr inbounds %"class.JPH::SwingTwistConstraintSettings", ptr %72, i32 0, i32 9
  store float %71, ptr %73, align 4, !tbaa !43
  %74 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %14, i32 0, i32 6
  %75 = load float, ptr %74, align 4, !tbaa !44
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = getelementptr inbounds %"class.JPH::SwingTwistConstraintSettings", ptr %76, i32 0, i32 10
  store float %75, ptr %77, align 8, !tbaa !45
  %78 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %14, i32 0, i32 7
  %79 = load float, ptr %78, align 8, !tbaa !46
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = getelementptr inbounds %"class.JPH::SwingTwistConstraintSettings", ptr %80, i32 0, i32 11
  store float %79, ptr %81, align 4, !tbaa !47
  %82 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %14, i32 0, i32 8
  %83 = load float, ptr %82, align 4, !tbaa !48
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = getelementptr inbounds %"class.JPH::SwingTwistConstraintSettings", ptr %84, i32 0, i32 12
  store float %83, ptr %85, align 16, !tbaa !49
  %86 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %14, i32 0, i32 9
  %87 = load float, ptr %86, align 16, !tbaa !50
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %"class.JPH::SwingTwistConstraintSettings", ptr %88, i32 0, i32 13
  store float %87, ptr %89, align 4, !tbaa !51
  %90 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %14, i32 0, i32 10
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %"class.JPH::SwingTwistConstraintSettings", ptr %91, i32 0, i32 14
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %92, ptr align 4 %90, i64 28, i1 false), !tbaa.struct !52
  %93 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %14, i32 0, i32 11
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  %95 = getelementptr inbounds %"class.JPH::SwingTwistConstraintSettings", ptr %94, i32 0, i32 15
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %95, ptr align 16 %93, i64 28, i1 false), !tbaa.struct !52
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN3JPH3RefINS_18ConstraintSettingsEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef %96)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  ret void

97:                                               ; preds = %2
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %6, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %7, align 4
  call void @_ZN3JPH28SwingTwistConstraintSettingsdlEPv(ptr noundef %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  br label %101

101:                                              ; preds = %97
  %102 = load ptr, ptr %6, align 8
  %103 = load i32, ptr %7, align 4
  %104 = insertvalue { ptr, i32 } poison, ptr %102, 0
  %105 = insertvalue { ptr, i32 } %104, i32 %103, 1
  resume { ptr, i32 } %105
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef ptr @_ZN3JPH28SwingTwistConstraintSettingsnwEm(i64 noundef) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH28SwingTwistConstraintSettingsC2Ev(ptr noundef nonnull align 16 dereferenceable(224)) unnamed_addr #4 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH28SwingTwistConstraintSettingsdlEPv(ptr noundef) #5 align 2

declare void @_ZNK3JPH10Constraint20ToConstraintSettingsERNS_18ConstraintSettingsE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(40)) #6

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH3RefINS_18ConstraintSettingsEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 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 = { 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 = { "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 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 #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, !21, i64 40}
!10 = !{!"_ZTSN3JPH28SwingTwistConstraintSettingsE", !11, i64 0, !21, i64 40, !22, i64 48, !22, i64 64, !22, i64 80, !22, i64 96, !22, i64 112, !22, i64 128, !23, i64 144, !19, i64 148, !19, i64 152, !19, i64 156, !19, i64 160, !19, i64 164, !24, i64 168, !24, i64 196}
!11 = !{!"_ZTSN3JPH25TwoBodyConstraintSettingsE", !12, i64 0}
!12 = !{!"_ZTSN3JPH18ConstraintSettingsE", !13, i64 0, !14, i64 8, !18, i64 12, !17, i64 16, !17, i64 20, !17, i64 24, !19, i64 28, !20, i64 32}
!13 = !{!"_ZTSN3JPH18SerializableObjectE"}
!14 = !{!"_ZTSN3JPH9RefTargetINS_18ConstraintSettingsEEE", !15, i64 0}
!15 = !{!"_ZTSSt6atomicIjE", !16, i64 0}
!16 = !{!"_ZTSSt13__atomic_baseIjE", !17, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!"float", !7, i64 0}
!20 = !{!"long", !7, i64 0}
!21 = !{!"_ZTSN3JPH16EConstraintSpaceE", !7, i64 0}
!22 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!23 = !{!"_ZTSN3JPH10ESwingTypeE", !7, i64 0}
!24 = !{!"_ZTSN3JPH13MotorSettingsE", !25, i64 0, !19, i64 12, !19, i64 16, !19, i64 20, !19, i64 24}
!25 = !{!"_ZTSN3JPH14SpringSettingsE", !26, i64 0, !7, i64 4, !19, i64 8}
!26 = !{!"_ZTSN3JPH11ESpringModeE", !7, i64 0}
!27 = !{i64 0, i64 16, !28}
!28 = !{!7, !7, i64 0}
!29 = !{!10, !23, i64 144}
!30 = !{!31, !19, i64 112}
!31 = !{!"_ZTSN3JPH20SwingTwistConstraintE", !32, i64 0, !22, i64 48, !22, i64 64, !35, i64 80, !35, i64 96, !19, i64 112, !19, i64 116, !19, i64 120, !19, i64 124, !19, i64 128, !24, i64 132, !24, i64 160, !37, i64 188, !37, i64 192, !22, i64 208, !35, i64 224, !7, i64 240, !38, i64 288, !40, i64 528, !7, i64 800}
!32 = !{!"_ZTSN3JPH17TwoBodyConstraintE", !33, i64 0, !6, i64 32, !6, i64 40}
!33 = !{!"_ZTSN3JPH10ConstraintE", !34, i64 8, !17, i64 12, !17, i64 16, !7, i64 20, !7, i64 21, !18, i64 22, !20, i64 24}
!34 = !{!"_ZTSN3JPH9RefTargetINS_10ConstraintEEE", !15, i64 0}
!35 = !{!"_ZTSN3JPH4QuatE", !36, i64 0}
!36 = !{!"_ZTSN3JPH4Vec4E", !7, i64 0}
!37 = !{!"_ZTSN3JPH11EMotorStateE", !7, i64 0}
!38 = !{!"_ZTSN3JPH19PointConstraintPartE", !22, i64 0, !22, i64 16, !39, i64 32, !39, i64 96, !39, i64 160, !22, i64 224}
!39 = !{!"_ZTSN3JPH5Mat44E", !7, i64 0}
!40 = !{!"_ZTSN3JPH24SwingTwistConstraintPartE", !7, i64 0, !23, i64 1, !19, i64 4, !19, i64 8, !19, i64 12, !19, i64 16, !19, i64 20, !19, i64 24, !19, i64 28, !19, i64 32, !19, i64 36, !19, i64 40, !19, i64 44, !19, i64 48, !19, i64 52, !19, i64 56, !19, i64 60, !19, i64 64, !22, i64 80, !22, i64 96, !22, i64 112, !41, i64 128, !41, i64 176, !41, i64 224}
!41 = !{!"_ZTSN3JPH19AngleConstraintPartE", !22, i64 0, !22, i64 16, !19, i64 32, !42, i64 36, !19, i64 44}
!42 = !{!"_ZTSN3JPH10SpringPartE", !19, i64 0, !19, i64 4}
!43 = !{!10, !19, i64 148}
!44 = !{!31, !19, i64 116}
!45 = !{!10, !19, i64 152}
!46 = !{!31, !19, i64 120}
!47 = !{!10, !19, i64 156}
!48 = !{!31, !19, i64 124}
!49 = !{!10, !19, i64 160}
!50 = !{!31, !19, i64 128}
!51 = !{!10, !19, i64 164}
!52 = !{i64 0, i64 1, !53, i64 4, i64 4, !28, i64 8, i64 4, !54, i64 12, i64 4, !54, i64 16, i64 4, !54, i64 20, i64 4, !54, i64 24, i64 4, !54}
!53 = !{!26, !26, i64 0}
!54 = !{!19, !19, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.JPH::Ref" = type { ptr }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress 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 @_ZNK3JPH20SwingTwistConstraint21GetConstraintSettingsEv(ptr dead_on_unwind noalias writable sret(%"class.JPH::Ref") align 8 %0, ptr noundef nonnull align 16 dereferenceable(944) %1) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = tail call noundef ptr @_ZN3JPH28SwingTwistConstraintSettingsnwEm(i64 noundef 224)
  invoke void @_ZN3JPH28SwingTwistConstraintSettingsC2Ev(ptr noundef nonnull align 16 dereferenceable(224) %3)
          to label %4 unwind label %41

4:                                                ; preds = %2
  tail call void @_ZNK3JPH10Constraint20ToConstraintSettingsERNS_18ConstraintSettingsE(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(40) %3)
  %5 = getelementptr inbounds i8, ptr %3, i64 40
  store i32 0, ptr %5, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %1, i64 48
  %.sroa.09.0.copyload = load <4 x float>, ptr %6, align 16, !tbaa !25
  %7 = getelementptr inbounds i8, ptr %3, i64 48
  store <4 x float> %.sroa.09.0.copyload, ptr %7, align 16, !tbaa !25
  %8 = getelementptr inbounds i8, ptr %1, i64 80
  %9 = tail call { double, double } @_ZNK3JPH4Quat11RotateAxisXEv(ptr noundef nonnull align 16 dereferenceable(16) %8)
  %10 = extractvalue { double, double } %9, 0
  %11 = extractvalue { double, double } %9, 1
  %12 = getelementptr inbounds i8, ptr %3, i64 64
  store double %10, ptr %12, align 16
  %.sroa.48.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 72
  store double %11, ptr %.sroa.48.0..sroa_idx, align 8, !tbaa !25
  %13 = tail call { double, double } @_ZNK3JPH4Quat11RotateAxisZEv(ptr noundef nonnull align 16 dereferenceable(16) %8)
  %14 = extractvalue { double, double } %13, 0
  %15 = extractvalue { double, double } %13, 1
  %16 = getelementptr inbounds i8, ptr %3, i64 80
  store double %14, ptr %16, align 16
  %.sroa.46.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 88
  store double %15, ptr %.sroa.46.0..sroa_idx, align 8, !tbaa !25
  %17 = getelementptr inbounds i8, ptr %1, i64 64
  %.sroa.03.0.copyload = load <4 x float>, ptr %17, align 16, !tbaa !25
  %18 = getelementptr inbounds i8, ptr %3, i64 96
  store <4 x float> %.sroa.03.0.copyload, ptr %18, align 16, !tbaa !25
  %19 = getelementptr inbounds i8, ptr %1, i64 96
  %20 = tail call { double, double } @_ZNK3JPH4Quat11RotateAxisXEv(ptr noundef nonnull align 16 dereferenceable(16) %19)
  %21 = extractvalue { double, double } %20, 0
  %22 = extractvalue { double, double } %20, 1
  %23 = getelementptr inbounds i8, ptr %3, i64 112
  store double %21, ptr %23, align 16
  %.sroa.42.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 120
  store double %22, ptr %.sroa.42.0..sroa_idx, align 8, !tbaa !25
  %24 = tail call { double, double } @_ZNK3JPH4Quat11RotateAxisZEv(ptr noundef nonnull align 16 dereferenceable(16) %19)
  %25 = extractvalue { double, double } %24, 0
  %26 = extractvalue { double, double } %24, 1
  %27 = getelementptr inbounds i8, ptr %3, i64 128
  store double %25, ptr %27, align 16
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 136
  store double %26, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !25
  %28 = getelementptr inbounds i8, ptr %1, i64 528
  %29 = tail call noundef zeroext i8 @_ZNK3JPH24SwingTwistConstraintPart12GetSwingTypeEv(ptr noundef nonnull align 16 dereferenceable(272) %28)
  %30 = getelementptr inbounds i8, ptr %3, i64 144
  store i8 %29, ptr %30, align 16, !tbaa !26
  %31 = getelementptr inbounds i8, ptr %1, i64 112
  %32 = getelementptr inbounds i8, ptr %3, i64 148
  %33 = load <4 x float>, ptr %31, align 16, !tbaa !27
  store <4 x float> %33, ptr %32, align 4, !tbaa !27
  %34 = getelementptr inbounds i8, ptr %1, i64 128
  %35 = load float, ptr %34, align 16, !tbaa !28
  %36 = getelementptr inbounds i8, ptr %3, i64 164
  store float %35, ptr %36, align 4, !tbaa !42
  %37 = getelementptr inbounds i8, ptr %1, i64 132
  %38 = getelementptr inbounds i8, ptr %3, i64 168
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(28) %38, ptr noundef nonnull align 4 dereferenceable(28) %37, i64 28, i1 false), !tbaa.struct !43
  %39 = getelementptr inbounds i8, ptr %1, i64 160
  %40 = getelementptr inbounds i8, ptr %3, i64 196
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %40, ptr noundef nonnull align 16 dereferenceable(28) %39, i64 28, i1 false), !tbaa.struct !43
  tail call void @_ZN3JPH3RefINS_18ConstraintSettingsEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull %3)
  ret void

41:                                               ; preds = %2
  %42 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN3JPH28SwingTwistConstraintSettingsdlEPv(ptr noundef %3) #7
  resume { ptr, i32 } %42
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef ptr @_ZN3JPH28SwingTwistConstraintSettingsnwEm(i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH28SwingTwistConstraintSettingsC2Ev(ptr noundef nonnull align 16 dereferenceable(224)) unnamed_addr #3 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH28SwingTwistConstraintSettingsdlEPv(ptr noundef) local_unnamed_addr #4 align 2

declare void @_ZNK3JPH10Constraint20ToConstraintSettingsERNS_18ConstraintSettingsE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_ZNK3JPH24SwingTwistConstraintPart12GetSwingTypeEv(ptr noundef nonnull align 16 dereferenceable(272)) local_unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH3RefINS_18ConstraintSettingsEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #3 align 2

attributes #0 = { mustprogress 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 = { alwaysinline 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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #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" }
attributes #6 = { 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, !19, i64 40}
!6 = !{!"_ZTSN3JPH28SwingTwistConstraintSettingsE", !7, i64 0, !19, i64 40, !20, i64 48, !20, i64 64, !20, i64 80, !20, i64 96, !20, i64 112, !20, i64 128, !21, i64 144, !17, i64 148, !17, i64 152, !17, i64 156, !17, i64 160, !17, i64 164, !22, i64 168, !22, i64 196}
!7 = !{!"_ZTSN3JPH25TwoBodyConstraintSettingsE", !8, i64 0}
!8 = !{!"_ZTSN3JPH18ConstraintSettingsE", !9, i64 0, !10, i64 8, !16, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !17, i64 28, !18, i64 32}
!9 = !{!"_ZTSN3JPH18SerializableObjectE"}
!10 = !{!"_ZTSN3JPH9RefTargetINS_18ConstraintSettingsEEE", !11, i64 0}
!11 = !{!"_ZTSSt6atomicIjE", !12, i64 0}
!12 = !{!"_ZTSSt13__atomic_baseIjE", !13, i64 0}
!13 = !{!"int", !14, i64 0}
!14 = !{!"omnipotent char", !15, i64 0}
!15 = !{!"Simple C++ TBAA"}
!16 = !{!"bool", !14, i64 0}
!17 = !{!"float", !14, i64 0}
!18 = !{!"long", !14, i64 0}
!19 = !{!"_ZTSN3JPH16EConstraintSpaceE", !14, i64 0}
!20 = !{!"_ZTSN3JPH4Vec3E", !14, i64 0}
!21 = !{!"_ZTSN3JPH10ESwingTypeE", !14, i64 0}
!22 = !{!"_ZTSN3JPH13MotorSettingsE", !23, i64 0, !17, i64 12, !17, i64 16, !17, i64 20, !17, i64 24}
!23 = !{!"_ZTSN3JPH14SpringSettingsE", !24, i64 0, !14, i64 4, !17, i64 8}
!24 = !{!"_ZTSN3JPH11ESpringModeE", !14, i64 0}
!25 = !{!14, !14, i64 0}
!26 = !{!6, !21, i64 144}
!27 = !{!17, !17, i64 0}
!28 = !{!29, !17, i64 128}
!29 = !{!"_ZTSN3JPH20SwingTwistConstraintE", !30, i64 0, !20, i64 48, !20, i64 64, !34, i64 80, !34, i64 96, !17, i64 112, !17, i64 116, !17, i64 120, !17, i64 124, !17, i64 128, !22, i64 132, !22, i64 160, !36, i64 188, !36, i64 192, !20, i64 208, !34, i64 224, !14, i64 240, !37, i64 288, !39, i64 528, !14, i64 800}
!30 = !{!"_ZTSN3JPH17TwoBodyConstraintE", !31, i64 0, !33, i64 32, !33, i64 40}
!31 = !{!"_ZTSN3JPH10ConstraintE", !32, i64 8, !13, i64 12, !13, i64 16, !14, i64 20, !14, i64 21, !16, i64 22, !18, i64 24}
!32 = !{!"_ZTSN3JPH9RefTargetINS_10ConstraintEEE", !11, i64 0}
!33 = !{!"any pointer", !14, i64 0}
!34 = !{!"_ZTSN3JPH4QuatE", !35, i64 0}
!35 = !{!"_ZTSN3JPH4Vec4E", !14, i64 0}
!36 = !{!"_ZTSN3JPH11EMotorStateE", !14, i64 0}
!37 = !{!"_ZTSN3JPH19PointConstraintPartE", !20, i64 0, !20, i64 16, !38, i64 32, !38, i64 96, !38, i64 160, !20, i64 224}
!38 = !{!"_ZTSN3JPH5Mat44E", !14, i64 0}
!39 = !{!"_ZTSN3JPH24SwingTwistConstraintPartE", !14, i64 0, !21, i64 1, !17, i64 4, !17, i64 8, !17, i64 12, !17, i64 16, !17, i64 20, !17, i64 24, !17, i64 28, !17, i64 32, !17, i64 36, !17, i64 40, !17, i64 44, !17, i64 48, !17, i64 52, !17, i64 56, !17, i64 60, !17, i64 64, !20, i64 80, !20, i64 96, !20, i64 112, !40, i64 128, !40, i64 176, !40, i64 224}
!40 = !{!"_ZTSN3JPH19AngleConstraintPartE", !20, i64 0, !20, i64 16, !17, i64 32, !41, i64 36, !17, i64 44}
!41 = !{!"_ZTSN3JPH10SpringPartE", !17, i64 0, !17, i64 4}
!42 = !{!6, !17, i64 164}
!43 = !{i64 0, i64 1, !44, i64 4, i64 4, !25, i64 8, i64 4, !27, i64 12, i64 4, !27, i64 16, i64 4, !27, i64 20, i64 4, !27, i64 24, i64 4, !27}
!44 = !{!24, !24, i64 0}


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