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

; 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::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::SliderConstraint" = type { %"class.JPH::TwoBodyConstraint", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Quat", i8, float, float, %"class.JPH::SpringSettings", float, %"class.JPH::MotorSettings", i32, float, float, %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", float, [12 x i8], %"class.JPH::DualAxisConstraintPart", %"class.JPH::RotationEulerConstraintPart", %"class.JPH::AxisConstraintPart", %"class.JPH::AxisConstraintPart" }
%"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" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"class.JPH::Quat" = type { %"class.JPH::Vec4" }
%"class.JPH::Vec4" = type { %union.anon.4 }
%union.anon.4 = type { <4 x float> }
%"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::DualAxisConstraintPart" = type <{ %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Matrix", %"class.JPH::Vector", [8 x i8] }>
%"class.JPH::Matrix" = type { [2 x %"class.JPH::Vector"] }
%"class.JPH::Vector" = type { [2 x float] }
%"class.JPH::RotationEulerConstraintPart" = type { %"class.JPH::Mat44", %"class.JPH::Mat44", %"class.JPH::Mat44", %"class.JPH::Vec3" }
%"class.JPH::Mat44" = type { [4 x %"class.JPH::Vec4"] }
%"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 }
%"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

; 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 noundef zeroext i1 @_ZN3JPH16SliderConstraint23SolveVelocityConstraintEf(ptr noundef nonnull align 16 dereferenceable(832) %0, float noundef %1) unnamed_addr #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca float, align 4
  %5 = alloca i8, align 1
  %6 = alloca float, align 4
  %7 = alloca %"class.JPH::Vec3", align 16
  %8 = alloca %"class.JPH::Vec3", align 16
  %9 = alloca i8, align 1
  %10 = alloca %"class.JPH::Vec3", align 16
  %11 = alloca %"class.JPH::Vec3", align 16
  %12 = alloca i8, align 1
  %13 = alloca i8, align 1
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca %"class.JPH::Vec3", align 16
  store ptr %0, ptr %3, align 8, !tbaa !5
  store float %1, ptr %4, align 4, !tbaa !9
  %17 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #5
  store i8 0, ptr %5, align 1, !tbaa !11
  %18 = getelementptr inbounds %"class.JPH::SliderConstraint", ptr %17, i32 0, i32 27
  %19 = call noundef zeroext i1 @_ZNK3JPH18AxisConstraintPart8IsActiveEv(ptr noundef nonnull align 4 dereferenceable(64) %18)
  br i1 %19, label %20, label %67

20:                                               ; preds = %2
  %21 = getelementptr inbounds %"class.JPH::SliderConstraint", ptr %17, i32 0, i32 13
  %22 = load i32, ptr %21, align 8, !tbaa !13
  switch i32 %22, label %66 [
    i32 0, label %23
    i32 1, label %43
    i32 2, label %43
  ]

23:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %24 = getelementptr inbounds %"class.JPH::SliderConstraint", ptr %17, i32 0, i32 11
  %25 = load float, ptr %24, align 8, !tbaa !37
  %26 = load float, ptr %4, align 4, !tbaa !9
  %27 = fmul float %25, %26
  store float %27, ptr %6, align 4, !tbaa !9
  %28 = getelementptr inbounds %"class.JPH::SliderConstraint", ptr %17, i32 0, i32 27
  %29 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %17, i32 0, i32 1
  %30 = load ptr, ptr %29, align 16, !tbaa !38
  %31 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %17, i32 0, i32 2
  %32 = load ptr, ptr %31, align 8, !tbaa !39
  %33 = getelementptr inbounds %"class.JPH::SliderConstraint", ptr %17, i32 0, i32 19
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %7, ptr align 16 %33, i64 16, i1 false), !tbaa.struct !40
  %34 = load float, ptr %6, align 4, !tbaa !9
  %35 = fneg float %34
  %36 = load float, ptr %6, align 4, !tbaa !9
  %37 = getelementptr inbounds { double, double }, ptr %7, i32 0, i32 0
  %38 = load double, ptr %37, align 16
  %39 = getelementptr inbounds { double, double }, ptr %7, i32 0, i32 1
  %40 = load double, ptr %39, align 8
  %41 = call noundef zeroext i1 @_ZN3JPH18AxisConstraintPart23SolveVelocityConstraintERNS_4BodyES2_NS_4Vec3Eff(ptr noundef nonnull align 4 dereferenceable(64) %28, ptr noundef nonnull align 16 dereferenceable(122) %30, ptr noundef nonnull align 16 dereferenceable(122) %32, double %38, double %40, float noundef %35, float noundef %36)
  %42 = zext i1 %41 to i8
  store i8 %42, ptr %5, align 1, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %66

43:                                               ; preds = %20, %20
  %44 = getelementptr inbounds %"class.JPH::SliderConstraint", ptr %17, i32 0, i32 27
  %45 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %17, i32 0, i32 1
  %46 = load ptr, ptr %45, align 16, !tbaa !38
  %47 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %17, i32 0, i32 2
  %48 = load ptr, ptr %47, align 8, !tbaa !39
  %49 = getelementptr inbounds %"class.JPH::SliderConstraint", ptr %17, i32 0, i32 19
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %8, ptr align 16 %49, i64 16, i1 false), !tbaa.struct !40
  %50 = load float, ptr %4, align 4, !tbaa !9
  %51 = getelementptr inbounds %"class.JPH::SliderConstraint", ptr %17, i32 0, i32 12
  %52 = getelementptr inbounds %"class.JPH::MotorSettings", ptr %51, i32 0, i32 1
  %53 = load float, ptr %52, align 4, !tbaa !42
  %54 = fmul float %50, %53
  %55 = load float, ptr %4, align 4, !tbaa !9
  %56 = getelementptr inbounds %"class.JPH::SliderConstraint", ptr %17, i32 0, i32 12
  %57 = getelementptr inbounds %"class.JPH::MotorSettings", ptr %56, i32 0, i32 2
  %58 = load float, ptr %57, align 4, !tbaa !43
  %59 = fmul float %55, %58
  %60 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 0
  %61 = load double, ptr %60, align 16
  %62 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 1
  %63 = load double, ptr %62, align 8
  %64 = call noundef zeroext i1 @_ZN3JPH18AxisConstraintPart23SolveVelocityConstraintERNS_4BodyES2_NS_4Vec3Eff(ptr noundef nonnull align 4 dereferenceable(64) %44, ptr noundef nonnull align 16 dereferenceable(122) %46, ptr noundef nonnull align 16 dereferenceable(122) %48, double %61, double %63, float noundef %54, float noundef %59)
  %65 = zext i1 %64 to i8
  store i8 %65, ptr %5, align 1, !tbaa !11
  br label %66

66:                                               ; preds = %43, %23, %20
  br label %67

67:                                               ; preds = %66, %2
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #5
  %68 = getelementptr inbounds %"class.JPH::SliderConstraint", ptr %17, i32 0, i32 24
  %69 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %17, i32 0, i32 1
  %70 = load ptr, ptr %69, align 16, !tbaa !38
  %71 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %17, i32 0, i32 2
  %72 = load ptr, ptr %71, align 8, !tbaa !39
  %73 = getelementptr inbounds %"class.JPH::SliderConstraint", ptr %17, i32 0, i32 20
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %10, ptr align 16 %73, i64 16, i1 false), !tbaa.struct !40
  %74 = getelementptr inbounds %"class.JPH::SliderConstraint", ptr %17, i32 0, i32 21
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %11, ptr align 16 %74, i64 16, i1 false), !tbaa.struct !40
  %75 = getelementptr inbounds { double, double }, ptr %10, i32 0, i32 0
  %76 = load double, ptr %75, align 16
  %77 = getelementptr inbounds { double, double }, ptr %10, i32 0, i32 1
  %78 = load double, ptr %77, align 8
  %79 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 0
  %80 = load double, ptr %79, align 16
  %81 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 1
  %82 = load double, ptr %81, align 8
  %83 = call noundef zeroext i1 @_ZN3JPH22DualAxisConstraintPart23SolveVelocityConstraintERNS_4BodyES2_NS_4Vec3ES3_(ptr noundef nonnull align 16 dereferenceable(152) %68, ptr noundef nonnull align 16 dereferenceable(122) %70, ptr noundef nonnull align 16 dereferenceable(122) %72, double %76, double %78, double %80, double %82)
  %84 = zext i1 %83 to i8
  store i8 %84, ptr %9, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #5
  %85 = getelementptr inbounds %"class.JPH::SliderConstraint", ptr %17, i32 0, i32 25
  %86 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %17, i32 0, i32 1
  %87 = load ptr, ptr %86, align 16, !tbaa !38
  %88 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %17, i32 0, i32 2
  %89 = load ptr, ptr %88, align 8, !tbaa !39
  %90 = call noundef zeroext i1 @_ZN3JPH27RotationEulerConstraintPart23SolveVelocityConstraintERNS_4BodyES2_(ptr noundef nonnull align 16 dereferenceable(208) %85, ptr noundef nonnull align 16 dereferenceable(122) %87, ptr noundef nonnull align 16 dereferenceable(122) %89)
  %91 = zext i1 %90 to i8
  store i8 %91, ptr %12, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #5
  store i8 0, ptr %13, align 1, !tbaa !11
  %92 = getelementptr inbounds %"class.JPH::SliderConstraint", ptr %17, i32 0, i32 26
  %93 = call noundef zeroext i1 @_ZNK3JPH18AxisConstraintPart8IsActiveEv(ptr noundef nonnull align 4 dereferenceable(64) %92)
  br i1 %93, label %94, label %125

94:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %95 = getelementptr inbounds %"class.JPH::SliderConstraint", ptr %17, i32 0, i32 8
  %96 = load float, ptr %95, align 4, !tbaa !44
  %97 = getelementptr inbounds %"class.JPH::SliderConstraint", ptr %17, i32 0, i32 9
  %98 = load float, ptr %97, align 8, !tbaa !45
  %99 = fcmp oeq float %96, %98
  br i1 %99, label %100, label %101

100:                                              ; preds = %94
  store float 0xC7EFFFFFE0000000, ptr %14, align 4, !tbaa !9
  store float 0x47EFFFFFE0000000, ptr %15, align 4, !tbaa !9
  br label %110

101:                                              ; preds = %94
  %102 = getelementptr inbounds %"class.JPH::SliderConstraint", ptr %17, i32 0, i32 22
  %103 = load float, ptr %102, align 16, !tbaa !46
  %104 = getelementptr inbounds %"class.JPH::SliderConstraint", ptr %17, i32 0, i32 8
  %105 = load float, ptr %104, align 4, !tbaa !44
  %106 = fcmp ole float %103, %105
  br i1 %106, label %107, label %108

107:                                              ; preds = %101
  store float 0.000000e+00, ptr %14, align 4, !tbaa !9
  store float 0x47EFFFFFE0000000, ptr %15, align 4, !tbaa !9
  br label %109

108:                                              ; preds = %101
  store float 0xC7EFFFFFE0000000, ptr %14, align 4, !tbaa !9
  store float 0.000000e+00, ptr %15, align 4, !tbaa !9
  br label %109

109:                                              ; preds = %108, %107
  br label %110

