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

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

@.str.1 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [96 x i8], align 1

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK3JPH8RefConstINS_18PathConstraintPathEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH14PathConstraint29CalculateConstraintPropertiesEf(ptr noundef nonnull align 16 dereferenceable(1104), float noundef) #3 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) #4

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN3JPH14PathConstraint23SolvePositionConstraintEff(ptr noundef nonnull align 16 dereferenceable(1104) %0, float noundef %1, float noundef %2) unnamed_addr #3 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca i8, align 1
  %8 = alloca %"class.JPH::Vec3", align 16
  %9 = alloca %"class.JPH::Vec3", align 16
  %10 = alloca %"class.JPH::Vec3", align 16
  %11 = alloca i8, align 1
  %12 = alloca %"class.JPH::Vec3", align 16
  %13 = alloca %"class.JPH::Vec3", align 16
  %14 = alloca %"struct.JPH::AssertLastParam", align 1
  %15 = alloca %"class.JPH::Vec3", align 16
  %16 = alloca %"class.JPH::Vec3", align 16
  %17 = alloca i8, align 1
  %18 = alloca %"class.JPH::Quat", align 16
  store ptr %0, ptr %4, align 8, !tbaa !5
  store float %1, ptr %5, align 4, !tbaa !9
  store float %2, ptr %6, align 4, !tbaa !9
  %19 = load ptr, ptr %4, align 8
  %20 = load float, ptr %5, align 4, !tbaa !9
  call void @_ZN3JPH14PathConstraint29CalculateConstraintPropertiesEf(ptr noundef nonnull align 16 dereferenceable(1104) %19, float noundef %20)
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #7
  %21 = getelementptr inbounds %"class.JPH::PathConstraint", ptr %19, i32 0, i32 19
  %22 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %19, i32 0, i32 1
  %23 = load ptr, ptr %22, align 16, !tbaa !11
  %24 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %19, i32 0, i32 2
  %25 = load ptr, ptr %24, align 8, !tbaa !20
  %26 = getelementptr inbounds %"class.JPH::PathConstraint", ptr %19, i32 0, i32 12
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %8, ptr align 16 %26, i64 16, i1 false), !tbaa.struct !21
  %27 = getelementptr inbounds %"class.JPH::PathConstraint", ptr %19, i32 0, i32 14
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %9, ptr align 16 %27, i64 16, i1 false), !tbaa.struct !21
  %28 = getelementptr inbounds %"class.JPH::PathConstraint", ptr %19, i32 0, i32 15
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %10, ptr align 16 %28, i64 16, i1 false), !tbaa.struct !21
  %29 = load float, ptr %6, align 4, !tbaa !9
  %30 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 0
  %31 = load double, ptr %30, align 16
  %32 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 1
  %33 = load double, ptr %32, align 8
  %34 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 0
  %35 = load double, ptr %34, align 16
  %36 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 1
  %37 = load double, ptr %36, align 8
  %38 = getelementptr inbounds { double, double }, ptr %10, i32 0, i32 0
  %39 = load double, ptr %38, align 16
  %40 = getelementptr inbounds { double, double }, ptr %10, i32 0, i32 1
  %41 = load double, ptr %40, align 8
  %42 = call noundef zeroext i1 @_ZNK3JPH22DualAxisConstraintPart23SolvePositionConstraintERNS_4BodyES2_NS_4Vec3ES3_S3_f(ptr noundef nonnull align 16 dereferenceable(152) %21, ptr noundef nonnull align 16 dereferenceable(122) %23, ptr noundef nonnull align 16 dereferenceable(122) %25, double %31, double %33, double %35, double %37, double %39, double %41, float noundef %29)
  %43 = zext i1 %42 to i8
  store i8 %43, ptr %7, align 1, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #7
  store i8 0, ptr %11, align 1, !tbaa !23
  %44 = getelementptr inbounds %"class.JPH::PathConstraint", ptr %19, i32 0, i32 20
  %45 = call noundef zeroext i1 @_ZNK3JPH18AxisConstraintPart8IsActiveEv(ptr noundef nonnull align 4 dereferenceable(64) %44)
  br i1 %45, label %46, label %109

