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

; 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::SixDOFConstraintSettings" = type <{ %"class.JPH::TwoBodyConstraintSettings", i32, [4 x i8], %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", [6 x float], i8, [3 x i8], [6 x float], [6 x float], [3 x %"class.JPH::SpringSettings"], [6 x %"class.JPH::MotorSettings"], [8 x i8] }>
%"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::SpringSettings" = type { i8, %union.anon.2, float }
%union.anon.2 = type { float }
%"class.JPH::MotorSettings" = type { %"class.JPH::SpringSettings", float, float, float, float }
%"class.JPH::SixDOFConstraint" = type { %"class.JPH::TwoBodyConstraint", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Quat", %"class.JPH::Quat", i8, i8, i8, i8, i8, i8, [6 x float], [6 x float], [3 x %"class.JPH::SpringSettings"], [6 x %"class.JPH::MotorSettings"], [6 x float], [6 x i32], %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Quat", [3 x %"class.JPH::Vec3"], [3 x %"class.JPH::Vec3"], [3 x float], [3 x %"class.JPH::AxisConstraintPart"], %"class.JPH::PointConstraintPart", %"class.JPH::SwingTwistConstraintPart", %"class.JPH::RotationEulerConstraintPart", [3 x %"class.JPH::AxisConstraintPart"], [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 }
%"class.JPH::RotationEulerConstraintPart" = type { %"class.JPH::Mat44", %"class.JPH::Mat44", %"class.JPH::Mat44", %"class.JPH::Vec3" }
%"class.JPH::AxisConstraintPart" = type { %"class.JPH::Float3", %"class.JPH::Float3", %"class.JPH::Float3", %"class.JPH::Float3", float, %"class.JPH::SpringPart", float }
%"class.JPH::Float3" = type { float, 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: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZNK3JPH4Quat11RotateAxisXEv(ptr noundef nonnull align 16 dereferenceable(16)) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH16SixDOFConstraint21GetConstraintSettingsEv(ptr dead_on_unwind noalias writable sret(%"class.JPH::Ref") align 8 %0, ptr noundef nonnull align 16 dereferenceable(1856) %1) unnamed_addr #3 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
  %14 = alloca i32, align 4
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  %15 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  %16 = call noundef ptr @_ZN3JPH24SixDOFConstraintSettingsnwEm(i64 noundef 432)
  invoke void @_ZN3JPH24SixDOFConstraintSettingsC2Ev(ptr noundef nonnull align 16 dereferenceable(432) %16)
          to label %17 unwind label %90

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

86:                                               ; preds = %104, %17
  %87 = load i32, ptr %14, align 4, !tbaa !27
  %88 = icmp slt i32 %87, 6
  br i1 %88, label %94, label %89

89:                                               ; preds = %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %107

90:                                               ; preds = %2
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %6, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %7, align 4
  call void @_ZN3JPH24SixDOFConstraintSettingsdlEPv(ptr noundef %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  br label %109

94:                                               ; preds = %86
  %95 = getelementptr inbounds %"class.JPH::SixDOFConstraint", ptr %15, i32 0, i32 14
  %96 = load i32, ptr %14, align 4, !tbaa !27
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [6 x %"class.JPH::MotorSettings"], ptr %95, i64 0, i64 %97
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = getelementptr inbounds %"class.JPH::SixDOFConstraintSettings", ptr %99, i32 0, i32 15
  %101 = load i32, ptr %14, align 4, !tbaa !27
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [6 x %"class.JPH::MotorSettings"], ptr %100, i64 0, i64 %102
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %103, ptr align 4 %98, i64 28, i1 false), !tbaa.struct !28
  br label %104

104:                                              ; preds = %94
  %105 = load i32, ptr %14, align 4, !tbaa !27
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %14, align 4, !tbaa !27
  br label %86, !llvm.loop !32

107:                                              ; preds = %89
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN3JPH3RefINS_18ConstraintSettingsEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef %108)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  ret void

109:                                              ; preds = %90
  %110 = load ptr, ptr %6, align 8
  %111 = load i32, ptr %7, align 4
  %112 = insertvalue { ptr, i32 } poison, ptr %110, 0
  %113 = insertvalue { ptr, i32 } %112, i32 %111, 1
  resume { ptr, i32 } %113
}

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

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH24SixDOFConstraintSettingsdlEPv(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: 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 = { 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 = { 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 = !{!"_ZTSN3JPH24SixDOFConstraintSettingsE", !11, i64 0, !21, i64 40, !22, i64 48, !22, i64 64, !22, i64 80, !22, i64 96, !22, i64 112, !22, i64 128, !7, i64 144, !23, i64 168, !7, i64 172, !7, i64 196, !7, i64 220, !7, i64 256}
!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 = !{i64 0, i64 16, !25}
!25 = !{!7, !7, i64 0}
!26 = !{!10, !23, i64 168}
!27 = !{!17, !17, i64 0}
!28 = !{i64 0, i64 1, !29, i64 4, i64 4, !25, i64 8, i64 4, !31, i64 12, i64 4, !31, i64 16, i64 4, !31, i64 20, i64 4, !31, i64 24, i64 4, !31}
!29 = !{!30, !30, i64 0}
!30 = !{!"_ZTSN3JPH11ESpringModeE", !7, i64 0}
!31 = !{!19, !19, i64 0}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}


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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3JPH16SixDOFConstraint21GetConstraintSettingsEv(ptr dead_on_unwind noalias writable sret(%"class.JPH::Ref") align 8 %0, ptr noundef nonnull align 16 dereferenceable(1856) %1) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = tail call noundef ptr @_ZN3JPH24SixDOFConstraintSettingsnwEm(i64 noundef 432)
  invoke void @_ZN3JPH24SixDOFConstraintSettingsC2Ev(ptr noundef nonnull align 16 dereferenceable(432) %3)
          to label %4 unwind label %49

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.012.0.copyload = load <4 x float>, ptr %6, align 16, !tbaa !22
  %7 = getelementptr inbounds i8, ptr %3, i64 48
  store <4 x float> %.sroa.012.0.copyload, ptr %7, align 16, !tbaa !22
  %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.411.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 72
  store double %11, ptr %.sroa.411.0..sroa_idx, align 8, !tbaa !22
  %13 = tail call { double, double } @_ZNK3JPH4Quat11RotateAxisYEv(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.49.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 88
  store double %15, ptr %.sroa.49.0..sroa_idx, align 8, !tbaa !22
  %17 = getelementptr inbounds i8, ptr %1, i64 64
  %.sroa.06.0.copyload = load <4 x float>, ptr %17, align 16, !tbaa !22
  %18 = getelementptr inbounds i8, ptr %3, i64 96
  store <4 x float> %.sroa.06.0.copyload, ptr %18, align 16, !tbaa !22
  %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.45.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 120
  store double %22, ptr %.sroa.45.0..sroa_idx, align 8, !tbaa !22
  %24 = tail call { double, double } @_ZNK3JPH4Quat11RotateAxisYEv(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 !22
  %28 = getelementptr inbounds i8, ptr %1, i64 1040
  %29 = tail call noundef zeroext i8 @_ZNK3JPH24SwingTwistConstraintPart12GetSwingTypeEv(ptr noundef nonnull align 16 dereferenceable(272) %28)
  %30 = getelementptr inbounds i8, ptr %3, i64 168
  store i8 %29, ptr %30, align 8, !tbaa !23
  %31 = getelementptr inbounds i8, ptr %3, i64 172
  %32 = getelementptr inbounds i8, ptr %1, i64 120
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(24) %31, ptr noundef nonnull align 8 dereferenceable(24) %32, i64 24, i1 false)
  %33 = getelementptr inbounds i8, ptr %3, i64 196
  %34 = getelementptr inbounds i8, ptr %1, i64 144
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(24) %33, ptr noundef nonnull align 16 dereferenceable(24) %34, i64 24, i1 false)
  %35 = getelementptr inbounds i8, ptr %3, i64 144
  %36 = getelementptr inbounds i8, ptr %1, i64 372
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) %35, ptr noundef nonnull align 4 dereferenceable(24) %36, i64 24, i1 false)
  %37 = getelementptr inbounds i8, ptr %1, i64 204
  %38 = getelementptr inbounds i8, ptr %3, i64 256
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %38, ptr noundef nonnull align 4 dereferenceable(28) %37, i64 28, i1 false), !tbaa.struct !24
  %39 = getelementptr inbounds i8, ptr %1, i64 232
  %40 = getelementptr inbounds i8, ptr %3, i64 284
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %40, ptr noundef nonnull align 8 dereferenceable(28) %39, i64 28, i1 false), !tbaa.struct !24
  %41 = getelementptr inbounds i8, ptr %1, i64 260
  %42 = getelementptr inbounds i8, ptr %3, i64 312
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %42, ptr noundef nonnull align 4 dereferenceable(28) %41, i64 28, i1 false), !tbaa.struct !24
  %43 = getelementptr inbounds i8, ptr %1, i64 288
  %44 = getelementptr inbounds i8, ptr %3, i64 340
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %44, ptr noundef nonnull align 16 dereferenceable(28) %43, i64 28, i1 false), !tbaa.struct !24
  %45 = getelementptr inbounds i8, ptr %1, i64 316
  %46 = getelementptr inbounds i8, ptr %3, i64 368
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %46, ptr noundef nonnull align 4 dereferenceable(28) %45, i64 28, i1 false), !tbaa.struct !24
  %47 = getelementptr inbounds i8, ptr %1, i64 344
  %48 = getelementptr inbounds i8, ptr %3, i64 396
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %48, ptr noundef nonnull align 8 dereferenceable(28) %47, i64 28, i1 false), !tbaa.struct !24
  tail call void @_ZN3JPH3RefINS_18ConstraintSettingsEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull %3)
  ret void

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

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

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH24SixDOFConstraintSettingsdlEPv(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: 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 = { 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 #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 = { 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 = !{!"_ZTSN3JPH24SixDOFConstraintSettingsE", !7, i64 0, !19, i64 40, !20, i64 48, !20, i64 64, !20, i64 80, !20, i64 96, !20, i64 112, !20, i64 128, !14, i64 144, !21, i64 168, !14, i64 172, !14, i64 196, !14, i64 220, !14, i64 256}
!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 = !{!14, !14, i64 0}
!23 = !{!6, !21, i64 168}
!24 = !{i64 0, i64 1, !25, i64 4, i64 4, !22, 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}
!25 = !{!26, !26, i64 0}
!26 = !{!"_ZTSN3JPH11ESpringModeE", !14, i64 0}
!27 = !{!17, !17, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,SROAPass,SimplifyCFGPass,TailCallElimPass