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

@.str.1 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1
@__const.b2SolveWeldJoint.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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

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

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

; 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) #4

; 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 <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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #5

; 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 @b2SolveWeldJoint(ptr noundef %0, ptr noundef %1, i1 noundef zeroext %2) #6 {
  %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 float, align 4
  %29 = alloca float, 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 %struct.b2Vec2, align 4
  %42 = alloca %struct.b2Mat22, 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
  %47 = alloca %struct.b2Vec2, align 4
  %48 = alloca %struct.b2Vec2, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %49 = zext i1 %2 to i8
  store i8 %49, ptr %6, align 1, !tbaa !9
  br label %50

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

55:                                               ; preds = %50
  %56 = call i32 @b2InternalAssertFcn(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 205)
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %58, label %59

58:                                               ; preds = %55
  call void @llvm.trap()
  br label %59

59:                                               ; preds = %58, %55, %50
  br label %60

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

79:                                               ; preds = %60
  br label %89

80:                                               ; preds = %60
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.b2StepContext, ptr %81, i32 0, i32 12
  %83 = load ptr, ptr %82, align 8, !tbaa !24
  %84 = load ptr, ptr %12, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.b2WeldJoint, ptr %84, i32 0, i32 9
  %86 = load i32, ptr %85, align 4, !tbaa !21
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds %struct.b2BodyState, ptr %83, i64 %87
  br label %89

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

95:                                               ; preds = %89
  br label %105

96:                                               ; preds = %89
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.b2StepContext, ptr %97, i32 0, i32 12
  %99 = load ptr, ptr %98, align 8, !tbaa !24
  %100 = load ptr, ptr %12, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.b2WeldJoint, ptr %100, i32 0, i32 10
  %102 = load i32, ptr %101, align 4, !tbaa !28
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds %struct.b2BodyState, ptr %99, i64 %103
  br label %105

105:                                              ; preds = %96, %95
  %106 = phi ptr [ %11, %95 ], [ %104, %96 ]
  store ptr %106, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %107 = load ptr, ptr %13, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.b2BodyState, ptr %107, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %108, i64 8, i1 false), !tbaa.struct !29
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %109 = load ptr, ptr %13, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.b2BodyState, ptr %109, i32 0, i32 1
  %111 = load float, ptr %110, align 4, !tbaa !30
  store float %111, ptr %16, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %112 = load ptr, ptr %14, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.b2BodyState, ptr %112, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %113, i64 8, i1 false), !tbaa.struct !29
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %114 = load ptr, ptr %14, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.b2BodyState, ptr %114, i32 0, i32 1
  %116 = load float, ptr %115, align 4, !tbaa !30
  store float %116, ptr %18, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  store float 0.000000e+00, ptr %19, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  store float 1.000000e+00, ptr %20, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  store float 0.000000e+00, ptr %21, align 4, !tbaa !17
  %117 = load i8, ptr %6, align 1, !tbaa !9, !range !33, !noundef !34
  %118 = trunc i8 %117 to i1
  br i1 %118, label %124, label %119

119:                                              ; preds = %105
  %120 = load ptr, ptr %12, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.b2WeldJoint, ptr %120, i32 0, i32 3
  %122 = load float, ptr %121, align 4, !tbaa !35
  %123 = fcmp ogt float %122, 0.000000e+00
  br i1 %123, label %124, label %150

124:                                              ; preds = %119, %105
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  %125 = load ptr, ptr %14, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.b2BodyState, ptr %125, i32 0, i32 4
  %127 = load ptr, ptr %13, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.b2BodyState, ptr %127, i32 0, i32 4
  %129 = load <2 x float>, ptr %126, align 4
  %130 = load <2 x float>, ptr %128, align 4
  %131 = call float @b2RelativeAngle(<2 x float> %129, <2 x float> %130)
  %132 = load ptr, ptr %12, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.b2WeldJoint, ptr %132, i32 0, i32 14
  %134 = load float, ptr %133, align 4, !tbaa !36
  %135 = fadd float %131, %134
  store float %135, ptr %22, align 4, !tbaa !17
  %136 = load ptr, ptr %12, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.b2WeldJoint, ptr %136, i32 0, i32 6
  %138 = getelementptr inbounds %struct.b2Softness, ptr %137, i32 0, i32 0
  %139 = load float, ptr %138, align 4, !tbaa !37
  %140 = load float, ptr %22, align 4, !tbaa !17
  %141 = fmul float %139, %140
  store float %141, ptr %19, align 4, !tbaa !17
  %142 = load ptr, ptr %12, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.b2WeldJoint, ptr %142, i32 0, i32 6
  %144 = getelementptr inbounds %struct.b2Softness, ptr %143, i32 0, i32 1
  %145 = load float, ptr %144, align 4, !tbaa !38
  store float %145, ptr %20, align 4, !tbaa !17
  %146 = load ptr, ptr %12, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.b2WeldJoint, ptr %146, i32 0, i32 6
  %148 = getelementptr inbounds %struct.b2Softness, ptr %147, i32 0, i32 2
  %149 = load float, ptr %148, align 4, !tbaa !39
  store float %149, ptr %21, align 4, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %150

150:                                              ; preds = %124, %119
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  %151 = load float, ptr %18, align 4, !tbaa !17
  %152 = load float, ptr %16, align 4, !tbaa !17
  %153 = fsub float %151, %152
  store float %153, ptr %23, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  %154 = load float, ptr %20, align 4, !tbaa !17
  %155 = fneg float %154
  %156 = load ptr, ptr %12, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.b2WeldJoint, ptr %156, i32 0, i32 15
  %158 = load float, ptr %157, align 4, !tbaa !40
  %159 = fmul float %155, %158
  %160 = load float, ptr %23, align 4, !tbaa !17
  %161 = load float, ptr %19, align 4, !tbaa !17
  %162 = fadd float %160, %161
  %163 = load float, ptr %21, align 4, !tbaa !17
  %164 = load ptr, ptr %12, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.b2WeldJoint, ptr %164, i32 0, i32 8
  %166 = load float, ptr %165, align 4, !tbaa !41
  %167 = fmul float %163, %166
  %168 = fneg float %167
  %169 = call float @llvm.fmuladd.f32(float %159, float %162, float %168)
  store float %169, ptr %24, align 4, !tbaa !17
  %170 = load float, ptr %24, align 4, !tbaa !17
  %171 = load ptr, ptr %12, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.b2WeldJoint, ptr %171, i32 0, i32 8
  %173 = load float, ptr %172, align 4, !tbaa !41
  %174 = fadd float %173, %170
  store float %174, ptr %172, align 4, !tbaa !41
  %175 = load float, ptr %9, align 4, !tbaa !17
  %176 = load float, ptr %24, align 4, !tbaa !17
  %177 = load float, ptr %16, align 4, !tbaa !17
  %178 = fneg float %175
  %179 = call float @llvm.fmuladd.f32(float %178, float %176, float %177)
  store float %179, ptr %16, align 4, !tbaa !17
  %180 = load float, ptr %10, align 4, !tbaa !17
  %181 = load float, ptr %24, align 4, !tbaa !17
  %182 = load float, ptr %18, align 4, !tbaa !17
  %183 = call float @llvm.fmuladd.f32(float %180, float %181, float %182)
  store float %183, 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 %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
  %184 = load ptr, ptr %13, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.b2BodyState, ptr %184, i32 0, i32 4
  %186 = load ptr, ptr %12, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.b2WeldJoint, ptr %186, i32 0, i32 11
  %188 = load <2 x float>, ptr %185, align 4
  %189 = load <2 x float>, ptr %187, align 4
  %190 = call <2 x float> @b2RotateVector(<2 x float> %188, <2 x float> %189)
  store <2 x float> %190, ptr %25, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %191 = load ptr, ptr %14, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.b2BodyState, ptr %191, i32 0, i32 4
  %193 = load ptr, ptr %12, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.b2WeldJoint, ptr %193, i32 0, i32 12
  %195 = load <2 x float>, ptr %192, align 4
  %196 = load <2 x float>, ptr %194, align 4
  %197 = call <2 x float> @b2RotateVector(<2 x float> %195, <2 x float> %196)
  store <2 x float> %197, ptr %26, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  call void @llvm.memset.p0.i64(ptr align 4 %27, i8 0, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #8
  store float 1.000000e+00, ptr %28, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #8
  store float 0.000000e+00, ptr %29, align 4, !tbaa !17
  %198 = load i8, ptr %6, align 1, !tbaa !9, !range !33, !noundef !34
  %199 = trunc i8 %198 to i1
  br i1 %199, label %205, label %200

200:                                              ; preds = %150
  %201 = load ptr, ptr %12, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.b2WeldJoint, ptr %201, i32 0, i32 1
  %203 = load float, ptr %202, align 4, !tbaa !42
  %204 = fcmp ogt float %203, 0.000000e+00
  br i1 %204, label %205, label %238

205:                                              ; preds = %200, %150
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #8
  %206 = load ptr, ptr %13, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.b2BodyState, ptr %206, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %30, ptr align 4 %207, i64 8, i1 false), !tbaa.struct !29
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #8
  %208 = load ptr, ptr %14, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.b2BodyState, ptr %208, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %31, ptr align 4 %209, i64 8, i1 false), !tbaa.struct !29
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #8
  %210 = load <2 x float>, ptr %31, align 4
  %211 = load <2 x float>, ptr %30, align 4
  %212 = call <2 x float> @b2Sub(<2 x float> %210, <2 x float> %211)
  store <2 x float> %212, ptr %34, align 4
  %213 = load <2 x float>, ptr %26, align 4
  %214 = load <2 x float>, ptr %25, align 4
  %215 = call <2 x float> @b2Sub(<2 x float> %213, <2 x float> %214)
  store <2 x float> %215, ptr %35, align 4
  %216 = load <2 x float>, ptr %34, align 4
  %217 = load <2 x float>, ptr %35, align 4
  %218 = call <2 x float> @b2Add(<2 x float> %216, <2 x float> %217)
  store <2 x float> %218, ptr %33, align 4
  %219 = load ptr, ptr %12, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.b2WeldJoint, ptr %219, i32 0, i32 13
  %221 = load <2 x float>, ptr %33, align 4
  %222 = load <2 x float>, ptr %220, align 4
  %223 = call <2 x float> @b2Add(<2 x float> %221, <2 x float> %222)
  store <2 x float> %223, ptr %32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #8
  %224 = load ptr, ptr %12, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.b2WeldJoint, ptr %224, i32 0, i32 5
  %226 = getelementptr inbounds %struct.b2Softness, ptr %225, i32 0, i32 0
  %227 = load float, ptr %226, align 4, !tbaa !43
  %228 = load <2 x float>, ptr %32, align 4
  %229 = call <2 x float> @b2MulSV(float noundef %227, <2 x float> %228)
  store <2 x float> %229, ptr %36, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %27, ptr align 4 %36, i64 8, i1 false), !tbaa.struct !29
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #8
  %230 = load ptr, ptr %12, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.b2WeldJoint, ptr %230, i32 0, i32 5
  %232 = getelementptr inbounds %struct.b2Softness, ptr %231, i32 0, i32 1
  %233 = load float, ptr %232, align 4, !tbaa !44
  store float %233, ptr %28, align 4, !tbaa !17
  %234 = load ptr, ptr %12, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.b2WeldJoint, ptr %234, i32 0, i32 5
  %236 = getelementptr inbounds %struct.b2Softness, ptr %235, i32 0, i32 2
  %237 = load float, ptr %236, align 4, !tbaa !45
  store float %237, ptr %29, align 4, !tbaa !17
  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
  br label %238

238:                                              ; preds = %205, %200
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #8
  %239 = load float, ptr %18, align 4, !tbaa !17
  %240 = load <2 x float>, ptr %26, align 4
  %241 = call <2 x float> @b2CrossSV(float noundef %239, <2 x float> %240)
  store <2 x float> %241, ptr %39, align 4
  %242 = load <2 x float>, ptr %17, align 4
  %243 = load <2 x float>, ptr %39, align 4
  %244 = call <2 x float> @b2Add(<2 x float> %242, <2 x float> %243)
  store <2 x float> %244, ptr %38, align 4
  %245 = load float, ptr %16, align 4, !tbaa !17
  %246 = load <2 x float>, ptr %25, align 4
  %247 = call <2 x float> @b2CrossSV(float noundef %245, <2 x float> %246)
  store <2 x float> %247, ptr %41, align 4
  %248 = load <2 x float>, ptr %15, align 4
  %249 = load <2 x float>, ptr %41, align 4
  %250 = call <2 x float> @b2Add(<2 x float> %248, <2 x float> %249)
  store <2 x float> %250, ptr %40, align 4
  %251 = load <2 x float>, ptr %38, align 4
  %252 = load <2 x float>, ptr %40, align 4
  %253 = call <2 x float> @b2Sub(<2 x float> %251, <2 x float> %252)
  store <2 x float> %253, ptr %37, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr %42) #8
  %254 = load float, ptr %7, align 4, !tbaa !17
  %255 = load float, ptr %8, align 4, !tbaa !17
  %256 = fadd float %254, %255
  %257 = getelementptr inbounds %struct.b2Vec2, ptr %25, i32 0, i32 1
  %258 = load float, ptr %257, align 4, !tbaa !46
  %259 = getelementptr inbounds %struct.b2Vec2, ptr %25, i32 0, i32 1
  %260 = load float, ptr %259, align 4, !tbaa !46
  %261 = fmul float %258, %260
  %262 = load float, ptr %9, align 4, !tbaa !17
  %263 = call float @llvm.fmuladd.f32(float %261, float %262, float %256)
  %264 = getelementptr inbounds %struct.b2Vec2, ptr %26, i32 0, i32 1
  %265 = load float, ptr %264, align 4, !tbaa !46
  %266 = getelementptr inbounds %struct.b2Vec2, ptr %26, i32 0, i32 1
  %267 = load float, ptr %266, align 4, !tbaa !46
  %268 = fmul float %265, %267
  %269 = load float, ptr %10, align 4, !tbaa !17
  %270 = call float @llvm.fmuladd.f32(float %268, float %269, float %263)
  %271 = getelementptr inbounds %struct.b2Mat22, ptr %42, i32 0, i32 0
  %272 = getelementptr inbounds %struct.b2Vec2, ptr %271, i32 0, i32 0
  store float %270, ptr %272, align 4, !tbaa !47
  %273 = getelementptr inbounds %struct.b2Vec2, ptr %25, i32 0, i32 1
  %274 = load float, ptr %273, align 4, !tbaa !46
  %275 = fneg float %274
  %276 = getelementptr inbounds %struct.b2Vec2, ptr %25, i32 0, i32 0
  %277 = load float, ptr %276, align 4, !tbaa !49
  %278 = fmul float %275, %277
  %279 = load float, ptr %9, align 4, !tbaa !17
  %280 = getelementptr inbounds %struct.b2Vec2, ptr %26, i32 0, i32 1
  %281 = load float, ptr %280, align 4, !tbaa !46
  %282 = getelementptr inbounds %struct.b2Vec2, ptr %26, i32 0, i32 0
  %283 = load float, ptr %282, align 4, !tbaa !49
  %284 = fmul float %281, %283
  %285 = load float, ptr %10, align 4, !tbaa !17
  %286 = fmul float %284, %285
  %287 = fneg float %286
  %288 = call float @llvm.fmuladd.f32(float %278, float %279, float %287)
  %289 = getelementptr inbounds %struct.b2Mat22, ptr %42, i32 0, i32 1
  %290 = getelementptr inbounds %struct.b2Vec2, ptr %289, i32 0, i32 0
  store float %288, ptr %290, align 4, !tbaa !50
  %291 = getelementptr inbounds %struct.b2Mat22, ptr %42, i32 0, i32 1
  %292 = getelementptr inbounds %struct.b2Vec2, ptr %291, i32 0, i32 0
  %293 = load float, ptr %292, align 4, !tbaa !50
  %294 = getelementptr inbounds %struct.b2Mat22, ptr %42, i32 0, i32 0
  %295 = getelementptr inbounds %struct.b2Vec2, ptr %294, i32 0, i32 1
  store float %293, ptr %295, align 4, !tbaa !51
  %296 = load float, ptr %7, align 4, !tbaa !17
  %297 = load float, ptr %8, align 4, !tbaa !17
  %298 = fadd float %296, %297
  %299 = getelementptr inbounds %struct.b2Vec2, ptr %25, i32 0, i32 0
  %300 = load float, ptr %299, align 4, !tbaa !49
  %301 = getelementptr inbounds %struct.b2Vec2, ptr %25, i32 0, i32 0
  %302 = load float, ptr %301, align 4, !tbaa !49
  %303 = fmul float %300, %302
  %304 = load float, ptr %9, align 4, !tbaa !17
  %305 = call float @llvm.fmuladd.f32(float %303, float %304, float %298)
  %306 = getelementptr inbounds %struct.b2Vec2, ptr %26, i32 0, i32 0
  %307 = load float, ptr %306, align 4, !tbaa !49
  %308 = getelementptr inbounds %struct.b2Vec2, ptr %26, i32 0, i32 0
  %309 = load float, ptr %308, align 4, !tbaa !49
  %310 = fmul float %307, %309
  %311 = load float, ptr %10, align 4, !tbaa !17
  %312 = call float @llvm.fmuladd.f32(float %310, float %311, float %305)
  %313 = getelementptr inbounds %struct.b2Mat22, ptr %42, i32 0, i32 1
  %314 = getelementptr inbounds %struct.b2Vec2, ptr %313, i32 0, i32 1
  store float %312, ptr %314, align 4, !tbaa !52
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #8
  %315 = load <2 x float>, ptr %37, align 4
  %316 = load <2 x float>, ptr %27, align 4
  %317 = call <2 x float> @b2Add(<2 x float> %315, <2 x float> %316)
  store <2 x float> %317, ptr %44, align 4
  %318 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %42, i32 0, i32 0
  %319 = load <2 x float>, ptr %318, align 4
  %320 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %42, i32 0, i32 1
  %321 = load <2 x float>, ptr %320, align 4
  %322 = load <2 x float>, ptr %44, align 4
  %323 = call <2 x float> @b2Solve22(<2 x float> %319, <2 x float> %321, <2 x float> %322)
  store <2 x float> %323, ptr %43, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #8
  %324 = getelementptr inbounds %struct.b2Vec2, ptr %45, i32 0, i32 0
  %325 = load float, ptr %28, align 4, !tbaa !17
  %326 = fneg float %325
  %327 = getelementptr inbounds %struct.b2Vec2, ptr %43, i32 0, i32 0
  %328 = load float, ptr %327, align 4, !tbaa !49
  %329 = load float, ptr %29, align 4, !tbaa !17
  %330 = load ptr, ptr %12, align 8, !tbaa !5
  %331 = getelementptr inbounds %struct.b2WeldJoint, ptr %330, i32 0, i32 7
  %332 = getelementptr inbounds %struct.b2Vec2, ptr %331, i32 0, i32 0
  %333 = load float, ptr %332, align 4, !tbaa !53
  %334 = fmul float %329, %333
  %335 = fneg float %334
  %336 = call float @llvm.fmuladd.f32(float %326, float %328, float %335)
  store float %336, ptr %324, align 4, !tbaa !49
  %337 = getelementptr inbounds %struct.b2Vec2, ptr %45, i32 0, i32 1
  %338 = load float, ptr %28, align 4, !tbaa !17
  %339 = fneg float %338
  %340 = getelementptr inbounds %struct.b2Vec2, ptr %43, i32 0, i32 1
  %341 = load float, ptr %340, align 4, !tbaa !46
  %342 = load float, ptr %29, align 4, !tbaa !17
  %343 = load ptr, ptr %12, align 8, !tbaa !5
  %344 = getelementptr inbounds %struct.b2WeldJoint, ptr %343, i32 0, i32 7
  %345 = getelementptr inbounds %struct.b2Vec2, ptr %344, i32 0, i32 1
  %346 = load float, ptr %345, align 4, !tbaa !54
  %347 = fmul float %342, %346
  %348 = fneg float %347
  %349 = call float @llvm.fmuladd.f32(float %339, float %341, float %348)
  store float %349, ptr %337, align 4, !tbaa !46
  %350 = load ptr, ptr %12, align 8, !tbaa !5
  %351 = getelementptr inbounds %struct.b2WeldJoint, ptr %350, i32 0, i32 7
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #8
  %352 = load ptr, ptr %12, align 8, !tbaa !5
  %353 = getelementptr inbounds %struct.b2WeldJoint, ptr %352, i32 0, i32 7
  %354 = load <2 x float>, ptr %353, align 4
  %355 = load <2 x float>, ptr %45, align 4
  %356 = call <2 x float> @b2Add(<2 x float> %354, <2 x float> %355)
  store <2 x float> %356, ptr %46, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %351, ptr align 4 %46, i64 8, i1 false), !tbaa.struct !29
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #8
  %357 = load float, ptr %7, align 4, !tbaa !17
  %358 = load <2 x float>, ptr %15, align 4
  %359 = load <2 x float>, ptr %45, align 4
  %360 = call <2 x float> @b2MulSub(<2 x float> %358, float noundef %357, <2 x float> %359)
  store <2 x float> %360, ptr %47, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %47, i64 8, i1 false), !tbaa.struct !29
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #8
  %361 = load float, ptr %9, align 4, !tbaa !17
  %362 = load <2 x float>, ptr %25, align 4
  %363 = load <2 x float>, ptr %45, align 4
  %364 = call float @b2Cross(<2 x float> %362, <2 x float> %363)
  %365 = load float, ptr %16, align 4, !tbaa !17
  %366 = fneg float %361
  %367 = call float @llvm.fmuladd.f32(float %366, float %364, float %365)
  store float %367, ptr %16, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %48) #8
  %368 = load float, ptr %8, align 4, !tbaa !17
  %369 = load <2 x float>, ptr %17, align 4
  %370 = load <2 x float>, ptr %45, align 4
  %371 = call <2 x float> @b2MulAdd(<2 x float> %369, float noundef %368, <2 x float> %370)
  store <2 x float> %371, ptr %48, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %48, i64 8, i1 false), !tbaa.struct !29
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #8
  %372 = load float, ptr %10, align 4, !tbaa !17
  %373 = load <2 x float>, ptr %26, align 4
  %374 = load <2 x float>, ptr %45, align 4
  %375 = call float @b2Cross(<2 x float> %373, <2 x float> %374)
  %376 = load float, ptr %18, align 4, !tbaa !17
  %377 = call float @llvm.fmuladd.f32(float %372, float %375, float %376)
  store float %377, ptr %18, align 4, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %42) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #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
  %378 = load ptr, ptr %13, align 8, !tbaa !5
  %379 = getelementptr inbounds %struct.b2BodyState, ptr %378, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %379, ptr align 4 %15, i64 8, i1 false), !tbaa.struct !29
  %380 = load float, ptr %16, align 4, !tbaa !17
  %381 = load ptr, ptr %13, align 8, !tbaa !5
  %382 = getelementptr inbounds %struct.b2BodyState, ptr %381, i32 0, i32 1
  store float %380, ptr %382, align 4, !tbaa !30
  %383 = load ptr, ptr %14, align 8, !tbaa !5
  %384 = getelementptr inbounds %struct.b2BodyState, ptr %383, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %384, ptr align 4 %17, i64 8, i1 false), !tbaa.struct !29
  %385 = load float, ptr %18, align 4, !tbaa !17
  %386 = load ptr, ptr %14, align 8, !tbaa !5
  %387 = getelementptr inbounds %struct.b2BodyState, ptr %386, i32 0, i32 1
  store float %385, ptr %387, align 4, !tbaa !30
  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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { cold noreturn nounwind memory(inaccessiblemem: write) }
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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 56}
!22 = !{!"b2WeldJoint", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !23, i64 20, !23, i64 32, !14, i64 44, !15, i64 52, !13, i64 56, !13, i64 60, !14, i64 64, !14, i64 72, !14, i64 80, !15, i64 88, !15, i64 92}
!23 = !{!"b2Softness", !15, i64 0, !15, i64 4, !15, i64 8}
!24 = !{!25, !6, i64 80}
!25 = !{!"b2StepContext", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !13, i64 16, !23, i64 20, !23, i64 32, !23, 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, !26, 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, !27, i64 240, !7, i64 244}
!26 = !{!"b2AtomicInt", !13, i64 0}
!27 = !{!"b2AtomicU32", !13, i64 0}
!28 = !{!22, !13, i64 60}
!29 = !{i64 0, i64 4, !17, i64 4, i64 4, !17}
!30 = !{!31, !15, i64 8}
!31 = !{!"b2BodyState", !14, i64 0, !15, i64 8, !13, i64 12, !14, i64 16, !32, i64 24}
!32 = !{!"b2Rot", !15, i64 0, !15, i64 4}
!33 = !{i8 0, i8 2}
!34 = !{}
!35 = !{!22, !15, i64 12}
!36 = !{!22, !15, i64 88}
!37 = !{!22, !15, i64 32}
!38 = !{!22, !15, i64 36}
!39 = !{!22, !15, i64 40}
!40 = !{!22, !15, i64 92}
!41 = !{!22, !15, i64 52}
!42 = !{!22, !15, i64 4}
!43 = !{!22, !15, i64 20}
!44 = !{!22, !15, i64 24}
!45 = !{!22, !15, i64 28}
!46 = !{!14, !15, i64 4}
!47 = !{!48, !15, i64 0}
!48 = !{!"b2Mat22", !14, i64 0, !14, i64 8}
!49 = !{!14, !15, i64 0}
!50 = !{!48, !15, i64 8}
!51 = !{!48, !15, i64 4}
!52 = !{!48, !15, i64 12}
!53 = !{!22, !15, i64 44}
!54 = !{!22, !15, i64 48}


; 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.1 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1
@__const.b2SolveWeldJoint.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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

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

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

; 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) #4

; 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 <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: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #5

; 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 @b2SolveWeldJoint(ptr nocapture noundef %0, ptr nocapture noundef readonly %1, i1 noundef zeroext %2) local_unnamed_addr #6 {
  %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, 6
  br i1 %7, label %11, label %8

8:                                                ; preds = %3
  %9 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 205) #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 <2 x float>, ptr %16, align 4, !tbaa !14
  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.b2SolveWeldJoint.dummyState, i64 32, i1 false)
  %18 = getelementptr inbounds i8, ptr %0, i64 104
  %19 = load i32, ptr %18, align 4, !tbaa !15
  %20 = icmp eq i32 %19, -1
  br i1 %20, label %26, label %21

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

26:                                               ; preds = %11, %21
  %27 = phi ptr [ %25, %21 ], [ %4, %11 ]
  %28 = getelementptr inbounds i8, ptr %0, i64 108
  %29 = load i32, ptr %28, align 4, !tbaa !24
  %30 = icmp eq i32 %29, -1
  br i1 %30, label %36, label %31

31:                                               ; preds = %26
  %32 = getelementptr inbounds i8, ptr %1, i64 80
  %33 = load ptr, ptr %32, align 8, !tbaa !18
  %34 = sext i32 %29 to i64
  %35 = getelementptr inbounds %struct.b2BodyState, ptr %33, i64 %34
  br label %36

36:                                               ; preds = %26, %31
  %37 = phi ptr [ %35, %31 ], [ %4, %26 ]
  %.sroa.076.0.copyload = load <2 x float>, ptr %27, align 4
  %38 = getelementptr inbounds i8, ptr %27, i64 8
  %39 = load float, ptr %38, align 4, !tbaa !25
  %.sroa.068.0.copyload = load <2 x float>, ptr %37, align 4
  %40 = getelementptr inbounds i8, ptr %37, i64 8
  %41 = load float, ptr %40, align 4, !tbaa !25
  br i1 %2, label %46, label %42

42:                                               ; preds = %36
  %43 = getelementptr inbounds i8, ptr %0, i64 60
  %44 = load float, ptr %43, align 4, !tbaa !28
  %45 = fcmp ogt float %44, 0.000000e+00
  br i1 %45, label %46, label %62

46:                                               ; preds = %42, %36
  %47 = getelementptr inbounds i8, ptr %37, i64 24
  %48 = getelementptr inbounds i8, ptr %27, i64 24
  %49 = load <2 x float>, ptr %47, align 4
  %50 = load <2 x float>, ptr %48, align 4
  %51 = tail call float @b2RelativeAngle(<2 x float> %49, <2 x float> %50)
  %52 = getelementptr inbounds i8, ptr %0, i64 136
  %53 = load float, ptr %52, align 4, !tbaa !29
  %54 = fadd float %51, %53
  %55 = getelementptr inbounds i8, ptr %0, i64 80
  %56 = load float, ptr %55, align 4, !tbaa !30
  %57 = fmul float %56, %54
  %58 = getelementptr inbounds i8, ptr %0, i64 84
  %59 = load float, ptr %58, align 4, !tbaa !31
  %60 = getelementptr inbounds i8, ptr %0, i64 88
  %61 = load float, ptr %60, align 4, !tbaa !32
  br label %62

62:                                               ; preds = %46, %42
  %.0142 = phi float [ %61, %46 ], [ 0.000000e+00, %42 ]
  %.0141 = phi float [ %59, %46 ], [ 1.000000e+00, %42 ]
  %.0 = phi float [ %57, %46 ], [ 0.000000e+00, %42 ]
  %63 = fsub float %41, %39
  %64 = fneg float %.0141
  %65 = getelementptr inbounds i8, ptr %0, i64 140
  %66 = load float, ptr %65, align 4, !tbaa !33
  %67 = fmul float %66, %64
  %68 = fadd float %63, %.0
  %69 = getelementptr inbounds i8, ptr %0, i64 100
  %70 = load float, ptr %69, align 4, !tbaa !34
  %71 = fneg float %.0142
  %72 = fmul float %70, %71
  %73 = tail call float @llvm.fmuladd.f32(float %67, float %68, float %72)
  %74 = fadd float %70, %73
  store float %74, ptr %69, align 4, !tbaa !34
  %75 = getelementptr inbounds i8, ptr %27, i64 24
  %76 = getelementptr inbounds i8, ptr %0, i64 112
  %77 = load <2 x float>, ptr %75, align 4
  %78 = load <2 x float>, ptr %76, align 4
  %79 = tail call <2 x float> @b2RotateVector(<2 x float> %77, <2 x float> %78)
  %80 = getelementptr inbounds i8, ptr %37, i64 24
  %81 = getelementptr inbounds i8, ptr %0, i64 120
  %82 = load <2 x float>, ptr %80, align 4
  %83 = load <2 x float>, ptr %81, align 4
  %84 = tail call <2 x float> @b2RotateVector(<2 x float> %82, <2 x float> %83)
  br i1 %2, label %89, label %85

85:                                               ; preds = %62
  %86 = getelementptr inbounds i8, ptr %0, i64 52
  %87 = load float, ptr %86, align 4, !tbaa !35
  %88 = fcmp ogt float %87, 0.000000e+00
  br i1 %88, label %89, label %105

89:                                               ; preds = %85, %62
  %90 = getelementptr inbounds i8, ptr %27, i64 16
  %.sroa.026.0.copyload = load <2 x float>, ptr %90, align 4
  %91 = getelementptr inbounds i8, ptr %37, i64 16
  %.sroa.025.0.copyload = load <2 x float>, ptr %91, align 4
  %92 = tail call <2 x float> @b2Sub(<2 x float> %.sroa.025.0.copyload, <2 x float> %.sroa.026.0.copyload)
  %93 = tail call <2 x float> @b2Sub(<2 x float> %84, <2 x float> %79)
  %94 = tail call <2 x float> @b2Add(<2 x float> %92, <2 x float> %93)
  %95 = getelementptr inbounds i8, ptr %0, i64 128
  %96 = load <2 x float>, ptr %95, align 4
  %97 = tail call <2 x float> @b2Add(<2 x float> %94, <2 x float> %96)
  %98 = getelementptr inbounds i8, ptr %0, i64 68
  %99 = load float, ptr %98, align 4, !tbaa !36
  %100 = tail call <2 x float> @b2MulSV(float noundef %99, <2 x float> %97)
  %101 = getelementptr inbounds i8, ptr %0, i64 72
  %102 = load float, ptr %101, align 4, !tbaa !37
  %103 = getelementptr inbounds i8, ptr %0, i64 76
  %104 = load float, ptr %103, align 4, !tbaa !38
  br label %105

105:                                              ; preds = %89, %85
  %.0144 = phi float [ %104, %89 ], [ 0.000000e+00, %85 ]
  %.0143 = phi float [ %102, %89 ], [ 1.000000e+00, %85 ]
  %.sroa.030.0 = phi <2 x float> [ %100, %89 ], [ zeroinitializer, %85 ]
  %106 = extractelement <2 x float> %17, i64 1
  %107 = tail call float @llvm.fmuladd.f32(float %106, float %73, float %41)
  %108 = extractelement <2 x float> %17, i64 0
  %109 = fneg float %108
  %110 = tail call float @llvm.fmuladd.f32(float %109, float %73, float %39)
  %111 = tail call <2 x float> @b2CrossSV(float noundef %107, <2 x float> %84)
  %112 = tail call <2 x float> @b2Add(<2 x float> %.sroa.068.0.copyload, <2 x float> %111)
  %113 = tail call <2 x float> @b2CrossSV(float noundef %110, <2 x float> %79)
  %114 = tail call <2 x float> @b2Add(<2 x float> %.sroa.076.0.copyload, <2 x float> %113)
  %115 = tail call <2 x float> @b2Sub(<2 x float> %112, <2 x float> %114)
  %116 = fadd float %13, %15
  %.sroa.043.4.vec.extract = extractelement <2 x float> %79, i64 1
  %117 = fmul float %.sroa.043.4.vec.extract, %.sroa.043.4.vec.extract
  %118 = tail call float @llvm.fmuladd.f32(float %117, float %108, float %116)
  %.sroa.031.4.vec.extract = extractelement <2 x float> %84, i64 1
  %119 = fmul float %.sroa.031.4.vec.extract, %.sroa.031.4.vec.extract
  %120 = tail call float @llvm.fmuladd.f32(float %119, float %106, float %118)
  %.sroa.011.0.vec.insert = insertelement <2 x float> poison, float %120, i64 0
  %121 = fneg float %.sroa.043.4.vec.extract
  %.sroa.031.0.vec.extract = extractelement <2 x float> %84, i64 0
  %122 = fneg float %.sroa.031.4.vec.extract
  %123 = fmul float %.sroa.031.0.vec.extract, %122
  %124 = fmul float %106, %123
  %125 = fmul <2 x float> %79, %79
  %126 = extractelement <2 x float> %125, i64 0
  %127 = tail call float @llvm.fmuladd.f32(float %126, float %108, float %116)
  %128 = shufflevector <2 x float> %79, <2 x float> %84, <2 x i32> <i32 0, i32 2>
  %129 = shufflevector <2 x float> %84, <2 x float> poison, <2 x i32> <i32 poison, i32 0>
  %130 = insertelement <2 x float> %129, float %121, i64 0
  %131 = fmul <2 x float> %128, %130
  %132 = insertelement <2 x float> poison, float %124, i64 0
  %133 = insertelement <2 x float> %132, float %127, i64 1
  %134 = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %131, <2 x float> %17, <2 x float> %133)
  %135 = shufflevector <2 x float> %.sroa.011.0.vec.insert, <2 x float> %134, <2 x i32> <i32 0, i32 2>
  %136 = tail call <2 x float> @b2Add(<2 x float> %115, <2 x float> %.sroa.030.0)
  %137 = tail call <2 x float> @b2Solve22(<2 x float> %135, <2 x float> %134, <2 x float> %136)
  %138 = fneg float %.0143
  %139 = getelementptr inbounds i8, ptr %0, i64 92
  %140 = fneg float %.0144
  %141 = load <2 x float>, ptr %139, align 4, !tbaa !14
  %142 = insertelement <2 x float> poison, float %140, i64 0
  %143 = shufflevector <2 x float> %142, <2 x float> poison, <2 x i32> zeroinitializer
  %144 = fmul <2 x float> %141, %143
  %145 = insertelement <2 x float> poison, float %138, i64 0
  %146 = shufflevector <2 x float> %145, <2 x float> poison, <2 x i32> zeroinitializer
  %147 = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %146, <2 x float> %137, <2 x float> %144)
  %148 = load <2 x float>, ptr %139, align 4
  %149 = tail call <2 x float> @b2Add(<2 x float> %148, <2 x float> %147)
  store <2 x float> %149, ptr %139, align 4
  %150 = tail call <2 x float> @b2MulSub(<2 x float> %.sroa.076.0.copyload, float noundef %13, <2 x float> %147)
  %151 = tail call float @b2Cross(<2 x float> %79, <2 x float> %147)
  %152 = tail call float @llvm.fmuladd.f32(float %109, float %151, float %110)
  %153 = tail call <2 x float> @b2MulAdd(<2 x float> %.sroa.068.0.copyload, float noundef %15, <2 x float> %147)
  %154 = tail call float @b2Cross(<2 x float> %84, <2 x float> %147)
  %155 = tail call float @llvm.fmuladd.f32(float %106, float %154, float %107)
  store <2 x float> %150, ptr %27, align 4
  store float %152, ptr %38, align 4, !tbaa !25
  store <2 x float> %153, ptr %37, align 4
  store float %155, ptr %40, align 4, !tbaa !25
  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> @b2Solve22(<2 x float>, <2 x float>, <2 x float>) local_unnamed_addr #3

; 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>) #7

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { cold noreturn nounwind memory(inaccessiblemem: write) }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!11, !11, i64 0}
!15 = !{!16, !7, i64 56}
!16 = !{!"b2WeldJoint", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !17, i64 20, !17, i64 32, !10, i64 44, !11, i64 52, !7, i64 56, !7, i64 60, !10, i64 64, !10, i64 72, !10, i64 80, !11, i64 88, !11, i64 92}
!17 = !{!"b2Softness", !11, i64 0, !11, i64 4, !11, i64 8}
!18 = !{!19, !20, i64 80}
!19 = !{!"b2StepContext", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !7, i64 16, !17, i64 20, !17, i64 32, !17, i64 44, !11, i64 56, !11, i64 60, !20, i64 64, !20, i64 72, !20, i64 80, !20, i64 88, !20, i64 96, !7, i64 104, !20, i64 112, !21, i64 120, !20, i64 128, !20, i64 136, !20, i64 144, !7, i64 152, !7, i64 156, !20, i64 160, !7, i64 168, !22, i64 172, !8, i64 173, !23, i64 240, !8, i64 244}
!20 = !{!"any pointer", !8, i64 0}
!21 = !{!"b2AtomicInt", !7, i64 0}
!22 = !{!"_Bool", !8, i64 0}
!23 = !{!"b2AtomicU32", !7, i64 0}
!24 = !{!16, !7, i64 60}
!25 = !{!26, !11, i64 8}
!26 = !{!"b2BodyState", !10, i64 0, !11, i64 8, !7, i64 12, !10, i64 16, !27, i64 24}
!27 = !{!"b2Rot", !11, i64 0, !11, i64 4}
!28 = !{!16, !11, i64 12}
!29 = !{!16, !11, i64 88}
!30 = !{!16, !11, i64 32}
!31 = !{!16, !11, i64 36}
!32 = !{!16, !11, i64 40}
!33 = !{!16, !11, i64 92}
!34 = !{!16, !11, i64 52}
!35 = !{!16, !11, i64 4}
!36 = !{!16, !11, i64 20}
!37 = !{!16, !11, i64 24}
!38 = !{!16, !11, i64 28}


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