46:                                               ; preds = %3
  %47 = getelementptr inbounds %"class.JPH::PathConstraint", ptr %19, i32 0, i32 17
  %48 = load float, ptr %47, align 16, !tbaa !24
  %49 = fcmp ole float %48, 0.000000e+00
  br i1 %49, label %50, label %71

50:                                               ; preds = %46
  %51 = getelementptr inbounds %"class.JPH::PathConstraint", ptr %19, i32 0, i32 20
  %52 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %19, i32 0, i32 1
  %53 = load ptr, ptr %52, align 16, !tbaa !11
  %54 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %19, i32 0, i32 2
  %55 = load ptr, ptr %54, align 8, !tbaa !20
  %56 = getelementptr inbounds %"class.JPH::PathConstraint", ptr %19, i32 0, i32 13
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %12, ptr align 16 %56, i64 16, i1 false), !tbaa.struct !21
  %57 = getelementptr inbounds %"class.JPH::PathConstraint", ptr %19, i32 0, i32 12
  %58 = getelementptr inbounds %"class.JPH::PathConstraint", ptr %19, i32 0, i32 13
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %13, ptr align 16 %58, i64 16, i1 false), !tbaa.struct !21
  %59 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 0
  %60 = load double, ptr %59, align 16
  %61 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 1
  %62 = load double, ptr %61, align 8
  %63 = call noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %57, double %60, double %62)
  %64 = load float, ptr %6, align 4, !tbaa !9
  %65 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 0
  %66 = load double, ptr %65, align 16
  %67 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 1
  %68 = load double, ptr %67, align 8
  %69 = call noundef zeroext i1 @_ZNK3JPH18AxisConstraintPart23SolvePositionConstraintERNS_4BodyES2_NS_4Vec3Eff(ptr noundef nonnull align 4 dereferenceable(64) %51, ptr noundef nonnull align 16 dereferenceable(122) %53, ptr noundef nonnull align 16 dereferenceable(122) %55, double %66, double %68, float noundef %63, float noundef %64)
  %70 = zext i1 %69 to i8
  store i8 %70, ptr %11, align 1, !tbaa !23
  br label %108

71:                                               ; preds = %46
  br label %72

72:                                               ; preds = %71
  %73 = getelementptr inbounds %"class.JPH::PathConstraint", ptr %19, i32 0, i32 17
  %74 = load float, ptr %73, align 16, !tbaa !24
  %75 = getelementptr inbounds %"class.JPH::PathConstraint", ptr %19, i32 0, i32 1
  %76 = call noundef ptr @_ZNK3JPH8RefConstINS_18PathConstraintPathEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %75)
  %77 = load ptr, ptr %76, align 8, !tbaa !44
  %78 = getelementptr inbounds ptr, ptr %77, i64 4
  %79 = load ptr, ptr %78, align 8
  %80 = call noundef float %79(ptr noundef nonnull align 8 dereferenceable(13) %76)
  %81 = fcmp oge float %74, %80
  br i1 %81, label %85, label %82

82:                                               ; preds = %72
  %83 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 343)
  br i1 %83, label %84, label %85

84:                                               ; preds = %82
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #7, !srcloc !46
  br label %85

85:                                               ; preds = %84, %82, %72
  br label %86

86:                                               ; preds = %85
  br label %87

87:                                               ; preds = %86
  %88 = getelementptr inbounds %"class.JPH::PathConstraint", ptr %19, i32 0, i32 20
  %89 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %19, i32 0, i32 1
  %90 = load ptr, ptr %89, align 16, !tbaa !11
  %91 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %19, i32 0, i32 2
  %92 = load ptr, ptr %91, align 8, !tbaa !20
  %93 = getelementptr inbounds %"class.JPH::PathConstraint", ptr %19, i32 0, i32 13
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %15, ptr align 16 %93, i64 16, i1 false), !tbaa.struct !21
  %94 = getelementptr inbounds %"class.JPH::PathConstraint", ptr %19, i32 0, i32 12
  %95 = getelementptr inbounds %"class.JPH::PathConstraint", ptr %19, i32 0, i32 13
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %16, ptr align 16 %95, i64 16, i1 false), !tbaa.struct !21
  %96 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %97 = load double, ptr %96, align 16
  %98 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 1
  %99 = load double, ptr %98, align 8
  %100 = call noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %94, double %97, double %99)
  %101 = load float, ptr %6, align 4, !tbaa !9
  %102 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 0
  %103 = load double, ptr %102, align 16
  %104 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 1
  %105 = load double, ptr %104, align 8
  %106 = call noundef zeroext i1 @_ZNK3JPH18AxisConstraintPart23SolvePositionConstraintERNS_4BodyES2_NS_4Vec3Eff(ptr noundef nonnull align 4 dereferenceable(64) %88, ptr noundef nonnull align 16 dereferenceable(122) %90, ptr noundef nonnull align 16 dereferenceable(122) %92, double %103, double %105, float noundef %100, float noundef %101)
  %107 = zext i1 %106 to i8
  store i8 %107, ptr %11, align 1, !tbaa !23
  br label %108

108:                                              ; preds = %87, %50
  br label %109

109:                                              ; preds = %108, %3
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #7
  store i8 0, ptr %17, align 1, !tbaa !23
  %110 = getelementptr inbounds %"class.JPH::PathConstraint", ptr %19, i32 0, i32 4
  %111 = load i32, ptr %110, align 16, !tbaa !47
  switch i32 %111, label %135 [
    i32 0, label %135
    i32 1, label %112
    i32 2, label %112
    i32 3, label %112
    i32 4, label %121
    i32 5, label %121
  ]

112:                                              ; preds = %109, %109, %109
  %113 = getelementptr inbounds %"class.JPH::PathConstraint", ptr %19, i32 0, i32 22
  %114 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %19, i32 0, i32 1
  %115 = load ptr, ptr %114, align 16, !tbaa !11
  %116 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %19, i32 0, i32 2
  %117 = load ptr, ptr %116, align 8, !tbaa !20
  %118 = load float, ptr %6, align 4, !tbaa !9
  %119 = call noundef zeroext i1 @_ZNK3JPH27HingeRotationConstraintPart23SolvePositionConstraintERNS_4BodyES2_f(ptr noundef nonnull align 16 dereferenceable(232) %113, ptr noundef nonnull align 16 dereferenceable(122) %115, ptr noundef nonnull align 16 dereferenceable(122) %117, float noundef %118)
  %120 = zext i1 %119 to i8
  store i8 %120, ptr %17, align 1, !tbaa !23
  br label %135

121:                                              ; preds = %109, %109
  %122 = getelementptr inbounds %"class.JPH::PathConstraint", ptr %19, i32 0, i32 23
  %123 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %19, i32 0, i32 1
  %124 = load ptr, ptr %123, align 16, !tbaa !11
  %125 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %19, i32 0, i32 2
  %126 = load ptr, ptr %125, align 8, !tbaa !20
  %127 = getelementptr inbounds %"class.JPH::PathConstraint", ptr %19, i32 0, i32 16
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %18, ptr align 16 %127, i64 16, i1 false), !tbaa.struct !21
  %128 = load float, ptr %6, align 4, !tbaa !9
  %129 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %130 = load double, ptr %129, align 16
  %131 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %132 = load double, ptr %131, align 8
  %133 = call noundef zeroext i1 @_ZNK3JPH27RotationEulerConstraintPart23SolvePositionConstraintERNS_4BodyES2_NS_4QuatEf(ptr noundef nonnull align 16 dereferenceable(208) %122, ptr noundef nonnull align 16 dereferenceable(122) %124, ptr noundef nonnull align 16 dereferenceable(122) %126, double %130, double %132, float noundef %128)
  %134 = zext i1 %133 to i8
  store i8 %134, ptr %17, align 1, !tbaa !23
  br label %135

135:                                              ; preds = %121, %112, %109, %109
  %136 = load i8, ptr %7, align 1, !tbaa !23, !range !48, !noundef !49
  %137 = trunc i8 %136 to i1
  br i1 %137, label %144, label %138

138:                                              ; preds = %135
  %139 = load i8, ptr %11, align 1, !tbaa !23, !range !48, !noundef !49
  %140 = trunc i8 %139 to i1
  br i1 %140, label %144, label %141

141:                                              ; preds = %138
  %142 = load i8, ptr %17, align 1, !tbaa !23, !range !48, !noundef !49
  %143 = trunc i8 %142 to i1
  br label %144

144:                                              ; preds = %141, %138, %135
  %145 = phi i1 [ true, %138 ], [ true, %135 ], [ %143, %141 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #7
  ret i1 %145
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH22DualAxisConstraintPart23SolvePositionConstraintERNS_4BodyES2_NS_4Vec3ES3_S3_f(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, double, double, float noundef) #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH18AxisConstraintPart23SolvePositionConstraintERNS_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: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH27HingeRotationConstraintPart23SolvePositionConstraintERNS_4BodyES2_f(ptr noundef nonnull align 16 dereferenceable(232), ptr noundef nonnull align 16 dereferenceable(122), ptr noundef nonnull align 16 dereferenceable(122), float noundef) #5 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="64" "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 = { 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 #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, !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, !6, i64 32}
!12 = !{!"_ZTSN3JPH17TwoBodyConstraintE", !13, i64 0, !6, i64 32, !6, i64 40}
!13 = !{!"_ZTSN3JPH10ConstraintE", !14, i64 8, !17, i64 12, !17, i64 16, !7, i64 20, !7, i64 21, !18, i64 22, !19, i64 24}
!14 = !{!"_ZTSN3JPH9RefTargetINS_10ConstraintEEE", !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 = !{!"long", !7, i64 0}
!20 = !{!12, !6, i64 40}
!21 = !{i64 0, i64 16, !22}
!22 = !{!7, !7, i64 0}
!23 = !{!18, !18, i64 0}
!24 = !{!25, !10, i64 352}
!25 = !{!"_ZTSN3JPH14PathConstraintE", !12, i64 0, !26, i64 48, !27, i64 64, !27, i64 128, !28, i64 192, !10, i64 196, !29, i64 200, !32, i64 228, !10, i64 232, !10, i64 236, !33, i64 240, !33, i64 256, !33, i64 272, !33, i64 288, !33, i64 304, !33, i64 320, !34, i64 336, !10, i64 352, !36, i64 368, !39, i64 528, !39, i64 592, !42, i64 656, !43, i64 896}
!26 = !{!"_ZTSN3JPH8RefConstINS_18PathConstraintPathEEE", !6, i64 0}
!27 = !{!"_ZTSN3JPH5Mat44E", !7, i64 0}
!28 = !{!"_ZTSN3JPH27EPathRotationConstraintTypeE", !7, i64 0}
!29 = !{!"_ZTSN3JPH13MotorSettingsE", !30, i64 0, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24}
!30 = !{!"_ZTSN3JPH14SpringSettingsE", !31, i64 0, !7, i64 4, !10, i64 8}
!31 = !{!"_ZTSN3JPH11ESpringModeE", !7, i64 0}
!32 = !{!"_ZTSN3JPH11EMotorStateE", !7, i64 0}
!33 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!34 = !{!"_ZTSN3JPH4QuatE", !35, i64 0}
!35 = !{!"_ZTSN3JPH4Vec4E", !7, i64 0}
!36 = !{!"_ZTSN3JPH22DualAxisConstraintPartE", !33, i64 0, !33, i64 16, !33, i64 32, !33, i64 48, !33, i64 64, !33, i64 80, !33, i64 96, !33, i64 112, !37, i64 128, !38, i64 144}
!37 = !{!"_ZTSN3JPH6MatrixILj2ELj2EEE", !7, i64 0}
!38 = !{!"_ZTSN3JPH6VectorILj2EEE", !7, i64 0}
!39 = !{!"_ZTSN3JPH18AxisConstraintPartE", !40, i64 0, !40, i64 12, !40, i64 24, !40, i64 36, !10, i64 48, !41, i64 52, !10, i64 60}
!40 = !{!"_ZTSN3JPH6Float3E", !10, i64 0, !10, i64 4, !10, i64 8}
!41 = !{!"_ZTSN3JPH10SpringPartE", !10, i64 0, !10, i64 4}
!42 = !{!"_ZTSN3JPH27HingeRotationConstraintPartE", !33, i64 0, !33, i64 16, !33, i64 32, !27, i64 48, !27, i64 112, !33, i64 176, !33, i64 192, !37, i64 208, !38, i64 224}
!43 = !{!"_ZTSN3JPH27RotationEulerConstraintPartE", !27, i64 0, !27, i64 64, !27, i64 128, !33, i64 192}
!44 = !{!45, !45, i64 0}
!45 = !{!"vtable pointer", !8, i64 0}
!46 = !{i64 2158374965}
!47 = !{!25, !28, i64 192}
!48 = !{i8 0, i8 2}
!49 = !{}


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

@.str.1 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [96 x i8], align 1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK3JPH8RefConstINS_18PathConstraintPathEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3JPH14PathConstraint29CalculateConstraintPropertiesEf(ptr noundef nonnull align 16 dereferenceable(1104), float noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN3JPH14PathConstraint23SolvePositionConstraintEff(ptr noundef nonnull align 16 dereferenceable(1104) %0, float noundef %1, float noundef %2) unnamed_addr #1 align 2 {
  tail call void @_ZN3JPH14PathConstraint29CalculateConstraintPropertiesEf(ptr noundef nonnull align 16 dereferenceable(1104) %0, float noundef %1)
  %4 = getelementptr inbounds i8, ptr %0, i64 368
  %5 = getelementptr inbounds i8, ptr %0, i64 32
  %6 = load ptr, ptr %5, align 16, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 40
  %8 = load ptr, ptr %7, align 8, !tbaa !17
  %9 = getelementptr inbounds i8, ptr %0, i64 272
  %.sroa.014.0.copyload = load double, ptr %9, align 16
  %.sroa.215.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 280
  %.sroa.215.0.copyload = load double, ptr %.sroa.215.0..sroa_idx, align 8, !tbaa !18
  %10 = getelementptr inbounds i8, ptr %0, i64 304
  %.sroa.012.0.copyload = load double, ptr %10, align 16
  %.sroa.213.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 312
  %.sroa.213.0.copyload = load double, ptr %.sroa.213.0..sroa_idx, align 8, !tbaa !18
  %11 = getelementptr inbounds i8, ptr %0, i64 320
  %.sroa.010.0.copyload = load double, ptr %11, align 16
  %.sroa.211.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 328
  %.sroa.211.0.copyload = load double, ptr %.sroa.211.0..sroa_idx, align 8, !tbaa !18
  %12 = tail call noundef zeroext i1 @_ZNK3JPH22DualAxisConstraintPart23SolvePositionConstraintERNS_4BodyES2_NS_4Vec3ES3_S3_f(ptr noundef nonnull align 16 dereferenceable(152) %4, ptr noundef nonnull align 16 dereferenceable(122) %6, ptr noundef nonnull align 16 dereferenceable(122) %8, double %.sroa.014.0.copyload, double %.sroa.215.0.copyload, double %.sroa.012.0.copyload, double %.sroa.213.0.copyload, double %.sroa.010.0.copyload, double %.sroa.211.0.copyload, float noundef %2)
  %13 = getelementptr inbounds i8, ptr %0, i64 528
  %14 = tail call noundef zeroext i1 @_ZNK3JPH18AxisConstraintPart8IsActiveEv(ptr noundef nonnull align 4 dereferenceable(64) %13)
  br i1 %14, label %15, label %35

15:                                               ; preds = %3
  %16 = getelementptr inbounds i8, ptr %0, i64 352
  %17 = load float, ptr %16, align 16, !tbaa !19
  %18 = fcmp ugt float %17, 0.000000e+00
  br i1 %18, label %19, label %.sink.split

19:                                               ; preds = %15
  %20 = getelementptr inbounds i8, ptr %0, i64 48
  %21 = tail call noundef ptr @_ZNK3JPH8RefConstINS_18PathConstraintPathEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20)
  %22 = load ptr, ptr %21, align 8, !tbaa !40
  %23 = getelementptr inbounds i8, ptr %22, i64 32
  %24 = load ptr, ptr %23, align 8
  %25 = tail call noundef float %24(ptr noundef nonnull align 8 dereferenceable(13) %21)
  %26 = fcmp ult float %17, %25
  br i1 %26, label %27, label %.sink.split

27:                                               ; preds = %19
  %28 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 343)
  br i1 %28, label %29, label %.sink.split

29:                                               ; preds = %27
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !42
  br label %.sink.split

.sink.split:                                      ; preds = %19, %27, %29, %15
  %30 = load ptr, ptr %5, align 16, !tbaa !5
  %31 = load ptr, ptr %7, align 8, !tbaa !17
  %32 = getelementptr inbounds i8, ptr %0, i64 288
  %.sroa.07.0.copyload = load double, ptr %32, align 16
  %.sroa.28.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 296
  %.sroa.28.0.copyload = load double, ptr %.sroa.28.0..sroa_idx, align 8, !tbaa !18
  %33 = tail call noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %9, double %.sroa.07.0.copyload, double %.sroa.28.0.copyload)
  %34 = tail call noundef zeroext i1 @_ZNK3JPH18AxisConstraintPart23SolvePositionConstraintERNS_4BodyES2_NS_4Vec3Eff(ptr noundef nonnull align 4 dereferenceable(64) %13, ptr noundef nonnull align 16 dereferenceable(122) %30, ptr noundef nonnull align 16 dereferenceable(122) %31, double %.sroa.07.0.copyload, double %.sroa.28.0.copyload, float noundef %33, float noundef %2)
  br label %35

35:                                               ; preds = %.sink.split, %3
  %.0.shrunk = phi i1 [ false, %3 ], [ %34, %.sink.split ]
  %36 = getelementptr inbounds i8, ptr %0, i64 192
  %37 = load i32, ptr %36, align 16, !tbaa !43
  switch i32 %37, label %49 [
    i32 5, label %43
    i32 1, label %38
    i32 2, label %38
    i32 3, label %38
    i32 4, label %43
  ]

38:                                               ; preds = %35, %35, %35
  %39 = getelementptr inbounds i8, ptr %0, i64 656
  %40 = load ptr, ptr %5, align 16, !tbaa !5
  %41 = load ptr, ptr %7, align 8, !tbaa !17
  %42 = tail call noundef zeroext i1 @_ZNK3JPH27HingeRotationConstraintPart23SolvePositionConstraintERNS_4BodyES2_f(ptr noundef nonnull align 16 dereferenceable(232) %39, ptr noundef nonnull align 16 dereferenceable(122) %40, ptr noundef nonnull align 16 dereferenceable(122) %41, float noundef %2)
  br label %49

43:                                               ; preds = %35, %35
  %44 = getelementptr inbounds i8, ptr %0, i64 896
  %45 = load ptr, ptr %5, align 16, !tbaa !5
  %46 = load ptr, ptr %7, align 8, !tbaa !17
  %47 = getelementptr inbounds i8, ptr %0, i64 336
  %.sroa.0.0.copyload = load double, ptr %47, align 16
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 344
  %.sroa.2.0.copyload = load double, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !18
  %48 = tail call noundef zeroext i1 @_ZNK3JPH27RotationEulerConstraintPart23SolvePositionConstraintERNS_4BodyES2_NS_4QuatEf(ptr noundef nonnull align 16 dereferenceable(208) %44, ptr noundef nonnull align 16 dereferenceable(122) %45, ptr noundef nonnull align 16 dereferenceable(122) %46, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload, float noundef %2)
  br label %49

49:                                               ; preds = %43, %38, %35
  %.023.shrunk = phi i1 [ false, %35 ], [ %42, %38 ], [ %48, %43 ]
  br i1 %12, label %51, label %50

50:                                               ; preds = %49
  %spec.select = or i1 %.0.shrunk, %.023.shrunk
  br label %51

51:                                               ; preds = %50, %49
  %52 = phi i1 [ true, %49 ], [ %spec.select, %50 ]
  ret i1 %52
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH22DualAxisConstraintPart23SolvePositionConstraintERNS_4BodyES2_NS_4Vec3ES3_S3_f(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, double, double, float noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH18AxisConstraintPart23SolvePositionConstraintERNS_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: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH27HingeRotationConstraintPart23SolvePositionConstraintERNS_4BodyES2_f(ptr noundef nonnull align 16 dereferenceable(232), ptr noundef nonnull align 16 dereferenceable(122), ptr noundef nonnull align 16 dereferenceable(122), float noundef) local_unnamed_addr #3 align 2

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

attributes #0 = { 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 #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 = { 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 #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="64" "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 = { 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, !16, i64 32}
!6 = !{!"_ZTSN3JPH17TwoBodyConstraintE", !7, i64 0, !16, i64 32, !16, i64 40}
!7 = !{!"_ZTSN3JPH10ConstraintE", !8, i64 8, !11, i64 12, !11, i64 16, !12, i64 20, !12, i64 21, !14, i64 22, !15, i64 24}
!8 = !{!"_ZTSN3JPH9RefTargetINS_10ConstraintEEE", !9, i64 0}
!9 = !{!"_ZTSSt6atomicIjE", !10, i64 0}
!10 = !{!"_ZTSSt13__atomic_baseIjE", !11, i64 0}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"bool", !12, i64 0}
!15 = !{!"long", !12, i64 0}
!16 = !{!"any pointer", !12, i64 0}
!17 = !{!6, !16, i64 40}
!18 = !{!12, !12, i64 0}
!19 = !{!20, !24, i64 352}
!20 = !{!"_ZTSN3JPH14PathConstraintE", !6, i64 0, !21, i64 48, !22, i64 64, !22, i64 128, !23, i64 192, !24, i64 196, !25, i64 200, !28, i64 228, !24, i64 232, !24, i64 236, !29, i64 240, !29, i64 256, !29, i64 272, !29, i64 288, !29, i64 304, !29, i64 320, !30, i64 336, !24, i64 352, !32, i64 368, !35, i64 528, !35, i64 592, !38, i64 656, !39, i64 896}
!21 = !{!"_ZTSN3JPH8RefConstINS_18PathConstraintPathEEE", !16, i64 0}
!22 = !{!"_ZTSN3JPH5Mat44E", !12, i64 0}
!23 = !{!"_ZTSN3JPH27EPathRotationConstraintTypeE", !12, i64 0}
!24 = !{!"float", !12, i64 0}
!25 = !{!"_ZTSN3JPH13MotorSettingsE", !26, i64 0, !24, i64 12, !24, i64 16, !24, i64 20, !24, i64 24}
!26 = !{!"_ZTSN3JPH14SpringSettingsE", !27, i64 0, !12, i64 4, !24, i64 8}
!27 = !{!"_ZTSN3JPH11ESpringModeE", !12, i64 0}
!28 = !{!"_ZTSN3JPH11EMotorStateE", !12, i64 0}
!29 = !{!"_ZTSN3JPH4Vec3E", !12, i64 0}
!30 = !{!"_ZTSN3JPH4QuatE", !31, i64 0}
!31 = !{!"_ZTSN3JPH4Vec4E", !12, i64 0}
!32 = !{!"_ZTSN3JPH22DualAxisConstraintPartE", !29, i64 0, !29, i64 16, !29, i64 32, !29, i64 48, !29, i64 64, !29, i64 80, !29, i64 96, !29, i64 112, !33, i64 128, !34, i64 144}
!33 = !{!"_ZTSN3JPH6MatrixILj2ELj2EEE", !12, i64 0}
!34 = !{!"_ZTSN3JPH6VectorILj2EEE", !12, i64 0}
!35 = !{!"_ZTSN3JPH18AxisConstraintPartE", !36, i64 0, !36, i64 12, !36, i64 24, !36, i64 36, !24, i64 48, !37, i64 52, !24, i64 60}
!36 = !{!"_ZTSN3JPH6Float3E", !24, i64 0, !24, i64 4, !24, i64 8}
!37 = !{!"_ZTSN3JPH10SpringPartE", !24, i64 0, !24, i64 4}
!38 = !{!"_ZTSN3JPH27HingeRotationConstraintPartE", !29, i64 0, !29, i64 16, !29, i64 32, !22, i64 48, !22, i64 112, !29, i64 176, !29, i64 192, !33, i64 208, !34, i64 224}
!39 = !{!"_ZTSN3JPH27RotationEulerConstraintPartE", !22, i64 0, !22, i64 64, !22, i64 128, !29, i64 192}
!40 = !{!41, !41, i64 0}
!41 = !{!"vtable pointer", !13, i64 0}
!42 = !{i64 2158374965}
!43 = !{!20, !23, i64 192}


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