; LLVM IR from jrouwe/JoltPhysics :: Jolt/Physics/Vehicle/WheeledVehicleController.ll (ZN3JPH15WheelSettingsWVC2Ev)

; 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::WheelSettingsWV" = type { %"class.JPH::WheelSettings.base", float, float, float, %"class.JPH::LinearCurve", %"class.JPH::LinearCurve", float, float, [8 x i8] }
%"class.JPH::WheelSettings.base" = type <{ %"class.JPH::SerializableObject", %"class.JPH::RefTarget.12", [4 x i8], %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", float, float, float, %"class.JPH::SpringSettings", float, float, i8 }>
%"class.JPH::SerializableObject" = type { ptr }
%"class.JPH::RefTarget.12" = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::SpringSettings" = type { i8, %union.anon.13, float }
%union.anon.13 = type { float }
%"class.JPH::LinearCurve" = type { %"class.JPH::Array" }
%"class.JPH::Array" = type { i64, i64, ptr }

@_ZTVN3JPH15WheelSettingsWVE = external dso_local unnamed_addr constant { [8 x ptr] }, align 8

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH15WheelSettingsWVC2Ev(ptr noundef nonnull align 16 dereferenceable(216) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  call void @_ZN3JPH13WheelSettingsC2Ev(ptr noundef nonnull align 16 dereferenceable(145) %5)
  store ptr getelementptr inbounds inrange(-16, 48) ({ [8 x ptr] }, ptr @_ZTVN3JPH15WheelSettingsWVE, i32 0, i32 0, i32 2), ptr %5, align 16, !tbaa !9
  %6 = getelementptr inbounds %"class.JPH::WheelSettingsWV", ptr %5, i32 0, i32 1
  store float 0x3FECCCCCC0000000, ptr %6, align 4, !tbaa !11
  %7 = getelementptr inbounds %"class.JPH::WheelSettingsWV", ptr %5, i32 0, i32 2
  store float 0x3FC99999A0000000, ptr %7, align 8, !tbaa !27
  %8 = getelementptr inbounds %"class.JPH::WheelSettingsWV", ptr %5, i32 0, i32 3
  %9 = invoke noundef float @_ZN3JPH16DegreesToRadiansEf(float noundef 7.000000e+01)
          to label %10 unwind label %31

10:                                               ; preds = %1
  store float %9, ptr %8, align 4, !tbaa !28
  %11 = getelementptr inbounds %"class.JPH::WheelSettingsWV", ptr %5, i32 0, i32 4
  call void @_ZN3JPH11LinearCurveC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  %12 = getelementptr inbounds %"class.JPH::WheelSettingsWV", ptr %5, i32 0, i32 5
  call void @_ZN3JPH11LinearCurveC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #4
  %13 = getelementptr inbounds %"class.JPH::WheelSettingsWV", ptr %5, i32 0, i32 6
  store float 1.500000e+03, ptr %13, align 16, !tbaa !29
  %14 = getelementptr inbounds %"class.JPH::WheelSettingsWV", ptr %5, i32 0, i32 7
  store float 4.000000e+03, ptr %14, align 4, !tbaa !30
  %15 = getelementptr inbounds %"class.JPH::WheelSettingsWV", ptr %5, i32 0, i32 4
  invoke void @_ZN3JPH11LinearCurve7ReserveEj(ptr noundef nonnull align 8 dereferenceable(24) %15, i32 noundef 3)
          to label %16 unwind label %35

16:                                               ; preds = %10
  %17 = getelementptr inbounds %"class.JPH::WheelSettingsWV", ptr %5, i32 0, i32 4
  invoke void @_ZN3JPH11LinearCurve8AddPointEff(ptr noundef nonnull align 8 dereferenceable(24) %17, float noundef 0.000000e+00, float noundef 0.000000e+00)
          to label %18 unwind label %35

18:                                               ; preds = %16
  %19 = getelementptr inbounds %"class.JPH::WheelSettingsWV", ptr %5, i32 0, i32 4
  invoke void @_ZN3JPH11LinearCurve8AddPointEff(ptr noundef nonnull align 8 dereferenceable(24) %19, float noundef 0x3FAEB851E0000000, float noundef 0x3FF3333340000000)
          to label %20 unwind label %35

20:                                               ; preds = %18
  %21 = getelementptr inbounds %"class.JPH::WheelSettingsWV", ptr %5, i32 0, i32 4
  invoke void @_ZN3JPH11LinearCurve8AddPointEff(ptr noundef nonnull align 8 dereferenceable(24) %21, float noundef 0x3FC99999A0000000, float noundef 1.000000e+00)
          to label %22 unwind label %35

22:                                               ; preds = %20
  %23 = getelementptr inbounds %"class.JPH::WheelSettingsWV", ptr %5, i32 0, i32 5
  invoke void @_ZN3JPH11LinearCurve7ReserveEj(ptr noundef nonnull align 8 dereferenceable(24) %23, i32 noundef 3)
          to label %24 unwind label %35

24:                                               ; preds = %22
  %25 = getelementptr inbounds %"class.JPH::WheelSettingsWV", ptr %5, i32 0, i32 5
  invoke void @_ZN3JPH11LinearCurve8AddPointEff(ptr noundef nonnull align 8 dereferenceable(24) %25, float noundef 0.000000e+00, float noundef 0.000000e+00)
          to label %26 unwind label %35

26:                                               ; preds = %24
  %27 = getelementptr inbounds %"class.JPH::WheelSettingsWV", ptr %5, i32 0, i32 5
  invoke void @_ZN3JPH11LinearCurve8AddPointEff(ptr noundef nonnull align 8 dereferenceable(24) %27, float noundef 3.000000e+00, float noundef 0x3FF3333340000000)
          to label %28 unwind label %35

28:                                               ; preds = %26
  %29 = getelementptr inbounds %"class.JPH::WheelSettingsWV", ptr %5, i32 0, i32 5
  invoke void @_ZN3JPH11LinearCurve8AddPointEff(ptr noundef nonnull align 8 dereferenceable(24) %29, float noundef 2.000000e+01, float noundef 1.000000e+00)
          to label %30 unwind label %35

30:                                               ; preds = %28
  ret void

31:                                               ; preds = %1
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %3, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %4, align 4
  br label %39

35:                                               ; preds = %28, %26, %24, %22, %20, %18, %16, %10
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %3, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %4, align 4
  call void @_ZN3JPH11LinearCurveD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #4
  call void @_ZN3JPH11LinearCurveD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  br label %39

39:                                               ; preds = %35, %31
  call void @_ZN3JPH13WheelSettingsD2Ev(ptr noundef nonnull align 16 dereferenceable(145) %5) #4
  br label %40

40:                                               ; preds = %39
  %41 = load ptr, ptr %3, align 8
  %42 = load i32, ptr %4, align 4
  %43 = insertvalue { ptr, i32 } poison, ptr %41, 0
  %44 = insertvalue { ptr, i32 } %43, i32 %42, 1
  resume { ptr, i32 } %44
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH13WheelSettingsC2Ev(ptr noundef nonnull align 16 dereferenceable(145)) unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZN3JPH16DegreesToRadiansEf(float noundef) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH11LinearCurve7ReserveEj(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH11LinearCurve8AddPointEff(ptr noundef nonnull align 8 dereferenceable(24), float noundef, float noundef) #0 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH13WheelSettingsD2Ev(ptr noundef nonnull align 16 dereferenceable(145)) unnamed_addr #3 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 = { 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 #2 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !20, i64 148}
!12 = !{!"_ZTSN3JPH15WheelSettingsWVE", !13, i64 0, !20, i64 148, !20, i64 152, !20, i64 156, !24, i64 160, !24, i64 184, !20, i64 208, !20, i64 212}
!13 = !{!"_ZTSN3JPH13WheelSettingsE", !14, i64 0, !15, i64 8, !19, i64 16, !19, i64 32, !19, i64 48, !19, i64 64, !19, i64 80, !19, i64 96, !20, i64 112, !20, i64 116, !20, i64 120, !21, i64 124, !20, i64 136, !20, i64 140, !23, i64 144}
!14 = !{!"_ZTSN3JPH18SerializableObjectE"}
!15 = !{!"_ZTSN3JPH9RefTargetINS_13WheelSettingsEEE", !16, i64 0}
!16 = !{!"_ZTSSt6atomicIjE", !17, i64 0}
!17 = !{!"_ZTSSt13__atomic_baseIjE", !18, i64 0}
!18 = !{!"int", !7, i64 0}
!19 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!20 = !{!"float", !7, i64 0}
!21 = !{!"_ZTSN3JPH14SpringSettingsE", !22, i64 0, !7, i64 4, !20, i64 8}
!22 = !{!"_ZTSN3JPH11ESpringModeE", !7, i64 0}
!23 = !{!"bool", !7, i64 0}
!24 = !{!"_ZTSN3JPH11LinearCurveE", !25, i64 0}
!25 = !{!"_ZTSN3JPH5ArrayINS_11LinearCurve5PointENS_12STLAllocatorIS2_EEEE", !26, i64 0, !26, i64 8, !6, i64 16}
!26 = !{!"long", !7, i64 0}
!27 = !{!12, !20, i64 152}
!28 = !{!12, !20, i64 156}
!29 = !{!12, !20, i64 208}
!30 = !{!12, !20, i64 212}


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

@_ZTVN3JPH15WheelSettingsWVE = external dso_local unnamed_addr constant { [8 x ptr] }, align 8

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH15WheelSettingsWVC2Ev(ptr noundef nonnull align 16 dereferenceable(216) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZN3JPH13WheelSettingsC2Ev(ptr noundef nonnull align 16 dereferenceable(145) %0)
  store ptr getelementptr inbounds inrange(-16, 48) (i8, ptr @_ZTVN3JPH15WheelSettingsWVE, i64 16), ptr %0, align 16, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 148
  store <2 x float> <float 0x3FECCCCCC0000000, float 0x3FC99999A0000000>, ptr %2, align 4, !tbaa !8
  %3 = getelementptr inbounds i8, ptr %0, i64 156
  %4 = tail call noundef float @_ZN3JPH16DegreesToRadiansEf(float noundef 7.000000e+01)
  store float %4, ptr %3, align 4, !tbaa !11
  %5 = getelementptr inbounds i8, ptr %0, i64 160
  tail call void @_ZN3JPH11LinearCurveC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  %6 = getelementptr inbounds i8, ptr %0, i64 184
  tail call void @_ZN3JPH11LinearCurveC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  %7 = getelementptr inbounds i8, ptr %0, i64 208
  store <2 x float> <float 1.500000e+03, float 4.000000e+03>, ptr %7, align 16, !tbaa !8
  invoke void @_ZN3JPH11LinearCurve7ReserveEj(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef 3)
          to label %8 unwind label %16

8:                                                ; preds = %1
  invoke void @_ZN3JPH11LinearCurve8AddPointEff(ptr noundef nonnull align 8 dereferenceable(24) %5, float noundef 0.000000e+00, float noundef 0.000000e+00)
          to label %9 unwind label %16

9:                                                ; preds = %8
  invoke void @_ZN3JPH11LinearCurve8AddPointEff(ptr noundef nonnull align 8 dereferenceable(24) %5, float noundef 0x3FAEB851E0000000, float noundef 0x3FF3333340000000)
          to label %10 unwind label %16

10:                                               ; preds = %9
  invoke void @_ZN3JPH11LinearCurve8AddPointEff(ptr noundef nonnull align 8 dereferenceable(24) %5, float noundef 0x3FC99999A0000000, float noundef 1.000000e+00)
          to label %11 unwind label %16

11:                                               ; preds = %10
  invoke void @_ZN3JPH11LinearCurve7ReserveEj(ptr noundef nonnull align 8 dereferenceable(24) %6, i32 noundef 3)
          to label %12 unwind label %16

12:                                               ; preds = %11
  invoke void @_ZN3JPH11LinearCurve8AddPointEff(ptr noundef nonnull align 8 dereferenceable(24) %6, float noundef 0.000000e+00, float noundef 0.000000e+00)
          to label %13 unwind label %16

13:                                               ; preds = %12
  invoke void @_ZN3JPH11LinearCurve8AddPointEff(ptr noundef nonnull align 8 dereferenceable(24) %6, float noundef 3.000000e+00, float noundef 0x3FF3333340000000)
          to label %14 unwind label %16

14:                                               ; preds = %13
  invoke void @_ZN3JPH11LinearCurve8AddPointEff(ptr noundef nonnull align 8 dereferenceable(24) %6, float noundef 2.000000e+01, float noundef 1.000000e+00)
          to label %15 unwind label %16

15:                                               ; preds = %14
  ret void

16:                                               ; preds = %14, %13, %12, %11, %10, %9, %8, %1
  %17 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN3JPH11LinearCurveD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  tail call void @_ZN3JPH11LinearCurveD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  tail call void @_ZN3JPH13WheelSettingsD2Ev(ptr noundef nonnull align 16 dereferenceable(145) %0) #4
  resume { ptr, i32 } %17
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH13WheelSettingsC2Ev(ptr noundef nonnull align 16 dereferenceable(145)) unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZN3JPH16DegreesToRadiansEf(float noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH11LinearCurve7ReserveEj(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH11LinearCurve8AddPointEff(ptr noundef nonnull align 8 dereferenceable(24), float noundef, float noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH13WheelSettingsD2Ev(ptr noundef nonnull align 16 dereferenceable(145)) unnamed_addr #3 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 = { 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 #2 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"float", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !9, i64 156}
!12 = !{!"_ZTSN3JPH15WheelSettingsWVE", !13, i64 0, !9, i64 148, !9, i64 152, !9, i64 156, !23, i64 160, !23, i64 184, !9, i64 208, !9, i64 212}
!13 = !{!"_ZTSN3JPH13WheelSettingsE", !14, i64 0, !15, i64 8, !19, i64 16, !19, i64 32, !19, i64 48, !19, i64 64, !19, i64 80, !19, i64 96, !9, i64 112, !9, i64 116, !9, i64 120, !20, i64 124, !9, i64 136, !9, i64 140, !22, i64 144}
!14 = !{!"_ZTSN3JPH18SerializableObjectE"}
!15 = !{!"_ZTSN3JPH9RefTargetINS_13WheelSettingsEEE", !16, i64 0}
!16 = !{!"_ZTSSt6atomicIjE", !17, i64 0}
!17 = !{!"_ZTSSt13__atomic_baseIjE", !18, i64 0}
!18 = !{!"int", !10, i64 0}
!19 = !{!"_ZTSN3JPH4Vec3E", !10, i64 0}
!20 = !{!"_ZTSN3JPH14SpringSettingsE", !21, i64 0, !10, i64 4, !9, i64 8}
!21 = !{!"_ZTSN3JPH11ESpringModeE", !10, i64 0}
!22 = !{!"bool", !10, i64 0}
!23 = !{!"_ZTSN3JPH11LinearCurveE", !24, i64 0}
!24 = !{!"_ZTSN3JPH5ArrayINS_11LinearCurve5PointENS_12STLAllocatorIS2_EEEE", !25, i64 0, !25, i64 8, !26, i64 16}
!25 = !{!"long", !10, i64 0}
!26 = !{!"any pointer", !10, i64 0}


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