; 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.b2Vec2 = 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.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.b2World = type { %struct.b2ArenaAllocator, %struct.b2BroadPhase, %struct.b2ConstraintGraph, %struct.b2IdPool, %struct.b2BodyArray, %struct.b2IdPool, %struct.b2SolverSetArray, %struct.b2IdPool, %struct.b2JointArray, %struct.b2IdPool, %struct.b2ContactArray, %struct.b2IdPool, %struct.b2IslandArray, %struct.b2IdPool, %struct.b2IdPool, %struct.b2ShapeArray, %struct.b2ChainShapeArray, %struct.b2SensorArray, %struct.b2TaskContextArray, %struct.b2SensorTaskContextArray, %struct.b2BodyMoveEventArray, %struct.b2SensorBeginTouchEventArray, %struct.b2ContactBeginTouchEventArray, [2 x %struct.b2SensorEndTouchEventArray], [2 x %struct.b2ContactEndTouchEventArray], i32, %struct.b2ContactHitEventArray, %struct.b2BitSet, %struct.b2BitSet, %struct.b2BitSet, %struct.b2BitSet, i64, i32, %struct.b2Vec2, float, float, float, float, float, float, float, float, ptr, ptr, i16, %struct.b2Profile, ptr, ptr, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr, float, i32, i32, i16, i8, i8, i8, i8, i8, i8 }
%struct.b2ArenaAllocator = type { ptr, i32, i32, i32, i32, %struct.b2ArenaEntryArray }
%struct.b2ArenaEntryArray = type { ptr, i32, i32 }
%struct.b2BroadPhase = type { [3 x %struct.b2DynamicTree], i32, %struct.b2HashSet, %struct.b2IntArray, ptr, ptr, i32, %struct.b2AtomicInt, %struct.b2HashSet }
%struct.b2DynamicTree = type { ptr, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, i32 }
%struct.b2IntArray = type { ptr, i32, i32 }
%struct.b2HashSet = type { ptr, i32, i32 }
%struct.b2ConstraintGraph = type { [12 x %struct.b2GraphColor] }
%struct.b2GraphColor = type { %struct.b2BitSet, %struct.b2ContactSimArray, %struct.b2JointSimArray, %union.anon.0 }
%struct.b2ContactSimArray = type { ptr, i32, i32 }
%struct.b2JointSimArray = type { ptr, i32, i32 }
%union.anon.0 = type { ptr }
%struct.b2BodyArray = type { ptr, i32, i32 }
%struct.b2SolverSetArray = type { ptr, i32, i32 }
%struct.b2JointArray = type { ptr, i32, i32 }
%struct.b2ContactArray = type { ptr, i32, i32 }
%struct.b2IslandArray = type { ptr, i32, i32 }
%struct.b2IdPool = type { %struct.b2IntArray, i32 }
%struct.b2ShapeArray = type { ptr, i32, i32 }
%struct.b2ChainShapeArray = type { ptr, i32, i32 }
%struct.b2SensorArray = type { ptr, i32, i32 }
%struct.b2TaskContextArray = type { ptr, i32, i32 }
%struct.b2SensorTaskContextArray = type { ptr, i32, i32 }
%struct.b2BodyMoveEventArray = type { ptr, i32, i32 }
%struct.b2SensorBeginTouchEventArray = type { ptr, i32, i32 }
%struct.b2ContactBeginTouchEventArray = type { ptr, i32, i32 }
%struct.b2SensorEndTouchEventArray = type { ptr, i32, i32 }
%struct.b2ContactEndTouchEventArray = type { ptr, i32, i32 }
%struct.b2ContactHitEventArray = type { ptr, i32, i32 }
%struct.b2BitSet = type { ptr, i32, i32 }
%struct.b2Profile = type { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float }
%struct.b2Body = type { [32 x i8], ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, float, float, float, i32, i32, i32, i16, i8, i8, i8, i8 }
%struct.b2SolverSet = type { %struct.b2BodySimArray, %struct.b2BodyStateArray, %struct.b2JointSimArray, %struct.b2ContactSimArray, %struct.b2IslandSimArray, i32 }
%struct.b2BodySimArray = type { ptr, i32, i32 }
%struct.b2BodyStateArray = type { ptr, i32, i32 }
%struct.b2IslandSimArray = type { ptr, i32, i32 }
%struct.b2BodySim = type { %struct.b2Transform, %struct.b2Vec2, %struct.b2Rot, %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, float, float, float, float, float, float, float, float, i32, i8, i8, i8, i8, i8 }
%struct.b2Transform = type { %struct.b2Vec2, %struct.b2Rot }
%struct.b2Rot = type { 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 }

@.str = external hidden unnamed_addr constant [28 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [65 x i8], align 1
@b2Vec2_zero = external hidden constant %struct.b2Vec2, 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: nounwind uwtable
define dso_local void @b2PrepareMotorJoint(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca ptr, align 8
  %21 = alloca %struct.b2Vec2, align 4
  %22 = alloca %struct.b2Vec2, align 4
  %23 = alloca %struct.b2Vec2, 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 %struct.b2Vec2, align 4
  %29 = alloca %struct.b2Mat22, align 4
  %30 = alloca %struct.b2Mat22, align 4
  %31 = alloca float, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  br label %32

32:                                               ; preds = %2
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.b2JointSim, ptr %33, i32 0, i32 3
  %35 = load i32, ptr %34, align 4, !tbaa !9
  %36 = icmp eq i32 %35, 2
  br i1 %36, label %41, label %37

37:                                               ; preds = %32
  %38 = call i32 @b2InternalAssertFcn(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 101)
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %40, label %41

40:                                               ; preds = %37
  call void @llvm.trap()
  br label %41

41:                                               ; preds = %40, %37, %32
  br label %42

42:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.b2JointSim, ptr %43, i32 0, i32 1
  %45 = load i32, ptr %44, align 4, !tbaa !14
  store i32 %45, ptr %5, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  %46 = load ptr, ptr %3, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.b2JointSim, ptr %46, i32 0, i32 2
  %48 = load i32, ptr %47, align 4, !tbaa !16
  store i32 %48, ptr %6, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.b2StepContext, ptr %49, i32 0, i32 10
  %51 = load ptr, ptr %50, align 8, !tbaa !17
  store ptr %51, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.b2World, ptr %52, i32 0, i32 4
  %54 = load i32, ptr %5, align 4, !tbaa !15
  %55 = call ptr @b2BodyArray_Get(ptr noundef %53, i32 noundef %54)
  store ptr %55, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.b2World, ptr %56, i32 0, i32 4
  %58 = load i32, ptr %6, align 4, !tbaa !15
  %59 = call ptr @b2BodyArray_Get(ptr noundef %57, i32 noundef %58)
  store ptr %59, ptr %9, align 8, !tbaa !5
  br label %60

60:                                               ; preds = %42
  %61 = load ptr, ptr %8, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.b2Body, ptr %61, i32 0, i32 2
  %63 = load i32, ptr %62, align 8, !tbaa !23
  %64 = icmp eq i32 %63, 2
  br i1 %64, label %74, label %65

65:                                               ; preds = %60
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.b2Body, ptr %66, i32 0, i32 2
  %68 = load i32, ptr %67, align 8, !tbaa !23
  %69 = icmp eq i32 %68, 2
  br i1 %69, label %74, label %70

70:                                               ; preds = %65
  %71 = call i32 @b2InternalAssertFcn(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 112)
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %74

73:                                               ; preds = %70
  call void @llvm.trap()
  br label %74

74:                                               ; preds = %73, %70, %65, %60
  br label %75

75:                                               ; preds = %74
  br label %76

76:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.b2World, ptr %77, i32 0, i32 6
  %79 = load ptr, ptr %8, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.b2Body, ptr %79, i32 0, i32 2
  %81 = load i32, ptr %80, align 8, !tbaa !23
  %82 = call ptr @b2SolverSetArray_Get(ptr noundef %78, i32 noundef %81)
  store ptr %82, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.b2World, ptr %83, i32 0, i32 6
  %85 = load ptr, ptr %9, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.b2Body, ptr %85, i32 0, i32 2
  %87 = load i32, ptr %86, align 8, !tbaa !23
  %88 = call ptr @b2SolverSetArray_Get(ptr noundef %84, i32 noundef %87)
  store ptr %88, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %89 = load ptr, ptr %8, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.b2Body, ptr %89, i32 0, i32 3
  %91 = load i32, ptr %90, align 4, !tbaa !26
  store i32 %91, ptr %12, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.b2Body, ptr %92, i32 0, i32 3
  %94 = load i32, ptr %93, align 4, !tbaa !26
  store i32 %94, ptr %13, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %95 = load ptr, ptr %10, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.b2SolverSet, ptr %95, i32 0, i32 0
  %97 = load i32, ptr %12, align 4, !tbaa !15
  %98 = call ptr @b2BodySimArray_Get(ptr noundef %96, i32 noundef %97)
  store ptr %98, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %99 = load ptr, ptr %11, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.b2SolverSet, ptr %99, i32 0, i32 0
  %101 = load i32, ptr %13, align 4, !tbaa !15
  %102 = call ptr @b2BodySimArray_Get(ptr noundef %100, i32 noundef %101)
  store ptr %102, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %103 = load ptr, ptr %14, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.b2BodySim, ptr %103, i32 0, i32 7
  %105 = load float, ptr %104, align 4, !tbaa !27
  store float %105, ptr %16, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %106 = load ptr, ptr %14, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.b2BodySim, ptr %106, i32 0, i32 8
  %108 = load float, ptr %107, align 4, !tbaa !32
  store float %108, ptr %17, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %109 = load ptr, ptr %15, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.b2BodySim, ptr %109, i32 0, i32 7
  %111 = load float, ptr %110, align 4, !tbaa !27
  store float %111, ptr %18, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %112 = load ptr, ptr %15, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.b2BodySim, ptr %112, i32 0, i32 8
  %114 = load float, ptr %113, align 4, !tbaa !32
  store float %114, ptr %19, align 4, !tbaa !31
  %115 = load float, ptr %16, align 4, !tbaa !31
  %116 = load ptr, ptr %3, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.b2JointSim, ptr %116, i32 0, i32 6
  store float %115, ptr %117, align 4, !tbaa !33
  %118 = load float, ptr %18, align 4, !tbaa !31
  %119 = load ptr, ptr %3, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.b2JointSim, ptr %119, i32 0, i32 7
  store float %118, ptr %120, align 4, !tbaa !34
  %121 = load float, ptr %17, align 4, !tbaa !31
  %122 = load ptr, ptr %3, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.b2JointSim, ptr %122, i32 0, i32 8
  store float %121, ptr %123, align 4, !tbaa !35
  %124 = load float, ptr %19, align 4, !tbaa !31
  %125 = load ptr, ptr %3, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.b2JointSim, ptr %125, i32 0, i32 9
  store float %124, ptr %126, align 4, !tbaa !36
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %127 = load ptr, ptr %3, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.b2JointSim, ptr %127, i32 0, i32 10
  store ptr %128, ptr %20, align 8, !tbaa !5
  %129 = load ptr, ptr %8, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.b2Body, ptr %129, i32 0, i32 2
  %131 = load i32, ptr %130, align 8, !tbaa !23
  %132 = icmp eq i32 %131, 2
  br i1 %132, label %133, label %135

133:                                              ; preds = %76
  %134 = load i32, ptr %12, align 4, !tbaa !15
  br label %136

135:                                              ; preds = %76
  br label %136

136:                                              ; preds = %135, %133
  %137 = phi i32 [ %134, %133 ], [ -1, %135 ]
  %138 = load ptr, ptr %20, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.b2MotorJoint, ptr %138, i32 0, i32 7
  store i32 %137, ptr %139, align 4, !tbaa !37
  %140 = load ptr, ptr %9, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.b2Body, ptr %140, i32 0, i32 2
  %142 = load i32, ptr %141, align 8, !tbaa !23
  %143 = icmp eq i32 %142, 2
  br i1 %143, label %144, label %146

144:                                              ; preds = %136
  %145 = load i32, ptr %13, align 4, !tbaa !15
  br label %147

146:                                              ; preds = %136
  br label %147

147:                                              ; preds = %146, %144
  %148 = phi i32 [ %145, %144 ], [ -1, %146 ]
  %149 = load ptr, ptr %20, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.b2MotorJoint, ptr %149, i32 0, i32 8
  store i32 %148, ptr %150, align 4, !tbaa !40
  %151 = load ptr, ptr %20, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.b2MotorJoint, ptr %151, i32 0, i32 9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %153 = load ptr, ptr %14, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.b2BodySim, ptr %153, i32 0, i32 0
  %155 = getelementptr inbounds %struct.b2Transform, ptr %154, i32 0, i32 1
  %156 = load ptr, ptr %3, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.b2JointSim, ptr %156, i32 0, i32 4
  %158 = load ptr, ptr %14, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.b2BodySim, ptr %158, i32 0, i32 4
  %160 = load <2 x float>, ptr %157, align 4
  %161 = load <2 x float>, ptr %159, align 4
  %162 = call <2 x float> @b2Sub(<2 x float> %160, <2 x float> %161)
  store <2 x float> %162, ptr %22, align 4
  %163 = load <2 x float>, ptr %155, align 4
  %164 = load <2 x float>, ptr %22, align 4
  %165 = call <2 x float> @b2RotateVector(<2 x float> %163, <2 x float> %164)
  store <2 x float> %165, ptr %21, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %152, ptr align 4 %21, i64 8, i1 false), !tbaa.struct !41
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  %166 = load ptr, ptr %20, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.b2MotorJoint, ptr %166, i32 0, i32 10
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  %168 = load ptr, ptr %15, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.b2BodySim, ptr %168, i32 0, i32 0
  %170 = getelementptr inbounds %struct.b2Transform, ptr %169, i32 0, i32 1
  %171 = load ptr, ptr %3, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.b2JointSim, ptr %171, i32 0, i32 5
  %173 = load ptr, ptr %15, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.b2BodySim, ptr %173, i32 0, i32 4
  %175 = load <2 x float>, ptr %172, align 4
  %176 = load <2 x float>, ptr %174, align 4
  %177 = call <2 x float> @b2Sub(<2 x float> %175, <2 x float> %176)
  store <2 x float> %177, ptr %24, align 4
  %178 = load <2 x float>, ptr %170, align 4
  %179 = load <2 x float>, ptr %24, align 4
  %180 = call <2 x float> @b2RotateVector(<2 x float> %178, <2 x float> %179)
  store <2 x float> %180, ptr %23, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %167, ptr align 4 %23, i64 8, i1 false), !tbaa.struct !41
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  %181 = load ptr, ptr %20, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.b2MotorJoint, ptr %181, i32 0, i32 11
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %183 = load ptr, ptr %15, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.b2BodySim, ptr %183, i32 0, i32 1
  %185 = load ptr, ptr %14, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.b2BodySim, ptr %185, i32 0, i32 1
  %187 = load <2 x float>, ptr %184, align 4
  %188 = load <2 x float>, ptr %186, align 4
  %189 = call <2 x float> @b2Sub(<2 x float> %187, <2 x float> %188)
  store <2 x float> %189, ptr %26, align 4
  %190 = load ptr, ptr %20, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.b2MotorJoint, ptr %190, i32 0, i32 0
  %192 = load <2 x float>, ptr %26, align 4
  %193 = load <2 x float>, ptr %191, align 4
  %194 = call <2 x float> @b2Sub(<2 x float> %192, <2 x float> %193)
  store <2 x float> %194, ptr %25, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %182, ptr align 4 %25, i64 8, i1 false), !tbaa.struct !41
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  %195 = load ptr, ptr %15, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.b2BodySim, ptr %195, i32 0, i32 0
  %197 = getelementptr inbounds %struct.b2Transform, ptr %196, i32 0, i32 1
  %198 = load ptr, ptr %14, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.b2BodySim, ptr %198, i32 0, i32 0
  %200 = getelementptr inbounds %struct.b2Transform, ptr %199, i32 0, i32 1
  %201 = load <2 x float>, ptr %197, align 4
  %202 = load <2 x float>, ptr %200, align 4
  %203 = call float @b2RelativeAngle(<2 x float> %201, <2 x float> %202)
  %204 = load ptr, ptr %20, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.b2MotorJoint, ptr %204, i32 0, i32 1
  %206 = load float, ptr %205, align 4, !tbaa !42
  %207 = fsub float %203, %206
  %208 = load ptr, ptr %20, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.b2MotorJoint, ptr %208, i32 0, i32 12
  store float %207, ptr %209, align 4, !tbaa !43
  %210 = load ptr, ptr %20, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.b2MotorJoint, ptr %210, i32 0, i32 12
  %212 = load float, ptr %211, align 4, !tbaa !43
  %213 = call float @b2UnwindAngle(float noundef %212)
  %214 = load ptr, ptr %20, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.b2MotorJoint, ptr %214, i32 0, i32 12
  store float %213, ptr %215, align 4, !tbaa !43
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  %216 = load ptr, ptr %20, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.b2MotorJoint, ptr %216, i32 0, i32 9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %27, ptr align 4 %217, i64 8, i1 false), !tbaa.struct !41
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #8
  %218 = load ptr, ptr %20, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.b2MotorJoint, ptr %218, i32 0, i32 10
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %28, ptr align 4 %219, i64 8, i1 false), !tbaa.struct !41
  call void @llvm.lifetime.start.p0(i64 16, ptr %29) #8
  %220 = load float, ptr %16, align 4, !tbaa !31
  %221 = load float, ptr %18, align 4, !tbaa !31
  %222 = fadd float %220, %221
  %223 = getelementptr inbounds %struct.b2Vec2, ptr %27, i32 0, i32 1
  %224 = load float, ptr %223, align 4, !tbaa !44
  %225 = getelementptr inbounds %struct.b2Vec2, ptr %27, i32 0, i32 1
  %226 = load float, ptr %225, align 4, !tbaa !44
  %227 = fmul float %224, %226
  %228 = load float, ptr %17, align 4, !tbaa !31
  %229 = call float @llvm.fmuladd.f32(float %227, float %228, float %222)
  %230 = getelementptr inbounds %struct.b2Vec2, ptr %28, i32 0, i32 1
  %231 = load float, ptr %230, align 4, !tbaa !44
  %232 = getelementptr inbounds %struct.b2Vec2, ptr %28, i32 0, i32 1
  %233 = load float, ptr %232, align 4, !tbaa !44
  %234 = fmul float %231, %233
  %235 = load float, ptr %19, align 4, !tbaa !31
  %236 = call float @llvm.fmuladd.f32(float %234, float %235, float %229)
  %237 = getelementptr inbounds %struct.b2Mat22, ptr %29, i32 0, i32 0
  %238 = getelementptr inbounds %struct.b2Vec2, ptr %237, i32 0, i32 0
  store float %236, ptr %238, align 4, !tbaa !45
  %239 = getelementptr inbounds %struct.b2Vec2, ptr %27, i32 0, i32 1
  %240 = load float, ptr %239, align 4, !tbaa !44
  %241 = fneg float %240
  %242 = getelementptr inbounds %struct.b2Vec2, ptr %27, i32 0, i32 0
  %243 = load float, ptr %242, align 4, !tbaa !46
  %244 = fmul float %241, %243
  %245 = load float, ptr %17, align 4, !tbaa !31
  %246 = getelementptr inbounds %struct.b2Vec2, ptr %28, i32 0, i32 1
  %247 = load float, ptr %246, align 4, !tbaa !44
  %248 = getelementptr inbounds %struct.b2Vec2, ptr %28, i32 0, i32 0
  %249 = load float, ptr %248, align 4, !tbaa !46
  %250 = fmul float %247, %249
  %251 = load float, ptr %19, align 4, !tbaa !31
  %252 = fmul float %250, %251
  %253 = fneg float %252
  %254 = call float @llvm.fmuladd.f32(float %244, float %245, float %253)
  %255 = getelementptr inbounds %struct.b2Mat22, ptr %29, i32 0, i32 0
  %256 = getelementptr inbounds %struct.b2Vec2, ptr %255, i32 0, i32 1
  store float %254, ptr %256, align 4, !tbaa !47
  %257 = getelementptr inbounds %struct.b2Mat22, ptr %29, i32 0, i32 0
  %258 = getelementptr inbounds %struct.b2Vec2, ptr %257, i32 0, i32 1
  %259 = load float, ptr %258, align 4, !tbaa !47
  %260 = getelementptr inbounds %struct.b2Mat22, ptr %29, i32 0, i32 1
  %261 = getelementptr inbounds %struct.b2Vec2, ptr %260, i32 0, i32 0
  store float %259, ptr %261, align 4, !tbaa !48
  %262 = load float, ptr %16, align 4, !tbaa !31
  %263 = load float, ptr %18, align 4, !tbaa !31
  %264 = fadd float %262, %263
  %265 = getelementptr inbounds %struct.b2Vec2, ptr %27, i32 0, i32 0
  %266 = load float, ptr %265, align 4, !tbaa !46
  %267 = getelementptr inbounds %struct.b2Vec2, ptr %27, i32 0, i32 0
  %268 = load float, ptr %267, align 4, !tbaa !46
  %269 = fmul float %266, %268
  %270 = load float, ptr %17, align 4, !tbaa !31
  %271 = call float @llvm.fmuladd.f32(float %269, float %270, float %264)
  %272 = getelementptr inbounds %struct.b2Vec2, ptr %28, i32 0, i32 0
  %273 = load float, ptr %272, align 4, !tbaa !46
  %274 = getelementptr inbounds %struct.b2Vec2, ptr %28, i32 0, i32 0
  %275 = load float, ptr %274, align 4, !tbaa !46
  %276 = fmul float %273, %275
  %277 = load float, ptr %19, align 4, !tbaa !31
  %278 = call float @llvm.fmuladd.f32(float %276, float %277, float %271)
  %279 = getelementptr inbounds %struct.b2Mat22, ptr %29, i32 0, i32 1
  %280 = getelementptr inbounds %struct.b2Vec2, ptr %279, i32 0, i32 1
  store float %278, ptr %280, align 4, !tbaa !49
  %281 = load ptr, ptr %20, align 8, !tbaa !5
  %282 = getelementptr inbounds %struct.b2MotorJoint, ptr %281, i32 0, i32 13
  call void @llvm.lifetime.start.p0(i64 16, ptr %30) #8
  %283 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %29, i32 0, i32 0
  %284 = load <2 x float>, ptr %283, align 4
  %285 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %29, i32 0, i32 1
  %286 = load <2 x float>, ptr %285, align 4
  %287 = call { <2 x float>, <2 x float> } @b2GetInverse22(<2 x float> %284, <2 x float> %286)
  %288 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %30, i32 0, i32 0
  %289 = extractvalue { <2 x float>, <2 x float> } %287, 0
  store <2 x float> %289, ptr %288, align 4
  %290 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %30, i32 0, i32 1
  %291 = extractvalue { <2 x float>, <2 x float> } %287, 1
  store <2 x float> %291, ptr %290, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %282, ptr align 4 %30, i64 16, i1 false), !tbaa.struct !50
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #8
  %292 = load float, ptr %17, align 4, !tbaa !31
  %293 = load float, ptr %19, align 4, !tbaa !31
  %294 = fadd float %292, %293
  store float %294, ptr %31, align 4, !tbaa !31
  %295 = load float, ptr %31, align 4, !tbaa !31
  %296 = fcmp ogt float %295, 0.000000e+00
  br i1 %296, label %297, label %300

297:                                              ; preds = %147
  %298 = load float, ptr %31, align 4, !tbaa !31
  %299 = fdiv float 1.000000e+00, %298
  br label %301

300:                                              ; preds = %147
  br label %301

301:                                              ; preds = %300, %297
  %302 = phi float [ %299, %297 ], [ 0.000000e+00, %300 ]
  %303 = load ptr, ptr %20, align 8, !tbaa !5
  %304 = getelementptr inbounds %struct.b2MotorJoint, ptr %303, i32 0, i32 14
  store float %302, ptr %304, align 4, !tbaa !51
  %305 = load ptr, ptr %4, align 8, !tbaa !5
  %306 = getelementptr inbounds %struct.b2StepContext, ptr %305, i32 0, i32 25
  %307 = load i8, ptr %306, align 4, !tbaa !52, !range !53, !noundef !54
  %308 = trunc i8 %307 to i1
  %309 = zext i1 %308 to i32
  %310 = icmp eq i32 %309, 0
  br i1 %310, label %311, label %316

311:                                              ; preds = %301
  %312 = load ptr, ptr %20, align 8, !tbaa !5
  %313 = getelementptr inbounds %struct.b2MotorJoint, ptr %312, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %313, ptr align 4 @b2Vec2_zero, i64 8, i1 false), !tbaa.struct !41
  %314 = load ptr, ptr %20, align 8, !tbaa !5
  %315 = getelementptr inbounds %struct.b2MotorJoint, ptr %314, i32 0, i32 3
  store float 0.000000e+00, ptr %315, align 4, !tbaa !55
  br label %316

316:                                              ; preds = %311, %301
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, 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 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  ret void
}

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @b2BodyArray_Get(ptr noundef, i32 noundef) #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @b2SolverSetArray_Get(ptr noundef, i32 noundef) #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @b2BodySimArray_Get(ptr noundef, i32 noundef) #5

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

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

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

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden { <2 x float>, <2 x float> } @b2GetInverse22(<2 x float>, <2 x float>) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { cold noreturn nounwind memory(inaccessiblemem: write) }
attributes #5 = { 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 #6 = { 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 #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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 12}
!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 = !{!10, !11, i64 4}
!15 = !{!11, !11, i64 0}
!16 = !{!10, !11, i64 8}
!17 = !{!18, !6, i64 64}
!18 = !{!"b2StepContext", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !11, i64 16, !19, i64 20, !19, i64 32, !19, 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, !20, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !11, i64 152, !11, i64 156, !6, i64 160, !11, i64 168, !21, i64 172, !7, i64 173, !22, i64 240, !7, i64 244}
!19 = !{!"b2Softness", !13, i64 0, !13, i64 4, !13, i64 8}
!20 = !{!"b2AtomicInt", !11, i64 0}
!21 = !{!"_Bool", !7, i64 0}
!22 = !{!"b2AtomicU32", !11, i64 0}
!23 = !{!24, !11, i64 40}
!24 = !{!"b2Body", !7, i64 0, !6, i64 32, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !13, i64 88, !13, i64 92, !13, i64 96, !13, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !25, i64 116, !21, i64 118, !21, i64 119, !21, i64 120, !21, i64 121}
!25 = !{!"short", !7, i64 0}
!26 = !{!24, !11, i64 44}
!27 = !{!28, !13, i64 60}
!28 = !{!"b2BodySim", !29, i64 0, !12, i64 16, !30, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !13, i64 56, !13, i64 60, !13, i64 64, !13, i64 68, !13, i64 72, !13, i64 76, !13, i64 80, !13, i64 84, !11, i64 88, !21, i64 92, !21, i64 93, !21, i64 94, !21, i64 95, !21, i64 96}
!29 = !{!"b2Transform", !12, i64 0, !30, i64 8}
!30 = !{!"b2Rot", !13, i64 0, !13, i64 4}
!31 = !{!13, !13, i64 0}
!32 = !{!28, !13, i64 64}
!33 = !{!10, !13, i64 32}
!34 = !{!10, !13, i64 36}
!35 = !{!10, !13, i64 40}
!36 = !{!10, !13, i64 44}
!37 = !{!38, !11, i64 36}
!38 = !{!"b2MotorJoint", !12, i64 0, !13, i64 8, !12, i64 12, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !11, i64 36, !11, i64 40, !12, i64 44, !12, i64 52, !12, i64 60, !13, i64 68, !39, i64 72, !13, i64 88}
!39 = !{!"b2Mat22", !12, i64 0, !12, i64 8}
!40 = !{!38, !11, i64 40}
!41 = !{i64 0, i64 4, !31, i64 4, i64 4, !31}
!42 = !{!38, !13, i64 8}
!43 = !{!38, !13, i64 68}
!44 = !{!12, !13, i64 4}
!45 = !{!39, !13, i64 0}
!46 = !{!12, !13, i64 0}
!47 = !{!39, !13, i64 4}
!48 = !{!39, !13, i64 8}
!49 = !{!39, !13, i64 12}
!50 = !{i64 0, i64 4, !31, i64 4, i64 4, !31, i64 8, i64 4, !31, i64 12, i64 4, !31}
!51 = !{!38, !13, i64 88}
!52 = !{!18, !21, i64 172}
!53 = !{i8 0, i8 2}
!54 = !{}
!55 = !{!38, !13, i64 20}


; 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.b2Vec2 = 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
@.str.2 = external hidden unnamed_addr constant [65 x i8], align 1
@b2Vec2_zero = external hidden local_unnamed_addr constant %struct.b2Vec2, align 4

; Function Attrs: nounwind uwtable
define dso_local void @b2PrepareMotorJoint(ptr nocapture noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 12
  %4 = load i32, ptr %3, align 4, !tbaa !5
  %5 = icmp eq i32 %4, 2
  br i1 %5, label %9, label %6

6:                                                ; preds = %2
  %7 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 101) #7
  %.not = icmp eq i32 %7, 0
  br i1 %.not, label %9, label %8

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

9:                                                ; preds = %2, %6
  %10 = getelementptr inbounds i8, ptr %0, i64 4
  %11 = load i32, ptr %10, align 4, !tbaa !12
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  %13 = load i32, ptr %12, align 4, !tbaa !13
  %14 = getelementptr inbounds i8, ptr %1, i64 64
  %15 = load ptr, ptr %14, align 8, !tbaa !14
  %16 = getelementptr inbounds i8, ptr %15, i64 1032
  %17 = tail call ptr @b2BodyArray_Get(ptr noundef nonnull %16, i32 noundef %11)
  %18 = tail call ptr @b2BodyArray_Get(ptr noundef nonnull %16, i32 noundef %13)
  %19 = getelementptr inbounds i8, ptr %17, i64 40
  %20 = load i32, ptr %19, align 8, !tbaa !21
  %21 = icmp eq i32 %20, 2
  br i1 %21, label %29, label %22

22:                                               ; preds = %9
  %23 = getelementptr inbounds i8, ptr %18, i64 40
  %24 = load i32, ptr %23, align 8, !tbaa !21
  %25 = icmp eq i32 %24, 2
  br i1 %25, label %29, label %26

26:                                               ; preds = %22
  %27 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 112) #7
  %.not99 = icmp eq i32 %27, 0
  br i1 %.not99, label %._crit_edge, label %28

._crit_edge:                                      ; preds = %26
  %.pre = load i32, ptr %19, align 8, !tbaa !21
  br label %29

28:                                               ; preds = %26
  tail call void @llvm.trap()
  unreachable

29:                                               ; preds = %._crit_edge, %22, %9
  %30 = phi i32 [ %.pre, %._crit_edge ], [ %20, %22 ], [ 2, %9 ]
  %31 = getelementptr inbounds i8, ptr %15, i64 1072
  %32 = tail call ptr @b2SolverSetArray_Get(ptr noundef nonnull %31, i32 noundef %30)
  %33 = getelementptr inbounds i8, ptr %18, i64 40
  %34 = load i32, ptr %33, align 8, !tbaa !21
  %35 = tail call ptr @b2SolverSetArray_Get(ptr noundef nonnull %31, i32 noundef %34)
  %36 = getelementptr inbounds i8, ptr %17, i64 44
  %37 = load i32, ptr %36, align 4, !tbaa !24
  %38 = getelementptr inbounds i8, ptr %18, i64 44
  %39 = load i32, ptr %38, align 4, !tbaa !24
  %40 = tail call ptr @b2BodySimArray_Get(ptr noundef %32, i32 noundef %37)
  %41 = tail call ptr @b2BodySimArray_Get(ptr noundef %35, i32 noundef %39)
  %42 = getelementptr inbounds i8, ptr %40, i64 60
  %43 = load <2 x float>, ptr %42, align 4, !tbaa !25
  %44 = getelementptr inbounds i8, ptr %41, i64 60
  %45 = load <2 x float>, ptr %44, align 4, !tbaa !25
  %46 = getelementptr inbounds i8, ptr %0, i64 32
  %47 = shufflevector <2 x float> %43, <2 x float> %45, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
  store <4 x float> %47, ptr %46, align 4, !tbaa !25
  %48 = getelementptr inbounds i8, ptr %0, i64 48
  %49 = load i32, ptr %19, align 8, !tbaa !21
  %50 = icmp eq i32 %49, 2
  %51 = select i1 %50, i32 %37, i32 -1
  %52 = getelementptr inbounds i8, ptr %0, i64 84
  store i32 %51, ptr %52, align 4, !tbaa !26
  %53 = load i32, ptr %33, align 8, !tbaa !21
  %54 = icmp eq i32 %53, 2
  %55 = select i1 %54, i32 %39, i32 -1
  %56 = getelementptr inbounds i8, ptr %0, i64 88
  store i32 %55, ptr %56, align 4, !tbaa !29
  %57 = getelementptr inbounds i8, ptr %0, i64 92
  %58 = getelementptr inbounds i8, ptr %40, i64 8
  %59 = getelementptr inbounds i8, ptr %0, i64 16
  %60 = getelementptr inbounds i8, ptr %40, i64 40
  %61 = load <2 x float>, ptr %59, align 4
  %62 = load <2 x float>, ptr %60, align 4
  %63 = tail call <2 x float> @b2Sub(<2 x float> %61, <2 x float> %62)
  %64 = load <2 x float>, ptr %58, align 4
  %65 = tail call <2 x float> @b2RotateVector(<2 x float> %64, <2 x float> %63)
  store <2 x float> %65, ptr %57, align 4
  %66 = getelementptr inbounds i8, ptr %0, i64 100
  %67 = getelementptr inbounds i8, ptr %41, i64 8
  %68 = getelementptr inbounds i8, ptr %0, i64 24
  %69 = getelementptr inbounds i8, ptr %41, i64 40
  %70 = load <2 x float>, ptr %68, align 4
  %71 = load <2 x float>, ptr %69, align 4
  %72 = tail call <2 x float> @b2Sub(<2 x float> %70, <2 x float> %71)
  %73 = load <2 x float>, ptr %67, align 4
  %74 = tail call <2 x float> @b2RotateVector(<2 x float> %73, <2 x float> %72)
  store <2 x float> %74, ptr %66, align 4
  %75 = getelementptr inbounds i8, ptr %0, i64 108
  %76 = getelementptr inbounds i8, ptr %41, i64 16
  %77 = getelementptr inbounds i8, ptr %40, i64 16
  %78 = load <2 x float>, ptr %76, align 4
  %79 = load <2 x float>, ptr %77, align 4
  %80 = tail call <2 x float> @b2Sub(<2 x float> %78, <2 x float> %79)
  %81 = load <2 x float>, ptr %48, align 4
  %82 = tail call <2 x float> @b2Sub(<2 x float> %80, <2 x float> %81)
  store <2 x float> %82, ptr %75, align 4
  %83 = load <2 x float>, ptr %67, align 4
  %84 = load <2 x float>, ptr %58, align 4
  %85 = tail call float @b2RelativeAngle(<2 x float> %83, <2 x float> %84)
  %86 = getelementptr inbounds i8, ptr %0, i64 56
  %87 = load float, ptr %86, align 4, !tbaa !30
  %88 = fsub float %85, %87
  %89 = getelementptr inbounds i8, ptr %0, i64 116
  store float %88, ptr %89, align 4, !tbaa !31
  %90 = tail call float @b2UnwindAngle(float noundef %88)
  store float %90, ptr %89, align 4, !tbaa !31
  %.sroa.012.0.copyload = load float, ptr %57, align 4, !tbaa !25
  %.sroa.615.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 96
  %.sroa.615.0.copyload = load float, ptr %.sroa.615.0..sroa_idx, align 4, !tbaa !25
  %.sroa.06.0.copyload = load float, ptr %66, align 4, !tbaa !25
  %.sroa.69.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 104
  %.sroa.69.0.copyload = load float, ptr %.sroa.69.0..sroa_idx, align 4, !tbaa !25
  %91 = fadd <2 x float> %43, %45
  %92 = extractelement <2 x float> %91, i64 0
  %93 = fmul float %.sroa.615.0.copyload, %.sroa.615.0.copyload
  %94 = extractelement <2 x float> %43, i64 1
  %95 = tail call float @llvm.fmuladd.f32(float %93, float %94, float %92)
  %96 = extractelement <2 x float> %45, i64 1
  %97 = fneg float %.sroa.615.0.copyload
  %98 = fneg float %.sroa.69.0.copyload
  %99 = fmul float %.sroa.06.0.copyload, %98
  %100 = fmul float %96, %99
  %101 = insertelement <2 x float> poison, float %.sroa.69.0.copyload, i64 0
  %102 = insertelement <2 x float> %101, float %.sroa.012.0.copyload, i64 1
  %103 = insertelement <2 x float> %102, float %97, i64 1
  %104 = fmul <2 x float> %102, %103
  %105 = shufflevector <2 x float> %45, <2 x float> %43, <2 x i32> <i32 1, i32 3>
  %106 = insertelement <2 x float> poison, float %95, i64 0
  %107 = insertelement <2 x float> %106, float %100, i64 1
  %108 = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %104, <2 x float> %105, <2 x float> %107)
  %109 = shufflevector <2 x float> %108, <2 x float> poison, <2 x i32> <i32 1, i32 poison>
  %110 = fmul float %.sroa.012.0.copyload, %.sroa.012.0.copyload
  %111 = tail call float @llvm.fmuladd.f32(float %110, float %94, float %92)
  %112 = fmul float %.sroa.06.0.copyload, %.sroa.06.0.copyload
  %113 = tail call float @llvm.fmuladd.f32(float %112, float %96, float %111)
  %.sroa.6.12.vec.insert = insertelement <2 x float> %109, float %113, i64 1
  %114 = getelementptr inbounds i8, ptr %0, i64 120
  %115 = tail call { <2 x float>, <2 x float> } @b2GetInverse22(<2 x float> %108, <2 x float> %.sroa.6.12.vec.insert)
  %116 = extractvalue { <2 x float>, <2 x float> } %115, 0
  %117 = extractvalue { <2 x float>, <2 x float> } %115, 1
  store <2 x float> %116, ptr %114, align 4
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 128
  store <2 x float> %117, ptr %.sroa.4.0..sroa_idx, align 4
  %118 = fadd float %94, %96
  %119 = fcmp ogt float %118, 0.000000e+00
  %120 = fdiv float 1.000000e+00, %118
  %121 = select i1 %119, float %120, float 0.000000e+00
  %122 = getelementptr inbounds i8, ptr %0, i64 136
  store float %121, ptr %122, align 4, !tbaa !32
  %123 = getelementptr inbounds i8, ptr %1, i64 172
  %124 = load i8, ptr %123, align 4, !tbaa !33, !range !34, !noundef !35
  %125 = icmp eq i8 %124, 0
  br i1 %125, label %126, label %130

126:                                              ; preds = %29
  %127 = getelementptr inbounds i8, ptr %0, i64 60
  %128 = load i64, ptr @b2Vec2_zero, align 4
  store i64 %128, ptr %127, align 4
  %129 = getelementptr inbounds i8, ptr %0, i64 68
  store float 0.000000e+00, ptr %129, align 4, !tbaa !36
  br label %130

130:                                              ; preds = %126, %29
  ret void
}

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 ptr @b2BodyArray_Get(ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @b2SolverSetArray_Get(ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @b2BodySimArray_Get(ptr noundef, i32 noundef) local_unnamed_addr #3

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

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2UnwindAngle(float noundef) 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>, <2 x float> } @b2GetInverse22(<2 x float>, <2 x float>) local_unnamed_addr #4

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

attributes #0 = { 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 = { "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"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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, !7, i64 4}
!13 = !{!6, !7, i64 8}
!14 = !{!15, !17, i64 64}
!15 = !{!"b2StepContext", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !7, i64 16, !16, i64 20, !16, i64 32, !16, i64 44, !11, i64 56, !11, i64 60, !17, i64 64, !17, i64 72, !17, i64 80, !17, i64 88, !17, i64 96, !7, i64 104, !17, i64 112, !18, i64 120, !17, i64 128, !17, i64 136, !17, i64 144, !7, i64 152, !7, i64 156, !17, i64 160, !7, i64 168, !19, i64 172, !8, i64 173, !20, i64 240, !8, i64 244}
!16 = !{!"b2Softness", !11, i64 0, !11, i64 4, !11, i64 8}
!17 = !{!"any pointer", !8, i64 0}
!18 = !{!"b2AtomicInt", !7, i64 0}
!19 = !{!"_Bool", !8, i64 0}
!20 = !{!"b2AtomicU32", !7, i64 0}
!21 = !{!22, !7, i64 40}
!22 = !{!"b2Body", !8, i64 0, !17, i64 32, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !7, i64 64, !7, i64 68, !7, i64 72, !7, i64 76, !7, i64 80, !7, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !7, i64 104, !7, i64 108, !7, i64 112, !23, i64 116, !19, i64 118, !19, i64 119, !19, i64 120, !19, i64 121}
!23 = !{!"short", !8, i64 0}
!24 = !{!22, !7, i64 44}
!25 = !{!11, !11, i64 0}
!26 = !{!27, !7, i64 36}
!27 = !{!"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, !28, i64 72, !11, i64 88}
!28 = !{!"b2Mat22", !10, i64 0, !10, i64 8}
!29 = !{!27, !7, i64 40}
!30 = !{!27, !11, i64 8}
!31 = !{!27, !11, i64 68}
!32 = !{!27, !11, i64 88}
!33 = !{!15, !19, i64 172}
!34 = !{i8 0, i8 2}
!35 = !{}
!36 = !{!27, !11, i64 20}


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