; LLVM IR from erincatto/box2d :: src (mouse_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.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.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 }
%struct.b2MouseJoint = type { %struct.b2Vec2, float, float, float, %struct.b2Vec2, float, %struct.b2Softness, %struct.b2Softness, i32, %struct.b2Vec2, %struct.b2Vec2, %struct.b2Mat22 }
%struct.b2Mat22 = type { %struct.b2Vec2, %struct.b2Vec2 }
%struct.b2BodyState = type { %struct.b2Vec2, float, i32, %struct.b2Vec2, %struct.b2Rot }

; 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 <2 x float> @b2MulSV(float noundef, <2 x float>) #2

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @b2SolveMouseJoint(ptr noundef %0, ptr noundef %1) #4 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %struct.b2Vec2, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca %struct.b2Rot, align 4
  %16 = alloca %struct.b2Vec2, align 4
  %17 = alloca %struct.b2Vec2, align 4
  %18 = alloca %struct.b2Vec2, align 4
  %19 = alloca %struct.b2Vec2, align 4
  %20 = alloca %struct.b2Vec2, align 4
  %21 = alloca %struct.b2Vec2, align 4
  %22 = alloca float, align 4
  %23 = alloca float, align 4
  %24 = alloca %struct.b2Vec2, align 4
  %25 = alloca %struct.b2Vec2, align 4
  %26 = alloca %struct.b2Vec2, align 4
  %27 = alloca %struct.b2Vec2, align 4
  %28 = alloca float, align 4
  %29 = alloca %struct.b2Vec2, align 4
  %30 = alloca %struct.b2Vec2, align 4
  %31 = alloca %struct.b2Vec2, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.b2JointSim, ptr %32, i32 0, i32 7
  %34 = load float, ptr %33, align 4, !tbaa !9
  store float %34, ptr %5, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.b2JointSim, ptr %35, i32 0, i32 9
  %37 = load float, ptr %36, align 4, !tbaa !15
  store float %37, ptr %6, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.b2JointSim, ptr %38, i32 0, i32 10
  store ptr %39, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.b2StepContext, ptr %40, i32 0, i32 12
  %42 = load ptr, ptr %41, align 8, !tbaa !16
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.b2MouseJoint, ptr %43, i32 0, i32 8
  %45 = load i32, ptr %44, align 4, !tbaa !22
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds %struct.b2BodyState, ptr %42, i64 %46
  store ptr %47, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.b2BodyState, ptr %48, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %49, i64 8, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.b2BodyState, ptr %50, i32 0, i32 1
  %52 = load float, ptr %51, align 4, !tbaa !26
  store float %52, ptr %10, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.b2MouseJoint, ptr %53, i32 0, i32 7
  %55 = getelementptr inbounds %struct.b2Softness, ptr %54, i32 0, i32 1
  %56 = load float, ptr %55, align 4, !tbaa !29
  store float %56, ptr %11, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.b2MouseJoint, ptr %57, i32 0, i32 7
  %59 = getelementptr inbounds %struct.b2Softness, ptr %58, i32 0, i32 2
  %60 = load float, ptr %59, align 4, !tbaa !30
  store float %60, ptr %12, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %61 = load float, ptr %6, align 4, !tbaa !14
  %62 = fcmp ogt float %61, 0.000000e+00
  br i1 %62, label %63, label %68

63:                                               ; preds = %2
  %64 = load float, ptr %10, align 4, !tbaa !14
  %65 = fneg float %64
  %66 = load float, ptr %6, align 4, !tbaa !14
  %67 = fdiv float %65, %66
  br label %69

68:                                               ; preds = %2
  br label %69

69:                                               ; preds = %68, %63
  %70 = phi float [ %67, %63 ], [ 0.000000e+00, %68 ]
  store float %70, ptr %13, align 4, !tbaa !14
  %71 = load float, ptr %11, align 4, !tbaa !14
  %72 = load float, ptr %13, align 4, !tbaa !14
  %73 = load float, ptr %12, align 4, !tbaa !14
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.b2MouseJoint, ptr %74, i32 0, i32 5
  %76 = load float, ptr %75, align 4, !tbaa !31
  %77 = fmul float %73, %76
  %78 = fneg float %77
  %79 = call float @llvm.fmuladd.f32(float %71, float %72, float %78)
  store float %79, ptr %13, align 4, !tbaa !14
  %80 = load float, ptr %13, align 4, !tbaa !14
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.b2MouseJoint, ptr %81, i32 0, i32 5
  %83 = load float, ptr %82, align 4, !tbaa !31
  %84 = fadd float %83, %80
  store float %84, ptr %82, align 4, !tbaa !31
  %85 = load float, ptr %6, align 4, !tbaa !14
  %86 = load float, ptr %13, align 4, !tbaa !14
  %87 = load float, ptr %10, align 4, !tbaa !14
  %88 = call float @llvm.fmuladd.f32(float %85, float %86, float %87)
  store float %88, ptr %10, align 4, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.b2MouseJoint, ptr %89, i32 0, i32 3
  %91 = load float, ptr %90, align 4, !tbaa !32
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.b2StepContext, ptr %92, i32 0, i32 2
  %94 = load float, ptr %93, align 8, !tbaa !33
  %95 = fmul float %91, %94
  store float %95, ptr %14, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %96 = load ptr, ptr %8, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.b2BodyState, ptr %96, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %97, i64 8, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.b2MouseJoint, ptr %98, i32 0, i32 9
  %100 = load <2 x float>, ptr %15, align 4
  %101 = load <2 x float>, ptr %99, align 4
  %102 = call <2 x float> @b2RotateVector(<2 x float> %100, <2 x float> %101)
  store <2 x float> %102, ptr %16, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %103 = load float, ptr %10, align 4, !tbaa !14
  %104 = load <2 x float>, ptr %16, align 4
  %105 = call <2 x float> @b2CrossSV(float noundef %103, <2 x float> %104)
  store <2 x float> %105, ptr %18, align 4
  %106 = load <2 x float>, ptr %9, align 4
  %107 = load <2 x float>, ptr %18, align 4
  %108 = call <2 x float> @b2Add(<2 x float> %106, <2 x float> %107)
  store <2 x float> %108, ptr %17, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %109 = load ptr, ptr %8, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.b2BodyState, ptr %109, i32 0, i32 3
  %111 = load <2 x float>, ptr %110, align 4
  %112 = load <2 x float>, ptr %16, align 4
  %113 = call <2 x float> @b2Add(<2 x float> %111, <2 x float> %112)
  store <2 x float> %113, ptr %20, align 4
  %114 = load ptr, ptr %7, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.b2MouseJoint, ptr %114, i32 0, i32 10
  %116 = load <2 x float>, ptr %20, align 4
  %117 = load <2 x float>, ptr %115, align 4
  %118 = call <2 x float> @b2Add(<2 x float> %116, <2 x float> %117)
  store <2 x float> %118, ptr %19, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.b2MouseJoint, ptr %119, i32 0, i32 6
  %121 = getelementptr inbounds %struct.b2Softness, ptr %120, i32 0, i32 0
  %122 = load float, ptr %121, align 4, !tbaa !34
  %123 = load <2 x float>, ptr %19, align 4
  %124 = call <2 x float> @b2MulSV(float noundef %122, <2 x float> %123)
  store <2 x float> %124, ptr %21, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.b2MouseJoint, ptr %125, i32 0, i32 6
  %127 = getelementptr inbounds %struct.b2Softness, ptr %126, i32 0, i32 1
  %128 = load float, ptr %127, align 4, !tbaa !35
  store float %128, ptr %22, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.b2MouseJoint, ptr %129, i32 0, i32 6
  %131 = getelementptr inbounds %struct.b2Softness, ptr %130, i32 0, i32 2
  %132 = load float, ptr %131, align 4, !tbaa !36
  store float %132, ptr %23, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %133 = load ptr, ptr %7, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.b2MouseJoint, ptr %133, i32 0, i32 11
  %135 = load <2 x float>, ptr %17, align 4
  %136 = load <2 x float>, ptr %21, align 4
  %137 = call <2 x float> @b2Add(<2 x float> %135, <2 x float> %136)
  store <2 x float> %137, ptr %25, align 4
  %138 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %134, i32 0, i32 0
  %139 = load <2 x float>, ptr %138, align 4
  %140 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %134, i32 0, i32 1
  %141 = load <2 x float>, ptr %140, align 4
  %142 = load <2 x float>, ptr %25, align 4
  %143 = call <2 x float> @b2MulMV(<2 x float> %139, <2 x float> %141, <2 x float> %142)
  store <2 x float> %143, ptr %24, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %144 = load float, ptr %22, align 4, !tbaa !14
  %145 = fneg float %144
  %146 = getelementptr inbounds %struct.b2Vec2, ptr %24, i32 0, i32 0
  %147 = load float, ptr %146, align 4, !tbaa !37
  %148 = load float, ptr %23, align 4, !tbaa !14
  %149 = load ptr, ptr %7, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.b2MouseJoint, ptr %149, i32 0, i32 4
  %151 = getelementptr inbounds %struct.b2Vec2, ptr %150, i32 0, i32 0
  %152 = load float, ptr %151, align 4, !tbaa !38
  %153 = fmul float %148, %152
  %154 = fneg float %153
  %155 = call float @llvm.fmuladd.f32(float %145, float %147, float %154)
  %156 = getelementptr inbounds %struct.b2Vec2, ptr %26, i32 0, i32 0
  store float %155, ptr %156, align 4, !tbaa !37
  %157 = load float, ptr %22, align 4, !tbaa !14
  %158 = fneg float %157
  %159 = getelementptr inbounds %struct.b2Vec2, ptr %24, i32 0, i32 1
  %160 = load float, ptr %159, align 4, !tbaa !39
  %161 = load float, ptr %23, align 4, !tbaa !14
  %162 = load ptr, ptr %7, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.b2MouseJoint, ptr %162, i32 0, i32 4
  %164 = getelementptr inbounds %struct.b2Vec2, ptr %163, i32 0, i32 1
  %165 = load float, ptr %164, align 4, !tbaa !40
  %166 = fmul float %161, %165
  %167 = fneg float %166
  %168 = call float @llvm.fmuladd.f32(float %158, float %160, float %167)
  %169 = getelementptr inbounds %struct.b2Vec2, ptr %26, i32 0, i32 1
  store float %168, ptr %169, align 4, !tbaa !39
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  %170 = load ptr, ptr %7, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.b2MouseJoint, ptr %170, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %27, ptr align 4 %171, i64 8, i1 false), !tbaa.struct !25
  %172 = getelementptr inbounds %struct.b2Vec2, ptr %26, i32 0, i32 0
  %173 = load float, ptr %172, align 4, !tbaa !37
  %174 = load ptr, ptr %7, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.b2MouseJoint, ptr %174, i32 0, i32 4
  %176 = getelementptr inbounds %struct.b2Vec2, ptr %175, i32 0, i32 0
  %177 = load float, ptr %176, align 4, !tbaa !38
  %178 = fadd float %177, %173
  store float %178, ptr %176, align 4, !tbaa !38
  %179 = getelementptr inbounds %struct.b2Vec2, ptr %26, i32 0, i32 1
  %180 = load float, ptr %179, align 4, !tbaa !39
  %181 = load ptr, ptr %7, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.b2MouseJoint, ptr %181, i32 0, i32 4
  %183 = getelementptr inbounds %struct.b2Vec2, ptr %182, i32 0, i32 1
  %184 = load float, ptr %183, align 4, !tbaa !40
  %185 = fadd float %184, %180
  store float %185, ptr %183, align 4, !tbaa !40
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  %186 = load ptr, ptr %7, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.b2MouseJoint, ptr %186, i32 0, i32 4
  %188 = load <2 x float>, ptr %187, align 4
  %189 = call float @b2Length(<2 x float> %188)
  store float %189, ptr %28, align 4, !tbaa !14
  %190 = load float, ptr %28, align 4, !tbaa !14
  %191 = load float, ptr %14, align 4, !tbaa !14
  %192 = fcmp ogt float %190, %191
  br i1 %192, label %193, label %203

193:                                              ; preds = %69
  %194 = load ptr, ptr %7, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.b2MouseJoint, ptr %194, i32 0, i32 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  %196 = load float, ptr %14, align 4, !tbaa !14
  %197 = load ptr, ptr %7, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.b2MouseJoint, ptr %197, i32 0, i32 4
  %199 = load <2 x float>, ptr %198, align 4
  %200 = call <2 x float> @b2Normalize(<2 x float> %199)
  store <2 x float> %200, ptr %30, align 4
  %201 = load <2 x float>, ptr %30, align 4
  %202 = call <2 x float> @b2MulSV(float noundef %196, <2 x float> %201)
  store <2 x float> %202, ptr %29, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %195, ptr align 4 %29, i64 8, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  br label %203

203:                                              ; preds = %193, %69
  %204 = load ptr, ptr %7, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.b2MouseJoint, ptr %204, i32 0, i32 4
  %206 = getelementptr inbounds %struct.b2Vec2, ptr %205, i32 0, i32 0
  %207 = load float, ptr %206, align 4, !tbaa !38
  %208 = getelementptr inbounds %struct.b2Vec2, ptr %27, i32 0, i32 0
  %209 = load float, ptr %208, align 4, !tbaa !37
  %210 = fsub float %207, %209
  %211 = getelementptr inbounds %struct.b2Vec2, ptr %26, i32 0, i32 0
  store float %210, ptr %211, align 4, !tbaa !37
  %212 = load ptr, ptr %7, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.b2MouseJoint, ptr %212, i32 0, i32 4
  %214 = getelementptr inbounds %struct.b2Vec2, ptr %213, i32 0, i32 1
  %215 = load float, ptr %214, align 4, !tbaa !40
  %216 = getelementptr inbounds %struct.b2Vec2, ptr %27, i32 0, i32 1
  %217 = load float, ptr %216, align 4, !tbaa !39
  %218 = fsub float %215, %217
  %219 = getelementptr inbounds %struct.b2Vec2, ptr %26, i32 0, i32 1
  store float %218, ptr %219, align 4, !tbaa !39
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #5
  %220 = load float, ptr %5, align 4, !tbaa !14
  %221 = load <2 x float>, ptr %9, align 4
  %222 = load <2 x float>, ptr %26, align 4
  %223 = call <2 x float> @b2MulAdd(<2 x float> %221, float noundef %220, <2 x float> %222)
  store <2 x float> %223, ptr %31, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %31, i64 8, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  %224 = load float, ptr %6, align 4, !tbaa !14
  %225 = load <2 x float>, ptr %16, align 4
  %226 = load <2 x float>, ptr %26, align 4
  %227 = call float @b2Cross(<2 x float> %225, <2 x float> %226)
  %228 = load float, ptr %10, align 4, !tbaa !14
  %229 = call float @llvm.fmuladd.f32(float %224, float %227, float %228)
  store float %229, ptr %10, align 4, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  %230 = load ptr, ptr %8, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.b2BodyState, ptr %230, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %231, ptr align 4 %9, i64 8, i1 false), !tbaa.struct !25
  %232 = load float, ptr %10, align 4, !tbaa !14
  %233 = load ptr, ptr %8, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.b2BodyState, ptr %233, i32 0, i32 1
  store float %232, ptr %234, align 4, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  ret void
}

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

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

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

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

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

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"="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 #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !13, i64 36}
!10 = !{!"b2JointSim", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !12, i64 16, !12, i64 24, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !7, i64 48}
!11 = !{!"int", !7, i64 0}
!12 = !{!"b2Vec2", !13, i64 0, !13, i64 4}
!13 = !{!"float", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!10, !13, i64 44}
!16 = !{!17, !6, i64 80}
!17 = !{!"b2StepContext", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !11, i64 16, !18, i64 20, !18, i64 32, !18, i64 44, !13, i64 56, !13, i64 60, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !11, i64 104, !6, i64 112, !19, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !11, i64 152, !11, i64 156, !6, i64 160, !11, i64 168, !20, i64 172, !7, i64 173, !21, i64 240, !7, i64 244}
!18 = !{!"b2Softness", !13, i64 0, !13, i64 4, !13, i64 8}
!19 = !{!"b2AtomicInt", !11, i64 0}
!20 = !{!"_Bool", !7, i64 0}
!21 = !{!"b2AtomicU32", !11, i64 0}
!22 = !{!23, !11, i64 56}
!23 = !{!"b2MouseJoint", !12, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !12, i64 20, !13, i64 28, !18, i64 32, !18, i64 44, !11, i64 56, !12, i64 60, !12, i64 68, !24, i64 76}
!24 = !{!"b2Mat22", !12, i64 0, !12, i64 8}
!25 = !{i64 0, i64 4, !14, i64 4, i64 4, !14}
!26 = !{!27, !13, i64 8}
!27 = !{!"b2BodyState", !12, i64 0, !13, i64 8, !11, i64 12, !12, i64 16, !28, i64 24}
!28 = !{!"b2Rot", !13, i64 0, !13, i64 4}
!29 = !{!23, !13, i64 48}
!30 = !{!23, !13, i64 52}
!31 = !{!23, !13, i64 28}
!32 = !{!23, !13, i64 16}
!33 = !{!17, !13, i64 8}
!34 = !{!23, !13, i64 32}
!35 = !{!23, !13, i64 36}
!36 = !{!23, !13, i64 40}
!37 = !{!12, !13, i64 0}
!38 = !{!23, !13, i64 20}
!39 = !{!12, !13, i64 4}
!40 = !{!23, !13, i64 24}


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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @b2SolveMouseJoint(ptr nocapture noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 36
  %4 = load float, ptr %3, align 4, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 44
  %6 = load float, ptr %5, align 4, !tbaa !12
  %7 = getelementptr inbounds i8, ptr %1, i64 80
  %8 = load ptr, ptr %7, align 8, !tbaa !13
  %9 = getelementptr inbounds i8, ptr %0, i64 104
  %10 = load i32, ptr %9, align 4, !tbaa !20
  %11 = sext i32 %10 to i64
  %12 = getelementptr inbounds %struct.b2BodyState, ptr %8, i64 %11
  %.sroa.040.0.copyload = load <2 x float>, ptr %12, align 4
  %13 = getelementptr inbounds i8, ptr %12, i64 8
  %14 = load float, ptr %13, align 4, !tbaa !23
  %15 = getelementptr inbounds i8, ptr %0, i64 96
  %16 = load float, ptr %15, align 4, !tbaa !26
  %17 = getelementptr inbounds i8, ptr %0, i64 100
  %18 = load float, ptr %17, align 4, !tbaa !27
  %19 = fcmp ogt float %6, 0.000000e+00
  %20 = fneg float %14
  %21 = fdiv float %20, %6
  %22 = select i1 %19, float %21, float 0.000000e+00
  %23 = getelementptr inbounds i8, ptr %0, i64 76
  %24 = load float, ptr %23, align 4, !tbaa !28
  %25 = fneg float %18
  %26 = fmul float %24, %25
  %27 = tail call float @llvm.fmuladd.f32(float %16, float %22, float %26)
  %28 = fadd float %24, %27
  store float %28, ptr %23, align 4, !tbaa !28
  %29 = tail call float @llvm.fmuladd.f32(float %6, float %27, float %14)
  %30 = getelementptr inbounds i8, ptr %0, i64 64
  %31 = load float, ptr %30, align 4, !tbaa !29
  %32 = getelementptr inbounds i8, ptr %1, i64 8
  %33 = load float, ptr %32, align 8, !tbaa !30
  %34 = fmul float %31, %33
  %35 = getelementptr inbounds i8, ptr %12, i64 24
  %.sroa.027.0.copyload = load <2 x float>, ptr %35, align 4
  %36 = getelementptr inbounds i8, ptr %0, i64 108
  %37 = load <2 x float>, ptr %36, align 4
  %38 = tail call <2 x float> @b2RotateVector(<2 x float> %.sroa.027.0.copyload, <2 x float> %37)
  %39 = tail call <2 x float> @b2CrossSV(float noundef %29, <2 x float> %38)
  %40 = tail call <2 x float> @b2Add(<2 x float> %.sroa.040.0.copyload, <2 x float> %39)
  %41 = getelementptr inbounds i8, ptr %12, i64 16
  %42 = load <2 x float>, ptr %41, align 4
  %43 = tail call <2 x float> @b2Add(<2 x float> %42, <2 x float> %38)
  %44 = getelementptr inbounds i8, ptr %0, i64 116
  %45 = load <2 x float>, ptr %44, align 4
  %46 = tail call <2 x float> @b2Add(<2 x float> %43, <2 x float> %45)
  %47 = getelementptr inbounds i8, ptr %0, i64 80
  %48 = load float, ptr %47, align 4, !tbaa !31
  %49 = tail call <2 x float> @b2MulSV(float noundef %48, <2 x float> %46)
  %50 = getelementptr inbounds i8, ptr %0, i64 84
  %51 = load float, ptr %50, align 4, !tbaa !32
  %52 = getelementptr inbounds i8, ptr %0, i64 88
  %53 = load float, ptr %52, align 4, !tbaa !33
  %54 = getelementptr inbounds i8, ptr %0, i64 124
  %55 = tail call <2 x float> @b2Add(<2 x float> %40, <2 x float> %49)
  %56 = load <2 x float>, ptr %54, align 4
  %57 = getelementptr inbounds i8, ptr %0, i64 132
  %58 = load <2 x float>, ptr %57, align 4
  %59 = tail call <2 x float> @b2MulMV(<2 x float> %56, <2 x float> %58, <2 x float> %55)
  %60 = fneg float %51
  %61 = getelementptr inbounds i8, ptr %0, i64 68
  %62 = fneg float %53
  %63 = load <2 x float>, ptr %61, align 4, !tbaa !34
  %64 = insertelement <2 x float> poison, float %62, i64 0
  %65 = shufflevector <2 x float> %64, <2 x float> poison, <2 x i32> zeroinitializer
  %66 = fmul <2 x float> %63, %65
  %67 = insertelement <2 x float> poison, float %60, i64 0
  %68 = shufflevector <2 x float> %67, <2 x float> poison, <2 x i32> zeroinitializer
  %69 = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %68, <2 x float> %59, <2 x float> %66)
  %70 = fadd <2 x float> %63, %69
  store <2 x float> %70, ptr %61, align 4, !tbaa !34
  %71 = tail call float @b2Length(<2 x float> %70)
  %72 = fcmp ogt float %71, %34
  br i1 %72, label %74, label %._crit_edge

._crit_edge:                                      ; preds = %2
  %73 = load <2 x float>, ptr %61, align 4, !tbaa !34
  br label %78

74:                                               ; preds = %2
  %75 = load <2 x float>, ptr %61, align 4
  %76 = tail call <2 x float> @b2Normalize(<2 x float> %75)
  %77 = tail call <2 x float> @b2MulSV(float noundef %34, <2 x float> %76)
  store <2 x float> %77, ptr %61, align 4
  br label %78

78:                                               ; preds = %._crit_edge, %74
  %79 = phi <2 x float> [ %73, %._crit_edge ], [ %77, %74 ]
  %80 = fsub <2 x float> %79, %63
  %81 = tail call <2 x float> @b2MulAdd(<2 x float> %.sroa.040.0.copyload, float noundef %4, <2 x float> %80)
  %82 = tail call float @b2Cross(<2 x float> %38, <2 x float> %80)
  %83 = tail call float @llvm.fmuladd.f32(float %6, float %82, float %29)
  store <2 x float> %81, ptr %12, align 4
  store float %83, ptr %13, align 4, !tbaa !23
  ret void
}

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x float> @llvm.fmuladd.v2f32(<2 x float>, <2 x float>, <2 x float>) #3

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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, !11, i64 36}
!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 44}
!13 = !{!14, !16, i64 80}
!14 = !{!"b2StepContext", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !7, i64 16, !15, i64 20, !15, i64 32, !15, i64 44, !11, i64 56, !11, i64 60, !16, i64 64, !16, i64 72, !16, i64 80, !16, i64 88, !16, i64 96, !7, i64 104, !16, i64 112, !17, i64 120, !16, i64 128, !16, i64 136, !16, i64 144, !7, i64 152, !7, i64 156, !16, i64 160, !7, i64 168, !18, i64 172, !8, i64 173, !19, i64 240, !8, i64 244}
!15 = !{!"b2Softness", !11, i64 0, !11, i64 4, !11, i64 8}
!16 = !{!"any pointer", !8, i64 0}
!17 = !{!"b2AtomicInt", !7, i64 0}
!18 = !{!"_Bool", !8, i64 0}
!19 = !{!"b2AtomicU32", !7, i64 0}
!20 = !{!21, !7, i64 56}
!21 = !{!"b2MouseJoint", !10, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !10, i64 20, !11, i64 28, !15, i64 32, !15, i64 44, !7, i64 56, !10, i64 60, !10, i64 68, !22, i64 76}
!22 = !{!"b2Mat22", !10, i64 0, !10, i64 8}
!23 = !{!24, !11, i64 8}
!24 = !{!"b2BodyState", !10, i64 0, !11, i64 8, !7, i64 12, !10, i64 16, !25, i64 24}
!25 = !{!"b2Rot", !11, i64 0, !11, i64 4}
!26 = !{!21, !11, i64 48}
!27 = !{!21, !11, i64 52}
!28 = !{!21, !11, i64 28}
!29 = !{!21, !11, i64 16}
!30 = !{!14, !11, i64 8}
!31 = !{!21, !11, i64 32}
!32 = !{!21, !11, i64 36}
!33 = !{!21, !11, i64 40}
!34 = !{!11, !11, i64 0}


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