; 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::Mat44" = type { [4 x %"class.JPH::Vec4"] }
%"class.JPH::Vec4" = type { %union.anon.4 }
%union.anon.4 = type { <4 x float> }
%"class.JPH::Quat" = type { %"class.JPH::Vec4" }
%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%"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::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::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::PointConstraintPart" = type { %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Mat44", %"class.JPH::Mat44", %"class.JPH::Mat44", %"class.JPH::Vec3" }
%"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 }

; 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 { double, double } @_ZNK3JPH4Body11GetRotationEv(ptr noundef nonnull align 16 dereferenceable(122)) #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH20SwingTwistConstraint23SetupVelocityConstraintEf(ptr noundef nonnull align 16 dereferenceable(944) %0, float noundef %1) unnamed_addr #5 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca float, align 4
  %5 = alloca %"class.JPH::Mat44", align 16
  %6 = alloca %"class.JPH::Quat", align 16
  %7 = alloca %"class.JPH::Mat44", align 16
  %8 = alloca %"class.JPH::Quat", align 16
  %9 = alloca %"class.JPH::Vec3", align 16
  %10 = alloca %"class.JPH::Vec3", align 16
  %11 = alloca %"class.JPH::Quat", align 16
  %12 = alloca %"class.JPH::Quat", align 16
  %13 = alloca %"class.JPH::Quat", align 16
  %14 = alloca %"class.JPH::Quat", align 16
  %15 = alloca %"class.JPH::Quat", align 16
  %16 = alloca %"class.JPH::Quat", align 16
  %17 = alloca %"class.JPH::Quat", align 16
  %18 = alloca %"class.JPH::Quat", align 16
  %19 = alloca %"class.JPH::Quat", align 16
  %20 = alloca %"class.JPH::Quat", align 16
  %21 = alloca %"class.JPH::Quat", align 16
  %22 = alloca %"class.JPH::Mat44", align 16
  %23 = alloca %"class.JPH::Quat", align 16
  %24 = alloca i32, align 4
  %25 = alloca %"class.JPH::Vec3", align 16
  %26 = alloca %"class.JPH::Vec3", align 16
  %27 = alloca %"class.JPH::Quat", align 16
  %28 = alloca %"class.JPH::Quat", align 16
  %29 = alloca %"class.JPH::Quat", align 16
  %30 = alloca %"class.JPH::Quat", align 16
  %31 = alloca %"class.JPH::Quat", align 16
  %32 = alloca %"class.JPH::Vec3", align 16
  %33 = alloca %"class.JPH::Vec3", align 16
  %34 = alloca i32, align 4
  %35 = alloca %"class.JPH::Vec3", align 16
  %36 = alloca ptr, align 8
  %37 = alloca ptr, align 8
  %38 = alloca ptr, align 8
  %39 = alloca ptr, align 8
  %40 = alloca i32, align 4
  %41 = alloca %"class.JPH::Vec3", align 16
  %42 = alloca i32, align 4
  %43 = alloca %"class.JPH::Vec3", align 16
  %44 = alloca i32, align 4
  %45 = alloca %"class.JPH::Vec3", align 16
  %46 = alloca %"class.JPH::Vec3", align 16
  %47 = alloca %"class.JPH::Vec3", align 16
  %48 = alloca ptr, align 8
  %49 = alloca ptr, align 8
  %50 = alloca ptr, align 8
  %51 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store float %1, ptr %4, align 4, !tbaa !9
  %52 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 64, ptr %5) #7
  %53 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %52, i32 0, i32 1
  %54 = load ptr, ptr %53, align 16, !tbaa !11
  %55 = call { double, double } @_ZNK3JPH4Body11GetRotationEv(ptr noundef nonnull align 16 dereferenceable(122) %54)
  %56 = getelementptr inbounds %"class.JPH::Quat", ptr %6, i32 0, i32 0
  %57 = getelementptr inbounds %"class.JPH::Vec4", ptr %56, i32 0, i32 0
  %58 = getelementptr inbounds %union.anon.4, ptr %57, i32 0, i32 0
  %59 = getelementptr inbounds { double, double }, ptr %58, i32 0, i32 0
  %60 = extractvalue { double, double } %55, 0
  store double %60, ptr %59, align 16
  %61 = getelementptr inbounds { double, double }, ptr %58, i32 0, i32 1
  %62 = extractvalue { double, double } %55, 1
  store double %62, ptr %61, align 8
  %63 = getelementptr inbounds { double, double }, ptr %6, i32 0, i32 0
  %64 = load double, ptr %63, align 16
  %65 = getelementptr inbounds { double, double }, ptr %6, i32 0, i32 1
  %66 = load double, ptr %65, align 8
  call void @_ZN3JPH5Mat449sRotationENS_4QuatE(ptr dead_on_unwind writable sret(%"class.JPH::Mat44") align 16 %5, double %64, double %66)
  call void @llvm.lifetime.start.p0(i64 64, ptr %7) #7
  %67 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %52, i32 0, i32 2
  %68 = load ptr, ptr %67, align 8, !tbaa !20
  %69 = call { double, double } @_ZNK3JPH4Body11GetRotationEv(ptr noundef nonnull align 16 dereferenceable(122) %68)
  %70 = getelementptr inbounds %"class.JPH::Quat", ptr %8, i32 0, i32 0
  %71 = getelementptr inbounds %"class.JPH::Vec4", ptr %70, i32 0, i32 0
  %72 = getelementptr inbounds %union.anon.4, ptr %71, i32 0, i32 0
  %73 = getelementptr inbounds { double, double }, ptr %72, i32 0, i32 0
  %74 = extractvalue { double, double } %69, 0
  store double %74, ptr %73, align 16
  %75 = getelementptr inbounds { double, double }, ptr %72, i32 0, i32 1
  %76 = extractvalue { double, double } %69, 1
  store double %76, ptr %75, align 8
  %77 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 0
  %78 = load double, ptr %77, align 16
  %79 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 1
  %80 = load double, ptr %79, align 8
  call void @_ZN3JPH5Mat449sRotationENS_4QuatE(ptr dead_on_unwind writable sret(%"class.JPH::Mat44") align 16 %7, double %78, double %80)
  %81 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 17
  %82 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %52, i32 0, i32 1
  %83 = load ptr, ptr %82, align 16, !tbaa !11
  %84 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %9, ptr align 16 %84, i64 16, i1 false), !tbaa.struct !21
  %85 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %52, i32 0, i32 2
  %86 = load ptr, ptr %85, align 8, !tbaa !20
  %87 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %10, ptr align 16 %87, i64 16, i1 false), !tbaa.struct !21
  %88 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 0
  %89 = load double, ptr %88, align 16
  %90 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 1
  %91 = load double, ptr %90, align 8
  %92 = getelementptr inbounds { double, double }, ptr %10, i32 0, i32 0
  %93 = load double, ptr %92, align 16
  %94 = getelementptr inbounds { double, double }, ptr %10, i32 0, i32 1
  %95 = load double, ptr %94, align 8
  call void @_ZN3JPH19PointConstraintPart29CalculateConstraintPropertiesERKNS_4BodyERKNS_5Mat44ENS_4Vec3ES3_S6_S7_(ptr noundef nonnull align 16 dereferenceable(240) %81, ptr noundef nonnull align 16 dereferenceable(122) %83, ptr noundef nonnull align 16 dereferenceable(64) %5, double %89, double %91, ptr noundef nonnull align 16 dereferenceable(122) %86, ptr noundef nonnull align 16 dereferenceable(64) %7, double %93, double %95)
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #7
  %96 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %52, i32 0, i32 1
  %97 = load ptr, ptr %96, align 16, !tbaa !11
  %98 = call { double, double } @_ZNK3JPH4Body11GetRotationEv(ptr noundef nonnull align 16 dereferenceable(122) %97)
  %99 = getelementptr inbounds %"class.JPH::Quat", ptr %12, i32 0, i32 0
  %100 = getelementptr inbounds %"class.JPH::Vec4", ptr %99, i32 0, i32 0
  %101 = getelementptr inbounds %union.anon.4, ptr %100, i32 0, i32 0
  %102 = getelementptr inbounds { double, double }, ptr %101, i32 0, i32 0
  %103 = extractvalue { double, double } %98, 0
  store double %103, ptr %102, align 16
  %104 = getelementptr inbounds { double, double }, ptr %101, i32 0, i32 1
  %105 = extractvalue { double, double } %98, 1
  store double %105, ptr %104, align 8
  %106 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %13, ptr align 16 %106, i64 16, i1 false), !tbaa.struct !21
  %107 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 0
  %108 = load double, ptr %107, align 16
  %109 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 1
  %110 = load double, ptr %109, align 8
  %111 = call { double, double } @_ZNK3JPH4QuatmlES0_(ptr noundef nonnull align 16 dereferenceable(16) %12, double %108, double %110)
  %112 = getelementptr inbounds %"class.JPH::Quat", ptr %11, i32 0, i32 0
  %113 = getelementptr inbounds %"class.JPH::Vec4", ptr %112, i32 0, i32 0
  %114 = getelementptr inbounds %union.anon.4, ptr %113, i32 0, i32 0
  %115 = getelementptr inbounds { double, double }, ptr %114, i32 0, i32 0
  %116 = extractvalue { double, double } %111, 0
  store double %116, ptr %115, align 16
  %117 = getelementptr inbounds { double, double }, ptr %114, i32 0, i32 1
  %118 = extractvalue { double, double } %111, 1
  store double %118, ptr %117, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #7
  %119 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %52, i32 0, i32 2
  %120 = load ptr, ptr %119, align 8, !tbaa !20
  %121 = call { double, double } @_ZNK3JPH4Body11GetRotationEv(ptr noundef nonnull align 16 dereferenceable(122) %120)
  %122 = getelementptr inbounds %"class.JPH::Quat", ptr %15, i32 0, i32 0
  %123 = getelementptr inbounds %"class.JPH::Vec4", ptr %122, i32 0, i32 0
  %124 = getelementptr inbounds %union.anon.4, ptr %123, i32 0, i32 0
  %125 = getelementptr inbounds { double, double }, ptr %124, i32 0, i32 0
  %126 = extractvalue { double, double } %121, 0
  store double %126, ptr %125, align 16
  %127 = getelementptr inbounds { double, double }, ptr %124, i32 0, i32 1
  %128 = extractvalue { double, double } %121, 1
  store double %128, ptr %127, align 8
  %129 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %16, ptr align 16 %129, i64 16, i1 false), !tbaa.struct !21
  %130 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %131 = load double, ptr %130, align 16
  %132 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 1
  %133 = load double, ptr %132, align 8
  %134 = call { double, double } @_ZNK3JPH4QuatmlES0_(ptr noundef nonnull align 16 dereferenceable(16) %15, double %131, double %133)
  %135 = getelementptr inbounds %"class.JPH::Quat", ptr %14, i32 0, i32 0
  %136 = getelementptr inbounds %"class.JPH::Vec4", ptr %135, i32 0, i32 0
  %137 = getelementptr inbounds %union.anon.4, ptr %136, i32 0, i32 0
  %138 = getelementptr inbounds { double, double }, ptr %137, i32 0, i32 0
  %139 = extractvalue { double, double } %134, 0
  store double %139, ptr %138, align 16
  %140 = getelementptr inbounds { double, double }, ptr %137, i32 0, i32 1
  %141 = extractvalue { double, double } %134, 1
  store double %141, ptr %140, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #7
  %142 = call { double, double } @_ZNK3JPH4Quat10ConjugatedEv(ptr noundef nonnull align 16 dereferenceable(16) %11)
  %143 = getelementptr inbounds %"class.JPH::Quat", ptr %18, i32 0, i32 0
  %144 = getelementptr inbounds %"class.JPH::Vec4", ptr %143, i32 0, i32 0
  %145 = getelementptr inbounds %union.anon.4, ptr %144, i32 0, i32 0
  %146 = getelementptr inbounds { double, double }, ptr %145, i32 0, i32 0
  %147 = extractvalue { double, double } %142, 0
  store double %147, ptr %146, align 16
  %148 = getelementptr inbounds { double, double }, ptr %145, i32 0, i32 1
  %149 = extractvalue { double, double } %142, 1
  store double %149, ptr %148, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %19, ptr align 16 %14, i64 16, i1 false), !tbaa.struct !21
  %150 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %151 = load double, ptr %150, align 16
  %152 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  %153 = load double, ptr %152, align 8
  %154 = call { double, double } @_ZNK3JPH4QuatmlES0_(ptr noundef nonnull align 16 dereferenceable(16) %18, double %151, double %153)
  %155 = getelementptr inbounds %"class.JPH::Quat", ptr %17, i32 0, i32 0
  %156 = getelementptr inbounds %"class.JPH::Vec4", ptr %155, i32 0, i32 0
  %157 = getelementptr inbounds %union.anon.4, ptr %156, i32 0, i32 0
  %158 = getelementptr inbounds { double, double }, ptr %157, i32 0, i32 0
  %159 = extractvalue { double, double } %154, 0
  store double %159, ptr %158, align 16
  %160 = getelementptr inbounds { double, double }, ptr %157, i32 0, i32 1
  %161 = extractvalue { double, double } %154, 1
  store double %161, ptr %160, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #7
  %162 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 18
  %163 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %52, i32 0, i32 1
  %164 = load ptr, ptr %163, align 16, !tbaa !11
  %165 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %52, i32 0, i32 2
  %166 = load ptr, ptr %165, align 8, !tbaa !20
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %20, ptr align 16 %17, i64 16, i1 false), !tbaa.struct !21
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %21, ptr align 16 %11, i64 16, i1 false), !tbaa.struct !21
  %167 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %168 = load double, ptr %167, align 16
  %169 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %170 = load double, ptr %169, align 8
  %171 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 0
  %172 = load double, ptr %171, align 16
  %173 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 1
  %174 = load double, ptr %173, align 8
  call void @_ZN3JPH24SwingTwistConstraintPart29CalculateConstraintPropertiesERKNS_4BodyES3_NS_4QuatES4_(ptr noundef nonnull align 16 dereferenceable(272) %162, ptr noundef nonnull align 16 dereferenceable(122) %164, ptr noundef nonnull align 16 dereferenceable(122) %166, double %168, double %170, double %172, double %174)
  %175 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 12
  %176 = load i32, ptr %175, align 4, !tbaa !23
  %177 = icmp ne i32 %176, 0
  br i1 %177, label %186, label %178

178:                                              ; preds = %2
  %179 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 13
  %180 = load i32, ptr %179, align 16, !tbaa !38
  %181 = icmp ne i32 %180, 0
  br i1 %181, label %186, label %182

182:                                              ; preds = %178
  %183 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 9
  %184 = load float, ptr %183, align 16, !tbaa !39
  %185 = fcmp ogt float %184, 0.000000e+00
  br i1 %185, label %186, label %477

186:                                              ; preds = %182, %178, %2
  call void @llvm.lifetime.start.p0(i64 64, ptr %22) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %23, ptr align 16 %14, i64 16, i1 false), !tbaa.struct !21
  %187 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 0
  %188 = load double, ptr %187, align 16
  %189 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 1
  %190 = load double, ptr %189, align 8
  call void @_ZN3JPH5Mat449sRotationENS_4QuatE(ptr dead_on_unwind writable sret(%"class.JPH::Mat44") align 16 %22, double %188, double %190)
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 0, ptr %24, align 4, !tbaa !40
  br label %191

191:                                              ; preds = %208, %186
  %192 = load i32, ptr %24, align 4, !tbaa !40
  %193 = icmp slt i32 %192, 3
  br i1 %193, label %195, label %194

194:                                              ; preds = %191
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %211

195:                                              ; preds = %191
  call void @llvm.lifetime.start.p0(i64 16, ptr %25) #7
  %196 = load i32, ptr %24, align 4, !tbaa !40
  %197 = call { double, double } @_ZNK3JPH5Mat4410GetColumn3Ej(ptr noundef nonnull align 16 dereferenceable(64) %22, i32 noundef %196)
  %198 = getelementptr inbounds %"class.JPH::Vec3", ptr %25, i32 0, i32 0
  %199 = getelementptr inbounds %union.anon, ptr %198, i32 0, i32 0
  %200 = getelementptr inbounds { double, double }, ptr %199, i32 0, i32 0
  %201 = extractvalue { double, double } %197, 0
  store double %201, ptr %200, align 16
  %202 = getelementptr inbounds { double, double }, ptr %199, i32 0, i32 1
  %203 = extractvalue { double, double } %197, 1
  store double %203, ptr %202, align 8
  %204 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 16
  %205 = load i32, ptr %24, align 4, !tbaa !40
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [3 x %"class.JPH::Vec3"], ptr %204, i64 0, i64 %206
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %207, ptr align 16 %25, i64 16, i1 false), !tbaa.struct !21
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #7
  br label %208

208:                                              ; preds = %195
  %209 = load i32, ptr %24, align 4, !tbaa !40
  %210 = add nsw i32 %209, 1
  store i32 %210, ptr %24, align 4, !tbaa !40
  br label %191, !llvm.loop !41

211:                                              ; preds = %194
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #7
  %212 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 12
  %213 = load i32, ptr %212, align 4, !tbaa !23
  %214 = icmp eq i32 %213, 2
  br i1 %214, label %219, label %215

215:                                              ; preds = %211
  %216 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 13
  %217 = load i32, ptr %216, align 16, !tbaa !38
  %218 = icmp eq i32 %217, 2
  br i1 %218, label %219, label %278

219:                                              ; preds = %215, %211
  call void @llvm.lifetime.start.p0(i64 16, ptr %27) #7
  %220 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 15
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %28, ptr align 16 %220, i64 16, i1 false), !tbaa.struct !21
  %221 = getelementptr inbounds { double, double }, ptr %28, i32 0, i32 0
  %222 = load double, ptr %221, align 16
  %223 = getelementptr inbounds { double, double }, ptr %28, i32 0, i32 1
  %224 = load double, ptr %223, align 8
  %225 = call noundef float @_ZNK3JPH4Quat3DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %17, double %222, double %224)
  %226 = fcmp ogt float %225, 0.000000e+00
  br i1 %226, label %227, label %229

227:                                              ; preds = %219
  %228 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 15
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %27, ptr align 16 %228, i64 16, i1 false), !tbaa.struct !21
  br label %239

229:                                              ; preds = %219
  %230 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 15
  %231 = call { double, double } @_ZNK3JPH4QuatngEv(ptr noundef nonnull align 16 dereferenceable(16) %230)
  %232 = getelementptr inbounds %"class.JPH::Quat", ptr %27, i32 0, i32 0
  %233 = getelementptr inbounds %"class.JPH::Vec4", ptr %232, i32 0, i32 0
  %234 = getelementptr inbounds %union.anon.4, ptr %233, i32 0, i32 0
  %235 = getelementptr inbounds { double, double }, ptr %234, i32 0, i32 0
  %236 = extractvalue { double, double } %231, 0
  store double %236, ptr %235, align 16
  %237 = getelementptr inbounds { double, double }, ptr %234, i32 0, i32 1
  %238 = extractvalue { double, double } %231, 1
  store double %238, ptr %237, align 8
  br label %239

239:                                              ; preds = %229, %227
  call void @llvm.lifetime.start.p0(i64 16, ptr %29) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %30) #7
  %240 = call { double, double } @_ZNK3JPH4Quat10ConjugatedEv(ptr noundef nonnull align 16 dereferenceable(16) %17)
  %241 = getelementptr inbounds %"class.JPH::Quat", ptr %30, i32 0, i32 0
  %242 = getelementptr inbounds %"class.JPH::Vec4", ptr %241, i32 0, i32 0
  %243 = getelementptr inbounds %union.anon.4, ptr %242, i32 0, i32 0
  %244 = getelementptr inbounds { double, double }, ptr %243, i32 0, i32 0
  %245 = extractvalue { double, double } %240, 0
  store double %245, ptr %244, align 16
  %246 = getelementptr inbounds { double, double }, ptr %243, i32 0, i32 1
  %247 = extractvalue { double, double } %240, 1
  store double %247, ptr %246, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %31, ptr align 16 %27, i64 16, i1 false), !tbaa.struct !21
  %248 = getelementptr inbounds { double, double }, ptr %31, i32 0, i32 0
  %249 = load double, ptr %248, align 16
  %250 = getelementptr inbounds { double, double }, ptr %31, i32 0, i32 1
  %251 = load double, ptr %250, align 8
  %252 = call { double, double } @_ZNK3JPH4QuatmlES0_(ptr noundef nonnull align 16 dereferenceable(16) %30, double %249, double %251)
  %253 = getelementptr inbounds %"class.JPH::Quat", ptr %29, i32 0, i32 0
  %254 = getelementptr inbounds %"class.JPH::Vec4", ptr %253, i32 0, i32 0
  %255 = getelementptr inbounds %union.anon.4, ptr %254, i32 0, i32 0
  %256 = getelementptr inbounds { double, double }, ptr %255, i32 0, i32 0
  %257 = extractvalue { double, double } %252, 0
  store double %257, ptr %256, align 16
  %258 = getelementptr inbounds { double, double }, ptr %255, i32 0, i32 1
  %259 = extractvalue { double, double } %252, 1
  store double %259, ptr %258, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %32) #7
  %260 = call { double, double } @_ZNK3JPH4Quat6GetXYZEv(ptr noundef nonnull align 16 dereferenceable(16) %29)
  %261 = getelementptr inbounds %"class.JPH::Vec3", ptr %33, i32 0, i32 0
  %262 = getelementptr inbounds %union.anon, ptr %261, i32 0, i32 0
  %263 = getelementptr inbounds { double, double }, ptr %262, i32 0, i32 0
  %264 = extractvalue { double, double } %260, 0
  store double %264, ptr %263, align 16
  %265 = getelementptr inbounds { double, double }, ptr %262, i32 0, i32 1
  %266 = extractvalue { double, double } %260, 1
  store double %266, ptr %265, align 8
  %267 = getelementptr inbounds { double, double }, ptr %33, i32 0, i32 0
  %268 = load double, ptr %267, align 16
  %269 = getelementptr inbounds { double, double }, ptr %33, i32 0, i32 1
  %270 = load double, ptr %269, align 8
  %271 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef -2.000000e+00, double %268, double %270)
  %272 = getelementptr inbounds %"class.JPH::Vec3", ptr %32, i32 0, i32 0
  %273 = getelementptr inbounds %union.anon, ptr %272, i32 0, i32 0
  %274 = getelementptr inbounds { double, double }, ptr %273, i32 0, i32 0
  %275 = extractvalue { double, double } %271, 0
  store double %275, ptr %274, align 16
  %276 = getelementptr inbounds { double, double }, ptr %273, i32 0, i32 1
  %277 = extractvalue { double, double } %271, 1
  store double %277, ptr %276, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %26, ptr align 16 %32, i64 16, i1 false), !tbaa.struct !21
  call void @llvm.lifetime.end.p0(i64 16, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #7
  br label %278

278:                                              ; preds = %239, %215
  %279 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 12
  %280 = load i32, ptr %279, align 4, !tbaa !23
  switch i32 %280, label %411 [
    i32 0, label %281
    i32 1, label %331
    i32 2, label %361
  ]

281:                                              ; preds = %278
  %282 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 9
  %283 = load float, ptr %282, align 16, !tbaa !39
  %284 = fcmp ogt float %283, 0.000000e+00
  br i1 %284, label %285, label %311

285:                                              ; preds = %281
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #7
  store i32 1, ptr %34, align 4, !tbaa !40
  br label %286

286:                                              ; preds = %307, %285
  %287 = load i32, ptr %34, align 4, !tbaa !40
  %288 = icmp slt i32 %287, 3
  br i1 %288, label %290, label %289

289:                                              ; preds = %286
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #7
  br label %310

290:                                              ; preds = %286
  %291 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 19
  %292 = load i32, ptr %34, align 4, !tbaa !40
  %293 = sext i32 %292 to i64
  %294 = getelementptr inbounds [3 x %"class.JPH::AngleConstraintPart"], ptr %291, i64 0, i64 %293
  %295 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %52, i32 0, i32 1
  %296 = load ptr, ptr %295, align 16, !tbaa !11
  %297 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %52, i32 0, i32 2
  %298 = load ptr, ptr %297, align 8, !tbaa !20
  %299 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 16
  %300 = load i32, ptr %34, align 4, !tbaa !40
  %301 = sext i32 %300 to i64
  %302 = getelementptr inbounds [3 x %"class.JPH::Vec3"], ptr %299, i64 0, i64 %301
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %35, ptr align 16 %302, i64 16, i1 false), !tbaa.struct !21
  %303 = getelementptr inbounds { double, double }, ptr %35, i32 0, i32 0
  %304 = load double, ptr %303, align 16
  %305 = getelementptr inbounds { double, double }, ptr %35, i32 0, i32 1
  %306 = load double, ptr %305, align 8
  call void @_ZN3JPH19AngleConstraintPart29CalculateConstraintPropertiesERKNS_4BodyES3_NS_4Vec3Ef(ptr noundef nonnull align 16 dereferenceable(48) %294, ptr noundef nonnull align 16 dereferenceable(122) %296, ptr noundef nonnull align 16 dereferenceable(122) %298, double %304, double %306, float noundef 0.000000e+00)
  br label %307

307:                                              ; preds = %290
  %308 = load i32, ptr %34, align 4, !tbaa !40
  %309 = add nsw i32 %308, 1
  store i32 %309, ptr %34, align 4, !tbaa !40
  br label %286, !llvm.loop !43

310:                                              ; preds = %289
  br label %330

311:                                              ; preds = %281
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #7
  %312 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 19
  store ptr %312, ptr %36, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #7
  %313 = load ptr, ptr %36, align 8, !tbaa !5
  %314 = getelementptr inbounds [3 x %"class.JPH::AngleConstraintPart"], ptr %313, i64 0, i64 0
  store ptr %314, ptr %37, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #7
  %315 = load ptr, ptr %36, align 8, !tbaa !5
  %316 = getelementptr inbounds [3 x %"class.JPH::AngleConstraintPart"], ptr %315, i64 0, i64 0
  %317 = getelementptr inbounds %"class.JPH::AngleConstraintPart", ptr %316, i64 3
  store ptr %317, ptr %38, align 8, !tbaa !5
  br label %318

318:                                              ; preds = %326, %311
  %319 = load ptr, ptr %37, align 8, !tbaa !5
  %320 = load ptr, ptr %38, align 8, !tbaa !5
  %321 = icmp ne ptr %319, %320
  br i1 %321, label %323, label %322

322:                                              ; preds = %318
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #7
  br label %329

323:                                              ; preds = %318
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #7
  %324 = load ptr, ptr %37, align 8, !tbaa !5
  store ptr %324, ptr %39, align 8, !tbaa !5
  %325 = load ptr, ptr %39, align 8, !tbaa !5
  call void @_ZN3JPH19AngleConstraintPart10DeactivateEv(ptr noundef nonnull align 16 dereferenceable(48) %325)
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #7
  br label %326

326:                                              ; preds = %323
  %327 = load ptr, ptr %37, align 8, !tbaa !5
  %328 = getelementptr inbounds %"class.JPH::AngleConstraintPart", ptr %327, i32 1
  store ptr %328, ptr %37, align 8, !tbaa !5
  br label %318

329:                                              ; preds = %322
  br label %330

330:                                              ; preds = %329, %310
  br label %411

331:                                              ; preds = %278
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #7
  store i32 1, ptr %40, align 4, !tbaa !40
  br label %332

332:                                              ; preds = %357, %331
  %333 = load i32, ptr %40, align 4, !tbaa !40
  %334 = icmp slt i32 %333, 3
  br i1 %334, label %336, label %335

335:                                              ; preds = %332
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #7
  br label %360

336:                                              ; preds = %332
  %337 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 19
  %338 = load i32, ptr %40, align 4, !tbaa !40
  %339 = sext i32 %338 to i64
  %340 = getelementptr inbounds [3 x %"class.JPH::AngleConstraintPart"], ptr %337, i64 0, i64 %339
  %341 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %52, i32 0, i32 1
  %342 = load ptr, ptr %341, align 16, !tbaa !11
  %343 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %52, i32 0, i32 2
  %344 = load ptr, ptr %343, align 8, !tbaa !20
  %345 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 16
  %346 = load i32, ptr %40, align 4, !tbaa !40
  %347 = sext i32 %346 to i64
  %348 = getelementptr inbounds [3 x %"class.JPH::Vec3"], ptr %345, i64 0, i64 %347
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %41, ptr align 16 %348, i64 16, i1 false), !tbaa.struct !21
  %349 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 14
  %350 = load i32, ptr %40, align 4, !tbaa !40
  %351 = call noundef float @_ZNK3JPH4Vec3ixEj(ptr noundef nonnull align 16 dereferenceable(16) %349, i32 noundef %350)
  %352 = fneg float %351
  %353 = getelementptr inbounds { double, double }, ptr %41, i32 0, i32 0
  %354 = load double, ptr %353, align 16
  %355 = getelementptr inbounds { double, double }, ptr %41, i32 0, i32 1
  %356 = load double, ptr %355, align 8
  call void @_ZN3JPH19AngleConstraintPart29CalculateConstraintPropertiesERKNS_4BodyES3_NS_4Vec3Ef(ptr noundef nonnull align 16 dereferenceable(48) %340, ptr noundef nonnull align 16 dereferenceable(122) %342, ptr noundef nonnull align 16 dereferenceable(122) %344, double %354, double %356, float noundef %352)
  br label %357

357:                                              ; preds = %336
  %358 = load i32, ptr %40, align 4, !tbaa !40
  %359 = add nsw i32 %358, 1
  store i32 %359, ptr %40, align 4, !tbaa !40
  br label %332, !llvm.loop !44

360:                                              ; preds = %335
  br label %411

361:                                              ; preds = %278
  %362 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 10
  %363 = getelementptr inbounds %"class.JPH::MotorSettings", ptr %362, i32 0, i32 0
  %364 = call noundef zeroext i1 @_ZNK3JPH14SpringSettings12HasStiffnessEv(ptr noundef nonnull align 4 dereferenceable(12) %363)
  br i1 %364, label %365, label %396

365:                                              ; preds = %361
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #7
  store i32 1, ptr %42, align 4, !tbaa !40
  br label %366

366:                                              ; preds = %392, %365
  %367 = load i32, ptr %42, align 4, !tbaa !40
  %368 = icmp slt i32 %367, 3
  br i1 %368, label %370, label %369

369:                                              ; preds = %366
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #7
  br label %395

370:                                              ; preds = %366
  %371 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 19
  %372 = load i32, ptr %42, align 4, !tbaa !40
  %373 = sext i32 %372 to i64
  %374 = getelementptr inbounds [3 x %"class.JPH::AngleConstraintPart"], ptr %371, i64 0, i64 %373
  %375 = load float, ptr %4, align 4, !tbaa !9
  %376 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %52, i32 0, i32 1
  %377 = load ptr, ptr %376, align 16, !tbaa !11
  %378 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %52, i32 0, i32 2
  %379 = load ptr, ptr %378, align 8, !tbaa !20
  %380 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 16
  %381 = load i32, ptr %42, align 4, !tbaa !40
  %382 = sext i32 %381 to i64
  %383 = getelementptr inbounds [3 x %"class.JPH::Vec3"], ptr %380, i64 0, i64 %382
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %43, ptr align 16 %383, i64 16, i1 false), !tbaa.struct !21
  %384 = load i32, ptr %42, align 4, !tbaa !40
  %385 = call noundef float @_ZNK3JPH4Vec3ixEj(ptr noundef nonnull align 16 dereferenceable(16) %26, i32 noundef %384)
  %386 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 10
  %387 = getelementptr inbounds %"class.JPH::MotorSettings", ptr %386, i32 0, i32 0
  %388 = getelementptr inbounds { double, double }, ptr %43, i32 0, i32 0
  %389 = load double, ptr %388, align 16
  %390 = getelementptr inbounds { double, double }, ptr %43, i32 0, i32 1
  %391 = load double, ptr %390, align 8
  call void @_ZN3JPH19AngleConstraintPart41CalculateConstraintPropertiesWithSettingsEfRKNS_4BodyES3_NS_4Vec3EffRKNS_14SpringSettingsE(ptr noundef nonnull align 16 dereferenceable(48) %374, float noundef %375, ptr noundef nonnull align 16 dereferenceable(122) %377, ptr noundef nonnull align 16 dereferenceable(122) %379, double %389, double %391, float noundef 0.000000e+00, float noundef %385, ptr noundef nonnull align 4 dereferenceable(12) %387)
  br label %392

392:                                              ; preds = %370
  %393 = load i32, ptr %42, align 4, !tbaa !40
  %394 = add nsw i32 %393, 1
  store i32 %394, ptr %42, align 4, !tbaa !40
  br label %366, !llvm.loop !45

395:                                              ; preds = %369
  br label %410

396:                                              ; preds = %361
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #7
  store i32 1, ptr %44, align 4, !tbaa !40
  br label %397

397:                                              ; preds = %406, %396
  %398 = load i32, ptr %44, align 4, !tbaa !40
  %399 = icmp slt i32 %398, 3
  br i1 %399, label %401, label %400

400:                                              ; preds = %397
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #7
  br label %409

401:                                              ; preds = %397
  %402 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 19
  %403 = load i32, ptr %44, align 4, !tbaa !40
  %404 = sext i32 %403 to i64
  %405 = getelementptr inbounds [3 x %"class.JPH::AngleConstraintPart"], ptr %402, i64 0, i64 %404
  call void @_ZN3JPH19AngleConstraintPart10DeactivateEv(ptr noundef nonnull align 16 dereferenceable(48) %405)
  br label %406

406:                                              ; preds = %401
  %407 = load i32, ptr %44, align 4, !tbaa !40
  %408 = add nsw i32 %407, 1
  store i32 %408, ptr %44, align 4, !tbaa !40
  br label %397, !llvm.loop !46

409:                                              ; preds = %400
  br label %410

410:                                              ; preds = %409, %395
  br label %411

411:                                              ; preds = %410, %360, %330, %278
  %412 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 13
  %413 = load i32, ptr %412, align 16, !tbaa !38
  switch i32 %413, label %476 [
    i32 0, label %414
    i32 1, label %435
    i32 2, label %451
  ]

414:                                              ; preds = %411
  %415 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 9
  %416 = load float, ptr %415, align 16, !tbaa !39
  %417 = fcmp ogt float %416, 0.000000e+00
  br i1 %417, label %418, label %431

418:                                              ; preds = %414
  %419 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 19
  %420 = getelementptr inbounds [3 x %"class.JPH::AngleConstraintPart"], ptr %419, i64 0, i64 0
  %421 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %52, i32 0, i32 1
  %422 = load ptr, ptr %421, align 16, !tbaa !11
  %423 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %52, i32 0, i32 2
  %424 = load ptr, ptr %423, align 8, !tbaa !20
  %425 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 16
  %426 = getelementptr inbounds [3 x %"class.JPH::Vec3"], ptr %425, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %45, ptr align 16 %426, i64 16, i1 false), !tbaa.struct !21
  %427 = getelementptr inbounds { double, double }, ptr %45, i32 0, i32 0
  %428 = load double, ptr %427, align 16
  %429 = getelementptr inbounds { double, double }, ptr %45, i32 0, i32 1
  %430 = load double, ptr %429, align 8
  call void @_ZN3JPH19AngleConstraintPart29CalculateConstraintPropertiesERKNS_4BodyES3_NS_4Vec3Ef(ptr noundef nonnull align 16 dereferenceable(48) %420, ptr noundef nonnull align 16 dereferenceable(122) %422, ptr noundef nonnull align 16 dereferenceable(122) %424, double %428, double %430, float noundef 0.000000e+00)
  br label %434

431:                                              ; preds = %414
  %432 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 19
  %433 = getelementptr inbounds [3 x %"class.JPH::AngleConstraintPart"], ptr %432, i64 0, i64 0
  call void @_ZN3JPH19AngleConstraintPart10DeactivateEv(ptr noundef nonnull align 16 dereferenceable(48) %433)
  br label %434

434:                                              ; preds = %431, %418
  br label %476

435:                                              ; preds = %411
  %436 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 19
  %437 = getelementptr inbounds [3 x %"class.JPH::AngleConstraintPart"], ptr %436, i64 0, i64 0
  %438 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %52, i32 0, i32 1
  %439 = load ptr, ptr %438, align 16, !tbaa !11
  %440 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %52, i32 0, i32 2
  %441 = load ptr, ptr %440, align 8, !tbaa !20
  %442 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 16
  %443 = getelementptr inbounds [3 x %"class.JPH::Vec3"], ptr %442, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %46, ptr align 16 %443, i64 16, i1 false), !tbaa.struct !21
  %444 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 14
  %445 = call noundef float @_ZNK3JPH4Vec3ixEj(ptr noundef nonnull align 16 dereferenceable(16) %444, i32 noundef 0)
  %446 = fneg float %445
  %447 = getelementptr inbounds { double, double }, ptr %46, i32 0, i32 0
  %448 = load double, ptr %447, align 16
  %449 = getelementptr inbounds { double, double }, ptr %46, i32 0, i32 1
  %450 = load double, ptr %449, align 8
  call void @_ZN3JPH19AngleConstraintPart29CalculateConstraintPropertiesERKNS_4BodyES3_NS_4Vec3Ef(ptr noundef nonnull align 16 dereferenceable(48) %437, ptr noundef nonnull align 16 dereferenceable(122) %439, ptr noundef nonnull align 16 dereferenceable(122) %441, double %448, double %450, float noundef %446)
  br label %476

451:                                              ; preds = %411
  %452 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 11
  %453 = getelementptr inbounds %"class.JPH::MotorSettings", ptr %452, i32 0, i32 0
  %454 = call noundef zeroext i1 @_ZNK3JPH14SpringSettings12HasStiffnessEv(ptr noundef nonnull align 4 dereferenceable(12) %453)
  br i1 %454, label %455, label %472

455:                                              ; preds = %451
  %456 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 19
  %457 = getelementptr inbounds [3 x %"class.JPH::AngleConstraintPart"], ptr %456, i64 0, i64 0
  %458 = load float, ptr %4, align 4, !tbaa !9
  %459 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %52, i32 0, i32 1
  %460 = load ptr, ptr %459, align 16, !tbaa !11
  %461 = getelementptr inbounds %"class.JPH::TwoBodyConstraint", ptr %52, i32 0, i32 2
  %462 = load ptr, ptr %461, align 8, !tbaa !20
  %463 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 16
  %464 = getelementptr inbounds [3 x %"class.JPH::Vec3"], ptr %463, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %47, ptr align 16 %464, i64 16, i1 false), !tbaa.struct !21
  %465 = call noundef float @_ZNK3JPH4Vec3ixEj(ptr noundef nonnull align 16 dereferenceable(16) %26, i32 noundef 0)
  %466 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 11
  %467 = getelementptr inbounds %"class.JPH::MotorSettings", ptr %466, i32 0, i32 0
  %468 = getelementptr inbounds { double, double }, ptr %47, i32 0, i32 0
  %469 = load double, ptr %468, align 16
  %470 = getelementptr inbounds { double, double }, ptr %47, i32 0, i32 1
  %471 = load double, ptr %470, align 8
  call void @_ZN3JPH19AngleConstraintPart41CalculateConstraintPropertiesWithSettingsEfRKNS_4BodyES3_NS_4Vec3EffRKNS_14SpringSettingsE(ptr noundef nonnull align 16 dereferenceable(48) %457, float noundef %458, ptr noundef nonnull align 16 dereferenceable(122) %460, ptr noundef nonnull align 16 dereferenceable(122) %462, double %469, double %471, float noundef 0.000000e+00, float noundef %465, ptr noundef nonnull align 4 dereferenceable(12) %467)
  br label %475

472:                                              ; preds = %451
  %473 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 19
  %474 = getelementptr inbounds [3 x %"class.JPH::AngleConstraintPart"], ptr %473, i64 0, i64 0
  call void @_ZN3JPH19AngleConstraintPart10DeactivateEv(ptr noundef nonnull align 16 dereferenceable(48) %474)
  br label %475

475:                                              ; preds = %472, %455
  br label %476

476:                                              ; preds = %475, %435, %434, %411
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %22) #7
  br label %496

477:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 8, ptr %48) #7
  %478 = getelementptr inbounds %"class.JPH::SwingTwistConstraint", ptr %52, i32 0, i32 19
  store ptr %478, ptr %48, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %49) #7
  %479 = load ptr, ptr %48, align 8, !tbaa !5
  %480 = getelementptr inbounds [3 x %"class.JPH::AngleConstraintPart"], ptr %479, i64 0, i64 0
  store ptr %480, ptr %49, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %50) #7
  %481 = load ptr, ptr %48, align 8, !tbaa !5
  %482 = getelementptr inbounds [3 x %"class.JPH::AngleConstraintPart"], ptr %481, i64 0, i64 0
  %483 = getelementptr inbounds %"class.JPH::AngleConstraintPart", ptr %482, i64 3
  store ptr %483, ptr %50, align 8, !tbaa !5
  br label %484

484:                                              ; preds = %492, %477
  %485 = load ptr, ptr %49, align 8, !tbaa !5
  %486 = load ptr, ptr %50, align 8, !tbaa !5
  %487 = icmp ne ptr %485, %486
  br i1 %487, label %489, label %488

488:                                              ; preds = %484
  call void @llvm.lifetime.end.p0(i64 8, ptr %50) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #7
  br label %495

489:                                              ; preds = %484
  call void @llvm.lifetime.start.p0(i64 8, ptr %51) #7
  %490 = load ptr, ptr %49, align 8, !tbaa !5
  store ptr %490, ptr %51, align 8, !tbaa !5
  %491 = load ptr, ptr %51, align 8, !tbaa !5
  call void @_ZN3JPH19AngleConstraintPart10DeactivateEv(ptr noundef nonnull align 16 dereferenceable(48) %491)
  call void @llvm.lifetime.end.p0(i64 8, ptr %51) #7
  br label %492

492:                                              ; preds = %489
  %493 = load ptr, ptr %49, align 8, !tbaa !5
  %494 = getelementptr inbounds %"class.JPH::AngleConstraintPart", ptr %493, i32 1
  store ptr %494, ptr %49, align 8, !tbaa !5
  br label %484

495:                                              ; preds = %488
  br label %496

496:                                              ; preds = %495, %476
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %5) #7
  ret void
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3JPH5Mat449sRotationENS_4QuatE(ptr dead_on_unwind noalias writable sret(%"class.JPH::Mat44") align 16, double, double) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH19PointConstraintPart29CalculateConstraintPropertiesERKNS_4BodyERKNS_5Mat44ENS_4Vec3ES3_S6_S7_(ptr noundef nonnull align 16 dereferenceable(240), ptr noundef nonnull align 16 dereferenceable(122), ptr noundef nonnull align 16 dereferenceable(64), double, double, ptr noundef nonnull align 16 dereferenceable(122), ptr noundef nonnull align 16 dereferenceable(64), double, double) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH24SwingTwistConstraintPart29CalculateConstraintPropertiesERKNS_4BodyES3_NS_4QuatES4_(ptr noundef nonnull align 16 dereferenceable(272), ptr noundef nonnull align 16 dereferenceable(122), ptr noundef nonnull align 16 dereferenceable(122), double, double, double, double) #2 align 2

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef float @_ZNK3JPH4Quat3DotES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) #3 align 2

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef, double, double) #6

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH19AngleConstraintPart29CalculateConstraintPropertiesERKNS_4BodyES3_NS_4Vec3Ef(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) #2 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef float @_ZNK3JPH4Vec3ixEj(ptr noundef nonnull align 16 dereferenceable(16), i32 noundef) #3 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH19AngleConstraintPart41CalculateConstraintPropertiesWithSettingsEfRKNS_4BodyES3_NS_4Vec3EffRKNS_14SpringSettingsE(ptr noundef nonnull align 16 dereferenceable(48), float noundef, ptr noundef nonnull align 16 dereferenceable(122), ptr noundef nonnull align 16 dereferenceable(122), double, double, float noundef, float noundef, ptr noundef nonnull align 4 dereferenceable(12)) #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 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { 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 #6 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 = !{!24, !31, i64 188}
!24 = !{!"_ZTSN3JPH20SwingTwistConstraintE", !12, i64 0, !25, i64 48, !25, i64 64, !26, i64 80, !26, i64 96, !10, i64 112, !10, i64 116, !10, i64 120, !10, i64 124, !10, i64 128, !28, i64 132, !28, i64 160, !31, i64 188, !31, i64 192, !25, i64 208, !26, i64 224, !7, i64 240, !32, i64 288, !34, i64 528, !7, i64 800}
!25 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!26 = !{!"_ZTSN3JPH4QuatE", !27, i64 0}
!27 = !{!"_ZTSN3JPH4Vec4E", !7, i64 0}
!28 = !{!"_ZTSN3JPH13MotorSettingsE", !29, i64 0, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24}
!29 = !{!"_ZTSN3JPH14SpringSettingsE", !30, i64 0, !7, i64 4, !10, i64 8}
!30 = !{!"_ZTSN3JPH11ESpringModeE", !7, i64 0}
!31 = !{!"_ZTSN3JPH11EMotorStateE", !7, i64 0}
!32 = !{!"_ZTSN3JPH19PointConstraintPartE", !25, i64 0, !25, i64 16, !33, i64 32, !33, i64 96, !33, i64 160, !25, i64 224}
!33 = !{!"_ZTSN3JPH5Mat44E", !7, i64 0}
!34 = !{!"_ZTSN3JPH24SwingTwistConstraintPartE", !7, i64 0, !35, 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, !25, i64 80, !25, i64 96, !25, i64 112, !36, i64 128, !36, i64 176, !36, i64 224}
!35 = !{!"_ZTSN3JPH10ESwingTypeE", !7, i64 0}
!36 = !{!"_ZTSN3JPH19AngleConstraintPartE", !25, i64 0, !25, i64 16, !10, i64 32, !37, i64 36, !10, i64 44}
!37 = !{!"_ZTSN3JPH10SpringPartE", !10, i64 0, !10, i64 4}
!38 = !{!24, !31, i64 192}
!39 = !{!24, !10, i64 128}
!40 = !{!17, !17, i64 0}
!41 = distinct !{!41, !42}
!42 = !{!"llvm.loop.mustprogress"}
!43 = distinct !{!43, !42}
!44 = distinct !{!44, !42}
!45 = distinct !{!45, !42}
!46 = distinct !{!46, !42}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.JPH::Mat44" = type { [4 x %"class.JPH::Vec4"] }
%"class.JPH::Vec4" = type { %union.anon.4 }
%union.anon.4 = type { <4 x float> }
%"class.JPH::Quat" = type { %"class.JPH::Vec4" }
%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH19AngleConstraintPart10DeactivateEv(ptr noundef nonnull align 16 dereferenceable(48)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH20SwingTwistConstraint23SetupVelocityConstraintEf(ptr noundef nonnull align 16 dereferenceable(944) %0, float noundef %1) unnamed_addr #4 align 2 {
  %3 = alloca %"class.JPH::Mat44", align 16
  %4 = alloca %"class.JPH::Mat44", align 16
  %5 = alloca %"class.JPH::Quat", align 16
  %6 = alloca %"class.JPH::Quat", align 16
  %7 = alloca %"class.JPH::Quat", align 16
  %8 = alloca %"class.JPH::Quat", align 16
  %9 = alloca %"class.JPH::Quat", align 16
  %10 = alloca %"class.JPH::Mat44", align 16
  %11 = alloca %"class.JPH::Vec3", align 16
  %12 = alloca %"class.JPH::Quat", align 16
  %13 = alloca %"class.JPH::Quat", align 16
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %3) #6
  %14 = getelementptr inbounds i8, ptr %0, i64 32
  %15 = load ptr, ptr %14, align 16, !tbaa !5
  %16 = tail call { double, double } @_ZNK3JPH4Body11GetRotationEv(ptr noundef nonnull align 16 dereferenceable(122) %15)
  %17 = extractvalue { double, double } %16, 0
  %18 = extractvalue { double, double } %16, 1
  call void @_ZN3JPH5Mat449sRotationENS_4QuatE(ptr dead_on_unwind nonnull writable sret(%"class.JPH::Mat44") align 16 %3, double %17, double %18)
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %4) #6
  %19 = getelementptr inbounds i8, ptr %0, i64 40
  %20 = load ptr, ptr %19, align 8, !tbaa !17
  %21 = call { double, double } @_ZNK3JPH4Body11GetRotationEv(ptr noundef nonnull align 16 dereferenceable(122) %20)
  %22 = extractvalue { double, double } %21, 0
  %23 = extractvalue { double, double } %21, 1
  call void @_ZN3JPH5Mat449sRotationENS_4QuatE(ptr dead_on_unwind nonnull writable sret(%"class.JPH::Mat44") align 16 %4, double %22, double %23)
  %24 = getelementptr inbounds i8, ptr %0, i64 288
  %25 = load ptr, ptr %14, align 16, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %0, i64 48
  %.sroa.070.0.copyload = load double, ptr %26, align 16
  %.sroa.271.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 56
  %.sroa.271.0.copyload = load double, ptr %.sroa.271.0..sroa_idx, align 8, !tbaa !18
  %27 = load ptr, ptr %19, align 8, !tbaa !17
  %28 = getelementptr inbounds i8, ptr %0, i64 64
  %.sroa.068.0.copyload = load double, ptr %28, align 16
  %.sroa.269.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 72
  %.sroa.269.0.copyload = load double, ptr %.sroa.269.0..sroa_idx, align 8, !tbaa !18
  call void @_ZN3JPH19PointConstraintPart29CalculateConstraintPropertiesERKNS_4BodyERKNS_5Mat44ENS_4Vec3ES3_S6_S7_(ptr noundef nonnull align 16 dereferenceable(240) %24, ptr noundef nonnull align 16 dereferenceable(122) %25, ptr noundef nonnull align 16 dereferenceable(64) %3, double %.sroa.070.0.copyload, double %.sroa.271.0.copyload, ptr noundef nonnull align 16 dereferenceable(122) %27, ptr noundef nonnull align 16 dereferenceable(64) %4, double %.sroa.068.0.copyload, double %.sroa.269.0.copyload)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #6
  %29 = load ptr, ptr %14, align 16, !tbaa !5
  %30 = call { double, double } @_ZNK3JPH4Body11GetRotationEv(ptr noundef nonnull align 16 dereferenceable(122) %29)
  %31 = extractvalue { double, double } %30, 0
  store double %31, ptr %6, align 16
  %32 = getelementptr inbounds i8, ptr %6, i64 8
  %33 = extractvalue { double, double } %30, 1
  store double %33, ptr %32, align 8
  %34 = getelementptr inbounds i8, ptr %0, i64 80
  %.sroa.066.0.copyload = load double, ptr %34, align 16
  %.sroa.267.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 88
  %.sroa.267.0.copyload = load double, ptr %.sroa.267.0..sroa_idx, align 8, !tbaa !18
  %35 = call { double, double } @_ZNK3JPH4QuatmlES0_(ptr noundef nonnull align 16 dereferenceable(16) %6, double %.sroa.066.0.copyload, double %.sroa.267.0.copyload)
  %36 = extractvalue { double, double } %35, 0
  store double %36, ptr %5, align 16
  %37 = getelementptr inbounds i8, ptr %5, i64 8
  %38 = extractvalue { double, double } %35, 1
  store double %38, ptr %37, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  %39 = load ptr, ptr %19, align 8, !tbaa !17
  %40 = call { double, double } @_ZNK3JPH4Body11GetRotationEv(ptr noundef nonnull align 16 dereferenceable(122) %39)
  %41 = extractvalue { double, double } %40, 0
  store double %41, ptr %7, align 16
  %42 = getelementptr inbounds i8, ptr %7, i64 8
  %43 = extractvalue { double, double } %40, 1
  store double %43, ptr %42, align 8
  %44 = getelementptr inbounds i8, ptr %0, i64 96
  %.sroa.062.0.copyload = load double, ptr %44, align 16
  %.sroa.263.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 104
  %.sroa.263.0.copyload = load double, ptr %.sroa.263.0..sroa_idx, align 8, !tbaa !18
  %45 = call { double, double } @_ZNK3JPH4QuatmlES0_(ptr noundef nonnull align 16 dereferenceable(16) %7, double %.sroa.062.0.copyload, double %.sroa.263.0.copyload)
  %46 = extractvalue { double, double } %45, 0
  %47 = extractvalue { double, double } %45, 1
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #6
  %48 = call { double, double } @_ZNK3JPH4Quat10ConjugatedEv(ptr noundef nonnull align 16 dereferenceable(16) %5)
  %49 = extractvalue { double, double } %48, 0
  store double %49, ptr %9, align 16
  %50 = getelementptr inbounds i8, ptr %9, i64 8
  %51 = extractvalue { double, double } %48, 1
  store double %51, ptr %50, align 8
  %52 = call { double, double } @_ZNK3JPH4QuatmlES0_(ptr noundef nonnull align 16 dereferenceable(16) %9, double %46, double %47)
  %53 = extractvalue { double, double } %52, 0
  store double %53, ptr %8, align 16
  %54 = getelementptr inbounds i8, ptr %8, i64 8
  %55 = extractvalue { double, double } %52, 1
  store double %55, ptr %54, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  %56 = getelementptr inbounds i8, ptr %0, i64 528
  %57 = load ptr, ptr %14, align 16, !tbaa !5
  %58 = load ptr, ptr %19, align 8, !tbaa !17
  %.sroa.056.0.copyload = load double, ptr %5, align 16
  %.sroa.257.0.copyload = load double, ptr %37, align 8, !tbaa !18
  call void @_ZN3JPH24SwingTwistConstraintPart29CalculateConstraintPropertiesERKNS_4BodyES3_NS_4QuatES4_(ptr noundef nonnull align 16 dereferenceable(272) %56, ptr noundef nonnull align 16 dereferenceable(122) %57, ptr noundef nonnull align 16 dereferenceable(122) %58, double %53, double %55, double %.sroa.056.0.copyload, double %.sroa.257.0.copyload)
  %59 = getelementptr inbounds i8, ptr %0, i64 188
  %60 = load i32, ptr %59, align 4, !tbaa !19
  %.not = icmp ne i32 %60, 0
  %61 = getelementptr inbounds i8, ptr %0, i64 192
  %62 = load i32, ptr %61, align 16
  %.not85 = icmp ne i32 %62, 0
  %or.cond.not97 = select i1 %.not, i1 true, i1 %.not85
  %63 = getelementptr inbounds i8, ptr %0, i64 128
  %64 = load float, ptr %63, align 16
  %65 = fcmp ogt float %64, 0.000000e+00
  %or.cond93 = select i1 %or.cond.not97, i1 true, i1 %65
  br i1 %or.cond93, label %66, label %.preheader106.preheader

.preheader106.preheader:                          ; preds = %2
  %.079.ptr = getelementptr inbounds i8, ptr %0, i64 800
  call void @_ZN3JPH19AngleConstraintPart10DeactivateEv(ptr noundef nonnull align 16 dereferenceable(48) %.079.ptr)
  %.079.ptr.1 = getelementptr inbounds i8, ptr %0, i64 848
  call void @_ZN3JPH19AngleConstraintPart10DeactivateEv(ptr noundef nonnull align 16 dereferenceable(48) %.079.ptr.1)
  %.079.ptr.2 = getelementptr inbounds i8, ptr %0, i64 896
  call void @_ZN3JPH19AngleConstraintPart10DeactivateEv(ptr noundef nonnull align 16 dereferenceable(48) %.079.ptr.2)
  br label %.loopexit107

66:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %10) #6
  call void @_ZN3JPH5Mat449sRotationENS_4QuatE(ptr dead_on_unwind nonnull writable sret(%"class.JPH::Mat44") align 16 %10, double %46, double %47)
  %67 = getelementptr inbounds i8, ptr %0, i64 240
  %68 = call { double, double } @_ZNK3JPH5Mat4410GetColumn3Ej(ptr noundef nonnull align 16 dereferenceable(64) %10, i32 noundef 0)
  %69 = extractvalue { double, double } %68, 0
  %70 = extractvalue { double, double } %68, 1
  store double %69, ptr %67, align 16
  %.sroa.449.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 248
  store double %70, ptr %.sroa.449.0..sroa_idx, align 8, !tbaa !18
  %71 = call { double, double } @_ZNK3JPH5Mat4410GetColumn3Ej(ptr noundef nonnull align 16 dereferenceable(64) %10, i32 noundef 1)
  %72 = extractvalue { double, double } %71, 0
  %73 = extractvalue { double, double } %71, 1
  %74 = getelementptr inbounds i8, ptr %0, i64 256
  store double %72, ptr %74, align 16
  %.sroa.449.0..sroa_idx.1 = getelementptr inbounds i8, ptr %0, i64 264
  store double %73, ptr %.sroa.449.0..sroa_idx.1, align 8, !tbaa !18
  %75 = call { double, double } @_ZNK3JPH5Mat4410GetColumn3Ej(ptr noundef nonnull align 16 dereferenceable(64) %10, i32 noundef 2)
  %76 = extractvalue { double, double } %75, 0
  %77 = extractvalue { double, double } %75, 1
  %78 = getelementptr inbounds i8, ptr %0, i64 272
  store double %76, ptr %78, align 16
  %.sroa.449.0..sroa_idx.2 = getelementptr inbounds i8, ptr %0, i64 280
  store double %77, ptr %.sroa.449.0..sroa_idx.2, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #6
  %79 = load i32, ptr %59, align 4, !tbaa !19
  %80 = icmp eq i32 %79, 2
  %81 = load i32, ptr %61, align 16
  %82 = icmp eq i32 %81, 2
  %or.cond96 = select i1 %80, i1 true, i1 %82
  br i1 %or.cond96, label %83, label %107

83:                                               ; preds = %66
  %84 = getelementptr inbounds i8, ptr %0, i64 224
  %.sroa.045.0.copyload = load double, ptr %84, align 16
  %.sroa.246.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 232
  %.sroa.246.0.copyload = load double, ptr %.sroa.246.0..sroa_idx, align 8, !tbaa !18
  %85 = call noundef float @_ZNK3JPH4Quat3DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %8, double %.sroa.045.0.copyload, double %.sroa.246.0.copyload)
  %86 = fcmp ogt float %85, 0.000000e+00
  br i1 %86, label %87, label %88

87:                                               ; preds = %83
  %.sroa.047.0.copyload = load double, ptr %84, align 16
  %.sroa.5.0.copyload = load double, ptr %.sroa.246.0..sroa_idx, align 8, !tbaa !18
  br label %92

88:                                               ; preds = %83
  %89 = call { double, double } @_ZNK3JPH4QuatngEv(ptr noundef nonnull align 16 dereferenceable(16) %84)
  %90 = extractvalue { double, double } %89, 0
  %91 = extractvalue { double, double } %89, 1
  br label %92

92:                                               ; preds = %88, %87
  %.sroa.047.0 = phi double [ %.sroa.047.0.copyload, %87 ], [ %90, %88 ]
  %.sroa.5.0 = phi double [ %.sroa.5.0.copyload, %87 ], [ %91, %88 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #6
  %93 = call { double, double } @_ZNK3JPH4Quat10ConjugatedEv(ptr noundef nonnull align 16 dereferenceable(16) %8)
  %94 = extractvalue { double, double } %93, 0
  store double %94, ptr %13, align 16
  %95 = getelementptr inbounds i8, ptr %13, i64 8
  %96 = extractvalue { double, double } %93, 1
  store double %96, ptr %95, align 8
  %97 = call { double, double } @_ZNK3JPH4QuatmlES0_(ptr noundef nonnull align 16 dereferenceable(16) %13, double %.sroa.047.0, double %.sroa.5.0)
  %98 = extractvalue { double, double } %97, 0
  store double %98, ptr %12, align 16
  %99 = getelementptr inbounds i8, ptr %12, i64 8
  %100 = extractvalue { double, double } %97, 1
  store double %100, ptr %99, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #6
  %101 = call { double, double } @_ZNK3JPH4Quat6GetXYZEv(ptr noundef nonnull align 16 dereferenceable(16) %12)
  %102 = extractvalue { double, double } %101, 0
  %103 = extractvalue { double, double } %101, 1
  %104 = call { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef -2.000000e+00, double %102, double %103)
  %105 = extractvalue { double, double } %104, 0
  %106 = extractvalue { double, double } %104, 1
  store double %105, ptr %11, align 16
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %11, i64 8
  store double %106, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #6
  %.pr = load i32, ptr %59, align 4, !tbaa !19
  br label %107

107:                                              ; preds = %66, %92
  %108 = phi i32 [ %79, %66 ], [ %.pr, %92 ]
  switch i32 %108, label %.loopexit [
    i32 0, label %120
    i32 1, label %.preheader100
    i32 2, label %129
  ]

.preheader100:                                    ; preds = %107
  %109 = getelementptr inbounds i8, ptr %0, i64 208
  %110 = getelementptr inbounds i8, ptr %0, i64 848
  %111 = load ptr, ptr %14, align 16, !tbaa !5
  %112 = load ptr, ptr %19, align 8, !tbaa !17
  %.sroa.020.0.copyload = load double, ptr %74, align 16
  %.sroa.221.0.copyload = load double, ptr %.sroa.449.0..sroa_idx.1, align 8, !tbaa !18
  %113 = call noundef float @_ZNK3JPH4Vec3ixEj(ptr noundef nonnull align 16 dereferenceable(16) %109, i32 noundef 1)
  %114 = fneg float %113
  call void @_ZN3JPH19AngleConstraintPart29CalculateConstraintPropertiesERKNS_4BodyES3_NS_4Vec3Ef(ptr noundef nonnull align 16 dereferenceable(48) %110, ptr noundef nonnull align 16 dereferenceable(122) %111, ptr noundef nonnull align 16 dereferenceable(122) %112, double %.sroa.020.0.copyload, double %.sroa.221.0.copyload, float noundef %114)
  %115 = getelementptr inbounds i8, ptr %0, i64 896
  %116 = load ptr, ptr %14, align 16, !tbaa !5
  %117 = load ptr, ptr %19, align 8, !tbaa !17
  %.sroa.020.0.copyload.1 = load double, ptr %78, align 16
  %.sroa.221.0.copyload.1 = load double, ptr %.sroa.449.0..sroa_idx.2, align 8, !tbaa !18
  %118 = call noundef float @_ZNK3JPH4Vec3ixEj(ptr noundef nonnull align 16 dereferenceable(16) %109, i32 noundef 2)
  %119 = fneg float %118
  call void @_ZN3JPH19AngleConstraintPart29CalculateConstraintPropertiesERKNS_4BodyES3_NS_4Vec3Ef(ptr noundef nonnull align 16 dereferenceable(48) %115, ptr noundef nonnull align 16 dereferenceable(122) %116, ptr noundef nonnull align 16 dereferenceable(122) %117, double %.sroa.020.0.copyload.1, double %.sroa.221.0.copyload.1, float noundef %119)
  br label %.loopexit

120:                                              ; preds = %107
  %121 = load float, ptr %63, align 16, !tbaa !35
  %122 = fcmp ogt float %121, 0.000000e+00
  br i1 %122, label %.preheader, label %.preheader98.preheader

.preheader98.preheader:                           ; preds = %120
  %.081.ptr = getelementptr inbounds i8, ptr %0, i64 800
  call void @_ZN3JPH19AngleConstraintPart10DeactivateEv(ptr noundef nonnull align 16 dereferenceable(48) %.081.ptr)
  %.081.ptr.1 = getelementptr inbounds i8, ptr %0, i64 848
  call void @_ZN3JPH19AngleConstraintPart10DeactivateEv(ptr noundef nonnull align 16 dereferenceable(48) %.081.ptr.1)
  %.081.ptr.2 = getelementptr inbounds i8, ptr %0, i64 896
  call void @_ZN3JPH19AngleConstraintPart10DeactivateEv(ptr noundef nonnull align 16 dereferenceable(48) %.081.ptr.2)
  br label %.loopexit

.preheader:                                       ; preds = %120
  %123 = getelementptr inbounds i8, ptr %0, i64 848
  %124 = load ptr, ptr %14, align 16, !tbaa !5
  %125 = load ptr, ptr %19, align 8, !tbaa !17
  %.sroa.034.0.copyload = load double, ptr %74, align 16
  %.sroa.235.0.copyload = load double, ptr %.sroa.449.0..sroa_idx.1, align 8, !tbaa !18
  call void @_ZN3JPH19AngleConstraintPart29CalculateConstraintPropertiesERKNS_4BodyES3_NS_4Vec3Ef(ptr noundef nonnull align 16 dereferenceable(48) %123, ptr noundef nonnull align 16 dereferenceable(122) %124, ptr noundef nonnull align 16 dereferenceable(122) %125, double %.sroa.034.0.copyload, double %.sroa.235.0.copyload, float noundef 0.000000e+00)
  %126 = getelementptr inbounds i8, ptr %0, i64 896
  %127 = load ptr, ptr %14, align 16, !tbaa !5
  %128 = load ptr, ptr %19, align 8, !tbaa !17
  %.sroa.034.0.copyload.1 = load double, ptr %78, align 16
  %.sroa.235.0.copyload.1 = load double, ptr %.sroa.449.0..sroa_idx.2, align 8, !tbaa !18
  call void @_ZN3JPH19AngleConstraintPart29CalculateConstraintPropertiesERKNS_4BodyES3_NS_4Vec3Ef(ptr noundef nonnull align 16 dereferenceable(48) %126, ptr noundef nonnull align 16 dereferenceable(122) %127, ptr noundef nonnull align 16 dereferenceable(122) %128, double %.sroa.034.0.copyload.1, double %.sroa.235.0.copyload.1, float noundef 0.000000e+00)
  br label %.loopexit

129:                                              ; preds = %107
  %130 = getelementptr inbounds i8, ptr %0, i64 132
  %131 = call noundef zeroext i1 @_ZNK3JPH14SpringSettings12HasStiffnessEv(ptr noundef nonnull align 4 dereferenceable(12) %130)
  %132 = getelementptr inbounds i8, ptr %0, i64 848
  br i1 %131, label %.preheader102, label %.preheader104

.preheader104:                                    ; preds = %129
  call void @_ZN3JPH19AngleConstraintPart10DeactivateEv(ptr noundef nonnull align 16 dereferenceable(48) %132)
  %133 = getelementptr inbounds i8, ptr %0, i64 896
  call void @_ZN3JPH19AngleConstraintPart10DeactivateEv(ptr noundef nonnull align 16 dereferenceable(48) %133)
  br label %.loopexit

.preheader102:                                    ; preds = %129
  %134 = load ptr, ptr %14, align 16, !tbaa !5
  %135 = load ptr, ptr %19, align 8, !tbaa !17
  %.sroa.013.0.copyload = load double, ptr %74, align 16
  %.sroa.214.0.copyload = load double, ptr %.sroa.449.0..sroa_idx.1, align 8, !tbaa !18
  %136 = call noundef float @_ZNK3JPH4Vec3ixEj(ptr noundef nonnull align 16 dereferenceable(16) %11, i32 noundef 1)
  call void @_ZN3JPH19AngleConstraintPart41CalculateConstraintPropertiesWithSettingsEfRKNS_4BodyES3_NS_4Vec3EffRKNS_14SpringSettingsE(ptr noundef nonnull align 16 dereferenceable(48) %132, float noundef %1, ptr noundef nonnull align 16 dereferenceable(122) %134, ptr noundef nonnull align 16 dereferenceable(122) %135, double %.sroa.013.0.copyload, double %.sroa.214.0.copyload, float noundef 0.000000e+00, float noundef %136, ptr noundef nonnull align 4 dereferenceable(12) %130)
  %137 = getelementptr inbounds i8, ptr %0, i64 896
  %138 = load ptr, ptr %14, align 16, !tbaa !5
  %139 = load ptr, ptr %19, align 8, !tbaa !17
  %.sroa.013.0.copyload.1 = load double, ptr %78, align 16
  %.sroa.214.0.copyload.1 = load double, ptr %.sroa.449.0..sroa_idx.2, align 8, !tbaa !18
  %140 = call noundef float @_ZNK3JPH4Vec3ixEj(ptr noundef nonnull align 16 dereferenceable(16) %11, i32 noundef 2)
  call void @_ZN3JPH19AngleConstraintPart41CalculateConstraintPropertiesWithSettingsEfRKNS_4BodyES3_NS_4Vec3EffRKNS_14SpringSettingsE(ptr noundef nonnull align 16 dereferenceable(48) %137, float noundef %1, ptr noundef nonnull align 16 dereferenceable(122) %138, ptr noundef nonnull align 16 dereferenceable(122) %139, double %.sroa.013.0.copyload.1, double %.sroa.214.0.copyload.1, float noundef 0.000000e+00, float noundef %140, ptr noundef nonnull align 4 dereferenceable(12) %130)
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader104, %.preheader102, %.preheader100, %.preheader98.preheader, %.preheader, %107
  %141 = load i32, ptr %61, align 16, !tbaa !36
  switch i32 %141, label %166 [
    i32 0, label %142
    i32 1, label %150
    i32 2, label %157
  ]

142:                                              ; preds = %.loopexit
  %143 = load float, ptr %63, align 16, !tbaa !35
  %144 = fcmp ogt float %143, 0.000000e+00
  %145 = getelementptr inbounds i8, ptr %0, i64 800
  br i1 %144, label %146, label %149

146:                                              ; preds = %142
  %147 = load ptr, ptr %14, align 16, !tbaa !5
  %148 = load ptr, ptr %19, align 8, !tbaa !17
  %.sroa.09.0.copyload = load double, ptr %67, align 16
  %.sroa.210.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 248
  %.sroa.210.0.copyload = load double, ptr %.sroa.210.0..sroa_idx, align 8, !tbaa !18
  call void @_ZN3JPH19AngleConstraintPart29CalculateConstraintPropertiesERKNS_4BodyES3_NS_4Vec3Ef(ptr noundef nonnull align 16 dereferenceable(48) %145, ptr noundef nonnull align 16 dereferenceable(122) %147, ptr noundef nonnull align 16 dereferenceable(122) %148, double %.sroa.09.0.copyload, double %.sroa.210.0.copyload, float noundef 0.000000e+00)
  br label %166

149:                                              ; preds = %142
  call void @_ZN3JPH19AngleConstraintPart10DeactivateEv(ptr noundef nonnull align 16 dereferenceable(48) %145)
  br label %166

150:                                              ; preds = %.loopexit
  %151 = getelementptr inbounds i8, ptr %0, i64 800
  %152 = load ptr, ptr %14, align 16, !tbaa !5
  %153 = load ptr, ptr %19, align 8, !tbaa !17
  %.sroa.07.0.copyload = load double, ptr %67, align 16
  %.sroa.28.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 248
  %.sroa.28.0.copyload = load double, ptr %.sroa.28.0..sroa_idx, align 8, !tbaa !18
  %154 = getelementptr inbounds i8, ptr %0, i64 208
  %155 = call noundef float @_ZNK3JPH4Vec3ixEj(ptr noundef nonnull align 16 dereferenceable(16) %154, i32 noundef 0)
  %156 = fneg float %155
  call void @_ZN3JPH19AngleConstraintPart29CalculateConstraintPropertiesERKNS_4BodyES3_NS_4Vec3Ef(ptr noundef nonnull align 16 dereferenceable(48) %151, ptr noundef nonnull align 16 dereferenceable(122) %152, ptr noundef nonnull align 16 dereferenceable(122) %153, double %.sroa.07.0.copyload, double %.sroa.28.0.copyload, float noundef %156)
  br label %166

157:                                              ; preds = %.loopexit
  %158 = getelementptr inbounds i8, ptr %0, i64 160
  %159 = call noundef zeroext i1 @_ZNK3JPH14SpringSettings12HasStiffnessEv(ptr noundef nonnull align 4 dereferenceable(12) %158)
  %160 = getelementptr inbounds i8, ptr %0, i64 800
  br i1 %159, label %161, label %165

161:                                              ; preds = %157
  %162 = load ptr, ptr %14, align 16, !tbaa !5
  %163 = load ptr, ptr %19, align 8, !tbaa !17
  %.sroa.0.0.copyload = load double, ptr %67, align 16
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 248
  %.sroa.2.0.copyload = load double, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !18
  %164 = call noundef float @_ZNK3JPH4Vec3ixEj(ptr noundef nonnull align 16 dereferenceable(16) %11, i32 noundef 0)
  call void @_ZN3JPH19AngleConstraintPart41CalculateConstraintPropertiesWithSettingsEfRKNS_4BodyES3_NS_4Vec3EffRKNS_14SpringSettingsE(ptr noundef nonnull align 16 dereferenceable(48) %160, float noundef %1, ptr noundef nonnull align 16 dereferenceable(122) %162, ptr noundef nonnull align 16 dereferenceable(122) %163, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload, float noundef 0.000000e+00, float noundef %164, ptr noundef nonnull align 4 dereferenceable(12) %158)
  br label %166

165:                                              ; preds = %157
  call void @_ZN3JPH19AngleConstraintPart10DeactivateEv(ptr noundef nonnull align 16 dereferenceable(48) %160)
  br label %166

166:                                              ; preds = %161, %165, %146, %149, %150, %.loopexit
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %10) #6
  br label %.loopexit107

.loopexit107:                                     ; preds = %.preheader106.preheader, %166
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #6
  ret void
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN3JPH5Mat449sRotationENS_4QuatE(ptr dead_on_unwind noalias writable sret(%"class.JPH::Mat44") align 16, double, double) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH19PointConstraintPart29CalculateConstraintPropertiesERKNS_4BodyERKNS_5Mat44ENS_4Vec3ES3_S6_S7_(ptr noundef nonnull align 16 dereferenceable(240), ptr noundef nonnull align 16 dereferenceable(122), ptr noundef nonnull align 16 dereferenceable(64), double, double, ptr noundef nonnull align 16 dereferenceable(122), ptr noundef nonnull align 16 dereferenceable(64), double, double) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH24SwingTwistConstraintPart29CalculateConstraintPropertiesERKNS_4BodyES3_NS_4QuatES4_(ptr noundef nonnull align 16 dereferenceable(272), ptr noundef nonnull align 16 dereferenceable(122), ptr noundef nonnull align 16 dereferenceable(122), double, double, double, double) local_unnamed_addr #1 align 2

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef float @_ZNK3JPH4Quat3DotES0_(ptr noundef nonnull align 16 dereferenceable(16), double, double) local_unnamed_addr #2 align 2

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPHmlEfNS_4Vec3E(float noundef, double, double) local_unnamed_addr #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH19AngleConstraintPart29CalculateConstraintPropertiesERKNS_4BodyES3_NS_4Vec3Ef(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) local_unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef float @_ZNK3JPH4Vec3ixEj(ptr noundef nonnull align 16 dereferenceable(16), i32 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3JPH19AngleConstraintPart41CalculateConstraintPropertiesWithSettingsEfRKNS_4BodyES3_NS_4Vec3EffRKNS_14SpringSettingsE(ptr noundef nonnull align 16 dereferenceable(48), float noundef, ptr noundef nonnull align 16 dereferenceable(122), ptr noundef nonnull align 16 dereferenceable(122), double, double, float noundef, float noundef, ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { alwaysinline mustprogress 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 = { 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, !28, i64 188}
!20 = !{!"_ZTSN3JPH20SwingTwistConstraintE", !6, i64 0, !21, i64 48, !21, i64 64, !22, i64 80, !22, i64 96, !24, i64 112, !24, i64 116, !24, i64 120, !24, i64 124, !24, i64 128, !25, i64 132, !25, i64 160, !28, i64 188, !28, i64 192, !21, i64 208, !22, i64 224, !12, i64 240, !29, i64 288, !31, i64 528, !12, i64 800}
!21 = !{!"_ZTSN3JPH4Vec3E", !12, i64 0}
!22 = !{!"_ZTSN3JPH4QuatE", !23, i64 0}
!23 = !{!"_ZTSN3JPH4Vec4E", !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 = !{!"_ZTSN3JPH19PointConstraintPartE", !21, i64 0, !21, i64 16, !30, i64 32, !30, i64 96, !30, i64 160, !21, i64 224}
!30 = !{!"_ZTSN3JPH5Mat44E", !12, i64 0}
!31 = !{!"_ZTSN3JPH24SwingTwistConstraintPartE", !12, i64 0, !32, i64 1, !24, i64 4, !24, i64 8, !24, i64 12, !24, i64 16, !24, i64 20, !24, i64 24, !24, i64 28, !24, i64 32, !24, i64 36, !24, i64 40, !24, i64 44, !24, i64 48, !24, i64 52, !24, i64 56, !24, i64 60, !24, i64 64, !21, i64 80, !21, i64 96, !21, i64 112, !33, i64 128, !33, i64 176, !33, i64 224}
!32 = !{!"_ZTSN3JPH10ESwingTypeE", !12, i64 0}
!33 = !{!"_ZTSN3JPH19AngleConstraintPartE", !21, i64 0, !21, i64 16, !24, i64 32, !34, i64 36, !24, i64 44}
!34 = !{!"_ZTSN3JPH10SpringPartE", !24, i64 0, !24, i64 4}
!35 = !{!20, !24, i64 128}
!36 = !{!20, !28, i64 192}


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