; 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.b2Rot = type { float, float }
%struct.b2Softness = type { float, float, float }
%struct.b2JointSim = type { i32, i32, i32, i32, %struct.b2Vec2, %struct.b2Vec2, float, float, float, float, %union.anon }
%union.anon = type { %struct.b2PrismaticJoint }
%struct.b2PrismaticJoint = type { %struct.b2Vec2, %struct.b2Vec2, float, float, float, float, float, float, float, float, float, float, float, i32, i32, %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, float, float, %struct.b2Softness, i8, i8, i8 }
%struct.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 }

@.str.1 = external hidden unnamed_addr constant [71 x i8], align 1
@b2Vec2_zero = external hidden constant %struct.b2Vec2, align 4
@.str.4 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [65 x i8], align 1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @b2PreparePrismaticJoint(ptr noundef %0, ptr noundef %1) #6 {
  %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.b2Rot, align 4
  %22 = alloca %struct.b2Rot, 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.b2Vec2, align 4
  %30 = alloca %struct.b2Vec2, align 4
  %31 = alloca %struct.b2Vec2, align 4
  %32 = alloca %struct.b2Vec2, align 4
  %33 = alloca float, align 4
  %34 = alloca %struct.b2Vec2, align 4
  %35 = alloca float, align 4
  %36 = alloca float, align 4
  %37 = alloca %struct.b2Softness, align 4
  %38 = alloca { <2 x float>, float }, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  br label %39

39:                                               ; preds = %2
  %40 = load ptr, ptr %3, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.b2JointSim, ptr %40, i32 0, i32 3
  %42 = load i32, ptr %41, align 4, !tbaa !9
  %43 = icmp eq i32 %42, 4
  br i1 %43, label %48, label %44

44:                                               ; preds = %39
  %45 = call i32 @b2InternalAssertFcn(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 269)
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %47, label %48

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

48:                                               ; preds = %47, %44, %39
  br label %49

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

67:                                               ; preds = %49
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.b2Body, ptr %68, i32 0, i32 2
  %70 = load i32, ptr %69, align 8, !tbaa !23
  %71 = icmp eq i32 %70, 2
  br i1 %71, label %81, label %72

72:                                               ; preds = %67
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.b2Body, ptr %73, i32 0, i32 2
  %75 = load i32, ptr %74, align 8, !tbaa !23
  %76 = icmp eq i32 %75, 2
  br i1 %76, label %81, label %77

77:                                               ; preds = %72
  %78 = call i32 @b2InternalAssertFcn(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 280)
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %80, label %81

80:                                               ; preds = %77
  call void @llvm.trap()
  br label %81

81:                                               ; preds = %80, %77, %72, %67
  br label %82

82:                                               ; preds = %81
  br label %83

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

140:                                              ; preds = %83
  %141 = load i32, ptr %12, align 4, !tbaa !15
  br label %143

142:                                              ; preds = %83
  br label %143

143:                                              ; preds = %142, %140
  %144 = phi i32 [ %141, %140 ], [ -1, %142 ]
  %145 = load ptr, ptr %20, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.b2PrismaticJoint, ptr %145, i32 0, i32 13
  store i32 %144, ptr %146, align 4, !tbaa !37
  %147 = load ptr, ptr %9, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.b2Body, ptr %147, i32 0, i32 2
  %149 = load i32, ptr %148, align 8, !tbaa !23
  %150 = icmp eq i32 %149, 2
  br i1 %150, label %151, label %153

151:                                              ; preds = %143
  %152 = load i32, ptr %13, align 4, !tbaa !15
  br label %154

153:                                              ; preds = %143
  br label %154

154:                                              ; preds = %153, %151
  %155 = phi i32 [ %152, %151 ], [ -1, %153 ]
  %156 = load ptr, ptr %20, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.b2PrismaticJoint, ptr %156, i32 0, i32 14
  store i32 %155, ptr %157, align 4, !tbaa !39
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %158 = load ptr, ptr %14, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.b2BodySim, ptr %158, i32 0, i32 0
  %160 = getelementptr inbounds %struct.b2Transform, ptr %159, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 4 %160, i64 8, i1 false), !tbaa.struct !40
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %161 = load ptr, ptr %15, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.b2BodySim, ptr %161, i32 0, i32 0
  %163 = getelementptr inbounds %struct.b2Transform, ptr %162, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 4 %163, i64 8, i1 false), !tbaa.struct !40
  %164 = load ptr, ptr %20, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.b2PrismaticJoint, ptr %164, i32 0, i32 15
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  %166 = load ptr, ptr %3, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.b2JointSim, ptr %166, i32 0, i32 4
  %168 = load ptr, ptr %14, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.b2BodySim, ptr %168, i32 0, i32 4
  %170 = load <2 x float>, ptr %167, align 4
  %171 = load <2 x float>, ptr %169, align 4
  %172 = call <2 x float> @b2Sub(<2 x float> %170, <2 x float> %171)
  store <2 x float> %172, ptr %24, align 4
  %173 = load <2 x float>, ptr %21, align 4
  %174 = load <2 x float>, ptr %24, align 4
  %175 = call <2 x float> @b2RotateVector(<2 x float> %173, <2 x float> %174)
  store <2 x float> %175, ptr %23, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %165, ptr align 4 %23, i64 8, i1 false), !tbaa.struct !40
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  %176 = load ptr, ptr %20, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.b2PrismaticJoint, ptr %176, i32 0, i32 16
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %178 = load ptr, ptr %3, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.b2JointSim, ptr %178, i32 0, i32 5
  %180 = load ptr, ptr %15, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.b2BodySim, ptr %180, i32 0, i32 4
  %182 = load <2 x float>, ptr %179, align 4
  %183 = load <2 x float>, ptr %181, align 4
  %184 = call <2 x float> @b2Sub(<2 x float> %182, <2 x float> %183)
  store <2 x float> %184, ptr %26, align 4
  %185 = load <2 x float>, ptr %22, align 4
  %186 = load <2 x float>, ptr %26, align 4
  %187 = call <2 x float> @b2RotateVector(<2 x float> %185, <2 x float> %186)
  store <2 x float> %187, ptr %25, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %177, ptr align 4 %25, i64 8, i1 false), !tbaa.struct !40
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  %188 = load ptr, ptr %20, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.b2PrismaticJoint, ptr %188, i32 0, i32 17
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  %190 = load ptr, ptr %20, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.b2PrismaticJoint, ptr %190, i32 0, i32 0
  %192 = load <2 x float>, ptr %21, align 4
  %193 = load <2 x float>, ptr %191, align 4
  %194 = call <2 x float> @b2RotateVector(<2 x float> %192, <2 x float> %193)
  store <2 x float> %194, ptr %27, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %189, ptr align 4 %27, i64 8, i1 false), !tbaa.struct !40
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  %195 = load ptr, ptr %20, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.b2PrismaticJoint, ptr %195, i32 0, i32 18
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #8
  %197 = load ptr, ptr %15, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.b2BodySim, ptr %197, i32 0, i32 1
  %199 = load ptr, ptr %14, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.b2BodySim, ptr %199, i32 0, i32 1
  %201 = load <2 x float>, ptr %198, align 4
  %202 = load <2 x float>, ptr %200, align 4
  %203 = call <2 x float> @b2Sub(<2 x float> %201, <2 x float> %202)
  store <2 x float> %203, ptr %28, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %196, ptr align 4 %28, i64 8, i1 false), !tbaa.struct !40
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  %204 = load <2 x float>, ptr %22, align 4
  %205 = load <2 x float>, ptr %21, align 4
  %206 = call float @b2RelativeAngle(<2 x float> %204, <2 x float> %205)
  %207 = load ptr, ptr %20, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.b2PrismaticJoint, ptr %207, i32 0, i32 10
  %209 = load float, ptr %208, align 4, !tbaa !41
  %210 = fsub float %206, %209
  %211 = load ptr, ptr %20, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.b2PrismaticJoint, ptr %211, i32 0, i32 19
  store float %210, ptr %212, align 4, !tbaa !42
  %213 = load ptr, ptr %20, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.b2PrismaticJoint, ptr %213, i32 0, i32 19
  %215 = load float, ptr %214, align 4, !tbaa !42
  %216 = call float @b2UnwindAngle(float noundef %215)
  %217 = load ptr, ptr %20, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.b2PrismaticJoint, ptr %217, i32 0, i32 19
  store float %216, ptr %218, align 4, !tbaa !42
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #8
  %219 = load ptr, ptr %20, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.b2PrismaticJoint, ptr %219, i32 0, i32 15
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %29, ptr align 4 %220, i64 8, i1 false), !tbaa.struct !40
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #8
  %221 = load ptr, ptr %20, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.b2PrismaticJoint, ptr %221, i32 0, i32 16
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %30, ptr align 4 %222, i64 8, i1 false), !tbaa.struct !40
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #8
  %223 = load ptr, ptr %20, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.b2PrismaticJoint, ptr %223, i32 0, i32 18
  %225 = load <2 x float>, ptr %30, align 4
  %226 = load <2 x float>, ptr %29, align 4
  %227 = call <2 x float> @b2Sub(<2 x float> %225, <2 x float> %226)
  store <2 x float> %227, ptr %32, align 4
  %228 = load <2 x float>, ptr %224, align 4
  %229 = load <2 x float>, ptr %32, align 4
  %230 = call <2 x float> @b2Add(<2 x float> %228, <2 x float> %229)
  store <2 x float> %230, ptr %31, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #8
  %231 = load <2 x float>, ptr %31, align 4
  %232 = load <2 x float>, ptr %29, align 4
  %233 = call <2 x float> @b2Add(<2 x float> %231, <2 x float> %232)
  store <2 x float> %233, ptr %34, align 4
  %234 = load ptr, ptr %20, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.b2PrismaticJoint, ptr %234, i32 0, i32 17
  %236 = load <2 x float>, ptr %34, align 4
  %237 = load <2 x float>, ptr %235, align 4
  %238 = call float @b2Cross(<2 x float> %236, <2 x float> %237)
  store float %238, ptr %33, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #8
  %239 = load ptr, ptr %20, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.b2PrismaticJoint, ptr %239, i32 0, i32 17
  %241 = load <2 x float>, ptr %30, align 4
  %242 = load <2 x float>, ptr %240, align 4
  %243 = call float @b2Cross(<2 x float> %241, <2 x float> %242)
  store float %243, ptr %35, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #8
  %244 = load float, ptr %16, align 4, !tbaa !31
  %245 = load float, ptr %18, align 4, !tbaa !31
  %246 = fadd float %244, %245
  %247 = load float, ptr %17, align 4, !tbaa !31
  %248 = load float, ptr %33, align 4, !tbaa !31
  %249 = fmul float %247, %248
  %250 = load float, ptr %33, align 4, !tbaa !31
  %251 = call float @llvm.fmuladd.f32(float %249, float %250, float %246)
  %252 = load float, ptr %19, align 4, !tbaa !31
  %253 = load float, ptr %35, align 4, !tbaa !31
  %254 = fmul float %252, %253
  %255 = load float, ptr %35, align 4, !tbaa !31
  %256 = call float @llvm.fmuladd.f32(float %254, float %255, float %251)
  store float %256, ptr %36, align 4, !tbaa !31
  %257 = load float, ptr %36, align 4, !tbaa !31
  %258 = fcmp ogt float %257, 0.000000e+00
  br i1 %258, label %259, label %262

259:                                              ; preds = %154
  %260 = load float, ptr %36, align 4, !tbaa !31
  %261 = fdiv float 1.000000e+00, %260
  br label %263

262:                                              ; preds = %154
  br label %263

263:                                              ; preds = %262, %259
  %264 = phi float [ %261, %259 ], [ 0.000000e+00, %262 ]
  %265 = load ptr, ptr %20, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct.b2PrismaticJoint, ptr %265, i32 0, i32 20
  store float %264, ptr %266, align 4, !tbaa !43
  %267 = load ptr, ptr %20, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct.b2PrismaticJoint, ptr %267, i32 0, i32 21
  call void @llvm.lifetime.start.p0(i64 12, ptr %37) #8
  %269 = load ptr, ptr %20, align 8, !tbaa !5
  %270 = getelementptr inbounds %struct.b2PrismaticJoint, ptr %269, i32 0, i32 6
  %271 = load float, ptr %270, align 4, !tbaa !44
  %272 = load ptr, ptr %20, align 8, !tbaa !5
  %273 = getelementptr inbounds %struct.b2PrismaticJoint, ptr %272, i32 0, i32 7
  %274 = load float, ptr %273, align 4, !tbaa !45
  %275 = load ptr, ptr %4, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct.b2StepContext, ptr %275, i32 0, i32 2
  %277 = load float, ptr %276, align 8, !tbaa !46
  %278 = call { <2 x float>, float } @b2MakeSoft(float noundef %271, float noundef %274, float noundef %277)
  store { <2 x float>, float } %278, ptr %38, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %37, ptr align 8 %38, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %268, ptr align 4 %37, i64 12, i1 false), !tbaa.struct !47
  call void @llvm.lifetime.end.p0(i64 12, ptr %37) #8
  %279 = load ptr, ptr %4, align 8, !tbaa !5
  %280 = getelementptr inbounds %struct.b2StepContext, ptr %279, i32 0, i32 25
  %281 = load i8, ptr %280, align 4, !tbaa !48, !range !49, !noundef !50
  %282 = trunc i8 %281 to i1
  %283 = zext i1 %282 to i32
  %284 = icmp eq i32 %283, 0
  br i1 %284, label %285, label %296

285:                                              ; preds = %263
  %286 = load ptr, ptr %20, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct.b2PrismaticJoint, ptr %286, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %287, ptr align 4 @b2Vec2_zero, i64 8, i1 false), !tbaa.struct !40
  %288 = load ptr, ptr %20, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct.b2PrismaticJoint, ptr %288, i32 0, i32 2
  store float 0.000000e+00, ptr %289, align 4, !tbaa !51
  %290 = load ptr, ptr %20, align 8, !tbaa !5
  %291 = getelementptr inbounds %struct.b2PrismaticJoint, ptr %290, i32 0, i32 3
  store float 0.000000e+00, ptr %291, align 4, !tbaa !52
  %292 = load ptr, ptr %20, align 8, !tbaa !5
  %293 = getelementptr inbounds %struct.b2PrismaticJoint, ptr %292, i32 0, i32 4
  store float 0.000000e+00, ptr %293, align 4, !tbaa !53
  %294 = load ptr, ptr %20, align 8, !tbaa !5
  %295 = getelementptr inbounds %struct.b2PrismaticJoint, ptr %294, i32 0, i32 5
  store float 0.000000e+00, ptr %295, align 4, !tbaa !54
  br label %296

296:                                              ; preds = %285, %263
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #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
}

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

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

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

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

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

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

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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !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 60}
!38 = !{!"b2PrismaticJoint", !12, i64 0, !12, i64 8, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !13, i64 48, !13, i64 52, !13, i64 56, !11, i64 60, !11, i64 64, !12, i64 68, !12, i64 76, !12, i64 84, !12, i64 92, !13, i64 100, !13, i64 104, !19, i64 108, !21, i64 120, !21, i64 121, !21, i64 122}
!39 = !{!38, !11, i64 64}
!40 = !{i64 0, i64 4, !31, i64 4, i64 4, !31}
!41 = !{!38, !13, i64 48}
!42 = !{!38, !13, i64 100}
!43 = !{!38, !13, i64 104}
!44 = !{!38, !13, i64 32}
!45 = !{!38, !13, i64 36}
!46 = !{!18, !13, i64 8}
!47 = !{i64 0, i64 4, !31, i64 4, i64 4, !31, i64 8, i64 4, !31}
!48 = !{!18, !21, i64 172}
!49 = !{i8 0, i8 2}
!50 = !{}
!51 = !{!38, !13, i64 16}
!52 = !{!38, !13, i64 20}
!53 = !{!38, !13, i64 24}
!54 = !{!38, !13, i64 28}


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

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

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

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

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

6:                                                ; preds = %2
  %7 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 269) #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.5, ptr noundef nonnull @.str.1, i32 noundef 280) #7
  %.not100 = icmp eq i32 %27, 0
  br i1 %.not100, 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 108
  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 112
  store i32 %55, ptr %56, align 4, !tbaa !28
  %57 = getelementptr inbounds i8, ptr %40, i64 8
  %.sroa.022.0.copyload = load <2 x float>, ptr %57, align 4
  %58 = getelementptr inbounds i8, ptr %41, i64 8
  %.sroa.020.0.copyload = load <2 x float>, ptr %58, align 4
  %59 = getelementptr inbounds i8, ptr %0, i64 116
  %60 = getelementptr inbounds i8, ptr %0, i64 16
  %61 = getelementptr inbounds i8, ptr %40, i64 40
  %62 = load <2 x float>, ptr %60, align 4
  %63 = load <2 x float>, ptr %61, align 4
  %64 = tail call <2 x float> @b2Sub(<2 x float> %62, <2 x float> %63)
  %65 = tail call <2 x float> @b2RotateVector(<2 x float> %.sroa.022.0.copyload, <2 x float> %64)
  store <2 x float> %65, ptr %59, align 4
  %66 = getelementptr inbounds i8, ptr %0, i64 124
  %67 = getelementptr inbounds i8, ptr %0, i64 24
  %68 = getelementptr inbounds i8, ptr %41, i64 40
  %69 = load <2 x float>, ptr %67, align 4
  %70 = load <2 x float>, ptr %68, align 4
  %71 = tail call <2 x float> @b2Sub(<2 x float> %69, <2 x float> %70)
  %72 = tail call <2 x float> @b2RotateVector(<2 x float> %.sroa.020.0.copyload, <2 x float> %71)
  store <2 x float> %72, ptr %66, align 4
  %73 = getelementptr inbounds i8, ptr %0, i64 132
  %74 = load <2 x float>, ptr %48, align 4
  %75 = tail call <2 x float> @b2RotateVector(<2 x float> %.sroa.022.0.copyload, <2 x float> %74)
  store <2 x float> %75, ptr %73, align 4
  %76 = getelementptr inbounds i8, ptr %0, i64 140
  %77 = getelementptr inbounds i8, ptr %41, i64 16
  %78 = getelementptr inbounds i8, ptr %40, i64 16
  %79 = load <2 x float>, ptr %77, align 4
  %80 = load <2 x float>, ptr %78, align 4
  %81 = tail call <2 x float> @b2Sub(<2 x float> %79, <2 x float> %80)
  store <2 x float> %81, ptr %76, align 4
  %82 = tail call float @b2RelativeAngle(<2 x float> %.sroa.020.0.copyload, <2 x float> %.sroa.022.0.copyload)
  %83 = getelementptr inbounds i8, ptr %0, i64 96
  %84 = load float, ptr %83, align 4, !tbaa !29
  %85 = fsub float %82, %84
  %86 = getelementptr inbounds i8, ptr %0, i64 148
  store float %85, ptr %86, align 4, !tbaa !30
  %87 = tail call float @b2UnwindAngle(float noundef %85)
  store float %87, ptr %86, align 4, !tbaa !30
  %.sroa.012.0.copyload = load <2 x float>, ptr %59, align 4
  %.sroa.010.0.copyload = load <2 x float>, ptr %66, align 4
  %88 = tail call <2 x float> @b2Sub(<2 x float> %.sroa.010.0.copyload, <2 x float> %.sroa.012.0.copyload)
  %89 = load <2 x float>, ptr %76, align 4
  %90 = tail call <2 x float> @b2Add(<2 x float> %89, <2 x float> %88)
  %91 = tail call <2 x float> @b2Add(<2 x float> %90, <2 x float> %.sroa.012.0.copyload)
  %92 = load <2 x float>, ptr %73, align 4
  %93 = tail call float @b2Cross(<2 x float> %91, <2 x float> %92)
  %94 = load <2 x float>, ptr %73, align 4
  %95 = tail call float @b2Cross(<2 x float> %.sroa.010.0.copyload, <2 x float> %94)
  %96 = fadd <2 x float> %43, %45
  %97 = extractelement <2 x float> %96, i64 0
  %98 = extractelement <2 x float> %43, i64 1
  %99 = fmul float %98, %93
  %100 = tail call float @llvm.fmuladd.f32(float %99, float %93, float %97)
  %101 = extractelement <2 x float> %45, i64 1
  %102 = fmul float %101, %95
  %103 = tail call float @llvm.fmuladd.f32(float %102, float %95, float %100)
  %104 = fcmp ogt float %103, 0.000000e+00
  %105 = fdiv float 1.000000e+00, %103
  %106 = select i1 %104, float %105, float 0.000000e+00
  %107 = getelementptr inbounds i8, ptr %0, i64 152
  store float %106, ptr %107, align 4, !tbaa !31
  %108 = getelementptr inbounds i8, ptr %0, i64 156
  %109 = getelementptr inbounds i8, ptr %0, i64 80
  %110 = load float, ptr %109, align 4, !tbaa !32
  %111 = getelementptr inbounds i8, ptr %0, i64 84
  %112 = load float, ptr %111, align 4, !tbaa !33
  %113 = getelementptr inbounds i8, ptr %1, i64 8
  %114 = load float, ptr %113, align 8, !tbaa !34
  %115 = tail call { <2 x float>, float } @b2MakeSoft(float noundef %110, float noundef %112, float noundef %114)
  %.fca.0.extract = extractvalue { <2 x float>, float } %115, 0
  %.fca.1.extract = extractvalue { <2 x float>, float } %115, 1
  store <2 x float> %.fca.0.extract, ptr %108, align 4
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 164
  store float %.fca.1.extract, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !25
  %116 = getelementptr inbounds i8, ptr %1, i64 172
  %117 = load i8, ptr %116, align 4, !tbaa !35, !range !36, !noundef !37
  %118 = icmp eq i8 %117, 0
  br i1 %118, label %119, label %123

119:                                              ; preds = %29
  %120 = getelementptr inbounds i8, ptr %0, i64 56
  %121 = load i64, ptr @b2Vec2_zero, align 4
  store i64 %121, ptr %120, align 4
  %122 = getelementptr inbounds i8, ptr %0, i64 64
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %122, i8 0, i64 16, i1 false)
  br label %123

123:                                              ; preds = %119, %29
  ret void
}

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

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

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

; 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>, float } @b2MakeSoft(float noundef, float noundef, float noundef) local_unnamed_addr #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

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 = { 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 = { 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 nounwind willreturn memory(argmem: write) }
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 60}
!27 = !{!"b2PrismaticJoint", !10, i64 0, !10, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !7, i64 60, !7, i64 64, !10, i64 68, !10, i64 76, !10, i64 84, !10, i64 92, !11, i64 100, !11, i64 104, !16, i64 108, !19, i64 120, !19, i64 121, !19, i64 122}
!28 = !{!27, !7, i64 64}
!29 = !{!27, !11, i64 48}
!30 = !{!27, !11, i64 100}
!31 = !{!27, !11, i64 104}
!32 = !{!27, !11, i64 32}
!33 = !{!27, !11, i64 36}
!34 = !{!15, !11, i64 8}
!35 = !{!15, !19, i64 172}
!36 = !{i8 0, i8 2}
!37 = !{}


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