110:                                              ; preds = %109, %100
  %111 = getelementptr inbounds %"class.JPH::SliderConstraint", ptr %17, i32 0, i32 26
  %112 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %17, i32 0, i32 1
  %113 = load ptr, ptr %112, align 16, !tbaa !38
  %114 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %17, i32 0, i32 2
  %115 = load ptr, ptr %114, align 8, !tbaa !39
  %116 = getelementptr inbounds %"class.JPH::SliderConstraint", ptr %17, i32 0, i32 19
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %16, ptr align 16 %116, i64 16, i1 false), !tbaa.struct !40
  %117 = load float, ptr %14, align 4, !tbaa !9
  %118 = load float, ptr %15, align 4, !tbaa !9
  %119 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %120 = load double, ptr %119, align 16
  %121 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 1
  %122 = load double, ptr %121, align 8
  %123 = call noundef zeroext i1 @_ZN3JPH18AxisConstraintPart23SolveVelocityConstraintERNS_4BodyES2_NS_4Vec3Eff(ptr noundef nonnull align 4 dereferenceable(64) %111, ptr noundef nonnull align 16 dereferenceable(122) %113, ptr noundef nonnull align 16 dereferenceable(122) %115, double %120, double %122, float noundef %117, float noundef %118)
  %124 = zext i1 %123 to i8
  store i8 %124, ptr %13, align 1, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %125

125:                                              ; preds = %110, %67
  %126 = load i8, ptr %5, align 1, !tbaa !11, !range !47, !noundef !48
  %127 = trunc i8 %126 to i1
  br i1 %127, label %137, label %128

128:                                              ; preds = %125
  %129 = load i8, ptr %9, align 1, !tbaa !11, !range !47, !noundef !48
  %130 = trunc i8 %129 to i1
  br i1 %130, label %137, label %131

131:                                              ; preds = %128
  %132 = load i8, ptr %12, align 1, !tbaa !11, !range !47, !noundef !48
  %133 = trunc i8 %132 to i1
  br i1 %133, label %137, label %134

134:                                              ; preds = %131
  %135 = load i8, ptr %13, align 1, !tbaa !11, !range !47, !noundef !48
  %136 = trunc i8 %135 to i1
  br label %137

137:                                              ; preds = %134, %131, %128, %125
  %138 = phi i1 [ true, %131 ], [ true, %128 ], [ true, %125 ], [ %136, %134 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #5
  ret i1 %138
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH18AxisConstraintPart8IsActiveEv(ptr noundef nonnull align 4 dereferenceable(64)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH18AxisConstraintPart23SolveVelocityConstraintERNS_4BodyES2_NS_4Vec3Eff(ptr noundef nonnull align 4 dereferenceable(64), ptr noundef nonnull align 16 dereferenceable(122), ptr noundef nonnull align 16 dereferenceable(122), double, double, float noundef, float noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH22DualAxisConstraintPart23SolveVelocityConstraintERNS_4BodyES2_NS_4Vec3ES3_(ptr noundef nonnull align 16 dereferenceable(152), ptr noundef nonnull align 16 dereferenceable(122), ptr noundef nonnull align 16 dereferenceable(122), double, double, double, double) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH27RotationEulerConstraintPart23SolveVelocityConstraintERNS_4BodyES2_(ptr noundef nonnull align 16 dereferenceable(208), ptr noundef nonnull align 16 dereferenceable(122), ptr noundef nonnull align 16 dereferenceable(122)) #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 = { 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 = { 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, !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 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !28, i64 200}
!14 = !{!"_ZTSN3JPH16SliderConstraintE", !15, i64 0, !22, i64 48, !22, i64 64, !22, i64 80, !22, i64 96, !22, i64 112, !23, i64 128, !12, i64 144, !10, i64 148, !10, i64 152, !25, i64 156, !10, i64 168, !27, i64 172, !28, i64 200, !10, i64 204, !10, i64 208, !22, i64 224, !22, i64 240, !22, i64 256, !22, i64 272, !22, i64 288, !22, i64 304, !10, i64 320, !29, i64 336, !32, i64 496, !34, i64 704, !34, i64 768}
!15 = !{!"_ZTSN3JPH17TwoBodyConstraintE", !16, i64 0, !6, i64 32, !6, i64 40}
!16 = !{!"_ZTSN3JPH10ConstraintE", !17, i64 8, !20, i64 12, !20, i64 16, !7, i64 20, !7, i64 21, !12, i64 22, !21, i64 24}
!17 = !{!"_ZTSN3JPH9RefTargetINS_10ConstraintEEE", !18, i64 0}
!18 = !{!"_ZTSSt6atomicIjE", !19, i64 0}
!19 = !{!"_ZTSSt13__atomic_baseIjE", !20, i64 0}
!20 = !{!"int", !7, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!23 = !{!"_ZTSN3JPH4QuatE", !24, i64 0}
!24 = !{!"_ZTSN3JPH4Vec4E", !7, i64 0}
!25 = !{!"_ZTSN3JPH14SpringSettingsE", !26, i64 0, !7, i64 4, !10, i64 8}
!26 = !{!"_ZTSN3JPH11ESpringModeE", !7, i64 0}
!27 = !{!"_ZTSN3JPH13MotorSettingsE", !25, i64 0, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24}
!28 = !{!"_ZTSN3JPH11EMotorStateE", !7, i64 0}
!29 = !{!"_ZTSN3JPH22DualAxisConstraintPartE", !22, i64 0, !22, i64 16, !22, i64 32, !22, i64 48, !22, i64 64, !22, i64 80, !22, i64 96, !22, i64 112, !30, i64 128, !31, i64 144}
!30 = !{!"_ZTSN3JPH6MatrixILj2ELj2EEE", !7, i64 0}
!31 = !{!"_ZTSN3JPH6VectorILj2EEE", !7, i64 0}
!32 = !{!"_ZTSN3JPH27RotationEulerConstraintPartE", !33, i64 0, !33, i64 64, !33, i64 128, !22, i64 192}
!33 = !{!"_ZTSN3JPH5Mat44E", !7, i64 0}
!34 = !{!"_ZTSN3JPH18AxisConstraintPartE", !35, i64 0, !35, i64 12, !35, i64 24, !35, i64 36, !10, i64 48, !36, i64 52, !10, i64 60}
!35 = !{!"_ZTSN3JPH6Float3E", !10, i64 0, !10, i64 4, !10, i64 8}
!36 = !{!"_ZTSN3JPH10SpringPartE", !10, i64 0, !10, i64 4}
!37 = !{!14, !10, i64 168}
!38 = !{!15, !6, i64 32}
!39 = !{!15, !6, i64 40}
!40 = !{i64 0, i64 16, !41}
!41 = !{!7, !7, i64 0}
!42 = !{!14, !10, i64 184}
!43 = !{!14, !10, i64 188}
!44 = !{!14, !10, i64 148}
!45 = !{!14, !10, i64 152}
!46 = !{!14, !10, i64 320}
!47 = !{i8 0, i8 2}
!48 = !{}


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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN3JPH16SliderConstraint23SolveVelocityConstraintEf(ptr noundef nonnull align 16 dereferenceable(832) %0, float noundef %1) unnamed_addr #0 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 768
  %4 = tail call noundef zeroext i1 @_ZNK3JPH18AxisConstraintPart8IsActiveEv(ptr noundef nonnull align 4 dereferenceable(64) %3)
  br i1 %4, label %5, label %32

5:                                                ; preds = %2
  %6 = getelementptr inbounds i8, ptr %0, i64 200
  %7 = load i32, ptr %6, align 8, !tbaa !5
  switch i32 %7, label %32 [
    i32 0, label %8
    i32 1, label %19
    i32 2, label %19
  ]

8:                                                ; preds = %5
  %9 = getelementptr inbounds i8, ptr %0, i64 168
  %10 = load float, ptr %9, align 8, !tbaa !34
  %11 = fmul float %10, %1
  %12 = getelementptr inbounds i8, ptr %0, i64 32
  %13 = load ptr, ptr %12, align 16, !tbaa !35
  %14 = getelementptr inbounds i8, ptr %0, i64 40
  %15 = load ptr, ptr %14, align 8, !tbaa !36
  %16 = getelementptr inbounds i8, ptr %0, i64 272
  %.sroa.010.0.copyload = load double, ptr %16, align 16
  %.sroa.211.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 280
  %.sroa.211.0.copyload = load double, ptr %.sroa.211.0..sroa_idx, align 8, !tbaa !37
  %17 = fneg float %11
  %18 = tail call noundef zeroext i1 @_ZN3JPH18AxisConstraintPart23SolveVelocityConstraintERNS_4BodyES2_NS_4Vec3Eff(ptr noundef nonnull align 4 dereferenceable(64) %3, ptr noundef nonnull align 16 dereferenceable(122) %13, ptr noundef nonnull align 16 dereferenceable(122) %15, double %.sroa.010.0.copyload, double %.sroa.211.0.copyload, float noundef %17, float noundef %11)
  br label %32

19:                                               ; preds = %5, %5
  %20 = getelementptr inbounds i8, ptr %0, i64 32
  %21 = load ptr, ptr %20, align 16, !tbaa !35
  %22 = getelementptr inbounds i8, ptr %0, i64 40
  %23 = load ptr, ptr %22, align 8, !tbaa !36
  %24 = getelementptr inbounds i8, ptr %0, i64 272
  %.sroa.08.0.copyload = load double, ptr %24, align 16
  %.sroa.29.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 280
  %.sroa.29.0.copyload = load double, ptr %.sroa.29.0..sroa_idx, align 8, !tbaa !37
  %25 = getelementptr inbounds i8, ptr %0, i64 184
  %26 = load float, ptr %25, align 8, !tbaa !38
  %27 = fmul float %26, %1
  %28 = getelementptr inbounds i8, ptr %0, i64 188
  %29 = load float, ptr %28, align 4, !tbaa !39
  %30 = fmul float %29, %1
  %31 = tail call noundef zeroext i1 @_ZN3JPH18AxisConstraintPart23SolveVelocityConstraintERNS_4BodyES2_NS_4Vec3Eff(ptr noundef nonnull align 4 dereferenceable(64) %3, ptr noundef nonnull align 16 dereferenceable(122) %21, ptr noundef nonnull align 16 dereferenceable(122) %23, double %.sroa.08.0.copyload, double %.sroa.29.0.copyload, float noundef %27, float noundef %30)
  br label %32

32:                                               ; preds = %5, %8, %19, %2
  %.0.shrunk = phi i1 [ false, %5 ], [ %31, %19 ], [ %18, %8 ], [ false, %2 ]
  %33 = getelementptr inbounds i8, ptr %0, i64 336
  %34 = getelementptr inbounds i8, ptr %0, i64 32
  %35 = load ptr, ptr %34, align 16, !tbaa !35
  %36 = getelementptr inbounds i8, ptr %0, i64 40
  %37 = load ptr, ptr %36, align 8, !tbaa !36
  %38 = getelementptr inbounds i8, ptr %0, i64 288
  %.sroa.05.0.copyload = load double, ptr %38, align 16
  %.sroa.26.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 296
  %.sroa.26.0.copyload = load double, ptr %.sroa.26.0..sroa_idx, align 8, !tbaa !37
  %39 = getelementptr inbounds i8, ptr %0, i64 304
  %.sroa.03.0.copyload = load double, ptr %39, align 16
  %.sroa.24.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 312
  %.sroa.24.0.copyload = load double, ptr %.sroa.24.0..sroa_idx, align 8, !tbaa !37
  %40 = tail call noundef zeroext i1 @_ZN3JPH22DualAxisConstraintPart23SolveVelocityConstraintERNS_4BodyES2_NS_4Vec3ES3_(ptr noundef nonnull align 16 dereferenceable(152) %33, ptr noundef nonnull align 16 dereferenceable(122) %35, ptr noundef nonnull align 16 dereferenceable(122) %37, double %.sroa.05.0.copyload, double %.sroa.26.0.copyload, double %.sroa.03.0.copyload, double %.sroa.24.0.copyload)
  %41 = getelementptr inbounds i8, ptr %0, i64 496
  %42 = load ptr, ptr %34, align 16, !tbaa !35
  %43 = load ptr, ptr %36, align 8, !tbaa !36
  %44 = tail call noundef zeroext i1 @_ZN3JPH27RotationEulerConstraintPart23SolveVelocityConstraintERNS_4BodyES2_(ptr noundef nonnull align 16 dereferenceable(208) %41, ptr noundef nonnull align 16 dereferenceable(122) %42, ptr noundef nonnull align 16 dereferenceable(122) %43)
  %45 = getelementptr inbounds i8, ptr %0, i64 704
  %46 = tail call noundef zeroext i1 @_ZNK3JPH18AxisConstraintPart8IsActiveEv(ptr noundef nonnull align 4 dereferenceable(64) %45)
  br i1 %46, label %47, label %62

47:                                               ; preds = %32
  %48 = getelementptr inbounds i8, ptr %0, i64 148
  %49 = load float, ptr %48, align 4, !tbaa !40
  %50 = getelementptr inbounds i8, ptr %0, i64 152
  %51 = load float, ptr %50, align 8, !tbaa !41
  %52 = fcmp oeq float %49, %51
  br i1 %52, label %57, label %53

53:                                               ; preds = %47
  %54 = getelementptr inbounds i8, ptr %0, i64 320
  %55 = load float, ptr %54, align 16, !tbaa !42
  %56 = fcmp ugt float %55, %49
  %. = select i1 %56, float 0xC7EFFFFFE0000000, float 0.000000e+00
  %.23 = select i1 %56, float 0.000000e+00, float 0x47EFFFFFE0000000
  br label %57

57:                                               ; preds = %53, %47
  %.021 = phi float [ 0xC7EFFFFFE0000000, %47 ], [ %., %53 ]
  %.020 = phi float [ 0x47EFFFFFE0000000, %47 ], [ %.23, %53 ]
  %58 = load ptr, ptr %34, align 16, !tbaa !35
  %59 = load ptr, ptr %36, align 8, !tbaa !36
  %60 = getelementptr inbounds i8, ptr %0, i64 272
  %.sroa.0.0.copyload = load double, ptr %60, align 16
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 280
  %.sroa.2.0.copyload = load double, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !37
  %61 = tail call noundef zeroext i1 @_ZN3JPH18AxisConstraintPart23SolveVelocityConstraintERNS_4BodyES2_NS_4Vec3Eff(ptr noundef nonnull align 4 dereferenceable(64) %45, ptr noundef nonnull align 16 dereferenceable(122) %58, ptr noundef nonnull align 16 dereferenceable(122) %59, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload, float noundef %.021, float noundef %.020)
  br label %62

62:                                               ; preds = %57, %32
  %.019 = phi i1 [ %61, %57 ], [ false, %32 ]
  %brmerge = or i1 %.0.shrunk, %40
  br i1 %brmerge, label %64, label %63

63:                                               ; preds = %62
  %spec.select = or i1 %44, %.019
  br label %64

64:                                               ; preds = %63, %62
  %65 = phi i1 [ true, %62 ], [ %spec.select, %63 ]
  ret i1 %65
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH18AxisConstraintPart8IsActiveEv(ptr noundef nonnull align 4 dereferenceable(64)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH18AxisConstraintPart23SolveVelocityConstraintERNS_4BodyES2_NS_4Vec3Eff(ptr noundef nonnull align 4 dereferenceable(64), ptr noundef nonnull align 16 dereferenceable(122), ptr noundef nonnull align 16 dereferenceable(122), double, double, float noundef, float noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH22DualAxisConstraintPart23SolveVelocityConstraintERNS_4BodyES2_NS_4Vec3ES3_(ptr noundef nonnull align 16 dereferenceable(152), ptr noundef nonnull align 16 dereferenceable(122), ptr noundef nonnull align 16 dereferenceable(122), double, double, double, double) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH27RotationEulerConstraintPart23SolveVelocityConstraintERNS_4BodyES2_(ptr noundef nonnull align 16 dereferenceable(208), ptr noundef nonnull align 16 dereferenceable(122), ptr noundef nonnull align 16 dereferenceable(122)) local_unnamed_addr #2 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 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 #2 = { 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" }

!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, !25, i64 200}
!6 = !{!"_ZTSN3JPH16SliderConstraintE", !7, i64 0, !18, i64 48, !18, i64 64, !18, i64 80, !18, i64 96, !18, i64 112, !19, i64 128, !15, i64 144, !21, i64 148, !21, i64 152, !22, i64 156, !21, i64 168, !24, i64 172, !25, i64 200, !21, i64 204, !21, i64 208, !18, i64 224, !18, i64 240, !18, i64 256, !18, i64 272, !18, i64 288, !18, i64 304, !21, i64 320, !26, i64 336, !29, i64 496, !31, i64 704, !31, i64 768}
!7 = !{!"_ZTSN3JPH17TwoBodyConstraintE", !8, i64 0, !17, i64 32, !17, i64 40}
!8 = !{!"_ZTSN3JPH10ConstraintE", !9, i64 8, !12, i64 12, !12, i64 16, !13, i64 20, !13, i64 21, !15, i64 22, !16, i64 24}
!9 = !{!"_ZTSN3JPH9RefTargetINS_10ConstraintEEE", !10, i64 0}
!10 = !{!"_ZTSSt6atomicIjE", !11, i64 0}
!11 = !{!"_ZTSSt13__atomic_baseIjE", !12, i64 0}
!12 = !{!"int", !13, i64 0}
!13 = !{!"omnipotent char", !14, i64 0}
!14 = !{!"Simple C++ TBAA"}
!15 = !{!"bool", !13, i64 0}
!16 = !{!"long", !13, i64 0}
!17 = !{!"any pointer", !13, i64 0}
!18 = !{!"_ZTSN3JPH4Vec3E", !13, i64 0}
!19 = !{!"_ZTSN3JPH4QuatE", !20, i64 0}
!20 = !{!"_ZTSN3JPH4Vec4E", !13, i64 0}
!21 = !{!"float", !13, i64 0}
!22 = !{!"_ZTSN3JPH14SpringSettingsE", !23, i64 0, !13, i64 4, !21, i64 8}
!23 = !{!"_ZTSN3JPH11ESpringModeE", !13, i64 0}
!24 = !{!"_ZTSN3JPH13MotorSettingsE", !22, i64 0, !21, i64 12, !21, i64 16, !21, i64 20, !21, i64 24}
!25 = !{!"_ZTSN3JPH11EMotorStateE", !13, i64 0}
!26 = !{!"_ZTSN3JPH22DualAxisConstraintPartE", !18, i64 0, !18, i64 16, !18, i64 32, !18, i64 48, !18, i64 64, !18, i64 80, !18, i64 96, !18, i64 112, !27, i64 128, !28, i64 144}
!27 = !{!"_ZTSN3JPH6MatrixILj2ELj2EEE", !13, i64 0}
!28 = !{!"_ZTSN3JPH6VectorILj2EEE", !13, i64 0}
!29 = !{!"_ZTSN3JPH27RotationEulerConstraintPartE", !30, i64 0, !30, i64 64, !30, i64 128, !18, i64 192}
!30 = !{!"_ZTSN3JPH5Mat44E", !13, i64 0}
!31 = !{!"_ZTSN3JPH18AxisConstraintPartE", !32, i64 0, !32, i64 12, !32, i64 24, !32, i64 36, !21, i64 48, !33, i64 52, !21, i64 60}
!32 = !{!"_ZTSN3JPH6Float3E", !21, i64 0, !21, i64 4, !21, i64 8}
!33 = !{!"_ZTSN3JPH10SpringPartE", !21, i64 0, !21, i64 4}
!34 = !{!6, !21, i64 168}
!35 = !{!7, !17, i64 32}
!36 = !{!7, !17, i64 40}
!37 = !{!13, !13, i64 0}
!38 = !{!6, !21, i64 184}
!39 = !{!6, !21, i64 188}
!40 = !{!6, !21, i64 148}
!41 = !{!6, !21, i64 152}
!42 = !{!6, !21, i64 320}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass