; LLVM IR from erincatto/box2d :: src (prismatic_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.b2JointId = type { i32, i16, i16 }
%struct.b2Transform = type { %struct.b2Vec2, %struct.b2Rot }
%struct.b2Rot = type { float, float }
%struct.b2Joint = type { ptr, i32, i32, i32, [2 x %struct.b2JointEdge], i32, i32, i32, i32, float, i32, i16, i8, i8 }
%struct.b2JointEdge = type { i32, i32, i32 }
%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.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.b2AtomicInt = type { 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.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.b2BodyState = type { %struct.b2Vec2, float, i32, %struct.b2Vec2, %struct.b2Rot }

@.str.1 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [36 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 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

declare ptr @b2GetWorld(i32 noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local float @b2PrismaticJoint_GetSpeed(i64 %0) #4 {
  %2 = alloca %struct.b2JointId, align 4
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %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 %struct.b2Transform, align 4
  %13 = alloca %struct.b2Transform, align 4
  %14 = alloca ptr, align 8
  %15 = alloca %struct.b2Vec2, align 4
  %16 = alloca %struct.b2Vec2, align 4
  %17 = alloca %struct.b2Vec2, align 4
  %18 = alloca %struct.b2Vec2, align 4
  %19 = alloca %struct.b2Vec2, align 4
  %20 = alloca %struct.b2Vec2, align 4
  %21 = alloca %struct.b2Vec2, align 4
  %22 = alloca %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 float, align 4
  %28 = alloca float, align 4
  %29 = alloca %struct.b2Vec2, align 4
  %30 = alloca %struct.b2Vec2, align 4
  %31 = alloca %struct.b2Vec2, align 4
  %32 = alloca %struct.b2Vec2, align 4
  %33 = alloca %struct.b2Vec2, align 4
  %34 = alloca float, align 4
  %35 = alloca %struct.b2Vec2, align 4
  store i64 %0, ptr %2, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  %36 = getelementptr inbounds %struct.b2JointId, ptr %2, i32 0, i32 1
  %37 = load i16, ptr %36, align 4, !tbaa !5
  %38 = zext i16 %37 to i32
  %39 = call ptr @b2GetWorld(i32 noundef %38)
  store ptr %39, ptr %3, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %40 = load ptr, ptr %3, align 8, !tbaa !11
  %41 = load i64, ptr %2, align 4
  %42 = call ptr @b2GetJointFullId(ptr noundef %40, i64 %41)
  store ptr %42, ptr %4, align 8, !tbaa !11
  br label %43

43:                                               ; preds = %1
  %44 = load ptr, ptr %4, align 8, !tbaa !11
  %45 = getelementptr inbounds %struct.b2Joint, ptr %44, i32 0, i32 10
  %46 = load i32, ptr %45, align 8, !tbaa !13
  %47 = icmp eq i32 %46, 4
  br i1 %47, label %52, label %48

48:                                               ; preds = %43
  %49 = call i32 @b2InternalAssertFcn(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 166)
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %51, label %52

51:                                               ; preds = %48
  call void @llvm.trap()
  br label %52

52:                                               ; preds = %51, %48, %43
  br label %53

53:                                               ; preds = %52
  br label %54

54:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %55 = load ptr, ptr %3, align 8, !tbaa !11
  %56 = load ptr, ptr %4, align 8, !tbaa !11
  %57 = call ptr @b2GetJointSim(ptr noundef %55, ptr noundef %56)
  store ptr %57, ptr %5, align 8, !tbaa !11
  br label %58

58:                                               ; preds = %54
  %59 = load ptr, ptr %5, align 8, !tbaa !11
  %60 = getelementptr inbounds %struct.b2JointSim, ptr %59, i32 0, i32 3
  %61 = load i32, ptr %60, align 4, !tbaa !17
  %62 = icmp eq i32 %61, 4
  br i1 %62, label %67, label %63

63:                                               ; preds = %58
  %64 = call i32 @b2InternalAssertFcn(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 168)
  %65 = icmp ne i32 %64, 0
  br i1 %65, label %66, label %67

66:                                               ; preds = %63
  call void @llvm.trap()
  br label %67

67:                                               ; preds = %66, %63, %58
  br label %68

68:                                               ; preds = %67
  br label %69

69:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %70 = load ptr, ptr %3, align 8, !tbaa !11
  %71 = getelementptr inbounds %struct.b2World, ptr %70, i32 0, i32 4
  %72 = load ptr, ptr %5, align 8, !tbaa !11
  %73 = getelementptr inbounds %struct.b2JointSim, ptr %72, i32 0, i32 1
  %74 = load i32, ptr %73, align 4, !tbaa !20
  %75 = call ptr @b2BodyArray_Get(ptr noundef %71, i32 noundef %74)
  store ptr %75, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %76 = load ptr, ptr %3, align 8, !tbaa !11
  %77 = getelementptr inbounds %struct.b2World, ptr %76, i32 0, i32 4
  %78 = load ptr, ptr %5, align 8, !tbaa !11
  %79 = getelementptr inbounds %struct.b2JointSim, ptr %78, i32 0, i32 2
  %80 = load i32, ptr %79, align 4, !tbaa !21
  %81 = call ptr @b2BodyArray_Get(ptr noundef %77, i32 noundef %80)
  store ptr %81, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %82 = load ptr, ptr %3, align 8, !tbaa !11
  %83 = load ptr, ptr %6, align 8, !tbaa !11
  %84 = call ptr @b2GetBodySim(ptr noundef %82, ptr noundef %83)
  store ptr %84, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %85 = load ptr, ptr %3, align 8, !tbaa !11
  %86 = load ptr, ptr %7, align 8, !tbaa !11
  %87 = call ptr @b2GetBodySim(ptr noundef %85, ptr noundef %86)
  store ptr %87, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %88 = load ptr, ptr %3, align 8, !tbaa !11
  %89 = load ptr, ptr %6, align 8, !tbaa !11
  %90 = call ptr @b2GetBodyState(ptr noundef %88, ptr noundef %89)
  store ptr %90, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %91 = load ptr, ptr %3, align 8, !tbaa !11
  %92 = load ptr, ptr %7, align 8, !tbaa !11
  %93 = call ptr @b2GetBodyState(ptr noundef %91, ptr noundef %92)
  store ptr %93, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #7
  %94 = load ptr, ptr %8, align 8, !tbaa !11
  %95 = getelementptr inbounds %struct.b2BodySim, ptr %94, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %95, i64 16, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #7
  %96 = load ptr, ptr %9, align 8, !tbaa !11
  %97 = getelementptr inbounds %struct.b2BodySim, ptr %96, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %97, i64 16, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %98 = load ptr, ptr %5, align 8, !tbaa !11
  %99 = getelementptr inbounds %struct.b2JointSim, ptr %98, i32 0, i32 10
  store ptr %99, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %100 = getelementptr inbounds %struct.b2Transform, ptr %12, i32 0, i32 1
  %101 = load ptr, ptr %14, align 8, !tbaa !11
  %102 = getelementptr inbounds %struct.b2PrismaticJoint, ptr %101, i32 0, i32 0
  %103 = load <2 x float>, ptr %100, align 4
  %104 = load <2 x float>, ptr %102, align 4
  %105 = call <2 x float> @b2RotateVector(<2 x float> %103, <2 x float> %104)
  store <2 x float> %105, ptr %15, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %106 = load ptr, ptr %8, align 8, !tbaa !11
  %107 = getelementptr inbounds %struct.b2BodySim, ptr %106, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %107, i64 8, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %108 = load ptr, ptr %9, align 8, !tbaa !11
  %109 = getelementptr inbounds %struct.b2BodySim, ptr %108, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %109, i64 8, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %110 = getelementptr inbounds %struct.b2Transform, ptr %12, i32 0, i32 1
  %111 = load ptr, ptr %5, align 8, !tbaa !11
  %112 = getelementptr inbounds %struct.b2JointSim, ptr %111, i32 0, i32 4
  %113 = load ptr, ptr %8, align 8, !tbaa !11
  %114 = getelementptr inbounds %struct.b2BodySim, ptr %113, i32 0, i32 4
  %115 = load <2 x float>, ptr %112, align 4
  %116 = load <2 x float>, ptr %114, align 4
  %117 = call <2 x float> @b2Sub(<2 x float> %115, <2 x float> %116)
  store <2 x float> %117, ptr %19, align 4
  %118 = load <2 x float>, ptr %110, align 4
  %119 = load <2 x float>, ptr %19, align 4
  %120 = call <2 x float> @b2RotateVector(<2 x float> %118, <2 x float> %119)
  store <2 x float> %120, ptr %18, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %121 = getelementptr inbounds %struct.b2Transform, ptr %13, i32 0, i32 1
  %122 = load ptr, ptr %5, align 8, !tbaa !11
  %123 = getelementptr inbounds %struct.b2JointSim, ptr %122, i32 0, i32 5
  %124 = load ptr, ptr %9, align 8, !tbaa !11
  %125 = getelementptr inbounds %struct.b2BodySim, ptr %124, i32 0, i32 4
  %126 = load <2 x float>, ptr %123, align 4
  %127 = load <2 x float>, ptr %125, align 4
  %128 = call <2 x float> @b2Sub(<2 x float> %126, <2 x float> %127)
  store <2 x float> %128, ptr %21, align 4
  %129 = load <2 x float>, ptr %121, align 4
  %130 = load <2 x float>, ptr %21, align 4
  %131 = call <2 x float> @b2RotateVector(<2 x float> %129, <2 x float> %130)
  store <2 x float> %131, ptr %20, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %132 = load <2 x float>, ptr %17, align 4
  %133 = load <2 x float>, ptr %16, align 4
  %134 = call <2 x float> @b2Sub(<2 x float> %132, <2 x float> %133)
  store <2 x float> %134, ptr %23, align 4
  %135 = load <2 x float>, ptr %20, align 4
  %136 = load <2 x float>, ptr %18, align 4
  %137 = call <2 x float> @b2Sub(<2 x float> %135, <2 x float> %136)
  store <2 x float> %137, ptr %24, align 4
  %138 = load <2 x float>, ptr %23, align 4
  %139 = load <2 x float>, ptr %24, align 4
  %140 = call <2 x float> @b2Add(<2 x float> %138, <2 x float> %139)
  store <2 x float> %140, ptr %22, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %141 = load ptr, ptr %10, align 8, !tbaa !11
  %142 = icmp ne ptr %141, null
  br i1 %142, label %143, label %146

143:                                              ; preds = %69
  %144 = load ptr, ptr %10, align 8, !tbaa !11
  %145 = getelementptr inbounds %struct.b2BodyState, ptr %144, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 4 %145, i64 8, i1 false), !tbaa.struct !24
  br label %147

146:                                              ; preds = %69
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 4 @b2Vec2_zero, i64 8, i1 false), !tbaa.struct !24
  br label %147

147:                                              ; preds = %146, %143
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %148 = load ptr, ptr %11, align 8, !tbaa !11
  %149 = icmp ne ptr %148, null
  br i1 %149, label %150, label %153

150:                                              ; preds = %147
  %151 = load ptr, ptr %11, align 8, !tbaa !11
  %152 = getelementptr inbounds %struct.b2BodyState, ptr %151, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 4 %152, i64 8, i1 false), !tbaa.struct !24
  br label %154

153:                                              ; preds = %147
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 4 @b2Vec2_zero, i64 8, i1 false), !tbaa.struct !24
  br label %154

154:                                              ; preds = %153, %150
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  %155 = load ptr, ptr %10, align 8, !tbaa !11
  %156 = icmp ne ptr %155, null
  br i1 %156, label %157, label %161

157:                                              ; preds = %154
  %158 = load ptr, ptr %10, align 8, !tbaa !11
  %159 = getelementptr inbounds %struct.b2BodyState, ptr %158, i32 0, i32 1
  %160 = load float, ptr %159, align 4, !tbaa !25
  br label %162

161:                                              ; preds = %154
  br label %162

162:                                              ; preds = %161, %157
  %163 = phi float [ %160, %157 ], [ 0.000000e+00, %161 ]
  store float %163, ptr %27, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  %164 = load ptr, ptr %11, align 8, !tbaa !11
  %165 = icmp ne ptr %164, null
  br i1 %165, label %166, label %170

166:                                              ; preds = %162
  %167 = load ptr, ptr %11, align 8, !tbaa !11
  %168 = getelementptr inbounds %struct.b2BodyState, ptr %167, i32 0, i32 1
  %169 = load float, ptr %168, align 4, !tbaa !25
  br label %171

170:                                              ; preds = %162
  br label %171

171:                                              ; preds = %170, %166
  %172 = phi float [ %169, %166 ], [ 0.000000e+00, %170 ]
  store float %172, ptr %28, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  %173 = load float, ptr %28, align 4, !tbaa !23
  %174 = load <2 x float>, ptr %20, align 4
  %175 = call <2 x float> @b2CrossSV(float noundef %173, <2 x float> %174)
  store <2 x float> %175, ptr %31, align 4
  %176 = load <2 x float>, ptr %26, align 4
  %177 = load <2 x float>, ptr %31, align 4
  %178 = call <2 x float> @b2Add(<2 x float> %176, <2 x float> %177)
  store <2 x float> %178, ptr %30, align 4
  %179 = load float, ptr %27, align 4, !tbaa !23
  %180 = load <2 x float>, ptr %18, align 4
  %181 = call <2 x float> @b2CrossSV(float noundef %179, <2 x float> %180)
  store <2 x float> %181, ptr %33, align 4
  %182 = load <2 x float>, ptr %25, align 4
  %183 = load <2 x float>, ptr %33, align 4
  %184 = call <2 x float> @b2Add(<2 x float> %182, <2 x float> %183)
  store <2 x float> %184, ptr %32, align 4
  %185 = load <2 x float>, ptr %30, align 4
  %186 = load <2 x float>, ptr %32, align 4
  %187 = call <2 x float> @b2Sub(<2 x float> %185, <2 x float> %186)
  store <2 x float> %187, ptr %29, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #7
  %188 = load float, ptr %27, align 4, !tbaa !23
  %189 = load <2 x float>, ptr %15, align 4
  %190 = call <2 x float> @b2CrossSV(float noundef %188, <2 x float> %189)
  store <2 x float> %190, ptr %35, align 4
  %191 = load <2 x float>, ptr %22, align 4
  %192 = load <2 x float>, ptr %35, align 4
  %193 = call float @b2Dot(<2 x float> %191, <2 x float> %192)
  %194 = load <2 x float>, ptr %15, align 4
  %195 = load <2 x float>, ptr %29, align 4
  %196 = call float @b2Dot(<2 x float> %194, <2 x float> %195)
  %197 = fadd float %193, %196
  store float %197, ptr %34, align 4, !tbaa !23
  %198 = load float, ptr %34, align 4, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  ret float %198
}

declare ptr @b2GetJointFullId(ptr noundef, i64) #1

declare ptr @b2GetJointSim(ptr noundef, ptr noundef) #1

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

declare ptr @b2GetBodySim(ptr noundef, ptr noundef) #1

declare ptr @b2GetBodyState(ptr noundef, ptr noundef) #1

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

; 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

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 = { 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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !10, i64 4}
!6 = !{!"b2JointId", !7, i64 0, !10, i64 4, !10, i64 6}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!14, !7, i64 64}
!14 = !{!"b2Joint", !12, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !8, i64 20, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !15, i64 60, !7, i64 64, !10, i64 68, !16, i64 70, !16, i64 71}
!15 = !{!"float", !8, i64 0}
!16 = !{!"_Bool", !8, i64 0}
!17 = !{!18, !7, i64 12}
!18 = !{!"b2JointSim", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !19, i64 16, !19, i64 24, !15, i64 32, !15, i64 36, !15, i64 40, !15, i64 44, !8, i64 48}
!19 = !{!"b2Vec2", !15, i64 0, !15, i64 4}
!20 = !{!18, !7, i64 4}
!21 = !{!18, !7, i64 8}
!22 = !{i64 0, i64 4, !23, i64 4, i64 4, !23, i64 8, i64 4, !23, i64 12, i64 4, !23}
!23 = !{!15, !15, i64 0}
!24 = !{i64 0, i64 4, !23, i64 4, i64 4, !23}
!25 = !{!26, !15, i64 8}
!26 = !{!"b2BodyState", !19, i64 0, !15, i64 8, !7, i64 12, !19, i64 16, !27, i64 24}
!27 = !{!"b2Rot", !15, i64 0, !15, i64 4}


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

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

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

declare ptr @b2GetWorld(i32 noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: nounwind uwtable
define dso_local float @b2PrismaticJoint_GetSpeed(i64 %0) local_unnamed_addr #3 {
  %.sroa.2.0.extract.shift = lshr i64 %0, 32
  %2 = trunc nuw i64 %.sroa.2.0.extract.shift to i32
  %3 = and i32 %2, 65535
  %4 = tail call ptr @b2GetWorld(i32 noundef %3) #5
  %5 = tail call ptr @b2GetJointFullId(ptr noundef %4, i64 %0) #5
  %6 = getelementptr inbounds i8, ptr %5, i64 64
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %8 = icmp eq i32 %7, 4
  br i1 %8, label %12, label %9

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

11:                                               ; preds = %9
  tail call void @llvm.trap()
  unreachable

12:                                               ; preds = %9, %1
  %13 = tail call ptr @b2GetJointSim(ptr noundef %4, ptr noundef nonnull %5) #5
  %14 = getelementptr inbounds i8, ptr %13, i64 12
  %15 = load i32, ptr %14, align 4, !tbaa !14
  %16 = icmp eq i32 %15, 4
  br i1 %16, label %20, label %17

17:                                               ; preds = %12
  %18 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 168) #5
  %.not69 = icmp eq i32 %18, 0
  br i1 %.not69, label %20, label %19

19:                                               ; preds = %17
  tail call void @llvm.trap()
  unreachable

20:                                               ; preds = %17, %12
  %21 = getelementptr inbounds i8, ptr %4, i64 1032
  %22 = getelementptr inbounds i8, ptr %13, i64 4
  %23 = load i32, ptr %22, align 4, !tbaa !17
  %24 = tail call ptr @b2BodyArray_Get(ptr noundef nonnull %21, i32 noundef %23)
  %25 = getelementptr inbounds i8, ptr %13, i64 8
  %26 = load i32, ptr %25, align 4, !tbaa !18
  %27 = tail call ptr @b2BodyArray_Get(ptr noundef nonnull %21, i32 noundef %26)
  %28 = tail call ptr @b2GetBodySim(ptr noundef %4, ptr noundef %24) #5
  %29 = tail call ptr @b2GetBodySim(ptr noundef %4, ptr noundef %27) #5
  %30 = tail call ptr @b2GetBodyState(ptr noundef %4, ptr noundef %24) #5
  %31 = tail call ptr @b2GetBodyState(ptr noundef %4, ptr noundef %27) #5
  %.sroa.329.0..sroa_idx = getelementptr inbounds i8, ptr %28, i64 8
  %.sroa.329.0.copyload = load <2 x float>, ptr %.sroa.329.0..sroa_idx, align 4
  %.sroa.3.0..sroa_idx = getelementptr inbounds i8, ptr %29, i64 8
  %.sroa.3.0.copyload = load <2 x float>, ptr %.sroa.3.0..sroa_idx, align 4
  %32 = getelementptr inbounds i8, ptr %13, i64 48
  %33 = load <2 x float>, ptr %32, align 4
  %34 = tail call <2 x float> @b2RotateVector(<2 x float> %.sroa.329.0.copyload, <2 x float> %33)
  %35 = getelementptr inbounds i8, ptr %28, i64 16
  %.sroa.023.0.copyload = load <2 x float>, ptr %35, align 4
  %36 = getelementptr inbounds i8, ptr %29, i64 16
  %.sroa.022.0.copyload = load <2 x float>, ptr %36, align 4
  %37 = getelementptr inbounds i8, ptr %13, i64 16
  %38 = getelementptr inbounds i8, ptr %28, i64 40
  %39 = load <2 x float>, ptr %37, align 4
  %40 = load <2 x float>, ptr %38, align 4
  %41 = tail call <2 x float> @b2Sub(<2 x float> %39, <2 x float> %40)
  %42 = tail call <2 x float> @b2RotateVector(<2 x float> %.sroa.329.0.copyload, <2 x float> %41)
  %43 = getelementptr inbounds i8, ptr %13, i64 24
  %44 = getelementptr inbounds i8, ptr %29, i64 40
  %45 = load <2 x float>, ptr %43, align 4
  %46 = load <2 x float>, ptr %44, align 4
  %47 = tail call <2 x float> @b2Sub(<2 x float> %45, <2 x float> %46)
  %48 = tail call <2 x float> @b2RotateVector(<2 x float> %.sroa.3.0.copyload, <2 x float> %47)
  %49 = tail call <2 x float> @b2Sub(<2 x float> %.sroa.022.0.copyload, <2 x float> %.sroa.023.0.copyload)
  %50 = tail call <2 x float> @b2Sub(<2 x float> %48, <2 x float> %42)
  %51 = tail call <2 x float> @b2Add(<2 x float> %49, <2 x float> %50)
  %.not70 = icmp eq ptr %30, null
  %b2Vec2_zero. = select i1 %.not70, ptr @b2Vec2_zero, ptr %30
  %.sroa.011.0 = load <2 x float>, ptr %b2Vec2_zero., align 4
  %.not71 = icmp eq ptr %31, null
  %.sroa.09.0.in = select i1 %.not71, ptr @b2Vec2_zero, ptr %31
  %.sroa.09.0 = load <2 x float>, ptr %.sroa.09.0.in, align 4
  br i1 %.not70, label %55, label %52

52:                                               ; preds = %20
  %53 = getelementptr inbounds i8, ptr %30, i64 8
  %54 = load float, ptr %53, align 4, !tbaa !19
  br label %55

55:                                               ; preds = %20, %52
  %56 = phi float [ %54, %52 ], [ 0.000000e+00, %20 ]
  br i1 %.not71, label %60, label %57

57:                                               ; preds = %55
  %58 = getelementptr inbounds i8, ptr %31, i64 8
  %59 = load float, ptr %58, align 4, !tbaa !19
  br label %60

60:                                               ; preds = %55, %57
  %61 = phi float [ %59, %57 ], [ 0.000000e+00, %55 ]
  %62 = tail call <2 x float> @b2CrossSV(float noundef %61, <2 x float> %48)
  %63 = tail call <2 x float> @b2Add(<2 x float> %.sroa.09.0, <2 x float> %62)
  %64 = tail call <2 x float> @b2CrossSV(float noundef %56, <2 x float> %42)
  %65 = tail call <2 x float> @b2Add(<2 x float> %.sroa.011.0, <2 x float> %64)
  %66 = tail call <2 x float> @b2Sub(<2 x float> %63, <2 x float> %65)
  %67 = tail call <2 x float> @b2CrossSV(float noundef %56, <2 x float> %34)
  %68 = tail call float @b2Dot(<2 x float> %51, <2 x float> %67)
  %69 = tail call float @b2Dot(<2 x float> %34, <2 x float> %66)
  %70 = fadd float %68, %69
  ret float %70
}

declare ptr @b2GetJointFullId(ptr noundef, i64) local_unnamed_addr #0

declare ptr @b2GetJointSim(ptr noundef, ptr noundef) local_unnamed_addr #0

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

declare ptr @b2GetBodySim(ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @b2GetBodyState(ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

attributes #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 #1 = { cold noreturn nounwind memory(inaccessiblemem: write) }
attributes #2 = { inlinehint nounwind uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { 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 #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 64}
!6 = !{!"b2Joint", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !8, i64 20, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !11, i64 60, !10, i64 64, !12, i64 68, !13, i64 70, !13, i64 71}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"float", !8, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = !{!"_Bool", !8, i64 0}
!14 = !{!15, !10, i64 12}
!15 = !{!"b2JointSim", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !16, i64 16, !16, i64 24, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !8, i64 48}
!16 = !{!"b2Vec2", !11, i64 0, !11, i64 4}
!17 = !{!15, !10, i64 4}
!18 = !{!15, !10, i64 8}
!19 = !{!20, !11, i64 8}
!20 = !{!"b2BodyState", !16, i64 0, !11, i64 8, !10, i64 12, !16, i64 16, !21, i64 24}
!21 = !{!"b2Rot", !11, i64 0, !11, i64 4}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass