; LLVM IR from erincatto/box2d :: src (motor_joint)

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

%struct.b2BodyState = type { %struct.b2Vec2, float, i32, %struct.b2Vec2, %struct.b2Rot }
%struct.b2Vec2 = type { float, float }
%struct.b2Rot = type { float, float }
%struct.b2JointSim = type { i32, i32, i32, i32, %struct.b2Vec2, %struct.b2Vec2, float, float, float, float, %union.anon }
%union.anon = type { %struct.b2PrismaticJoint }
%struct.b2PrismaticJoint = type { %struct.b2Vec2, %struct.b2Vec2, float, float, float, float, float, float, float, float, float, float, float, i32, i32, %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, float, float, %struct.b2Softness, i8, i8, i8 }
%struct.b2Softness = type { float, float, float }
%struct.b2MotorJoint = type { %struct.b2Vec2, float, %struct.b2Vec2, float, float, float, float, i32, i32, %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, float, %struct.b2Mat22, float }
%struct.b2Mat22 = type { %struct.b2Vec2, %struct.b2Vec2 }
%struct.b2StepContext = type { float, float, float, float, i32, %struct.b2Softness, %struct.b2Softness, %struct.b2Softness, float, float, ptr, ptr, ptr, ptr, ptr, i32, ptr, %struct.b2AtomicInt, ptr, ptr, ptr, i32, i32, ptr, i32, i8, [64 x i8], %struct.b2AtomicU32, [64 x i8] }
%struct.b2AtomicInt = type { i32 }
%struct.b2AtomicU32 = type { i32 }

@.str = external hidden unnamed_addr constant [28 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [67 x i8], align 1
@__const.b2SolveMotorJoint.dummyState = external hidden unnamed_addr constant %struct.b2BodyState, 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 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2ClampFloat(float noundef, float noundef, float noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2MulSV(float noundef, <2 x float>) #3

declare i32 @b2InternalAssertFcn(ptr noundef, ptr noundef, i32 noundef) #4

; Function Attrs: cold noreturn nounwind memory(inaccessiblemem: write)
declare void @llvm.trap() #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2RotateVector(<2 x float>, <2 x float>) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2Sub(<2 x float>, <2 x float>) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2RelativeAngle(<2 x float>, <2 x float>) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2UnwindAngle(float noundef) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2MulSub(<2 x float>, float noundef, <2 x float>) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2Cross(<2 x float>, <2 x float>) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2MulAdd(<2 x float>, float noundef, <2 x float>) #3

; Function Attrs: nounwind uwtable
define dso_local void @b2SolveMotorJoint(ptr noundef %0, ptr noundef %1, i1 noundef zeroext %2) #7 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca %struct.b2BodyState, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca %struct.b2Vec2, align 4
  %16 = alloca float, align 4
  %17 = alloca %struct.b2Vec2, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  %21 = alloca float, align 4
  %22 = alloca float, align 4
  %23 = alloca float, align 4
  %24 = alloca float, align 4
  %25 = alloca %struct.b2Vec2, align 4
  %26 = alloca %struct.b2Vec2, align 4
  %27 = alloca %struct.b2Vec2, align 4
  %28 = alloca %struct.b2Vec2, align 4
  %29 = alloca %struct.b2Vec2, align 4
  %30 = alloca %struct.b2Vec2, align 4
  %31 = alloca %struct.b2Vec2, align 4
  %32 = alloca %struct.b2Vec2, align 4
  %33 = alloca %struct.b2Vec2, align 4
  %34 = alloca %struct.b2Vec2, align 4
  %35 = alloca %struct.b2Vec2, align 4
  %36 = alloca %struct.b2Vec2, align 4
  %37 = alloca %struct.b2Vec2, align 4
  %38 = alloca %struct.b2Vec2, align 4
  %39 = alloca %struct.b2Vec2, align 4
  %40 = alloca %struct.b2Vec2, align 4
  %41 = alloca float, align 4
  %42 = alloca %struct.b2Vec2, align 4
  %43 = alloca %struct.b2Vec2, align 4
  %44 = alloca %struct.b2Vec2, align 4
  %45 = alloca %struct.b2Vec2, align 4
  %46 = alloca %struct.b2Vec2, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %47 = zext i1 %2 to i8
  store i8 %47, ptr %6, align 1, !tbaa !9
  br label %48

48:                                               ; preds = %3
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.b2JointSim, ptr %49, i32 0, i32 3
  %51 = load i32, ptr %50, align 4, !tbaa !11
  %52 = icmp eq i32 %51, 2
  br i1 %52, label %57, label %53

53:                                               ; preds = %48
  %54 = call i32 @b2InternalAssertFcn(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 190)
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %57

56:                                               ; preds = %53
  call void @llvm.trap()
  br label %57

57:                                               ; preds = %56, %53, %48
  br label %58

58:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.b2JointSim, ptr %59, i32 0, i32 6
  %61 = load float, ptr %60, align 4, !tbaa !16
  store float %61, ptr %7, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.b2JointSim, ptr %62, i32 0, i32 7
  %64 = load float, ptr %63, align 4, !tbaa !18
  store float %64, ptr %8, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.b2JointSim, ptr %65, i32 0, i32 8
  %67 = load float, ptr %66, align 4, !tbaa !19
  store float %67, ptr %9, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.b2JointSim, ptr %68, i32 0, i32 9
  %70 = load float, ptr %69, align 4, !tbaa !20
  store float %70, ptr %10, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 @__const.b2SolveMotorJoint.dummyState, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.b2JointSim, ptr %71, i32 0, i32 10
  store ptr %72, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %73 = load ptr, ptr %12, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.b2MotorJoint, ptr %73, i32 0, i32 7
  %75 = load i32, ptr %74, align 4, !tbaa !21
  %76 = icmp eq i32 %75, -1
  br i1 %76, label %77, label %78

77:                                               ; preds = %58
  br label %87

78:                                               ; preds = %58
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.b2StepContext, ptr %79, i32 0, i32 12
  %81 = load ptr, ptr %80, align 8, !tbaa !24
  %82 = load ptr, ptr %12, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.b2MotorJoint, ptr %82, i32 0, i32 7
  %84 = load i32, ptr %83, align 4, !tbaa !21
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds %struct.b2BodyState, ptr %81, i64 %85
  br label %87

87:                                               ; preds = %78, %77
  %88 = phi ptr [ %11, %77 ], [ %86, %78 ]
  store ptr %88, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %89 = load ptr, ptr %12, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.b2MotorJoint, ptr %89, i32 0, i32 8
  %91 = load i32, ptr %90, align 4, !tbaa !29
  %92 = icmp eq i32 %91, -1
  br i1 %92, label %93, label %94

93:                                               ; preds = %87
  br label %103

94:                                               ; preds = %87
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.b2StepContext, ptr %95, i32 0, i32 12
  %97 = load ptr, ptr %96, align 8, !tbaa !24
  %98 = load ptr, ptr %12, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.b2MotorJoint, ptr %98, i32 0, i32 8
  %100 = load i32, ptr %99, align 4, !tbaa !29
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds %struct.b2BodyState, ptr %97, i64 %101
  br label %103

103:                                              ; preds = %94, %93
  %104 = phi ptr [ %11, %93 ], [ %102, %94 ]
  store ptr %104, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %105 = load ptr, ptr %13, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.b2BodyState, ptr %105, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %106, i64 8, i1 false), !tbaa.struct !30
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %107 = load ptr, ptr %13, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.b2BodyState, ptr %107, i32 0, i32 1
  %109 = load float, ptr %108, align 4, !tbaa !31
  store float %109, ptr %16, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %110 = load ptr, ptr %14, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.b2BodyState, ptr %110, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %111, i64 8, i1 false), !tbaa.struct !30
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %112 = load ptr, ptr %14, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.b2BodyState, ptr %112, i32 0, i32 1
  %114 = load float, ptr %113, align 4, !tbaa !31
  store float %114, ptr %18, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %115 = load ptr, ptr %14, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.b2BodyState, ptr %115, i32 0, i32 4
  %117 = load ptr, ptr %13, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.b2BodyState, ptr %117, i32 0, i32 4
  %119 = load <2 x float>, ptr %116, align 4
  %120 = load <2 x float>, ptr %118, align 4
  %121 = call float @b2RelativeAngle(<2 x float> %119, <2 x float> %120)
  %122 = load ptr, ptr %12, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.b2MotorJoint, ptr %122, i32 0, i32 12
  %124 = load float, ptr %123, align 4, !tbaa !34
  %125 = fadd float %121, %124
  store float %125, ptr %19, align 4, !tbaa !17
  %126 = load float, ptr %19, align 4, !tbaa !17
  %127 = call float @b2UnwindAngle(float noundef %126)
  store float %127, ptr %19, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.b2StepContext, ptr %128, i32 0, i32 3
  %130 = load float, ptr %129, align 4, !tbaa !35
  %131 = load ptr, ptr %12, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.b2MotorJoint, ptr %131, i32 0, i32 6
  %133 = load float, ptr %132, align 4, !tbaa !36
  %134 = fmul float %130, %133
  %135 = load float, ptr %19, align 4, !tbaa !17
  %136 = fmul float %134, %135
  store float %136, ptr %20, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  %137 = load float, ptr %18, align 4, !tbaa !17
  %138 = load float, ptr %16, align 4, !tbaa !17
  %139 = fsub float %137, %138
  store float %139, ptr %21, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  %140 = load ptr, ptr %12, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.b2MotorJoint, ptr %140, i32 0, i32 14
  %142 = load float, ptr %141, align 4, !tbaa !37
  %143 = fneg float %142
  %144 = load float, ptr %21, align 4, !tbaa !17
  %145 = load float, ptr %20, align 4, !tbaa !17
  %146 = fadd float %144, %145
  %147 = fmul float %143, %146
  store float %147, ptr %22, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  %148 = load ptr, ptr %12, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.b2MotorJoint, ptr %148, i32 0, i32 3
  %150 = load float, ptr %149, align 4, !tbaa !38
  store float %150, ptr %23, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  %151 = load ptr, ptr %5, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.b2StepContext, ptr %151, i32 0, i32 2
  %153 = load float, ptr %152, align 8, !tbaa !39
  %154 = load ptr, ptr %12, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.b2MotorJoint, ptr %154, i32 0, i32 5
  %156 = load float, ptr %155, align 4, !tbaa !40
  %157 = fmul float %153, %156
  store float %157, ptr %24, align 4, !tbaa !17
  %158 = load ptr, ptr %12, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.b2MotorJoint, ptr %158, i32 0, i32 3
  %160 = load float, ptr %159, align 4, !tbaa !38
  %161 = load float, ptr %22, align 4, !tbaa !17
  %162 = fadd float %160, %161
  %163 = load float, ptr %24, align 4, !tbaa !17
  %164 = fneg float %163
  %165 = load float, ptr %24, align 4, !tbaa !17
  %166 = call float @b2ClampFloat(float noundef %162, float noundef %164, float noundef %165)
  %167 = load ptr, ptr %12, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.b2MotorJoint, ptr %167, i32 0, i32 3
  store float %166, ptr %168, align 4, !tbaa !38
  %169 = load ptr, ptr %12, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.b2MotorJoint, ptr %169, i32 0, i32 3
  %171 = load float, ptr %170, align 4, !tbaa !38
  %172 = load float, ptr %23, align 4, !tbaa !17
  %173 = fsub float %171, %172
  store float %173, ptr %22, align 4, !tbaa !17
  %174 = load float, ptr %9, align 4, !tbaa !17
  %175 = load float, ptr %22, align 4, !tbaa !17
  %176 = load float, ptr %16, align 4, !tbaa !17
  %177 = fneg float %174
  %178 = call float @llvm.fmuladd.f32(float %177, float %175, float %176)
  store float %178, ptr %16, align 4, !tbaa !17
  %179 = load float, ptr %10, align 4, !tbaa !17
  %180 = load float, ptr %22, align 4, !tbaa !17
  %181 = load float, ptr %18, align 4, !tbaa !17
  %182 = call float @llvm.fmuladd.f32(float %179, float %180, float %181)
  store float %182, ptr %18, align 4, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %183 = load ptr, ptr %13, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.b2BodyState, ptr %183, i32 0, i32 4
  %185 = load ptr, ptr %12, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.b2MotorJoint, ptr %185, i32 0, i32 9
  %187 = load <2 x float>, ptr %184, align 4
  %188 = load <2 x float>, ptr %186, align 4
  %189 = call <2 x float> @b2RotateVector(<2 x float> %187, <2 x float> %188)
  store <2 x float> %189, ptr %25, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %190 = load ptr, ptr %14, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.b2BodyState, ptr %190, i32 0, i32 4
  %192 = load ptr, ptr %12, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.b2MotorJoint, ptr %192, i32 0, i32 10
  %194 = load <2 x float>, ptr %191, align 4
  %195 = load <2 x float>, ptr %193, align 4
  %196 = call <2 x float> @b2RotateVector(<2 x float> %194, <2 x float> %195)
  store <2 x float> %196, ptr %26, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  %197 = load ptr, ptr %14, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.b2BodyState, ptr %197, i32 0, i32 3
  %199 = load ptr, ptr %13, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.b2BodyState, ptr %199, i32 0, i32 3
  %201 = load <2 x float>, ptr %198, align 4
  %202 = load <2 x float>, ptr %200, align 4
  %203 = call <2 x float> @b2Sub(<2 x float> %201, <2 x float> %202)
  store <2 x float> %203, ptr %28, align 4
  %204 = load <2 x float>, ptr %26, align 4
  %205 = load <2 x float>, ptr %25, align 4
  %206 = call <2 x float> @b2Sub(<2 x float> %204, <2 x float> %205)
  store <2 x float> %206, ptr %29, align 4
  %207 = load <2 x float>, ptr %28, align 4
  %208 = load <2 x float>, ptr %29, align 4
  %209 = call <2 x float> @b2Add(<2 x float> %207, <2 x float> %208)
  store <2 x float> %209, ptr %27, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #8
  %210 = load ptr, ptr %12, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.b2MotorJoint, ptr %210, i32 0, i32 11
  %212 = load <2 x float>, ptr %211, align 4
  %213 = load <2 x float>, ptr %27, align 4
  %214 = call <2 x float> @b2Add(<2 x float> %212, <2 x float> %213)
  store <2 x float> %214, ptr %30, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #8
  %215 = load ptr, ptr %5, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.b2StepContext, ptr %215, i32 0, i32 3
  %217 = load float, ptr %216, align 4, !tbaa !35
  %218 = load ptr, ptr %12, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.b2MotorJoint, ptr %218, i32 0, i32 6
  %220 = load float, ptr %219, align 4, !tbaa !36
  %221 = fmul float %217, %220
  %222 = load <2 x float>, ptr %30, align 4
  %223 = call <2 x float> @b2MulSV(float noundef %221, <2 x float> %222)
  store <2 x float> %223, ptr %31, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #8
  %224 = load float, ptr %18, align 4, !tbaa !17
  %225 = load <2 x float>, ptr %26, align 4
  %226 = call <2 x float> @b2CrossSV(float noundef %224, <2 x float> %225)
  store <2 x float> %226, ptr %34, align 4
  %227 = load <2 x float>, ptr %17, align 4
  %228 = load <2 x float>, ptr %34, align 4
  %229 = call <2 x float> @b2Add(<2 x float> %227, <2 x float> %228)
  store <2 x float> %229, ptr %33, align 4
  %230 = load float, ptr %16, align 4, !tbaa !17
  %231 = load <2 x float>, ptr %25, align 4
  %232 = call <2 x float> @b2CrossSV(float noundef %230, <2 x float> %231)
  store <2 x float> %232, ptr %36, align 4
  %233 = load <2 x float>, ptr %15, align 4
  %234 = load <2 x float>, ptr %36, align 4
  %235 = call <2 x float> @b2Add(<2 x float> %233, <2 x float> %234)
  store <2 x float> %235, ptr %35, align 4
  %236 = load <2 x float>, ptr %33, align 4
  %237 = load <2 x float>, ptr %35, align 4
  %238 = call <2 x float> @b2Sub(<2 x float> %236, <2 x float> %237)
  store <2 x float> %238, ptr %32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #8
  %239 = load ptr, ptr %12, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.b2MotorJoint, ptr %239, i32 0, i32 13
  %241 = load <2 x float>, ptr %32, align 4
  %242 = load <2 x float>, ptr %31, align 4
  %243 = call <2 x float> @b2Add(<2 x float> %241, <2 x float> %242)
  store <2 x float> %243, ptr %38, align 4
  %244 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %240, i32 0, i32 0
  %245 = load <2 x float>, ptr %244, align 4
  %246 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %240, i32 0, i32 1
  %247 = load <2 x float>, ptr %246, align 4
  %248 = load <2 x float>, ptr %38, align 4
  %249 = call <2 x float> @b2MulMV(<2 x float> %245, <2 x float> %247, <2 x float> %248)
  store <2 x float> %249, ptr %37, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #8
  %250 = getelementptr inbounds %struct.b2Vec2, ptr %39, i32 0, i32 0
  %251 = getelementptr inbounds %struct.b2Vec2, ptr %37, i32 0, i32 0
  %252 = load float, ptr %251, align 4, !tbaa !41
  %253 = fneg float %252
  store float %253, ptr %250, align 4, !tbaa !41
  %254 = getelementptr inbounds %struct.b2Vec2, ptr %39, i32 0, i32 1
  %255 = getelementptr inbounds %struct.b2Vec2, ptr %37, i32 0, i32 1
  %256 = load float, ptr %255, align 4, !tbaa !42
  %257 = fneg float %256
  store float %257, ptr %254, align 4, !tbaa !42
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #8
  %258 = load ptr, ptr %12, align 8, !tbaa !5
  %259 = getelementptr inbounds %struct.b2MotorJoint, ptr %258, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %40, ptr align 4 %259, i64 8, i1 false), !tbaa.struct !30
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #8
  %260 = load ptr, ptr %5, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.b2StepContext, ptr %260, i32 0, i32 2
  %262 = load float, ptr %261, align 8, !tbaa !39
  %263 = load ptr, ptr %12, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.b2MotorJoint, ptr %263, i32 0, i32 4
  %265 = load float, ptr %264, align 4, !tbaa !43
  %266 = fmul float %262, %265
  store float %266, ptr %41, align 4, !tbaa !17
  %267 = load ptr, ptr %12, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct.b2MotorJoint, ptr %267, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #8
  %269 = load ptr, ptr %12, align 8, !tbaa !5
  %270 = getelementptr inbounds %struct.b2MotorJoint, ptr %269, i32 0, i32 2
  %271 = load <2 x float>, ptr %270, align 4
  %272 = load <2 x float>, ptr %39, align 4
  %273 = call <2 x float> @b2Add(<2 x float> %271, <2 x float> %272)
  store <2 x float> %273, ptr %42, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %268, ptr align 4 %42, i64 8, i1 false), !tbaa.struct !30
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #8
  %274 = load ptr, ptr %12, align 8, !tbaa !5
  %275 = getelementptr inbounds %struct.b2MotorJoint, ptr %274, i32 0, i32 2
  %276 = load <2 x float>, ptr %275, align 4
  %277 = call float @b2LengthSquared(<2 x float> %276)
  %278 = load float, ptr %41, align 4, !tbaa !17
  %279 = load float, ptr %41, align 4, !tbaa !17
  %280 = fmul float %278, %279
  %281 = fcmp ogt float %277, %280
  br i1 %281, label %282, label %301

282:                                              ; preds = %103
  %283 = load ptr, ptr %12, align 8, !tbaa !5
  %284 = getelementptr inbounds %struct.b2MotorJoint, ptr %283, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #8
  %285 = load ptr, ptr %12, align 8, !tbaa !5
  %286 = getelementptr inbounds %struct.b2MotorJoint, ptr %285, i32 0, i32 2
  %287 = load <2 x float>, ptr %286, align 4
  %288 = call <2 x float> @b2Normalize(<2 x float> %287)
  store <2 x float> %288, ptr %43, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %284, ptr align 4 %43, i64 8, i1 false), !tbaa.struct !30
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #8
  %289 = load float, ptr %41, align 4, !tbaa !17
  %290 = load ptr, ptr %12, align 8, !tbaa !5
  %291 = getelementptr inbounds %struct.b2MotorJoint, ptr %290, i32 0, i32 2
  %292 = getelementptr inbounds %struct.b2Vec2, ptr %291, i32 0, i32 0
  %293 = load float, ptr %292, align 4, !tbaa !44
  %294 = fmul float %293, %289
  store float %294, ptr %292, align 4, !tbaa !44
  %295 = load float, ptr %41, align 4, !tbaa !17
  %296 = load ptr, ptr %12, align 8, !tbaa !5
  %297 = getelementptr inbounds %struct.b2MotorJoint, ptr %296, i32 0, i32 2
  %298 = getelementptr inbounds %struct.b2Vec2, ptr %297, i32 0, i32 1
  %299 = load float, ptr %298, align 4, !tbaa !45
  %300 = fmul float %299, %295
  store float %300, ptr %298, align 4, !tbaa !45
  br label %301

301:                                              ; preds = %282, %103
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #8
  %302 = load ptr, ptr %12, align 8, !tbaa !5
  %303 = getelementptr inbounds %struct.b2MotorJoint, ptr %302, i32 0, i32 2
  %304 = load <2 x float>, ptr %303, align 4
  %305 = load <2 x float>, ptr %40, align 4
  %306 = call <2 x float> @b2Sub(<2 x float> %304, <2 x float> %305)
  store <2 x float> %306, ptr %44, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %39, ptr align 4 %44, i64 8, i1 false), !tbaa.struct !30
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #8
  %307 = load float, ptr %7, align 4, !tbaa !17
  %308 = load <2 x float>, ptr %15, align 4
  %309 = load <2 x float>, ptr %39, align 4
  %310 = call <2 x float> @b2MulSub(<2 x float> %308, float noundef %307, <2 x float> %309)
  store <2 x float> %310, ptr %45, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %45, i64 8, i1 false), !tbaa.struct !30
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #8
  %311 = load float, ptr %9, align 4, !tbaa !17
  %312 = load <2 x float>, ptr %25, align 4
  %313 = load <2 x float>, ptr %39, align 4
  %314 = call float @b2Cross(<2 x float> %312, <2 x float> %313)
  %315 = load float, ptr %16, align 4, !tbaa !17
  %316 = fneg float %311
  %317 = call float @llvm.fmuladd.f32(float %316, float %314, float %315)
  store float %317, ptr %16, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #8
  %318 = load float, ptr %8, align 4, !tbaa !17
  %319 = load <2 x float>, ptr %17, align 4
  %320 = load <2 x float>, ptr %39, align 4
  %321 = call <2 x float> @b2MulAdd(<2 x float> %319, float noundef %318, <2 x float> %320)
  store <2 x float> %321, ptr %46, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %46, i64 8, i1 false), !tbaa.struct !30
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #8
  %322 = load float, ptr %10, align 4, !tbaa !17
  %323 = load <2 x float>, ptr %26, align 4
  %324 = load <2 x float>, ptr %39, align 4
  %325 = call float @b2Cross(<2 x float> %323, <2 x float> %324)
  %326 = load float, ptr %18, align 4, !tbaa !17
  %327 = call float @llvm.fmuladd.f32(float %322, float %325, float %326)
  store float %327, ptr %18, align 4, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  %328 = load ptr, ptr %13, align 8, !tbaa !5
  %329 = getelementptr inbounds %struct.b2BodyState, ptr %328, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %329, ptr align 4 %15, i64 8, i1 false), !tbaa.struct !30
  %330 = load float, ptr %16, align 4, !tbaa !17
  %331 = load ptr, ptr %13, align 8, !tbaa !5
  %332 = getelementptr inbounds %struct.b2BodyState, ptr %331, i32 0, i32 1
  store float %330, ptr %332, align 4, !tbaa !31
  %333 = load ptr, ptr %14, align 8, !tbaa !5
  %334 = getelementptr inbounds %struct.b2BodyState, ptr %333, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %334, ptr align 4 %17, i64 8, i1 false), !tbaa.struct !30
  %335 = load float, ptr %18, align 4, !tbaa !17
  %336 = load ptr, ptr %14, align 8, !tbaa !5
  %337 = getelementptr inbounds %struct.b2BodyState, ptr %336, i32 0, i32 1
  store float %335, ptr %337, align 4, !tbaa !31
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  ret void
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2Add(<2 x float>, <2 x float>) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2CrossSV(float noundef, <2 x float>) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2MulMV(<2 x float>, <2 x float>, <2 x float>) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2LengthSquared(<2 x float>) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2Normalize(<2 x float>) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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 = { inlinehint nounwind uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 = { cold noreturn nounwind memory(inaccessiblemem: write) }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"_Bool", !7, i64 0}
!11 = !{!12, !13, i64 12}
!12 = !{!"b2JointSim", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !14, i64 16, !14, i64 24, !15, i64 32, !15, i64 36, !15, i64 40, !15, i64 44, !7, i64 48}
!13 = !{!"int", !7, i64 0}
!14 = !{!"b2Vec2", !15, i64 0, !15, i64 4}
!15 = !{!"float", !7, i64 0}
!16 = !{!12, !15, i64 32}
!17 = !{!15, !15, i64 0}
!18 = !{!12, !15, i64 36}
!19 = !{!12, !15, i64 40}
!20 = !{!12, !15, i64 44}
!21 = !{!22, !13, i64 36}
!22 = !{!"b2MotorJoint", !14, i64 0, !15, i64 8, !14, i64 12, !15, i64 20, !15, i64 24, !15, i64 28, !15, i64 32, !13, i64 36, !13, i64 40, !14, i64 44, !14, i64 52, !14, i64 60, !15, i64 68, !23, i64 72, !15, i64 88}
!23 = !{!"b2Mat22", !14, i64 0, !14, i64 8}
!24 = !{!25, !6, i64 80}
!25 = !{!"b2StepContext", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !13, i64 16, !26, i64 20, !26, i64 32, !26, i64 44, !15, i64 56, !15, i64 60, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !13, i64 104, !6, i64 112, !27, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !13, i64 152, !13, i64 156, !6, i64 160, !13, i64 168, !10, i64 172, !7, i64 173, !28, i64 240, !7, i64 244}
!26 = !{!"b2Softness", !15, i64 0, !15, i64 4, !15, i64 8}
!27 = !{!"b2AtomicInt", !13, i64 0}
!28 = !{!"b2AtomicU32", !13, i64 0}
!29 = !{!22, !13, i64 40}
!30 = !{i64 0, i64 4, !17, i64 4, i64 4, !17}
!31 = !{!32, !15, i64 8}
!32 = !{!"b2BodyState", !14, i64 0, !15, i64 8, !13, i64 12, !14, i64 16, !33, i64 24}
!33 = !{!"b2Rot", !15, i64 0, !15, i64 4}
!34 = !{!22, !15, i64 68}
!35 = !{!25, !15, i64 12}
!36 = !{!22, !15, i64 32}
!37 = !{!22, !15, i64 88}
!38 = !{!22, !15, i64 20}
!39 = !{!25, !15, i64 8}
!40 = !{!22, !15, i64 28}
!41 = !{!14, !15, i64 0}
!42 = !{!14, !15, i64 4}
!43 = !{!22, !15, i64 24}
!44 = !{!22, !15, i64 12}
!45 = !{!22, !15, i64 16}


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

%struct.b2BodyState = type { %struct.b2Vec2, float, i32, %struct.b2Vec2, %struct.b2Rot }
%struct.b2Vec2 = type { float, float }
%struct.b2Rot = type { float, float }

@.str = external hidden unnamed_addr constant [28 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [67 x i8], align 1
@__const.b2SolveMotorJoint.dummyState = external hidden unnamed_addr constant %struct.b2BodyState, 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2ClampFloat(float noundef, float noundef, float noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2MulSV(float noundef, <2 x float>) local_unnamed_addr #3

declare i32 @b2InternalAssertFcn(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: cold noreturn nounwind memory(inaccessiblemem: write)
declare void @llvm.trap() #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2RotateVector(<2 x float>, <2 x float>) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2Sub(<2 x float>, <2 x float>) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2RelativeAngle(<2 x float>, <2 x float>) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2UnwindAngle(float noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2MulSub(<2 x float>, float noundef, <2 x float>) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2Cross(<2 x float>, <2 x float>) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2MulAdd(<2 x float>, float noundef, <2 x float>) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local void @b2SolveMotorJoint(ptr nocapture noundef %0, ptr nocapture noundef readonly %1, i1 noundef zeroext %2) local_unnamed_addr #7 {
  %4 = alloca %struct.b2BodyState, align 4
  %5 = getelementptr inbounds i8, ptr %0, i64 12
  %6 = load i32, ptr %5, align 4, !tbaa !5
  %7 = icmp eq i32 %6, 2
  br i1 %7, label %11, label %8

8:                                                ; preds = %3
  %9 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 190) #8
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %11, label %10

10:                                               ; preds = %8
  tail call void @llvm.trap()
  unreachable

11:                                               ; preds = %3, %8
  %12 = getelementptr inbounds i8, ptr %0, i64 32
  %13 = load float, ptr %12, align 4, !tbaa !12
  %14 = getelementptr inbounds i8, ptr %0, i64 36
  %15 = load float, ptr %14, align 4, !tbaa !13
  %16 = getelementptr inbounds i8, ptr %0, i64 40
  %17 = load float, ptr %16, align 4, !tbaa !14
  %18 = getelementptr inbounds i8, ptr %0, i64 44
  %19 = load float, ptr %18, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(32) %4, ptr noundef nonnull align 4 dereferenceable(32) @__const.b2SolveMotorJoint.dummyState, i64 32, i1 false)
  %20 = getelementptr inbounds i8, ptr %0, i64 84
  %21 = load i32, ptr %20, align 4, !tbaa !16
  %22 = icmp eq i32 %21, -1
  br i1 %22, label %28, label %23

23:                                               ; preds = %11
  %24 = getelementptr inbounds i8, ptr %1, i64 80
  %25 = load ptr, ptr %24, align 8, !tbaa !19
  %26 = sext i32 %21 to i64
  %27 = getelementptr inbounds %struct.b2BodyState, ptr %25, i64 %26
  br label %28

28:                                               ; preds = %11, %23
  %29 = phi ptr [ %27, %23 ], [ %4, %11 ]
  %30 = getelementptr inbounds i8, ptr %0, i64 88
  %31 = load i32, ptr %30, align 4, !tbaa !26
  %32 = icmp eq i32 %31, -1
  br i1 %32, label %38, label %33

33:                                               ; preds = %28
  %34 = getelementptr inbounds i8, ptr %1, i64 80
  %35 = load ptr, ptr %34, align 8, !tbaa !19
  %36 = sext i32 %31 to i64
  %37 = getelementptr inbounds %struct.b2BodyState, ptr %35, i64 %36
  br label %38

38:                                               ; preds = %28, %33
  %39 = phi ptr [ %37, %33 ], [ %4, %28 ]
  %.sroa.056.0.copyload = load <2 x float>, ptr %29, align 4
  %40 = getelementptr inbounds i8, ptr %29, i64 8
  %41 = load float, ptr %40, align 4, !tbaa !27
  %.sroa.048.0.copyload = load <2 x float>, ptr %39, align 4
  %42 = getelementptr inbounds i8, ptr %39, i64 8
  %43 = load float, ptr %42, align 4, !tbaa !27
  %44 = getelementptr inbounds i8, ptr %39, i64 24
  %45 = getelementptr inbounds i8, ptr %29, i64 24
  %46 = load <2 x float>, ptr %44, align 4
  %47 = load <2 x float>, ptr %45, align 4
  %48 = tail call float @b2RelativeAngle(<2 x float> %46, <2 x float> %47)
  %49 = getelementptr inbounds i8, ptr %0, i64 116
  %50 = load float, ptr %49, align 4, !tbaa !30
  %51 = fadd float %48, %50
  %52 = tail call float @b2UnwindAngle(float noundef %51)
  %53 = getelementptr inbounds i8, ptr %1, i64 12
  %54 = load float, ptr %53, align 4, !tbaa !31
  %55 = getelementptr inbounds i8, ptr %0, i64 80
  %56 = load float, ptr %55, align 4, !tbaa !32
  %57 = fmul float %54, %56
  %58 = fmul float %52, %57
  %59 = fsub float %43, %41
  %60 = getelementptr inbounds i8, ptr %0, i64 136
  %61 = load float, ptr %60, align 4, !tbaa !33
  %62 = fadd float %59, %58
  %63 = getelementptr inbounds i8, ptr %0, i64 68
  %64 = load float, ptr %63, align 4, !tbaa !34
  %65 = getelementptr inbounds i8, ptr %1, i64 8
  %66 = load float, ptr %65, align 8, !tbaa !35
  %67 = getelementptr inbounds i8, ptr %0, i64 76
  %68 = load float, ptr %67, align 4, !tbaa !36
  %69 = fmul float %66, %68
  %70 = fmul float %61, %62
  %71 = fsub float %64, %70
  %72 = fneg float %69
  %73 = tail call float @b2ClampFloat(float noundef %71, float noundef %72, float noundef %69)
  store float %73, ptr %63, align 4, !tbaa !34
  %74 = fsub float %73, %64
  %75 = fneg float %17
  %76 = tail call float @llvm.fmuladd.f32(float %75, float %74, float %41)
  %77 = tail call float @llvm.fmuladd.f32(float %19, float %74, float %43)
  %78 = getelementptr inbounds i8, ptr %0, i64 92
  %79 = load <2 x float>, ptr %45, align 4
  %80 = load <2 x float>, ptr %78, align 4
  %81 = tail call <2 x float> @b2RotateVector(<2 x float> %79, <2 x float> %80)
  %82 = getelementptr inbounds i8, ptr %0, i64 100
  %83 = load <2 x float>, ptr %44, align 4
  %84 = load <2 x float>, ptr %82, align 4
  %85 = tail call <2 x float> @b2RotateVector(<2 x float> %83, <2 x float> %84)
  %86 = getelementptr inbounds i8, ptr %39, i64 16
  %87 = getelementptr inbounds i8, ptr %29, i64 16
  %88 = load <2 x float>, ptr %86, align 4
  %89 = load <2 x float>, ptr %87, align 4
  %90 = tail call <2 x float> @b2Sub(<2 x float> %88, <2 x float> %89)
  %91 = tail call <2 x float> @b2Sub(<2 x float> %85, <2 x float> %81)
  %92 = tail call <2 x float> @b2Add(<2 x float> %90, <2 x float> %91)
  %93 = getelementptr inbounds i8, ptr %0, i64 108
  %94 = load <2 x float>, ptr %93, align 4
  %95 = tail call <2 x float> @b2Add(<2 x float> %94, <2 x float> %92)
  %96 = load float, ptr %53, align 4, !tbaa !31
  %97 = load float, ptr %55, align 4, !tbaa !32
  %98 = fmul float %96, %97
  %99 = tail call <2 x float> @b2MulSV(float noundef %98, <2 x float> %95)
  %100 = tail call <2 x float> @b2CrossSV(float noundef %77, <2 x float> %85)
  %101 = tail call <2 x float> @b2Add(<2 x float> %.sroa.048.0.copyload, <2 x float> %100)
  %102 = tail call <2 x float> @b2CrossSV(float noundef %76, <2 x float> %81)
  %103 = tail call <2 x float> @b2Add(<2 x float> %.sroa.056.0.copyload, <2 x float> %102)
  %104 = tail call <2 x float> @b2Sub(<2 x float> %101, <2 x float> %103)
  %105 = getelementptr inbounds i8, ptr %0, i64 120
  %106 = tail call <2 x float> @b2Add(<2 x float> %104, <2 x float> %99)
  %107 = load <2 x float>, ptr %105, align 4
  %108 = getelementptr inbounds i8, ptr %0, i64 128
  %109 = load <2 x float>, ptr %108, align 4
  %110 = tail call <2 x float> @b2MulMV(<2 x float> %107, <2 x float> %109, <2 x float> %106)
  %111 = fneg <2 x float> %110
  %112 = getelementptr inbounds i8, ptr %0, i64 60
  %.sroa.08.0.copyload = load <2 x float>, ptr %112, align 4
  %113 = load float, ptr %65, align 8, !tbaa !35
  %114 = getelementptr inbounds i8, ptr %0, i64 72
  %115 = load float, ptr %114, align 4, !tbaa !37
  %116 = fmul float %113, %115
  %117 = tail call <2 x float> @b2Add(<2 x float> %.sroa.08.0.copyload, <2 x float> %111)
  store <2 x float> %117, ptr %112, align 4
  %118 = tail call float @b2LengthSquared(<2 x float> %117)
  %119 = fmul float %116, %116
  %120 = fcmp ogt float %118, %119
  br i1 %120, label %121, label %127

121:                                              ; preds = %38
  %122 = load <2 x float>, ptr %112, align 4
  %123 = tail call <2 x float> @b2Normalize(<2 x float> %122)
  %124 = insertelement <2 x float> poison, float %116, i64 0
  %125 = shufflevector <2 x float> %124, <2 x float> poison, <2 x i32> zeroinitializer
  %126 = fmul <2 x float> %125, %123
  store <2 x float> %126, ptr %112, align 4, !tbaa !38
  br label %127

127:                                              ; preds = %121, %38
  %128 = load <2 x float>, ptr %112, align 4
  %129 = tail call <2 x float> @b2Sub(<2 x float> %128, <2 x float> %.sroa.08.0.copyload)
  %130 = tail call <2 x float> @b2MulSub(<2 x float> %.sroa.056.0.copyload, float noundef %13, <2 x float> %129)
  %131 = tail call float @b2Cross(<2 x float> %81, <2 x float> %129)
  %132 = tail call float @llvm.fmuladd.f32(float %75, float %131, float %76)
  %133 = tail call <2 x float> @b2MulAdd(<2 x float> %.sroa.048.0.copyload, float noundef %15, <2 x float> %129)
  %134 = tail call float @b2Cross(<2 x float> %85, <2 x float> %129)
  %135 = tail call float @llvm.fmuladd.f32(float %19, float %134, float %77)
  store <2 x float> %130, ptr %29, align 4
  store float %132, ptr %40, align 4, !tbaa !27
  store <2 x float> %133, ptr %39, align 4
  store float %135, ptr %42, align 4, !tbaa !27
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #8
  ret void
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2Add(<2 x float>, <2 x float>) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2CrossSV(float noundef, <2 x float>) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2MulMV(<2 x float>, <2 x float>, <2 x float>) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2LengthSquared(<2 x float>) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @b2Normalize(<2 x float>) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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 = { inlinehint nounwind uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 = { cold noreturn nounwind memory(inaccessiblemem: write) }
attributes #6 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { 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, !7, i64 12}
!6 = !{!"b2JointSim", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16, !10, i64 24, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !8, i64 48}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"b2Vec2", !11, i64 0, !11, i64 4}
!11 = !{!"float", !8, i64 0}
!12 = !{!6, !11, i64 32}
!13 = !{!6, !11, i64 36}
!14 = !{!6, !11, i64 40}
!15 = !{!6, !11, i64 44}
!16 = !{!17, !7, i64 36}
!17 = !{!"b2MotorJoint", !10, i64 0, !11, i64 8, !10, i64 12, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !7, i64 36, !7, i64 40, !10, i64 44, !10, i64 52, !10, i64 60, !11, i64 68, !18, i64 72, !11, i64 88}
!18 = !{!"b2Mat22", !10, i64 0, !10, i64 8}
!19 = !{!20, !22, i64 80}
!20 = !{!"b2StepContext", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !7, i64 16, !21, i64 20, !21, i64 32, !21, i64 44, !11, i64 56, !11, i64 60, !22, i64 64, !22, i64 72, !22, i64 80, !22, i64 88, !22, i64 96, !7, i64 104, !22, i64 112, !23, i64 120, !22, i64 128, !22, i64 136, !22, i64 144, !7, i64 152, !7, i64 156, !22, i64 160, !7, i64 168, !24, i64 172, !8, i64 173, !25, i64 240, !8, i64 244}
!21 = !{!"b2Softness", !11, i64 0, !11, i64 4, !11, i64 8}
!22 = !{!"any pointer", !8, i64 0}
!23 = !{!"b2AtomicInt", !7, i64 0}
!24 = !{!"_Bool", !8, i64 0}
!25 = !{!"b2AtomicU32", !7, i64 0}
!26 = !{!17, !7, i64 40}
!27 = !{!28, !11, i64 8}
!28 = !{!"b2BodyState", !10, i64 0, !11, i64 8, !7, i64 12, !10, i64 16, !29, i64 24}
!29 = !{!"b2Rot", !11, i64 0, !11, i64 4}
!30 = !{!17, !11, i64 68}
!31 = !{!20, !11, i64 12}
!32 = !{!17, !11, i64 32}
!33 = !{!17, !11, i64 88}
!34 = !{!17, !11, i64 20}
!35 = !{!20, !11, i64 8}
!36 = !{!17, !11, i64 28}
!37 = !{!17, !11, i64 24}
!38 = !{!11, !11, i64 0}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass