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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

@.str.2 = external hidden unnamed_addr constant [102 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [36 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: 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: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN3JPH20SwingTwistConstraint23SolveVelocityConstraintEf(ptr noundef nonnull align 16 dereferenceable(944) %0, float noundef %1) unnamed_addr #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca float, align 4
  %5 = alloca i8, align 1
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca %"class.JPH::Vec3", align 16
  %9 = alloca %"struct.JPH::AssertLastParam", align 1
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.JPH::Vec3", align 16
  %14 = alloca %"struct.JPH::AssertLastParam", align 1
  store ptr %0, ptr %3, align 8, !tbaa !5
  store float %1, ptr %4, align 4, !tbaa !9
  %15 = 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
  %16 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %15, i32 0, i32 19
  %17 = getelementptr inbounds [3 x %"class.JPH::AngleConstraintPart"], ptr %16, i64 0, i64 0
  %18 = call noundef zeroext i1 @_ZNK3JPH19AngleConstraintPart8IsActiveEv(ptr noundef nonnull align 16 dereferenceable(48) %17)
  br i1 %18, label %19, label %64

19:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %20 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %15, i32 0, i32 13
  %21 = load i32, ptr %20, align 16, !tbaa !13
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %23, label %30

23:                                               ; preds = %19
  %24 = load float, ptr %4, align 4, !tbaa !9
  %25 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %15, i32 0, i32 9
  %26 = load float, ptr %25, align 16, !tbaa !35
  %27 = fmul float %24, %26
  store float %27, ptr %7, align 4, !tbaa !9
  %28 = load float, ptr %7, align 4, !tbaa !9
  %29 = fneg float %28
  store float %29, ptr %6, align 4, !tbaa !9
  br label %41

30:                                               ; preds = %19
  %31 = load float, ptr %4, align 4, !tbaa !9
  %32 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %15, i32 0, i32 11
  %33 = getelementptr inbounds %"class.JPH::MotorSettings", ptr %32, i32 0, i32 3
  %34 = load float, ptr %33, align 4, !tbaa !36
  %35 = fmul float %31, %34
  store float %35, ptr %6, align 4, !tbaa !9
  %36 = load float, ptr %4, align 4, !tbaa !9
  %37 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %15, i32 0, i32 11
  %38 = getelementptr inbounds %"class.JPH::MotorSettings", ptr %37, i32 0, i32 4
  %39 = load float, ptr %38, align 8, !tbaa !37
  %40 = fmul float %36, %39
  store float %40, ptr %7, align 4, !tbaa !9
  br label %41

41:                                               ; preds = %30, %23
  %42 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %15, i32 0, i32 19
  %43 = getelementptr inbounds [3 x %"class.JPH::AngleConstraintPart"], ptr %42, i64 0, i64 0
  %44 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %15, i32 0, i32 1
  %45 = load ptr, ptr %44, align 16, !tbaa !38
  %46 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %15, i32 0, i32 2
  %47 = load ptr, ptr %46, align 8, !tbaa !39
  %48 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %15, i32 0, i32 16
  %49 = getelementptr inbounds [3 x %"class.JPH::Vec3"], ptr %48, i64 0, i64 0
  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 %6, align 4, !tbaa !9
  %51 = load float, ptr %7, align 4, !tbaa !9
  %52 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 0
  %53 = load double, ptr %52, align 16
  %54 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 1
  %55 = load double, ptr %54, align 8
  %56 = call noundef zeroext i1 @_ZN3JPH19AngleConstraintPart23SolveVelocityConstraintERNS_4BodyES2_NS_4Vec3Eff(ptr noundef nonnull align 16 dereferenceable(48) %43, ptr noundef nonnull align 16 dereferenceable(122) %45, ptr noundef nonnull align 16 dereferenceable(122) %47, double %53, double %55, float noundef %50, float noundef %51)
  %57 = zext i1 %56 to i32
  %58 = load i8, ptr %5, align 1, !tbaa !11, !range !42, !noundef !43
  %59 = trunc i8 %58 to i1
  %60 = zext i1 %59 to i32
  %61 = or i32 %60, %57
  %62 = icmp ne i32 %61, 0
  %63 = zext i1 %62 to i8
  store i8 %63, ptr %5, align 1, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %64

64:                                               ; preds = %41, %2
  %65 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %15, i32 0, i32 19
  %66 = getelementptr inbounds [3 x %"class.JPH::AngleConstraintPart"], ptr %65, i64 0, i64 1
  %67 = call noundef zeroext i1 @_ZNK3JPH19AngleConstraintPart8IsActiveEv(ptr noundef nonnull align 16 dereferenceable(48) %66)
  br i1 %67, label %68, label %136

68:                                               ; preds = %64
  br label %69

69:                                               ; preds = %68
  %70 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %15, i32 0, i32 19
  %71 = getelementptr inbounds [3 x %"class.JPH::AngleConstraintPart"], ptr %70, i64 0, i64 2
  %72 = call noundef zeroext i1 @_ZNK3JPH19AngleConstraintPart8IsActiveEv(ptr noundef nonnull align 16 dereferenceable(48) %71)
  br i1 %72, label %76, label %73

73:                                               ; preds = %69
  %74 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.4, ptr noundef @.str.2, i32 noundef 376)
  br i1 %74, label %75, label %76

75:                                               ; preds = %73
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !44
  br label %76

76:                                               ; preds = %75, %73, %69
  br label %77

77:                                               ; preds = %76
  br label %78

78:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %79 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %15, i32 0, i32 12
  %80 = load i32, ptr %79, align 4, !tbaa !45
  %81 = icmp eq i32 %80, 0
  br i1 %81, label %82, label %89

82:                                               ; preds = %78
  %83 = load float, ptr %4, align 4, !tbaa !9
  %84 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %15, i32 0, i32 9
  %85 = load float, ptr %84, align 16, !tbaa !35
  %86 = fmul float %83, %85
  store float %86, ptr %11, align 4, !tbaa !9
  %87 = load float, ptr %11, align 4, !tbaa !9
  %88 = fneg float %87
  store float %88, ptr %10, align 4, !tbaa !9
  br label %100

89:                                               ; preds = %78
  %90 = load float, ptr %4, align 4, !tbaa !9
  %91 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %15, i32 0, i32 10
  %92 = getelementptr inbounds %"class.JPH::MotorSettings", ptr %91, i32 0, i32 3
  %93 = load float, ptr %92, align 4, !tbaa !46
  %94 = fmul float %90, %93
  store float %94, ptr %10, align 4, !tbaa !9
  %95 = load float, ptr %4, align 4, !tbaa !9
  %96 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %15, i32 0, i32 10
  %97 = getelementptr inbounds %"class.JPH::MotorSettings", ptr %96, i32 0, i32 4
  %98 = load float, ptr %97, align 4, !tbaa !47
  %99 = fmul float %95, %98
  store float %99, ptr %11, align 4, !tbaa !9
  br label %100

100:                                              ; preds = %89, %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 1, ptr %12, align 4, !tbaa !48
  br label %101

101:                                              ; preds = %132, %100
  %102 = load i32, ptr %12, align 4, !tbaa !48
  %103 = icmp slt i32 %102, 3
  br i1 %103, label %105, label %104

104:                                              ; preds = %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %135

105:                                              ; preds = %101
  %106 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %15, i32 0, i32 19
  %107 = load i32, ptr %12, align 4, !tbaa !48
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [3 x %"class.JPH::AngleConstraintPart"], ptr %106, i64 0, i64 %108
  %110 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %15, i32 0, i32 1
  %111 = load ptr, ptr %110, align 16, !tbaa !38
  %112 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %15, i32 0, i32 2
  %113 = load ptr, ptr %112, align 8, !tbaa !39
  %114 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %15, i32 0, i32 16
  %115 = load i32, ptr %12, align 4, !tbaa !48
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [3 x %"class.JPH::Vec3"], ptr %114, i64 0, i64 %116
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %13, ptr align 16 %117, i64 16, i1 false), !tbaa.struct !40
  %118 = load float, ptr %10, align 4, !tbaa !9
  %119 = load float, ptr %11, align 4, !tbaa !9
  %120 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 0
  %121 = load double, ptr %120, align 16
  %122 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 1
  %123 = load double, ptr %122, align 8
  %124 = call noundef zeroext i1 @_ZN3JPH19AngleConstraintPart23SolveVelocityConstraintERNS_4BodyES2_NS_4Vec3Eff(ptr noundef nonnull align 16 dereferenceable(48) %109, ptr noundef nonnull align 16 dereferenceable(122) %111, ptr noundef nonnull align 16 dereferenceable(122) %113, double %121, double %123, float noundef %118, float noundef %119)
  %125 = zext i1 %124 to i32
  %126 = load i8, ptr %5, align 1, !tbaa !11, !range !42, !noundef !43
  %127 = trunc i8 %126 to i1
  %128 = zext i1 %127 to i32
  %129 = or i32 %128, %125
  %130 = icmp ne i32 %129, 0
  %131 = zext i1 %130 to i8
  store i8 %131, ptr %5, align 1, !tbaa !11
  br label %132

132:                                              ; preds = %105
  %133 = load i32, ptr %12, align 4, !tbaa !48
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %12, align 4, !tbaa !48
  br label %101, !llvm.loop !49

135:                                              ; preds = %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %147

136:                                              ; preds = %64
  br label %137

137:                                              ; preds = %136
  %138 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %15, i32 0, i32 19
  %139 = getelementptr inbounds [3 x %"class.JPH::AngleConstraintPart"], ptr %138, i64 0, i64 2
  %140 = call noundef zeroext i1 @_ZNK3JPH19AngleConstraintPart8IsActiveEv(ptr noundef nonnull align 16 dereferenceable(48) %139)
  br i1 %140, label %141, label %144

141:                                              ; preds = %137
  %142 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.5, ptr noundef @.str.2, i32 noundef 397)
  br i1 %142, label %143, label %144

143:                                              ; preds = %141
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !51
  br label %144

144:                                              ; preds = %143, %141, %137
  br label %145

145:                                              ; preds = %144
  br label %146

146:                                              ; preds = %145
  br label %147

147:                                              ; preds = %146, %135
  %148 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %15, i32 0, i32 18
  %149 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %15, i32 0, i32 1
  %150 = load ptr, ptr %149, align 16, !tbaa !38
  %151 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %15, i32 0, i32 2
  %152 = load ptr, ptr %151, align 8, !tbaa !39
  %153 = call noundef zeroext i1 @_ZN3JPH24SwingTwistConstraintPart23SolveVelocityConstraintERNS_4BodyES2_(ptr noundef nonnull align 16 dereferenceable(272) %148, ptr noundef nonnull align 16 dereferenceable(122) %150, ptr noundef nonnull align 16 dereferenceable(122) %152)
  %154 = zext i1 %153 to i32
  %155 = load i8, ptr %5, align 1, !tbaa !11, !range !42, !noundef !43
  %156 = trunc i8 %155 to i1
  %157 = zext i1 %156 to i32
  %158 = or i32 %157, %154
  %159 = icmp ne i32 %158, 0
  %160 = zext i1 %159 to i8
  store i8 %160, ptr %5, align 1, !tbaa !11
  %161 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %15, i32 0, i32 17
  %162 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %15, i32 0, i32 1
  %163 = load ptr, ptr %162, align 16, !tbaa !38
  %164 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %15, i32 0, i32 2
  %165 = load ptr, ptr %164, align 8, !tbaa !39
  %166 = call noundef zeroext i1 @_ZN3JPH19PointConstraintPart23SolveVelocityConstraintERNS_4BodyES2_(ptr noundef nonnull align 16 dereferenceable(240) %161, ptr noundef nonnull align 16 dereferenceable(122) %163, ptr noundef nonnull align 16 dereferenceable(122) %165)
  %167 = zext i1 %166 to i32
  %168 = load i8, ptr %5, align 1, !tbaa !11, !range !42, !noundef !43
  %169 = trunc i8 %168 to i1
  %170 = zext i1 %169 to i32
  %171 = or i32 %170, %167
  %172 = icmp ne i32 %171, 0
  %173 = zext i1 %172 to i8
  store i8 %173, ptr %5, align 1, !tbaa !11
  %174 = load i8, ptr %5, align 1, !tbaa !11, !range !42, !noundef !43
  %175 = trunc i8 %174 to i1
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #5
  ret i1 %175
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH19AngleConstraintPart8IsActiveEv(ptr noundef nonnull align 16 dereferenceable(48)) #4 align 2

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 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, !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 192}
!14 = !{!"_ZTSN3JPH20SwingTwistConstraintE", !15, i64 0, !22, i64 48, !22, i64 64, !23, i64 80, !23, i64 96, !10, i64 112, !10, i64 116, !10, i64 120, !10, i64 124, !10, i64 128, !25, i64 132, !25, i64 160, !28, i64 188, !28, i64 192, !22, i64 208, !23, i64 224, !7, i64 240, !29, i64 288, !31, i64 528, !7, i64 800}
!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 = !{!"_ZTSN3JPH13MotorSettingsE", !26, i64 0, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24}
!26 = !{!"_ZTSN3JPH14SpringSettingsE", !27, i64 0, !7, i64 4, !10, i64 8}
!27 = !{!"_ZTSN3JPH11ESpringModeE", !7, i64 0}
!28 = !{!"_ZTSN3JPH11EMotorStateE", !7, i64 0}
!29 = !{!"_ZTSN3JPH19PointConstraintPartE", !22, i64 0, !22, i64 16, !30, i64 32, !30, i64 96, !30, i64 160, !22, i64 224}
!30 = !{!"_ZTSN3JPH5Mat44E", !7, i64 0}
!31 = !{!"_ZTSN3JPH24SwingTwistConstraintPartE", !7, i64 0, !32, i64 1, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !22, i64 80, !22, i64 96, !22, i64 112, !33, i64 128, !33, i64 176, !33, i64 224}
!32 = !{!"_ZTSN3JPH10ESwingTypeE", !7, i64 0}
!33 = !{!"_ZTSN3JPH19AngleConstraintPartE", !22, i64 0, !22, i64 16, !10, i64 32, !34, i64 36, !10, i64 44}
!34 = !{!"_ZTSN3JPH10SpringPartE", !10, i64 0, !10, i64 4}
!35 = !{!14, !10, i64 128}
!36 = !{!14, !10, i64 180}
!37 = !{!14, !10, i64 184}
!38 = !{!15, !6, i64 32}
!39 = !{!15, !6, i64 40}
!40 = !{i64 0, i64 16, !41}
!41 = !{!7, !7, i64 0}
!42 = !{i8 0, i8 2}
!43 = !{}
!44 = !{i64 2158329346}
!45 = !{!14, !28, i64 188}
!46 = !{!14, !10, i64 152}
!47 = !{!14, !10, i64 156}
!48 = !{!20, !20, i64 0}
!49 = distinct !{!49, !50}
!50 = !{!"llvm.loop.mustprogress"}
!51 = !{i64 2158329726}


; 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.2 = external hidden unnamed_addr constant [102 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [36 x i8], align 1

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN3JPH20SwingTwistConstraint23SolveVelocityConstraintEf(ptr noundef nonnull align 16 dereferenceable(944) %0, float noundef %1) unnamed_addr #1 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 800
  %4 = tail call noundef zeroext i1 @_ZNK3JPH19AngleConstraintPart8IsActiveEv(ptr noundef nonnull align 16 dereferenceable(48) %3)
  br i1 %4, label %5, label %29

5:                                                ; preds = %2
  %6 = getelementptr inbounds i8, ptr %0, i64 192
  %7 = load i32, ptr %6, align 16, !tbaa !5
  %8 = icmp eq i32 %7, 0
  br i1 %8, label %9, label %14

9:                                                ; preds = %5
  %10 = getelementptr inbounds i8, ptr %0, i64 128
  %11 = load float, ptr %10, align 16, !tbaa !32
  %12 = fmul float %11, %1
  %13 = fneg float %12
  br label %21

14:                                               ; preds = %5
  %15 = getelementptr inbounds i8, ptr %0, i64 180
  %16 = load float, ptr %15, align 4, !tbaa !33
  %17 = fmul float %16, %1
  %18 = getelementptr inbounds i8, ptr %0, i64 184
  %19 = load float, ptr %18, align 8, !tbaa !34
  %20 = fmul float %19, %1
  br label %21

21:                                               ; preds = %14, %9
  %.027 = phi float [ %12, %9 ], [ %20, %14 ]
  %.023 = phi float [ %13, %9 ], [ %17, %14 ]
  %22 = getelementptr inbounds i8, ptr %0, i64 32
  %23 = load ptr, ptr %22, align 16, !tbaa !35
  %24 = getelementptr inbounds i8, ptr %0, i64 40
  %25 = load ptr, ptr %24, align 8, !tbaa !36
  %26 = getelementptr inbounds i8, ptr %0, i64 240
  %.sroa.06.0.copyload = load double, ptr %26, align 16
  %.sroa.27.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 248
  %.sroa.27.0.copyload = load double, ptr %.sroa.27.0..sroa_idx, align 8, !tbaa !37
  %27 = tail call noundef zeroext i1 @_ZN3JPH19AngleConstraintPart23SolveVelocityConstraintERNS_4BodyES2_NS_4Vec3Eff(ptr noundef nonnull align 16 dereferenceable(48) %3, ptr noundef nonnull align 16 dereferenceable(122) %23, ptr noundef nonnull align 16 dereferenceable(122) %25, double %.sroa.06.0.copyload, double %.sroa.27.0.copyload, float noundef %.023, float noundef %.027)
  %28 = zext i1 %27 to i8
  br label %29

29:                                               ; preds = %21, %2
  %.0 = phi i8 [ %28, %21 ], [ 0, %2 ]
  %30 = getelementptr inbounds i8, ptr %0, i64 848
  %31 = tail call noundef zeroext i1 @_ZNK3JPH19AngleConstraintPart8IsActiveEv(ptr noundef nonnull align 16 dereferenceable(48) %30)
  %32 = getelementptr inbounds i8, ptr %0, i64 896
  %33 = tail call noundef zeroext i1 @_ZNK3JPH19AngleConstraintPart8IsActiveEv(ptr noundef nonnull align 16 dereferenceable(48) %32)
  br i1 %31, label %34, label %69

34:                                               ; preds = %29
  br i1 %33, label %38, label %35

35:                                               ; preds = %34
  %36 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.2, i32 noundef 376)
  br i1 %36, label %37, label %38

37:                                               ; preds = %35
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #3, !srcloc !38
  br label %38

38:                                               ; preds = %37, %35, %34
  %39 = getelementptr inbounds i8, ptr %0, i64 188
  %40 = load i32, ptr %39, align 4, !tbaa !39
  %41 = icmp eq i32 %40, 0
  br i1 %41, label %42, label %47

42:                                               ; preds = %38
  %43 = getelementptr inbounds i8, ptr %0, i64 128
  %44 = load float, ptr %43, align 16, !tbaa !32
  %45 = fmul float %44, %1
  %46 = fneg float %45
  br label %.loopexit.loopexit

47:                                               ; preds = %38
  %48 = getelementptr inbounds i8, ptr %0, i64 152
  %49 = load float, ptr %48, align 8, !tbaa !40
  %50 = fmul float %49, %1
  %51 = getelementptr inbounds i8, ptr %0, i64 156
  %52 = load float, ptr %51, align 4, !tbaa !41
  %53 = fmul float %52, %1
  br label %.loopexit.loopexit

.loopexit.loopexit:                               ; preds = %47, %42
  %.026 = phi float [ %46, %42 ], [ %50, %47 ]
  %.025 = phi float [ %45, %42 ], [ %53, %47 ]
  %54 = getelementptr inbounds i8, ptr %0, i64 32
  %55 = getelementptr inbounds i8, ptr %0, i64 40
  %56 = getelementptr inbounds i8, ptr %0, i64 848
  %57 = load ptr, ptr %54, align 16, !tbaa !35
  %58 = load ptr, ptr %55, align 8, !tbaa !36
  %59 = getelementptr inbounds i8, ptr %0, i64 256
  %.sroa.0.0.copyload = load double, ptr %59, align 16
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 264
  %.sroa.2.0.copyload = load double, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !37
  %60 = tail call noundef zeroext i1 @_ZN3JPH19AngleConstraintPart23SolveVelocityConstraintERNS_4BodyES2_NS_4Vec3Eff(ptr noundef nonnull align 16 dereferenceable(48) %56, ptr noundef nonnull align 16 dereferenceable(122) %57, ptr noundef nonnull align 16 dereferenceable(122) %58, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload, float noundef %.026, float noundef %.025)
  %61 = getelementptr inbounds i8, ptr %0, i64 896
  %62 = load ptr, ptr %54, align 16, !tbaa !35
  %63 = load ptr, ptr %55, align 8, !tbaa !36
  %64 = getelementptr inbounds i8, ptr %0, i64 272
  %.sroa.0.0.copyload.1 = load double, ptr %64, align 16
  %.sroa.2.0..sroa_idx.1 = getelementptr inbounds i8, ptr %0, i64 280
  %.sroa.2.0.copyload.1 = load double, ptr %.sroa.2.0..sroa_idx.1, align 8, !tbaa !37
  %65 = tail call noundef zeroext i1 @_ZN3JPH19AngleConstraintPart23SolveVelocityConstraintERNS_4BodyES2_NS_4Vec3Eff(ptr noundef nonnull align 16 dereferenceable(48) %61, ptr noundef nonnull align 16 dereferenceable(122) %62, ptr noundef nonnull align 16 dereferenceable(122) %63, double %.sroa.0.0.copyload.1, double %.sroa.2.0.copyload.1, float noundef %.026, float noundef %.025)
  %66 = or i1 %60, %65
  %67 = zext i1 %66 to i8
  %68 = or i8 %.0, %67
  br label %.loopexit

69:                                               ; preds = %29
  br i1 %33, label %70, label %.loopexit

70:                                               ; preds = %69
  %71 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.2, i32 noundef 397)
  br i1 %71, label %72, label %.loopexit

72:                                               ; preds = %70
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #3, !srcloc !42
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %69, %70, %72
  %.2 = phi i8 [ %.0, %72 ], [ %.0, %70 ], [ %.0, %69 ], [ %68, %.loopexit.loopexit ]
  %73 = getelementptr inbounds i8, ptr %0, i64 528
  %74 = getelementptr inbounds i8, ptr %0, i64 32
  %75 = load ptr, ptr %74, align 16, !tbaa !35
  %76 = getelementptr inbounds i8, ptr %0, i64 40
  %77 = load ptr, ptr %76, align 8, !tbaa !36
  %78 = tail call noundef zeroext i1 @_ZN3JPH24SwingTwistConstraintPart23SolveVelocityConstraintERNS_4BodyES2_(ptr noundef nonnull align 16 dereferenceable(272) %73, ptr noundef nonnull align 16 dereferenceable(122) %75, ptr noundef nonnull align 16 dereferenceable(122) %77)
  %79 = zext i1 %78 to i8
  %80 = or i8 %.2, %79
  %81 = getelementptr inbounds i8, ptr %0, i64 288
  %82 = load ptr, ptr %74, align 16, !tbaa !35
  %83 = load ptr, ptr %76, align 8, !tbaa !36
  %84 = tail call noundef zeroext i1 @_ZN3JPH19PointConstraintPart23SolveVelocityConstraintERNS_4BodyES2_(ptr noundef nonnull align 16 dereferenceable(240) %81, ptr noundef nonnull align 16 dereferenceable(122) %82, ptr noundef nonnull align 16 dereferenceable(122) %83)
  %85 = zext i1 %84 to i8
  %86 = or i8 %80, %85
  %87 = icmp ne i8 %86, 0
  ret i1 %87
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH19AngleConstraintPart8IsActiveEv(ptr noundef nonnull align 16 dereferenceable(48)) local_unnamed_addr #2 align 2

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

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

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

attributes #0 = { 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 #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 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 = { 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, !25, i64 192}
!6 = !{!"_ZTSN3JPH20SwingTwistConstraintE", !7, i64 0, !18, i64 48, !18, i64 64, !19, i64 80, !19, i64 96, !21, i64 112, !21, i64 116, !21, i64 120, !21, i64 124, !21, i64 128, !22, i64 132, !22, i64 160, !25, i64 188, !25, i64 192, !18, i64 208, !19, i64 224, !13, i64 240, !26, i64 288, !28, i64 528, !13, i64 800}
!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 = !{!"_ZTSN3JPH13MotorSettingsE", !23, i64 0, !21, i64 12, !21, i64 16, !21, i64 20, !21, i64 24}
!23 = !{!"_ZTSN3JPH14SpringSettingsE", !24, i64 0, !13, i64 4, !21, i64 8}
!24 = !{!"_ZTSN3JPH11ESpringModeE", !13, i64 0}
!25 = !{!"_ZTSN3JPH11EMotorStateE", !13, i64 0}
!26 = !{!"_ZTSN3JPH19PointConstraintPartE", !18, i64 0, !18, i64 16, !27, i64 32, !27, i64 96, !27, i64 160, !18, i64 224}
!27 = !{!"_ZTSN3JPH5Mat44E", !13, i64 0}
!28 = !{!"_ZTSN3JPH24SwingTwistConstraintPartE", !13, i64 0, !29, i64 1, !21, i64 4, !21, i64 8, !21, i64 12, !21, i64 16, !21, i64 20, !21, i64 24, !21, i64 28, !21, i64 32, !21, i64 36, !21, i64 40, !21, i64 44, !21, i64 48, !21, i64 52, !21, i64 56, !21, i64 60, !21, i64 64, !18, i64 80, !18, i64 96, !18, i64 112, !30, i64 128, !30, i64 176, !30, i64 224}
!29 = !{!"_ZTSN3JPH10ESwingTypeE", !13, i64 0}
!30 = !{!"_ZTSN3JPH19AngleConstraintPartE", !18, i64 0, !18, i64 16, !21, i64 32, !31, i64 36, !21, i64 44}
!31 = !{!"_ZTSN3JPH10SpringPartE", !21, i64 0, !21, i64 4}
!32 = !{!6, !21, i64 128}
!33 = !{!6, !21, i64 180}
!34 = !{!6, !21, i64 184}
!35 = !{!7, !17, i64 32}
!36 = !{!7, !17, i64 40}
!37 = !{!13, !13, i64 0}
!38 = !{i64 2158329346}
!39 = !{!6, !25, i64 188}
!40 = !{!6, !21, i64 152}
!41 = !{!6, !21, i64 156}
!42 = !{i64 2158329726}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass