; LLVM IR from jrouwe/JoltPhysics :: Samples/Tests/Vehicle (VehicleSixDOFTest)

; 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.4 }
%union.anon.4 = type { <4 x float> }
%"class.JPH::Quat" = type { %"class.JPH::Vec4" }
%"class.JPH::Vec4" = type { %union.anon }
%union.anon = type { <4 x float> }
%class.VehicleSixDOFTest = type <{ %class.VehicleTest, ptr, [4 x %"class.JPH::Ref"], %"class.JPH::Mat44", float, float, [8 x i8] }>
%class.VehicleTest = type { %class.Test, %"class.JPH::Array" }
%class.Test = type { ptr, ptr, ptr, ptr, ptr, ptr, i8, %"class.std::unordered_map" }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.JPH::Ref" = type { ptr }
%"class.JPH::Mat44" = type { [4 x %"class.JPH::Vec4"] }

@__const._ZN17VehicleSixDOFTest16PrePhysicsUpdateERKN4Test15PreUpdateParamsE.front_wheels = external hidden unnamed_addr constant [2 x i32], align 4
@__const._ZN17VehicleSixDOFTest16PrePhysicsUpdateERKN4Test15PreUpdateParamsE.rear_wheels = external hidden unnamed_addr constant [2 x i32], align 4

; 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: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16), float noundef, float noundef, float noundef) unnamed_addr #1 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN17VehicleSixDOFTest12sIsLeftWheelENS_6EWheelE(i32 noundef) #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Quat9sRotationENS_4Vec3Ef(double, double, float noundef) #4 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec36sAxisYEv() #4 align 2

declare void @_ZN3JPH16SixDOFConstraint13SetMotorStateENS_24SixDOFConstraintSettings5EAxisENS_11EMotorStateE(ptr noundef nonnull align 16 dereferenceable(1856), i32 noundef, i32 noundef) #5

declare void @_ZN3JPH16SixDOFConstraint22SetTargetOrientationCSENS_4QuatE(ptr noundef nonnull align 16 dereferenceable(1856), double, double) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN17VehicleSixDOFTest17UpdateCameraPivotEv(ptr noundef nonnull align 16 dereferenceable(248)) #6 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN17VehicleSixDOFTest16PrePhysicsUpdateERKN4Test15PreUpdateParamsE(ptr noundef nonnull align 16 dereferenceable(248) %0, ptr noundef nonnull align 16 dereferenceable(80) %1) unnamed_addr #6 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca float, align 4
  %6 = alloca %"class.JPH::Vec3", align 16
  %7 = alloca %"class.JPH::Vec3", align 16
  %8 = alloca %"class.JPH::Quat", align 16
  %9 = alloca i8, align 1
  %10 = alloca [2 x i32], align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca %"class.JPH::Quat", align 16
  %18 = alloca %"class.JPH::Vec3", align 16
  %19 = alloca %"class.JPH::Quat", align 16
  %20 = alloca %"class.JPH::Vec3", align 16
  %21 = alloca %"class.JPH::Vec3", align 16
  %22 = alloca [2 x i32], align 4
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  %27 = alloca ptr, align 8
  %28 = alloca %"class.JPH::Vec3", align 16
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %29 = load ptr, ptr %3, align 8
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN11VehicleTest16PrePhysicsUpdateERKN4Test15PreUpdateParamsE(ptr noundef nonnull align 8 dereferenceable(136) %29, ptr noundef nonnull align 16 dereferenceable(80) %30)
  call void @_ZN17VehicleSixDOFTest17UpdateCameraPivotEv(ptr noundef nonnull align 16 dereferenceable(248) %29)
  %31 = getelementptr inbounds %class.VehicleSixDOFTest, ptr %29, i32 0, i32 4
  %32 = load float, ptr %31, align 16, !tbaa !9
  %33 = fcmp une float %32, 0.000000e+00
  br i1 %33, label %38, label %34

34:                                               ; preds = %2
  %35 = getelementptr inbounds %class.VehicleSixDOFTest, ptr %29, i32 0, i32 5
  %36 = load float, ptr %35, align 4, !tbaa !22
  %37 = fcmp une float %36, 0.000000e+00
  br i1 %37, label %38, label %44

38:                                               ; preds = %34, %2
  %39 = getelementptr inbounds %class.Test, ptr %29, i32 0, i32 3
  %40 = load ptr, ptr %39, align 8, !tbaa !23
  %41 = getelementptr inbounds %class.VehicleSixDOFTest, ptr %29, i32 0, i32 1
  %42 = load ptr, ptr %41, align 8, !tbaa !24
  %43 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122) %42)
  call void @_ZN3JPH13BodyInterface12ActivateBodyERKNS_6BodyIDE(ptr noundef nonnull align 8 dereferenceable(24) %40, ptr noundef nonnull align 4 dereferenceable(4) %43)
  br label %44

44:                                               ; preds = %38, %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #11
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #11
  %45 = getelementptr inbounds %class.VehicleSixDOFTest, ptr %29, i32 0, i32 1
  %46 = load ptr, ptr %45, align 8, !tbaa !24
  %47 = call { double, double } @_ZNK3JPH4Body17GetLinearVelocityEv(ptr noundef nonnull align 16 dereferenceable(122) %46)
  %48 = getelementptr inbounds %"class.JPH::Vec3", ptr %6, i32 0, i32 0
  %49 = getelementptr inbounds %union.anon.4, ptr %48, i32 0, i32 0
  %50 = getelementptr inbounds { double, double }, ptr %49, i32 0, i32 0
  %51 = extractvalue { double, double } %47, 0
  store double %51, ptr %50, align 16
  %52 = getelementptr inbounds { double, double }, ptr %49, i32 0, i32 1
  %53 = extractvalue { double, double } %47, 1
  store double %53, ptr %52, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #11
  %54 = getelementptr inbounds %class.VehicleSixDOFTest, ptr %29, i32 0, i32 1
  %55 = load ptr, ptr %54, align 8, !tbaa !24
  %56 = call { double, double } @_ZNK3JPH4Body11GetRotationEv(ptr noundef nonnull align 16 dereferenceable(122) %55)
  %57 = getelementptr inbounds %"class.JPH::Quat", ptr %8, i32 0, i32 0
  %58 = getelementptr inbounds %"class.JPH::Vec4", ptr %57, i32 0, i32 0
  %59 = getelementptr inbounds %union.anon, ptr %58, i32 0, i32 0
  %60 = getelementptr inbounds { double, double }, ptr %59, i32 0, i32 0
  %61 = extractvalue { double, double } %56, 0
  store double %61, ptr %60, align 16
  %62 = getelementptr inbounds { double, double }, ptr %59, i32 0, i32 1
  %63 = extractvalue { double, double } %56, 1
  store double %63, ptr %62, align 8
  %64 = call { double, double } @_ZNK3JPH4Quat11RotateAxisZEv(ptr noundef nonnull align 16 dereferenceable(16) %8)
  %65 = getelementptr inbounds %"class.JPH::Vec3", ptr %7, i32 0, i32 0
  %66 = getelementptr inbounds %union.anon.4, ptr %65, i32 0, i32 0
  %67 = getelementptr inbounds { double, double }, ptr %66, i32 0, i32 0
  %68 = extractvalue { double, double } %64, 0
  store double %68, ptr %67, align 16
  %69 = getelementptr inbounds { double, double }, ptr %66, i32 0, i32 1
  %70 = extractvalue { double, double } %64, 1
  store double %70, ptr %69, align 8
  %71 = getelementptr inbounds { double, double }, ptr %7, i32 0, i32 0
  %72 = load double, ptr %71, align 16
  %73 = getelementptr inbounds { double, double }, ptr %7, i32 0, i32 1
  %74 = load double, ptr %73, align 8
  %75 = call noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %6, double %72, double %74)
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #11
  store float %75, ptr %5, align 4, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #11
  %76 = getelementptr inbounds %class.VehicleSixDOFTest, ptr %29, i32 0, i32 5
  %77 = load float, ptr %76, align 4, !tbaa !22
  %78 = fcmp une float %77, 0.000000e+00
  br i1 %78, label %79, label %89

79:                                               ; preds = %44
  %80 = load float, ptr %5, align 4, !tbaa !25
  %81 = fcmp une float %80, 0.000000e+00
  br i1 %81, label %82, label %89

82:                                               ; preds = %79
  %83 = getelementptr inbounds %class.VehicleSixDOFTest, ptr %29, i32 0, i32 5
  %84 = load float, ptr %83, align 4, !tbaa !22
  %85 = call noundef float @_ZN3JPH4SignIfEET_S1_(float noundef %84)
  %86 = load float, ptr %5, align 4, !tbaa !25
  %87 = call noundef float @_ZN3JPH4SignIfEET_S1_(float noundef %86)
  %88 = fcmp une float %85, %87
  br label %89

89:                                               ; preds = %82, %79, %44
  %90 = phi i1 [ false, %79 ], [ false, %44 ], [ %88, %82 ]
  %91 = zext i1 %90 to i8
  store i8 %91, ptr %9, align 1, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 @__const._ZN17VehicleSixDOFTest16PrePhysicsUpdateERKN4Test15PreUpdateParamsE.front_wheels, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #11
  store ptr %10, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #11
  %92 = load ptr, ptr %11, align 8, !tbaa !5
  %93 = getelementptr inbounds [2 x i32], ptr %92, i64 0, i64 0
  store ptr %93, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #11
  %94 = load ptr, ptr %11, align 8, !tbaa !5
  %95 = getelementptr inbounds [2 x i32], ptr %94, i64 0, i64 0
  %96 = getelementptr inbounds i32, ptr %95, i64 2
  store ptr %96, ptr %13, align 8, !tbaa !5
  br label %97

97:                                               ; preds = %188, %89
  %98 = load ptr, ptr %12, align 8, !tbaa !5
  %99 = load ptr, ptr %13, align 8, !tbaa !5
  %100 = icmp ne ptr %98, %99
  br i1 %100, label %102, label %101

101:                                              ; preds = %97
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #11
  br label %191

102:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #11
  %103 = load ptr, ptr %12, align 8, !tbaa !5
  %104 = load i32, ptr %103, align 4, !tbaa !27
  store i32 %104, ptr %15, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #11
  %105 = getelementptr inbounds %class.VehicleSixDOFTest, ptr %29, i32 0, i32 2
  %106 = load i32, ptr %15, align 4, !tbaa !27
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [4 x %"class.JPH::Ref"], ptr %105, i64 0, i64 %107
  %109 = call noundef ptr @_ZNK3JPH3RefINS_16SixDOFConstraintEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %108)
  store ptr %109, ptr %16, align 8, !tbaa !5
  %110 = load ptr, ptr %16, align 8, !tbaa !5
  %111 = icmp eq ptr %110, null
  br i1 %111, label %112, label %113

112:                                              ; preds = %102
  store i32 3, ptr %14, align 4
  br label %182

113:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #11
  %114 = call { double, double } @_ZN3JPH4Vec36sAxisYEv()
  %115 = getelementptr inbounds %"class.JPH::Vec3", ptr %18, i32 0, i32 0
  %116 = getelementptr inbounds %union.anon.4, ptr %115, i32 0, i32 0
  %117 = getelementptr inbounds { double, double }, ptr %116, i32 0, i32 0
  %118 = extractvalue { double, double } %114, 0
  store double %118, ptr %117, align 16
  %119 = getelementptr inbounds { double, double }, ptr %116, i32 0, i32 1
  %120 = extractvalue { double, double } %114, 1
  store double %120, ptr %119, align 8
  %121 = getelementptr inbounds %class.VehicleSixDOFTest, ptr %29, i32 0, i32 4
  %122 = load float, ptr %121, align 16, !tbaa !9
  %123 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %124 = load double, ptr %123, align 16
  %125 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %126 = load double, ptr %125, align 8
  %127 = call { double, double } @_ZN3JPH4Quat9sRotationENS_4Vec3Ef(double %124, double %126, float noundef %122)
  %128 = getelementptr inbounds %"class.JPH::Quat", ptr %17, i32 0, i32 0
  %129 = getelementptr inbounds %"class.JPH::Vec4", ptr %128, i32 0, i32 0
  %130 = getelementptr inbounds %union.anon, ptr %129, i32 0, i32 0
  %131 = getelementptr inbounds { double, double }, ptr %130, i32 0, i32 0
  %132 = extractvalue { double, double } %127, 0
  store double %132, ptr %131, align 16
  %133 = getelementptr inbounds { double, double }, ptr %130, i32 0, i32 1
  %134 = extractvalue { double, double } %127, 1
  store double %134, ptr %133, align 8
  %135 = load ptr, ptr %16, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %19, ptr align 16 %17, i64 16, i1 false), !tbaa.struct !29
  %136 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %137 = load double, ptr %136, align 16
  %138 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  %139 = load double, ptr %138, align 8
  call void @_ZN3JPH16SixDOFConstraint22SetTargetOrientationCSENS_4QuatE(ptr noundef nonnull align 16 dereferenceable(1856) %135, double %137, double %139)
  %140 = load i8, ptr %9, align 1, !tbaa !26, !range !31, !noundef !32
  %141 = trunc i8 %140 to i1
  br i1 %141, label %142, label %156

142:                                              ; preds = %113
  %143 = load ptr, ptr %16, align 8, !tbaa !5
  %144 = call { double, double } @_ZN3JPH4Vec35sZeroEv()
  %145 = getelementptr inbounds %"class.JPH::Vec3", ptr %20, i32 0, i32 0
  %146 = getelementptr inbounds %union.anon.4, ptr %145, i32 0, i32 0
  %147 = getelementptr inbounds { double, double }, ptr %146, i32 0, i32 0
  %148 = extractvalue { double, double } %144, 0
  store double %148, ptr %147, align 16
  %149 = getelementptr inbounds { double, double }, ptr %146, i32 0, i32 1
  %150 = extractvalue { double, double } %144, 1
  store double %150, ptr %149, align 8
  %151 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %152 = load double, ptr %151, align 16
  %153 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %154 = load double, ptr %153, align 8
  call void @_ZN3JPH16SixDOFConstraint26SetTargetAngularVelocityCSENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(1856) %143, double %152, double %154)
  %155 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN3JPH16SixDOFConstraint13SetMotorStateENS_24SixDOFConstraintSettings5EAxisENS_11EMotorStateE(ptr noundef nonnull align 16 dereferenceable(1856) %155, i32 noundef 3, i32 noundef 1)
  br label %181

156:                                              ; preds = %113
  %157 = getelementptr inbounds %class.VehicleSixDOFTest, ptr %29, i32 0, i32 5
  %158 = load float, ptr %157, align 4, !tbaa !22
  %159 = fcmp une float %158, 0.000000e+00
  br i1 %159, label %160, label %178

160:                                              ; preds = %156
  %161 = load ptr, ptr %16, align 8, !tbaa !5
  %162 = load i32, ptr %15, align 4, !tbaa !27
  %163 = call noundef zeroext i1 @_ZN17VehicleSixDOFTest12sIsLeftWheelENS_6EWheelE(i32 noundef %162)
  br i1 %163, label %164, label %168

164:                                              ; preds = %160
  %165 = getelementptr inbounds %class.VehicleSixDOFTest, ptr %29, i32 0, i32 5
  %166 = load float, ptr %165, align 4, !tbaa !22
  %167 = fneg float %166
  br label %171

168:                                              ; preds = %160
  %169 = getelementptr inbounds %class.VehicleSixDOFTest, ptr %29, i32 0, i32 5
  %170 = load float, ptr %169, align 4, !tbaa !22
  br label %171

171:                                              ; preds = %168, %164
  %172 = phi float [ %167, %164 ], [ %170, %168 ]
  call void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16) %21, float noundef %172, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %173 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 0
  %174 = load double, ptr %173, align 16
  %175 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 1
  %176 = load double, ptr %175, align 8
  call void @_ZN3JPH16SixDOFConstraint26SetTargetAngularVelocityCSENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(1856) %161, double %174, double %176)
  %177 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN3JPH16SixDOFConstraint13SetMotorStateENS_24SixDOFConstraintSettings5EAxisENS_11EMotorStateE(ptr noundef nonnull align 16 dereferenceable(1856) %177, i32 noundef 3, i32 noundef 1)
  br label %180

178:                                              ; preds = %156
  %179 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN3JPH16SixDOFConstraint13SetMotorStateENS_24SixDOFConstraintSettings5EAxisENS_11EMotorStateE(ptr noundef nonnull align 16 dereferenceable(1856) %179, i32 noundef 3, i32 noundef 0)
  br label %180

180:                                              ; preds = %178, %171
  br label %181

181:                                              ; preds = %180, %142
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #11
  store i32 0, ptr %14, align 4
  br label %182

182:                                              ; preds = %181, %112
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #11
  %183 = load i32, ptr %14, align 4
  switch i32 %183, label %185 [
    i32 0, label %184
  ]

184:                                              ; preds = %182
  store i32 0, ptr %14, align 4
  br label %185

185:                                              ; preds = %184, %182
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #11
  %186 = load i32, ptr %14, align 4
  switch i32 %186, label %243 [
    i32 0, label %187
    i32 3, label %188
  ]

187:                                              ; preds = %185
  br label %188

188:                                              ; preds = %187, %185
  %189 = load ptr, ptr %12, align 8, !tbaa !5
  %190 = getelementptr inbounds i32, ptr %189, i32 1
  store ptr %190, ptr %12, align 8, !tbaa !5
  br label %97

191:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 4 @__const._ZN17VehicleSixDOFTest16PrePhysicsUpdateERKN4Test15PreUpdateParamsE.rear_wheels, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #11
  store ptr %22, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #11
  %192 = load ptr, ptr %23, align 8, !tbaa !5
  %193 = getelementptr inbounds [2 x i32], ptr %192, i64 0, i64 0
  store ptr %193, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #11
  %194 = load ptr, ptr %23, align 8, !tbaa !5
  %195 = getelementptr inbounds [2 x i32], ptr %194, i64 0, i64 0
  %196 = getelementptr inbounds i32, ptr %195, i64 2
  store ptr %196, ptr %25, align 8, !tbaa !5
  br label %197

197:                                              ; preds = %239, %191
  %198 = load ptr, ptr %24, align 8, !tbaa !5
  %199 = load ptr, ptr %25, align 8, !tbaa !5
  %200 = icmp ne ptr %198, %199
  br i1 %200, label %202, label %201

201:                                              ; preds = %197
  store i32 4, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #11
  br label %242

202:                                              ; preds = %197
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #11
  %203 = load ptr, ptr %24, align 8, !tbaa !5
  %204 = load i32, ptr %203, align 4, !tbaa !27
  store i32 %204, ptr %26, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #11
  %205 = getelementptr inbounds %class.VehicleSixDOFTest, ptr %29, i32 0, i32 2
  %206 = load i32, ptr %26, align 4, !tbaa !27
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [4 x %"class.JPH::Ref"], ptr %205, i64 0, i64 %207
  %209 = call noundef ptr @_ZNK3JPH3RefINS_16SixDOFConstraintEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %208)
  store ptr %209, ptr %27, align 8, !tbaa !5
  %210 = load ptr, ptr %27, align 8, !tbaa !5
  %211 = icmp eq ptr %210, null
  br i1 %211, label %212, label %213

212:                                              ; preds = %202
  store i32 5, ptr %14, align 4
  br label %233

213:                                              ; preds = %202
  %214 = load i8, ptr %9, align 1, !tbaa !26, !range !31, !noundef !32
  %215 = trunc i8 %214 to i1
  br i1 %215, label %216, label %230

216:                                              ; preds = %213
  %217 = load ptr, ptr %27, align 8, !tbaa !5
  %218 = call { double, double } @_ZN3JPH4Vec35sZeroEv()
  %219 = getelementptr inbounds %"class.JPH::Vec3", ptr %28, i32 0, i32 0
  %220 = getelementptr inbounds %union.anon.4, ptr %219, i32 0, i32 0
  %221 = getelementptr inbounds { double, double }, ptr %220, i32 0, i32 0
  %222 = extractvalue { double, double } %218, 0
  store double %222, ptr %221, align 16
  %223 = getelementptr inbounds { double, double }, ptr %220, i32 0, i32 1
  %224 = extractvalue { double, double } %218, 1
  store double %224, ptr %223, align 8
  %225 = getelementptr inbounds { double, double }, ptr %28, i32 0, i32 0
  %226 = load double, ptr %225, align 16
  %227 = getelementptr inbounds { double, double }, ptr %28, i32 0, i32 1
  %228 = load double, ptr %227, align 8
  call void @_ZN3JPH16SixDOFConstraint26SetTargetAngularVelocityCSENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(1856) %217, double %226, double %228)
  %229 = load ptr, ptr %27, align 8, !tbaa !5
  call void @_ZN3JPH16SixDOFConstraint13SetMotorStateENS_24SixDOFConstraintSettings5EAxisENS_11EMotorStateE(ptr noundef nonnull align 16 dereferenceable(1856) %229, i32 noundef 3, i32 noundef 1)
  br label %232

230:                                              ; preds = %213
  %231 = load ptr, ptr %27, align 8, !tbaa !5
  call void @_ZN3JPH16SixDOFConstraint13SetMotorStateENS_24SixDOFConstraintSettings5EAxisENS_11EMotorStateE(ptr noundef nonnull align 16 dereferenceable(1856) %231, i32 noundef 3, i32 noundef 0)
  br label %232

232:                                              ; preds = %230, %216
  store i32 0, ptr %14, align 4
  br label %233

233:                                              ; preds = %232, %212
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #11
  %234 = load i32, ptr %14, align 4
  switch i32 %234, label %236 [
    i32 0, label %235
  ]

235:                                              ; preds = %233
  store i32 0, ptr %14, align 4
  br label %236

236:                                              ; preds = %235, %233
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #11
  %237 = load i32, ptr %14, align 4
  switch i32 %237, label %243 [
    i32 0, label %238
    i32 5, label %239
  ]

238:                                              ; preds = %236
  br label %239

239:                                              ; preds = %238, %236
  %240 = load ptr, ptr %24, align 8, !tbaa !5
  %241 = getelementptr inbounds i32, ptr %240, i32 1
  store ptr %241, ptr %24, align 8, !tbaa !5
  br label %197

242:                                              ; preds = %201
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #11
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #11
  ret void

243:                                              ; preds = %236, %185
  unreachable
}

declare void @_ZN11VehicleTest16PrePhysicsUpdateERKN4Test15PreUpdateParamsE(ptr noundef nonnull align 8 dereferenceable(136), ptr noundef nonnull align 16 dereferenceable(80)) unnamed_addr #5

declare void @_ZN3JPH13BodyInterface12ActivateBodyERKNS_6BodyIDE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #5

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH16SixDOFConstraint26SetTargetAngularVelocityCSENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(1856), double, double) #9 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec35sZeroEv() #10 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { alwaysinline mustprogress nounwind 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #5 = { "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 = { 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 #7 = { 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 #8 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { 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 #10 = { 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 #11 = { 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, !19, i64 240}
!10 = !{!"_ZTS17VehicleSixDOFTest", !11, i64 0, !6, i64 136, !7, i64 144, !21, i64 176, !19, i64 240, !19, i64 244}
!11 = !{!"_ZTS11VehicleTest", !12, i64 0, !20, i64 112}
!12 = !{!"_ZTS4Test", !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !13, i64 48, !14, i64 56}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTSSt13unordered_mapIN3JPH6BodyIDENSt7__cxx1112basic_stringIcSt11char_traitsIcENS0_12STLAllocatorIcEEEESt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_S8_EEE", !15, i64 0}
!15 = !{!"_ZTSSt10_HashtableIN3JPH6BodyIDESt4pairIKS1_NSt7__cxx1112basic_stringIcSt11char_traitsIcENS0_12STLAllocatorIcEEEEESaISB_ENSt8__detail10_Select1stESt8equal_toIS1_ESt4hashIS1_ENSD_18_Mod_range_hashingENSD_20_Default_ranged_hashENSD_20_Prime_rehash_policyENSD_17_Hashtable_traitsILb1ELb0ELb1EEEE", !6, i64 0, !16, i64 8, !17, i64 16, !16, i64 24, !18, i64 32, !6, i64 48}
!16 = !{!"long", !7, i64 0}
!17 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!18 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !19, i64 0, !16, i64 8}
!19 = !{!"float", !7, i64 0}
!20 = !{!"_ZTSN3JPH5ArrayIN11VehicleTest4LineENS_12STLAllocatorIS2_EEEE", !16, i64 0, !16, i64 8, !6, i64 16}
!21 = !{!"_ZTSN3JPH5Mat44E", !7, i64 0}
!22 = !{!10, !19, i64 244}
!23 = !{!12, !6, i64 24}
!24 = !{!10, !6, i64 136}
!25 = !{!19, !19, i64 0}
!26 = !{!13, !13, i64 0}
!27 = !{!28, !28, i64 0}
!28 = !{!"_ZTSN17VehicleSixDOFTest6EWheelE", !7, i64 0}
!29 = !{i64 0, i64 16, !30}
!30 = !{!7, !7, i64 0}
!31 = !{i8 0, i8 2}
!32 = !{}


; 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::Vec3" = type { %union.anon.4 }
%union.anon.4 = type { <4 x float> }
%"class.JPH::Quat" = type { %"class.JPH::Vec4" }
%"class.JPH::Vec4" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::Ref" = type { ptr }

@__const._ZN17VehicleSixDOFTest16PrePhysicsUpdateERKN4Test15PreUpdateParamsE.front_wheels = external hidden unnamed_addr constant [2 x i32], align 4
@__const._ZN17VehicleSixDOFTest16PrePhysicsUpdateERKN4Test15PreUpdateParamsE.rear_wheels = external hidden unnamed_addr constant [2 x i32], align 4

; 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: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16), float noundef, float noundef, float noundef) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN17VehicleSixDOFTest12sIsLeftWheelENS_6EWheelE(i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Quat9sRotationENS_4Vec3Ef(double, double, float noundef) local_unnamed_addr #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec36sAxisYEv() local_unnamed_addr #3 align 2

declare void @_ZN3JPH16SixDOFConstraint13SetMotorStateENS_24SixDOFConstraintSettings5EAxisENS_11EMotorStateE(ptr noundef nonnull align 16 dereferenceable(1856), i32 noundef, i32 noundef) local_unnamed_addr #4

declare void @_ZN3JPH16SixDOFConstraint22SetTargetOrientationCSENS_4QuatE(ptr noundef nonnull align 16 dereferenceable(1856), double, double) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN17VehicleSixDOFTest17UpdateCameraPivotEv(ptr noundef nonnull align 16 dereferenceable(248)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN17VehicleSixDOFTest16PrePhysicsUpdateERKN4Test15PreUpdateParamsE(ptr noundef nonnull align 16 dereferenceable(248) %0, ptr noundef nonnull align 16 dereferenceable(80) %1) unnamed_addr #5 align 2 {
  %3 = alloca %"class.JPH::Vec3", align 16
  %4 = alloca %"class.JPH::Quat", align 16
  %5 = alloca %"class.JPH::Vec3", align 16
  tail call void @_ZN11VehicleTest16PrePhysicsUpdateERKN4Test15PreUpdateParamsE(ptr noundef nonnull align 8 dereferenceable(136) %0, ptr noundef nonnull align 16 dereferenceable(80) %1)
  tail call void @_ZN17VehicleSixDOFTest17UpdateCameraPivotEv(ptr noundef nonnull align 16 dereferenceable(248) %0)
  %6 = getelementptr inbounds i8, ptr %0, i64 240
  %7 = load float, ptr %6, align 16, !tbaa !5
  %8 = fcmp une float %7, 0.000000e+00
  %9 = getelementptr inbounds i8, ptr %0, i64 244
  %10 = load float, ptr %9, align 4
  %11 = fcmp une float %10, 0.000000e+00
  %or.cond54 = select i1 %8, i1 true, i1 %11
  br i1 %or.cond54, label %12, label %18

12:                                               ; preds = %2
  %13 = getelementptr inbounds i8, ptr %0, i64 24
  %14 = load ptr, ptr %13, align 8, !tbaa !21
  %15 = getelementptr inbounds i8, ptr %0, i64 136
  %16 = load ptr, ptr %15, align 8, !tbaa !22
  %17 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3JPH4Body5GetIDEv(ptr noundef nonnull align 16 dereferenceable(122) %16)
  tail call void @_ZN3JPH13BodyInterface12ActivateBodyERKNS_6BodyIDE(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 4 dereferenceable(4) %17)
  br label %18

18:                                               ; preds = %2, %12
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #10
  %19 = getelementptr inbounds i8, ptr %0, i64 136
  %20 = load ptr, ptr %19, align 8, !tbaa !22
  %21 = tail call { double, double } @_ZNK3JPH4Body17GetLinearVelocityEv(ptr noundef nonnull align 16 dereferenceable(122) %20)
  %22 = extractvalue { double, double } %21, 0
  store double %22, ptr %3, align 16
  %23 = getelementptr inbounds i8, ptr %3, i64 8
  %24 = extractvalue { double, double } %21, 1
  store double %24, ptr %23, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #10
  %25 = load ptr, ptr %19, align 8, !tbaa !22
  %26 = tail call { double, double } @_ZNK3JPH4Body11GetRotationEv(ptr noundef nonnull align 16 dereferenceable(122) %25)
  %27 = extractvalue { double, double } %26, 0
  store double %27, ptr %4, align 16
  %28 = getelementptr inbounds i8, ptr %4, i64 8
  %29 = extractvalue { double, double } %26, 1
  store double %29, ptr %28, align 8
  %30 = call { double, double } @_ZNK3JPH4Quat11RotateAxisZEv(ptr noundef nonnull align 16 dereferenceable(16) %4)
  %31 = extractvalue { double, double } %30, 0
  %32 = extractvalue { double, double } %30, 1
  %33 = call noundef float @_ZNK3JPH4Vec33DotES0_(ptr noundef nonnull align 16 dereferenceable(16) %3, double %31, double %32)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #10
  %34 = load float, ptr %9, align 4, !tbaa !23
  %35 = fcmp une float %34, 0.000000e+00
  %36 = fcmp une float %33, 0.000000e+00
  %or.cond = and i1 %36, %35
  br i1 %or.cond, label %39, label %.thread

.thread:                                          ; preds = %18
  %37 = load i64, ptr @__const._ZN17VehicleSixDOFTest16PrePhysicsUpdateERKN4Test15PreUpdateParamsE.front_wheels, align 4
  %38 = getelementptr inbounds i8, ptr %5, i64 8
  br label %.split.preheader

39:                                               ; preds = %18
  %40 = call noundef float @_ZN3JPH4SignIfEET_S1_(float noundef %34)
  %41 = call noundef float @_ZN3JPH4SignIfEET_S1_(float noundef %33)
  %42 = fcmp une float %40, %41
  %43 = load i64, ptr @__const._ZN17VehicleSixDOFTest16PrePhysicsUpdateERKN4Test15PreUpdateParamsE.front_wheels, align 4
  %44 = getelementptr inbounds i8, ptr %0, i64 144
  %45 = getelementptr inbounds i8, ptr %5, i64 8
  br i1 %42, label %.split.us.preheader, label %.split.preheader

.split.preheader:                                 ; preds = %.thread, %39
  %46 = phi ptr [ %38, %.thread ], [ %45, %39 ]
  %47 = phi i64 [ %37, %.thread ], [ %43, %39 ]
  %48 = getelementptr inbounds i8, ptr %0, i64 144
  %.sroa.066.0.extract.trunc80 = trunc i64 %47 to i32
  %.sroa.568.0.extract.trunc81.in = lshr i64 %47, 32
  %.sroa.568.0.extract.trunc81 = trunc nuw i64 %.sroa.568.0.extract.trunc81.in to i32
  %sext = shl i64 %47, 32
  %49 = ashr exact i64 %sext, 32
  %50 = getelementptr inbounds [4 x %"class.JPH::Ref"], ptr %48, i64 0, i64 %49
  %51 = call noundef ptr @_ZNK3JPH3RefINS_16SixDOFConstraintEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %50)
  %52 = icmp eq ptr %51, null
  br i1 %52, label %.split.1, label %106

.split.us.preheader:                              ; preds = %39
  %sext71 = shl i64 %43, 32
  %53 = ashr exact i64 %sext71, 32
  %54 = getelementptr inbounds [4 x %"class.JPH::Ref"], ptr %44, i64 0, i64 %53
  %55 = call noundef ptr @_ZNK3JPH3RefINS_16SixDOFConstraintEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %54)
  %56 = icmp eq ptr %55, null
  br i1 %56, label %.split.us.1, label %57

57:                                               ; preds = %.split.us.preheader
  %58 = call { double, double } @_ZN3JPH4Vec36sAxisYEv()
  %59 = extractvalue { double, double } %58, 0
  %60 = extractvalue { double, double } %58, 1
  %61 = load float, ptr %6, align 16, !tbaa !5
  %62 = call { double, double } @_ZN3JPH4Quat9sRotationENS_4Vec3Ef(double %59, double %60, float noundef %61)
  %63 = extractvalue { double, double } %62, 0
  %64 = extractvalue { double, double } %62, 1
  call void @_ZN3JPH16SixDOFConstraint22SetTargetOrientationCSENS_4QuatE(ptr noundef nonnull align 16 dereferenceable(1856) %55, double %63, double %64)
  %65 = call { double, double } @_ZN3JPH4Vec35sZeroEv()
  %66 = extractvalue { double, double } %65, 0
  %67 = extractvalue { double, double } %65, 1
  call void @_ZN3JPH16SixDOFConstraint26SetTargetAngularVelocityCSENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(1856) %55, double %66, double %67)
  call void @_ZN3JPH16SixDOFConstraint13SetMotorStateENS_24SixDOFConstraintSettings5EAxisENS_11EMotorStateE(ptr noundef nonnull align 16 dereferenceable(1856) %55, i32 noundef 3, i32 noundef 1)
  br label %.split.us.1

.split.us.1:                                      ; preds = %57, %.split.us.preheader
  %68 = ashr i64 %43, 32
  %69 = getelementptr inbounds [4 x %"class.JPH::Ref"], ptr %44, i64 0, i64 %68
  %70 = call noundef ptr @_ZNK3JPH3RefINS_16SixDOFConstraintEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %69)
  %71 = icmp eq ptr %70, null
  br i1 %71, label %.split59.us.preheader, label %72

72:                                               ; preds = %.split.us.1
  %73 = call { double, double } @_ZN3JPH4Vec36sAxisYEv()
  %74 = extractvalue { double, double } %73, 0
  %75 = extractvalue { double, double } %73, 1
  %76 = load float, ptr %6, align 16, !tbaa !5
  %77 = call { double, double } @_ZN3JPH4Quat9sRotationENS_4Vec3Ef(double %74, double %75, float noundef %76)
  %78 = extractvalue { double, double } %77, 0
  %79 = extractvalue { double, double } %77, 1
  call void @_ZN3JPH16SixDOFConstraint22SetTargetOrientationCSENS_4QuatE(ptr noundef nonnull align 16 dereferenceable(1856) %70, double %78, double %79)
  %80 = call { double, double } @_ZN3JPH4Vec35sZeroEv()
  %81 = extractvalue { double, double } %80, 0
  %82 = extractvalue { double, double } %80, 1
  call void @_ZN3JPH16SixDOFConstraint26SetTargetAngularVelocityCSENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(1856) %70, double %81, double %82)
  call void @_ZN3JPH16SixDOFConstraint13SetMotorStateENS_24SixDOFConstraintSettings5EAxisENS_11EMotorStateE(ptr noundef nonnull align 16 dereferenceable(1856) %70, i32 noundef 3, i32 noundef 1)
  br label %.split59.us.preheader

.split59.preheader.sink.split:                    ; preds = %128, %138
  %.sink = phi i32 [ 1, %138 ], [ 0, %128 ]
  call void @_ZN3JPH16SixDOFConstraint13SetMotorStateENS_24SixDOFConstraintSettings5EAxisENS_11EMotorStateE(ptr noundef nonnull align 16 dereferenceable(1856) %126, i32 noundef 3, i32 noundef %.sink)
  br label %.split59.preheader

.split59.preheader:                               ; preds = %.split59.preheader.sink.split, %.split.1
  %83 = getelementptr inbounds i8, ptr %0, i64 144
  %84 = load i64, ptr @__const._ZN17VehicleSixDOFTest16PrePhysicsUpdateERKN4Test15PreUpdateParamsE.rear_wheels, align 4
  %sext73 = shl i64 %84, 32
  %85 = ashr exact i64 %sext73, 32
  %86 = getelementptr inbounds [4 x %"class.JPH::Ref"], ptr %83, i64 0, i64 %85
  %87 = call noundef ptr @_ZNK3JPH3RefINS_16SixDOFConstraintEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %86)
  %88 = icmp eq ptr %87, null
  br i1 %88, label %.split59.1, label %145

.split59.us.preheader:                            ; preds = %72, %.split.us.1
  %89 = load i64, ptr @__const._ZN17VehicleSixDOFTest16PrePhysicsUpdateERKN4Test15PreUpdateParamsE.rear_wheels, align 4
  %sext75 = shl i64 %89, 32
  %90 = ashr exact i64 %sext75, 32
  %91 = getelementptr inbounds [4 x %"class.JPH::Ref"], ptr %44, i64 0, i64 %90
  %92 = call noundef ptr @_ZNK3JPH3RefINS_16SixDOFConstraintEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %91)
  %93 = icmp eq ptr %92, null
  br i1 %93, label %.split59.us.1, label %94

94:                                               ; preds = %.split59.us.preheader
  %95 = call { double, double } @_ZN3JPH4Vec35sZeroEv()
  %96 = extractvalue { double, double } %95, 0
  %97 = extractvalue { double, double } %95, 1
  call void @_ZN3JPH16SixDOFConstraint26SetTargetAngularVelocityCSENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(1856) %92, double %96, double %97)
  call void @_ZN3JPH16SixDOFConstraint13SetMotorStateENS_24SixDOFConstraintSettings5EAxisENS_11EMotorStateE(ptr noundef nonnull align 16 dereferenceable(1856) %92, i32 noundef 3, i32 noundef 1)
  br label %.split59.us.1

.split59.us.1:                                    ; preds = %94, %.split59.us.preheader
  %98 = ashr i64 %89, 32
  %99 = getelementptr inbounds [4 x %"class.JPH::Ref"], ptr %44, i64 0, i64 %98
  %100 = call noundef ptr @_ZNK3JPH3RefINS_16SixDOFConstraintEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %99)
  %101 = icmp eq ptr %100, null
  br i1 %101, label %.split61.us, label %102

102:                                              ; preds = %.split59.us.1
  %103 = call { double, double } @_ZN3JPH4Vec35sZeroEv()
  %104 = extractvalue { double, double } %103, 0
  %105 = extractvalue { double, double } %103, 1
  call void @_ZN3JPH16SixDOFConstraint26SetTargetAngularVelocityCSENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(1856) %100, double %104, double %105)
  call void @_ZN3JPH16SixDOFConstraint13SetMotorStateENS_24SixDOFConstraintSettings5EAxisENS_11EMotorStateE(ptr noundef nonnull align 16 dereferenceable(1856) %100, i32 noundef 3, i32 noundef 1)
  br label %.split61.us

106:                                              ; preds = %.split.preheader
  %107 = call { double, double } @_ZN3JPH4Vec36sAxisYEv()
  %108 = extractvalue { double, double } %107, 0
  %109 = extractvalue { double, double } %107, 1
  %110 = load float, ptr %6, align 16, !tbaa !5
  %111 = call { double, double } @_ZN3JPH4Quat9sRotationENS_4Vec3Ef(double %108, double %109, float noundef %110)
  %112 = extractvalue { double, double } %111, 0
  %113 = extractvalue { double, double } %111, 1
  call void @_ZN3JPH16SixDOFConstraint22SetTargetOrientationCSENS_4QuatE(ptr noundef nonnull align 16 dereferenceable(1856) %51, double %112, double %113)
  %114 = load float, ptr %9, align 4, !tbaa !23
  %115 = fcmp une float %114, 0.000000e+00
  br i1 %115, label %116, label %.split.1.sink.split

116:                                              ; preds = %106
  %117 = call noundef zeroext i1 @_ZN17VehicleSixDOFTest12sIsLeftWheelENS_6EWheelE(i32 noundef %.sroa.066.0.extract.trunc80)
  %118 = load float, ptr %9, align 4
  %119 = fneg float %118
  %120 = select i1 %117, float %119, float %118
  call void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16) %5, float noundef %120, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %121 = load double, ptr %5, align 16
  %122 = load double, ptr %46, align 8
  call void @_ZN3JPH16SixDOFConstraint26SetTargetAngularVelocityCSENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(1856) %51, double %121, double %122)
  br label %.split.1.sink.split

.split.1.sink.split:                              ; preds = %106, %116
  %.sink82 = phi i32 [ 1, %116 ], [ 0, %106 ]
  call void @_ZN3JPH16SixDOFConstraint13SetMotorStateENS_24SixDOFConstraintSettings5EAxisENS_11EMotorStateE(ptr noundef nonnull align 16 dereferenceable(1856) %51, i32 noundef 3, i32 noundef %.sink82)
  br label %.split.1

.split.1:                                         ; preds = %.split.1.sink.split, %.split.preheader
  %123 = getelementptr inbounds i8, ptr %0, i64 144
  %124 = ashr i64 %47, 32
  %125 = getelementptr inbounds [4 x %"class.JPH::Ref"], ptr %123, i64 0, i64 %124
  %126 = call noundef ptr @_ZNK3JPH3RefINS_16SixDOFConstraintEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %125)
  %127 = icmp eq ptr %126, null
  br i1 %127, label %.split59.preheader, label %128

128:                                              ; preds = %.split.1
  %129 = call { double, double } @_ZN3JPH4Vec36sAxisYEv()
  %130 = extractvalue { double, double } %129, 0
  %131 = extractvalue { double, double } %129, 1
  %132 = load float, ptr %6, align 16, !tbaa !5
  %133 = call { double, double } @_ZN3JPH4Quat9sRotationENS_4Vec3Ef(double %130, double %131, float noundef %132)
  %134 = extractvalue { double, double } %133, 0
  %135 = extractvalue { double, double } %133, 1
  call void @_ZN3JPH16SixDOFConstraint22SetTargetOrientationCSENS_4QuatE(ptr noundef nonnull align 16 dereferenceable(1856) %126, double %134, double %135)
  %136 = load float, ptr %9, align 4, !tbaa !23
  %137 = fcmp une float %136, 0.000000e+00
  br i1 %137, label %138, label %.split59.preheader.sink.split

138:                                              ; preds = %128
  %139 = call noundef zeroext i1 @_ZN17VehicleSixDOFTest12sIsLeftWheelENS_6EWheelE(i32 noundef %.sroa.568.0.extract.trunc81)
  %140 = load float, ptr %9, align 4
  %141 = fneg float %140
  %142 = select i1 %139, float %141, float %140
  call void @_ZN3JPH4Vec3C2Efff(ptr noundef nonnull align 16 dereferenceable(16) %5, float noundef %142, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %143 = load double, ptr %5, align 16
  %144 = load double, ptr %46, align 8
  call void @_ZN3JPH16SixDOFConstraint26SetTargetAngularVelocityCSENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(1856) %126, double %143, double %144)
  br label %.split59.preheader.sink.split

.split61.us:                                      ; preds = %.split59.1, %151, %.split59.us.1, %102
  ret void

145:                                              ; preds = %.split59.preheader
  call void @_ZN3JPH16SixDOFConstraint13SetMotorStateENS_24SixDOFConstraintSettings5EAxisENS_11EMotorStateE(ptr noundef nonnull align 16 dereferenceable(1856) %87, i32 noundef 3, i32 noundef 0)
  br label %.split59.1

.split59.1:                                       ; preds = %145, %.split59.preheader
  %146 = getelementptr inbounds i8, ptr %0, i64 144
  %147 = ashr i64 %84, 32
  %148 = getelementptr inbounds [4 x %"class.JPH::Ref"], ptr %146, i64 0, i64 %147
  %149 = call noundef ptr @_ZNK3JPH3RefINS_16SixDOFConstraintEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %148)
  %150 = icmp eq ptr %149, null
  br i1 %150, label %.split61.us, label %151

151:                                              ; preds = %.split59.1
  call void @_ZN3JPH16SixDOFConstraint13SetMotorStateENS_24SixDOFConstraintSettings5EAxisENS_11EMotorStateE(ptr noundef nonnull align 16 dereferenceable(1856) %149, i32 noundef 3, i32 noundef 0)
  br label %.split61.us
}

declare void @_ZN11VehicleTest16PrePhysicsUpdateERKN4Test15PreUpdateParamsE(ptr noundef nonnull align 8 dereferenceable(136), ptr noundef nonnull align 16 dereferenceable(80)) unnamed_addr #4

declare void @_ZN3JPH13BodyInterface12ActivateBodyERKNS_6BodyIDE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH16SixDOFConstraint26SetTargetAngularVelocityCSENS_4Vec3E(ptr noundef nonnull align 16 dereferenceable(1856), double, double) local_unnamed_addr #8 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN3JPH4Vec35sZeroEv() local_unnamed_addr #9 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { alwaysinline mustprogress nounwind 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 #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 = { 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 = { "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 = { 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 #7 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { 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 #9 = { 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 #10 = { 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, !18, i64 240}
!6 = !{!"_ZTS17VehicleSixDOFTest", !7, i64 0, !9, i64 136, !10, i64 144, !20, i64 176, !18, i64 240, !18, i64 244}
!7 = !{!"_ZTS11VehicleTest", !8, i64 0, !19, i64 112}
!8 = !{!"_ZTS4Test", !9, i64 8, !9, i64 16, !9, i64 24, !9, i64 32, !9, i64 40, !12, i64 48, !13, i64 56}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"bool", !10, i64 0}
!13 = !{!"_ZTSSt13unordered_mapIN3JPH6BodyIDENSt7__cxx1112basic_stringIcSt11char_traitsIcENS0_12STLAllocatorIcEEEESt4hashIS1_ESt8equal_toIS1_ESaISt4pairIKS1_S8_EEE", !14, i64 0}
!14 = !{!"_ZTSSt10_HashtableIN3JPH6BodyIDESt4pairIKS1_NSt7__cxx1112basic_stringIcSt11char_traitsIcENS0_12STLAllocatorIcEEEEESaISB_ENSt8__detail10_Select1stESt8equal_toIS1_ESt4hashIS1_ENSD_18_Mod_range_hashingENSD_20_Default_ranged_hashENSD_20_Prime_rehash_policyENSD_17_Hashtable_traitsILb1ELb0ELb1EEEE", !9, i64 0, !15, i64 8, !16, i64 16, !15, i64 24, !17, i64 32, !9, i64 48}
!15 = !{!"long", !10, i64 0}
!16 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !9, i64 0}
!17 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !18, i64 0, !15, i64 8}
!18 = !{!"float", !10, i64 0}
!19 = !{!"_ZTSN3JPH5ArrayIN11VehicleTest4LineENS_12STLAllocatorIS2_EEEE", !15, i64 0, !15, i64 8, !9, i64 16}
!20 = !{!"_ZTSN3JPH5Mat44E", !10, i64 0}
!21 = !{!8, !9, i64 24}
!22 = !{!6, !9, i64 136}
!23 = !{!6, !18, i64 244}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass