; LLVM IR from erincatto/box2d :: src (solver_set)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.b2BodyState = type { %struct.b2Vec2, float, i32, %struct.b2Vec2, %struct.b2Rot }
%struct.b2Vec2 = type { float, float }
%struct.b2Rot = type { float, float }
%struct.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 }
%struct.b2ContactSimArray = type { ptr, i32, i32 }
%struct.b2JointSimArray = type { ptr, i32, i32 }
%union.anon = 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.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.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.b2Contact = type { i32, i32, i32, [2 x %struct.b2ContactEdge], i32, i32, i32, i32, i32, i32, i32, i8 }
%struct.b2ContactEdge = type { i32, i32, i32 }
%struct.b2ContactSim = type { i32, i32, i32, i32, i32, float, float, float, float, %struct.b2Manifold, float, float, float, float, i32, %struct.b2SimplexCache }
%struct.b2Manifold = type { %struct.b2Vec2, float, [2 x %struct.b2ManifoldPoint], i32 }
%struct.b2ManifoldPoint = type { %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, float, float, float, float, float, i16, i8 }
%struct.b2SimplexCache = type { i16, [3 x i8], [3 x i8] }
%struct.b2JointSim = type { i32, i32, i32, i32, %struct.b2Vec2, %struct.b2Vec2, float, float, float, float, %union.anon.0 }
%union.anon.0 = 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.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.b2IslandSim = type { i32 }
%struct.b2Island = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }

@.str = external hidden unnamed_addr constant [32 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [27 x i8], align 1
@b2_identityBodyState = external hidden constant %struct.b2BodyState, align 4
@.str.3 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [28 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @b2DestroySolverSet(ptr noundef, i32 noundef) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind uwtable
define dso_local void @b2WakeSolverSet(ptr noundef %0, i32 noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca ptr, align 8
  %33 = alloca ptr, align 8
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca ptr, align 8
  %37 = alloca ptr, align 8
  %38 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  br label %39

39:                                               ; preds = %2
  %40 = load i32, ptr %4, align 4, !tbaa !9
  %41 = icmp sge i32 %40, 3
  br i1 %41, label %46, label %42

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

45:                                               ; preds = %42
  call void @llvm.trap()
  br label %46

46:                                               ; preds = %45, %42, %39
  br label %47

47:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.b2World, ptr %48, i32 0, i32 6
  %50 = load i32, ptr %4, align 4, !tbaa !9
  %51 = call ptr @b2SolverSetArray_Get(ptr noundef %49, i32 noundef %50)
  store ptr %51, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.b2World, ptr %52, i32 0, i32 6
  %54 = call ptr @b2SolverSetArray_Get(ptr noundef %53, i32 noundef 2)
  store ptr %54, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.b2World, ptr %55, i32 0, i32 6
  %57 = call ptr @b2SolverSetArray_Get(ptr noundef %56, i32 noundef 1)
  store ptr %57, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.b2World, ptr %58, i32 0, i32 4
  %60 = getelementptr inbounds %struct.b2BodyArray, ptr %59, i32 0, i32 0
  %61 = load ptr, ptr %60, align 8, !tbaa !11
  store ptr %61, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.b2SolverSet, ptr %62, i32 0, i32 0
  %64 = getelementptr inbounds %struct.b2BodySimArray, ptr %63, i32 0, i32 1
  %65 = load i32, ptr %64, align 8, !tbaa !27
  store i32 %65, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %66

66:                                               ; preds = %243, %47
  %67 = load i32, ptr %10, align 4, !tbaa !9
  %68 = load i32, ptr %9, align 4, !tbaa !9
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  store i32 4, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %246

71:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.b2SolverSet, ptr %72, i32 0, i32 0
  %74 = getelementptr inbounds %struct.b2BodySimArray, ptr %73, i32 0, i32 0
  %75 = load ptr, ptr %74, align 8, !tbaa !29
  %76 = load i32, ptr %10, align 4, !tbaa !9
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds %struct.b2BodySim, ptr %75, i64 %77
  store ptr %78, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %79 = load ptr, ptr %8, align 8, !tbaa !5
  %80 = load ptr, ptr %12, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.b2BodySim, ptr %80, i32 0, i32 14
  %82 = load i32, ptr %81, align 4, !tbaa !30
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds %struct.b2Body, ptr %79, i64 %83
  store ptr %84, ptr %13, align 8, !tbaa !5
  br label %85

85:                                               ; preds = %71
  %86 = load ptr, ptr %13, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.b2Body, ptr %86, i32 0, i32 2
  %88 = load i32, ptr %87, align 8, !tbaa !34
  %89 = load i32, ptr %4, align 4, !tbaa !9
  %90 = icmp eq i32 %88, %89
  br i1 %90, label %95, label %91

91:                                               ; preds = %85
  %92 = call i32 @b2InternalAssertFcn(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 52)
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %94, label %95

94:                                               ; preds = %91
  call void @llvm.trap()
  br label %95

95:                                               ; preds = %94, %91, %85
  br label %96

96:                                               ; preds = %95
  br label %97

97:                                               ; preds = %96
  %98 = load ptr, ptr %13, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.b2Body, ptr %98, i32 0, i32 2
  store i32 2, ptr %99, align 8, !tbaa !34
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.b2SolverSet, ptr %100, i32 0, i32 0
  %102 = getelementptr inbounds %struct.b2BodySimArray, ptr %101, i32 0, i32 1
  %103 = load i32, ptr %102, align 8, !tbaa !27
  %104 = load ptr, ptr %13, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.b2Body, ptr %104, i32 0, i32 3
  store i32 %103, ptr %105, align 4, !tbaa !36
  %106 = load ptr, ptr %13, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.b2Body, ptr %106, i32 0, i32 17
  store float 0.000000e+00, ptr %107, align 4, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.b2SolverSet, ptr %108, i32 0, i32 0
  %110 = call ptr @b2BodySimArray_Add(ptr noundef %109)
  store ptr %110, ptr %14, align 8, !tbaa !5
  %111 = load ptr, ptr %14, align 8, !tbaa !5
  %112 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %111, ptr align 4 %112, i64 100, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %113 = load ptr, ptr %6, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.b2SolverSet, ptr %113, i32 0, i32 1
  %115 = call ptr @b2BodyStateArray_Add(ptr noundef %114)
  store ptr %115, ptr %15, align 8, !tbaa !5
  %116 = load ptr, ptr %15, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %116, ptr align 4 @b2_identityBodyState, i64 32, i1 false), !tbaa.struct !38
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %117 = load ptr, ptr %13, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.b2Body, ptr %117, i32 0, i32 4
  %119 = load i32, ptr %118, align 8, !tbaa !40
  store i32 %119, ptr %16, align 4, !tbaa !9
  br label %120

120:                                              ; preds = %241, %239, %97
  %121 = load i32, ptr %16, align 4, !tbaa !9
  %122 = icmp ne i32 %121, -1
  br i1 %122, label %123, label %242

123:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %124 = load i32, ptr %16, align 4, !tbaa !9
  %125 = and i32 %124, 1
  store i32 %125, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %126 = load i32, ptr %16, align 4, !tbaa !9
  %127 = ashr i32 %126, 1
  store i32 %127, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %128 = load ptr, ptr %3, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.b2World, ptr %128, i32 0, i32 10
  %130 = load i32, ptr %18, align 4, !tbaa !9
  %131 = call ptr @b2ContactArray_Get(ptr noundef %129, i32 noundef %130)
  store ptr %131, ptr %19, align 8, !tbaa !5
  %132 = load ptr, ptr %19, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.b2Contact, ptr %132, i32 0, i32 3
  %134 = load i32, ptr %17, align 4, !tbaa !9
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [2 x %struct.b2ContactEdge], ptr %133, i64 0, i64 %135
  %137 = getelementptr inbounds %struct.b2ContactEdge, ptr %136, i32 0, i32 2
  %138 = load i32, ptr %137, align 4, !tbaa !41
  store i32 %138, ptr %16, align 4, !tbaa !9
  %139 = load ptr, ptr %19, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.b2Contact, ptr %139, i32 0, i32 0
  %141 = load i32, ptr %140, align 4, !tbaa !43
  %142 = icmp ne i32 %141, 1
  br i1 %142, label %143, label %162

143:                                              ; preds = %123
  br label %144

144:                                              ; preds = %143
  %145 = load ptr, ptr %19, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.b2Contact, ptr %145, i32 0, i32 0
  %147 = load i32, ptr %146, align 4, !tbaa !43
  %148 = icmp eq i32 %147, 2
  br i1 %148, label %159, label %149

149:                                              ; preds = %144
  %150 = load ptr, ptr %19, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.b2Contact, ptr %150, i32 0, i32 0
  %152 = load i32, ptr %151, align 4, !tbaa !43
  %153 = load i32, ptr %4, align 4, !tbaa !9
  %154 = icmp eq i32 %152, %153
  br i1 %154, label %159, label %155

155:                                              ; preds = %149
  %156 = call i32 @b2InternalAssertFcn(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 78)
  %157 = icmp ne i32 %156, 0
  br i1 %157, label %158, label %159

158:                                              ; preds = %155
  call void @llvm.trap()
  br label %159

159:                                              ; preds = %158, %155, %149, %144
  br label %160

160:                                              ; preds = %159
  br label %161

161:                                              ; preds = %160
  store i32 9, ptr %11, align 4
  br label %239, !llvm.loop !45

162:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %163 = load ptr, ptr %19, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.b2Contact, ptr %163, i32 0, i32 2
  %165 = load i32, ptr %164, align 4, !tbaa !47
  store i32 %165, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %166 = load ptr, ptr %7, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.b2SolverSet, ptr %166, i32 0, i32 3
  %168 = load i32, ptr %20, align 4, !tbaa !9
  %169 = call ptr @b2ContactSimArray_Get(ptr noundef %167, i32 noundef %168)
  store ptr %169, ptr %21, align 8, !tbaa !5
  br label %170

170:                                              ; preds = %162
  %171 = load ptr, ptr %19, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.b2Contact, ptr %171, i32 0, i32 10
  %173 = load i32, ptr %172, align 4, !tbaa !48
  %174 = and i32 %173, 1
  %175 = icmp eq i32 %174, 0
  br i1 %175, label %176, label %182

176:                                              ; preds = %170
  %177 = load ptr, ptr %21, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.b2ContactSim, ptr %177, i32 0, i32 9
  %179 = getelementptr inbounds %struct.b2Manifold, ptr %178, i32 0, i32 3
  %180 = load i32, ptr %179, align 4, !tbaa !49
  %181 = icmp eq i32 %180, 0
  br i1 %181, label %186, label %182

182:                                              ; preds = %176, %170
  %183 = call i32 @b2InternalAssertFcn(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 85)
  %184 = icmp ne i32 %183, 0
  br i1 %184, label %185, label %186

185:                                              ; preds = %182
  call void @llvm.trap()
  br label %186

186:                                              ; preds = %185, %182, %176
  br label %187

187:                                              ; preds = %186
  br label %188

188:                                              ; preds = %187
  %189 = load ptr, ptr %19, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.b2Contact, ptr %189, i32 0, i32 0
  store i32 2, ptr %190, align 4, !tbaa !43
  %191 = load ptr, ptr %6, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.b2SolverSet, ptr %191, i32 0, i32 3
  %193 = getelementptr inbounds %struct.b2ContactSimArray, ptr %192, i32 0, i32 1
  %194 = load i32, ptr %193, align 8, !tbaa !53
  %195 = load ptr, ptr %19, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.b2Contact, ptr %195, i32 0, i32 2
  store i32 %194, ptr %196, align 4, !tbaa !47
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %197 = load ptr, ptr %6, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.b2SolverSet, ptr %197, i32 0, i32 3
  %199 = call ptr @b2ContactSimArray_Add(ptr noundef %198)
  store ptr %199, ptr %22, align 8, !tbaa !5
  %200 = load ptr, ptr %22, align 8, !tbaa !5
  %201 = load ptr, ptr %21, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %200, ptr align 4 %201, i64 176, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %202 = load ptr, ptr %7, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.b2SolverSet, ptr %202, i32 0, i32 3
  %204 = load i32, ptr %20, align 4, !tbaa !9
  %205 = call i32 @b2ContactSimArray_RemoveSwap(ptr noundef %203, i32 noundef %204)
  store i32 %205, ptr %23, align 4, !tbaa !9
  %206 = load i32, ptr %23, align 4, !tbaa !9
  %207 = icmp ne i32 %206, -1
  br i1 %207, label %208, label %238

208:                                              ; preds = %188
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %209 = load ptr, ptr %7, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.b2SolverSet, ptr %209, i32 0, i32 3
  %211 = getelementptr inbounds %struct.b2ContactSimArray, ptr %210, i32 0, i32 0
  %212 = load ptr, ptr %211, align 8, !tbaa !54
  %213 = load i32, ptr %20, align 4, !tbaa !9
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds %struct.b2ContactSim, ptr %212, i64 %214
  store ptr %215, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %216 = load ptr, ptr %3, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.b2World, ptr %216, i32 0, i32 10
  %218 = load ptr, ptr %24, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.b2ContactSim, ptr %218, i32 0, i32 0
  %220 = load i32, ptr %219, align 4, !tbaa !55
  %221 = call ptr @b2ContactArray_Get(ptr noundef %217, i32 noundef %220)
  store ptr %221, ptr %25, align 8, !tbaa !5
  br label %222

222:                                              ; preds = %208
  %223 = load ptr, ptr %25, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.b2Contact, ptr %223, i32 0, i32 2
  %225 = load i32, ptr %224, align 4, !tbaa !47
  %226 = load i32, ptr %23, align 4, !tbaa !9
  %227 = icmp eq i32 %225, %226
  br i1 %227, label %232, label %228

228:                                              ; preds = %222
  %229 = call i32 @b2InternalAssertFcn(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 98)
  %230 = icmp ne i32 %229, 0
  br i1 %230, label %231, label %232

231:                                              ; preds = %228
  call void @llvm.trap()
  br label %232

232:                                              ; preds = %231, %228, %222
  br label %233

233:                                              ; preds = %232
  br label %234

234:                                              ; preds = %233
  %235 = load i32, ptr %20, align 4, !tbaa !9
  %236 = load ptr, ptr %25, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.b2Contact, ptr %236, i32 0, i32 2
  store i32 %235, ptr %237, align 4, !tbaa !47
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  br label %238

238:                                              ; preds = %234, %188
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  store i32 0, ptr %11, align 4
  br label %239

239:                                              ; preds = %238, %161
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  %240 = load i32, ptr %11, align 4
  switch i32 %240, label %419 [
    i32 0, label %241
    i32 9, label %120
  ]

241:                                              ; preds = %239
  br label %120, !llvm.loop !45

242:                                              ; preds = %120
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %243

243:                                              ; preds = %242
  %244 = load i32, ptr %10, align 4, !tbaa !9
  %245 = add nsw i32 %244, 1
  store i32 %245, ptr %10, align 4, !tbaa !9
  br label %66, !llvm.loop !56

246:                                              ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  %247 = load ptr, ptr %5, align 8, !tbaa !5
  %248 = getelementptr inbounds %struct.b2SolverSet, ptr %247, i32 0, i32 3
  %249 = getelementptr inbounds %struct.b2ContactSimArray, ptr %248, i32 0, i32 1
  %250 = load i32, ptr %249, align 8, !tbaa !53
  store i32 %250, ptr %26, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  store i32 0, ptr %27, align 4, !tbaa !9
  br label %251

251:                                              ; preds = %327, %246
  %252 = load i32, ptr %27, align 4, !tbaa !9
  %253 = load i32, ptr %26, align 4, !tbaa !9
  %254 = icmp slt i32 %252, %253
  br i1 %254, label %256, label %255

255:                                              ; preds = %251
  store i32 17, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  br label %330

256:                                              ; preds = %251
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  %257 = load ptr, ptr %5, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.b2SolverSet, ptr %257, i32 0, i32 3
  %259 = getelementptr inbounds %struct.b2ContactSimArray, ptr %258, i32 0, i32 0
  %260 = load ptr, ptr %259, align 8, !tbaa !54
  %261 = load i32, ptr %27, align 4, !tbaa !9
  %262 = sext i32 %261 to i64
  %263 = getelementptr inbounds %struct.b2ContactSim, ptr %260, i64 %262
  store ptr %263, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #6
  %264 = load ptr, ptr %3, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct.b2World, ptr %264, i32 0, i32 10
  %266 = load ptr, ptr %28, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct.b2ContactSim, ptr %266, i32 0, i32 0
  %268 = load i32, ptr %267, align 4, !tbaa !55
  %269 = call ptr @b2ContactArray_Get(ptr noundef %265, i32 noundef %268)
  store ptr %269, ptr %29, align 8, !tbaa !5
  br label %270

270:                                              ; preds = %256
  %271 = load ptr, ptr %29, align 8, !tbaa !5
  %272 = getelementptr inbounds %struct.b2Contact, ptr %271, i32 0, i32 10
  %273 = load i32, ptr %272, align 4, !tbaa !48
  %274 = and i32 %273, 1
  %275 = icmp ne i32 %274, 0
  br i1 %275, label %280, label %276

276:                                              ; preds = %270
  %277 = call i32 @b2InternalAssertFcn(ptr noundef @.str.6, ptr noundef @.str.1, i32 noundef 111)
  %278 = icmp ne i32 %277, 0
  br i1 %278, label %279, label %280

279:                                              ; preds = %276
  call void @llvm.trap()
  br label %280

280:                                              ; preds = %279, %276, %270
  br label %281

281:                                              ; preds = %280
  br label %282

282:                                              ; preds = %281
  br label %283

283:                                              ; preds = %282
  %284 = load ptr, ptr %28, align 8, !tbaa !5
  %285 = getelementptr inbounds %struct.b2ContactSim, ptr %284, i32 0, i32 14
  %286 = load i32, ptr %285, align 4, !tbaa !57
  %287 = and i32 %286, 65536
  %288 = icmp ne i32 %287, 0
  br i1 %288, label %293, label %289

289:                                              ; preds = %283
  %290 = call i32 @b2InternalAssertFcn(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 112)
  %291 = icmp ne i32 %290, 0
  br i1 %291, label %292, label %293

292:                                              ; preds = %289
  call void @llvm.trap()
  br label %293

293:                                              ; preds = %292, %289, %283
  br label %294

294:                                              ; preds = %293
  br label %295

295:                                              ; preds = %294
  br label %296

296:                                              ; preds = %295
  %297 = load ptr, ptr %28, align 8, !tbaa !5
  %298 = getelementptr inbounds %struct.b2ContactSim, ptr %297, i32 0, i32 9
  %299 = getelementptr inbounds %struct.b2Manifold, ptr %298, i32 0, i32 3
  %300 = load i32, ptr %299, align 4, !tbaa !49
  %301 = icmp sgt i32 %300, 0
  br i1 %301, label %306, label %302

302:                                              ; preds = %296
  %303 = call i32 @b2InternalAssertFcn(ptr noundef @.str.8, ptr noundef @.str.1, i32 noundef 113)
  %304 = icmp ne i32 %303, 0
  br i1 %304, label %305, label %306

305:                                              ; preds = %302
  call void @llvm.trap()
  br label %306

306:                                              ; preds = %305, %302, %296
  br label %307

307:                                              ; preds = %306
  br label %308

308:                                              ; preds = %307
  br label %309

309:                                              ; preds = %308
  %310 = load ptr, ptr %29, align 8, !tbaa !5
  %311 = getelementptr inbounds %struct.b2Contact, ptr %310, i32 0, i32 0
  %312 = load i32, ptr %311, align 4, !tbaa !43
  %313 = load i32, ptr %4, align 4, !tbaa !9
  %314 = icmp eq i32 %312, %313
  br i1 %314, label %319, label %315

315:                                              ; preds = %309
  %316 = call i32 @b2InternalAssertFcn(ptr noundef @.str.9, ptr noundef @.str.1, i32 noundef 114)
  %317 = icmp ne i32 %316, 0
  br i1 %317, label %318, label %319

318:                                              ; preds = %315
  call void @llvm.trap()
  br label %319

319:                                              ; preds = %318, %315, %309
  br label %320

320:                                              ; preds = %319
  br label %321

321:                                              ; preds = %320
  %322 = load ptr, ptr %3, align 8, !tbaa !5
  %323 = load ptr, ptr %28, align 8, !tbaa !5
  %324 = load ptr, ptr %29, align 8, !tbaa !5
  call void @b2AddContactToGraph(ptr noundef %322, ptr noundef %323, ptr noundef %324)
  %325 = load ptr, ptr %29, align 8, !tbaa !5
  %326 = getelementptr inbounds %struct.b2Contact, ptr %325, i32 0, i32 0
  store i32 2, ptr %326, align 4, !tbaa !43
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  br label %327

327:                                              ; preds = %321
  %328 = load i32, ptr %27, align 4, !tbaa !9
  %329 = add nsw i32 %328, 1
  store i32 %329, ptr %27, align 4, !tbaa !9
  br label %251, !llvm.loop !58

330:                                              ; preds = %255
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #6
  %331 = load ptr, ptr %5, align 8, !tbaa !5
  %332 = getelementptr inbounds %struct.b2SolverSet, ptr %331, i32 0, i32 2
  %333 = getelementptr inbounds %struct.b2JointSimArray, ptr %332, i32 0, i32 1
  %334 = load i32, ptr %333, align 8, !tbaa !59
  store i32 %334, ptr %30, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #6
  store i32 0, ptr %31, align 4, !tbaa !9
  br label %335

335:                                              ; preds = %372, %330
  %336 = load i32, ptr %31, align 4, !tbaa !9
  %337 = load i32, ptr %30, align 4, !tbaa !9
  %338 = icmp slt i32 %336, %337
  br i1 %338, label %340, label %339

339:                                              ; preds = %335
  store i32 28, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #6
  br label %375

340:                                              ; preds = %335
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #6
  %341 = load ptr, ptr %5, align 8, !tbaa !5
  %342 = getelementptr inbounds %struct.b2SolverSet, ptr %341, i32 0, i32 2
  %343 = getelementptr inbounds %struct.b2JointSimArray, ptr %342, i32 0, i32 0
  %344 = load ptr, ptr %343, align 8, !tbaa !60
  %345 = load i32, ptr %31, align 4, !tbaa !9
  %346 = sext i32 %345 to i64
  %347 = getelementptr inbounds %struct.b2JointSim, ptr %344, i64 %346
  store ptr %347, ptr %32, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #6
  %348 = load ptr, ptr %3, align 8, !tbaa !5
  %349 = getelementptr inbounds %struct.b2World, ptr %348, i32 0, i32 8
  %350 = load ptr, ptr %32, align 8, !tbaa !5
  %351 = getelementptr inbounds %struct.b2JointSim, ptr %350, i32 0, i32 0
  %352 = load i32, ptr %351, align 4, !tbaa !61
  %353 = call ptr @b2JointArray_Get(ptr noundef %349, i32 noundef %352)
  store ptr %353, ptr %33, align 8, !tbaa !5
  br label %354

354:                                              ; preds = %340
  %355 = load ptr, ptr %33, align 8, !tbaa !5
  %356 = getelementptr inbounds %struct.b2Joint, ptr %355, i32 0, i32 1
  %357 = load i32, ptr %356, align 8, !tbaa !63
  %358 = load i32, ptr %4, align 4, !tbaa !9
  %359 = icmp eq i32 %357, %358
  br i1 %359, label %364, label %360

360:                                              ; preds = %354
  %361 = call i32 @b2InternalAssertFcn(ptr noundef @.str.10, ptr noundef @.str.1, i32 noundef 127)
  %362 = icmp ne i32 %361, 0
  br i1 %362, label %363, label %364

363:                                              ; preds = %360
  call void @llvm.trap()
  br label %364

364:                                              ; preds = %363, %360, %354
  br label %365

365:                                              ; preds = %364
  br label %366

366:                                              ; preds = %365
  %367 = load ptr, ptr %3, align 8, !tbaa !5
  %368 = load ptr, ptr %32, align 8, !tbaa !5
  %369 = load ptr, ptr %33, align 8, !tbaa !5
  call void @b2AddJointToGraph(ptr noundef %367, ptr noundef %368, ptr noundef %369)
  %370 = load ptr, ptr %33, align 8, !tbaa !5
  %371 = getelementptr inbounds %struct.b2Joint, ptr %370, i32 0, i32 1
  store i32 2, ptr %371, align 8, !tbaa !63
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #6
  br label %372

372:                                              ; preds = %366
  %373 = load i32, ptr %31, align 4, !tbaa !9
  %374 = add nsw i32 %373, 1
  store i32 %374, ptr %31, align 4, !tbaa !9
  br label %335, !llvm.loop !65

375:                                              ; preds = %339
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #6
  %376 = load ptr, ptr %5, align 8, !tbaa !5
  %377 = getelementptr inbounds %struct.b2SolverSet, ptr %376, i32 0, i32 4
  %378 = getelementptr inbounds %struct.b2IslandSimArray, ptr %377, i32 0, i32 1
  %379 = load i32, ptr %378, align 8, !tbaa !66
  store i32 %379, ptr %34, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #6
  store i32 0, ptr %35, align 4, !tbaa !9
  br label %380

380:                                              ; preds = %412, %375
  %381 = load i32, ptr %35, align 4, !tbaa !9
  %382 = load i32, ptr %34, align 4, !tbaa !9
  %383 = icmp slt i32 %381, %382
  br i1 %383, label %385, label %384

384:                                              ; preds = %380
  store i32 33, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #6
  br label %415

385:                                              ; preds = %380
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #6
  %386 = load ptr, ptr %5, align 8, !tbaa !5
  %387 = getelementptr inbounds %struct.b2SolverSet, ptr %386, i32 0, i32 4
  %388 = getelementptr inbounds %struct.b2IslandSimArray, ptr %387, i32 0, i32 0
  %389 = load ptr, ptr %388, align 8, !tbaa !67
  %390 = load i32, ptr %35, align 4, !tbaa !9
  %391 = sext i32 %390 to i64
  %392 = getelementptr inbounds %struct.b2IslandSim, ptr %389, i64 %391
  store ptr %392, ptr %36, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #6
  %393 = load ptr, ptr %3, align 8, !tbaa !5
  %394 = getelementptr inbounds %struct.b2World, ptr %393, i32 0, i32 12
  %395 = load ptr, ptr %36, align 8, !tbaa !5
  %396 = getelementptr inbounds %struct.b2IslandSim, ptr %395, i32 0, i32 0
  %397 = load i32, ptr %396, align 4, !tbaa !68
  %398 = call ptr @b2IslandArray_Get(ptr noundef %394, i32 noundef %397)
  store ptr %398, ptr %37, align 8, !tbaa !5
  %399 = load ptr, ptr %37, align 8, !tbaa !5
  %400 = getelementptr inbounds %struct.b2Island, ptr %399, i32 0, i32 0
  store i32 2, ptr %400, align 4, !tbaa !70
  %401 = load ptr, ptr %6, align 8, !tbaa !5
  %402 = getelementptr inbounds %struct.b2SolverSet, ptr %401, i32 0, i32 4
  %403 = getelementptr inbounds %struct.b2IslandSimArray, ptr %402, i32 0, i32 1
  %404 = load i32, ptr %403, align 8, !tbaa !66
  %405 = load ptr, ptr %37, align 8, !tbaa !5
  %406 = getelementptr inbounds %struct.b2Island, ptr %405, i32 0, i32 1
  store i32 %404, ptr %406, align 4, !tbaa !72
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #6
  %407 = load ptr, ptr %6, align 8, !tbaa !5
  %408 = getelementptr inbounds %struct.b2SolverSet, ptr %407, i32 0, i32 4
  %409 = call ptr @b2IslandSimArray_Add(ptr noundef %408)
  store ptr %409, ptr %38, align 8, !tbaa !5
  %410 = load ptr, ptr %38, align 8, !tbaa !5
  %411 = load ptr, ptr %36, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %410, ptr align 4 %411, i64 4, i1 false)
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #6
  br label %412

412:                                              ; preds = %385
  %413 = load i32, ptr %35, align 4, !tbaa !9
  %414 = add nsw i32 %413, 1
  store i32 %414, ptr %35, align 4, !tbaa !9
  br label %380, !llvm.loop !73

415:                                              ; preds = %384
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #6
  %416 = load ptr, ptr %3, align 8, !tbaa !5
  %417 = load i32, ptr %4, align 4, !tbaa !9
  call void @b2DestroySolverSet(ptr noundef %416, i32 noundef %417)
  %418 = load ptr, ptr %3, align 8, !tbaa !5
  call void @b2ValidateSolverSets(ptr noundef %418)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret void

419:                                              ; preds = %239
  unreachable
}

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @b2BodySimArray_Add(ptr noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @b2BodyStateArray_Add(ptr noundef) #2

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @b2ContactSimArray_Add(ptr noundef) #2

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

declare void @b2AddContactToGraph(ptr noundef, ptr noundef, ptr noundef) #4

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

declare void @b2AddJointToGraph(ptr noundef, ptr noundef, ptr noundef) #4

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @b2IslandSimArray_Add(ptr noundef) #2

declare void @b2ValidateSolverSets(ptr noundef) #4

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "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 = { cold noreturn nounwind memory(inaccessiblemem: write) }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 1032}
!12 = !{!"b2World", !13, i64 0, !15, i64 40, !18, i64 336, !19, i64 1008, !14, i64 1032, !19, i64 1048, !14, i64 1072, !19, i64 1088, !14, i64 1112, !19, i64 1128, !14, i64 1152, !19, i64 1168, !14, i64 1192, !19, i64 1208, !19, i64 1232, !14, i64 1256, !14, i64 1272, !14, i64 1288, !14, i64 1304, !14, i64 1320, !14, i64 1336, !14, i64 1352, !14, i64 1368, !7, i64 1384, !7, i64 1416, !10, i64 1448, !14, i64 1456, !20, i64 1472, !20, i64 1488, !20, i64 1504, !20, i64 1520, !21, i64 1536, !10, i64 1544, !22, i64 1548, !23, i64 1556, !23, i64 1560, !23, i64 1564, !23, i64 1568, !23, i64 1572, !23, i64 1576, !23, i64 1580, !23, i64 1584, !6, i64 1592, !6, i64 1600, !24, i64 1608, !25, i64 1612, !6, i64 1704, !6, i64 1712, !6, i64 1720, !6, i64 1728, !10, i64 1736, !6, i64 1744, !6, i64 1752, !6, i64 1760, !6, i64 1768, !6, i64 1776, !23, i64 1784, !10, i64 1788, !10, i64 1792, !24, i64 1796, !26, i64 1798, !26, i64 1799, !26, i64 1800, !26, i64 1801, !26, i64 1802, !26, i64 1803}
!13 = !{!"b2ArenaAllocator", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !14, i64 24}
!14 = !{!"", !6, i64 0, !10, i64 8, !10, i64 12}
!15 = !{!"b2BroadPhase", !7, i64 0, !10, i64 216, !16, i64 224, !14, i64 240, !6, i64 256, !6, i64 264, !10, i64 272, !17, i64 276, !16, i64 280}
!16 = !{!"b2HashSet", !6, i64 0, !10, i64 8, !10, i64 12}
!17 = !{!"b2AtomicInt", !10, i64 0}
!18 = !{!"b2ConstraintGraph", !7, i64 0}
!19 = !{!"b2IdPool", !14, i64 0, !10, i64 16}
!20 = !{!"b2BitSet", !6, i64 0, !10, i64 8, !10, i64 12}
!21 = !{!"long", !7, i64 0}
!22 = !{!"b2Vec2", !23, i64 0, !23, i64 4}
!23 = !{!"float", !7, i64 0}
!24 = !{!"short", !7, i64 0}
!25 = !{!"b2Profile", !23, i64 0, !23, i64 4, !23, i64 8, !23, i64 12, !23, i64 16, !23, i64 20, !23, i64 24, !23, i64 28, !23, i64 32, !23, i64 36, !23, i64 40, !23, i64 44, !23, i64 48, !23, i64 52, !23, i64 56, !23, i64 60, !23, i64 64, !23, i64 68, !23, i64 72, !23, i64 76, !23, i64 80, !23, i64 84}
!26 = !{!"_Bool", !7, i64 0}
!27 = !{!28, !10, i64 8}
!28 = !{!"b2SolverSet", !14, i64 0, !14, i64 16, !14, i64 32, !14, i64 48, !14, i64 64, !10, i64 80}
!29 = !{!28, !6, i64 0}
!30 = !{!31, !10, i64 88}
!31 = !{!"b2BodySim", !32, i64 0, !22, i64 16, !33, i64 24, !22, i64 32, !22, i64 40, !22, i64 48, !23, i64 56, !23, i64 60, !23, i64 64, !23, i64 68, !23, i64 72, !23, i64 76, !23, i64 80, !23, i64 84, !10, i64 88, !26, i64 92, !26, i64 93, !26, i64 94, !26, i64 95, !26, i64 96}
!32 = !{!"b2Transform", !22, i64 0, !33, i64 8}
!33 = !{!"b2Rot", !23, i64 0, !23, i64 4}
!34 = !{!35, !10, i64 40}
!35 = !{!"b2Body", !7, i64 0, !6, i64 32, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !23, i64 88, !23, i64 92, !23, i64 96, !23, i64 100, !10, i64 104, !10, i64 108, !10, i64 112, !24, i64 116, !26, i64 118, !26, i64 119, !26, i64 120, !26, i64 121}
!36 = !{!35, !10, i64 44}
!37 = !{!35, !23, i64 100}
!38 = !{i64 0, i64 4, !39, i64 4, i64 4, !39, i64 8, i64 4, !39, i64 12, i64 4, !9, i64 16, i64 4, !39, i64 20, i64 4, !39, i64 24, i64 4, !39, i64 28, i64 4, !39}
!39 = !{!23, !23, i64 0}
!40 = !{!35, !10, i64 48}
!41 = !{!42, !10, i64 8}
!42 = !{!"b2ContactEdge", !10, i64 0, !10, i64 4, !10, i64 8}
!43 = !{!44, !10, i64 0}
!44 = !{!"b2Contact", !10, i64 0, !10, i64 4, !10, i64 8, !7, i64 12, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !26, i64 64}
!45 = distinct !{!45, !46}
!46 = !{!"llvm.loop.mustprogress"}
!47 = !{!44, !10, i64 8}
!48 = !{!44, !10, i64 60}
!49 = !{!50, !10, i64 144}
!50 = !{!"b2ContactSim", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !23, i64 20, !23, i64 24, !23, i64 28, !23, i64 32, !51, i64 36, !23, i64 148, !23, i64 152, !23, i64 156, !23, i64 160, !10, i64 164, !52, i64 168}
!51 = !{!"b2Manifold", !22, i64 0, !23, i64 8, !7, i64 12, !10, i64 108}
!52 = !{!"b2SimplexCache", !24, i64 0, !7, i64 2, !7, i64 5}
!53 = !{!28, !10, i64 56}
!54 = !{!28, !6, i64 48}
!55 = !{!50, !10, i64 0}
!56 = distinct !{!56, !46}
!57 = !{!50, !10, i64 164}
!58 = distinct !{!58, !46}
!59 = !{!28, !10, i64 40}
!60 = !{!28, !6, i64 32}
!61 = !{!62, !10, i64 0}
!62 = !{!"b2JointSim", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !22, i64 16, !22, i64 24, !23, i64 32, !23, i64 36, !23, i64 40, !23, i64 44, !7, i64 48}
!63 = !{!64, !10, i64 8}
!64 = !{!"b2Joint", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !7, i64 20, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !23, i64 60, !10, i64 64, !24, i64 68, !26, i64 70, !26, i64 71}
!65 = distinct !{!65, !46}
!66 = !{!28, !10, i64 72}
!67 = !{!28, !6, i64 64}
!68 = !{!69, !10, i64 0}
!69 = !{!"b2IslandSim", !10, i64 0}
!70 = !{!71, !10, i64 0}
!71 = !{!"b2Island", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52}
!72 = !{!71, !10, i64 4}
!73 = distinct !{!73, !46}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.b2BodyState = type { %struct.b2Vec2, float, i32, %struct.b2Vec2, %struct.b2Rot }
%struct.b2Vec2 = type { float, float }
%struct.b2Rot = type { float, float }
%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.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.b2ContactEdge = type { i32, i32, i32 }
%struct.b2ContactSim = type { i32, i32, i32, i32, i32, float, float, float, float, %struct.b2Manifold, float, float, float, float, i32, %struct.b2SimplexCache }
%struct.b2Manifold = type { %struct.b2Vec2, float, [2 x %struct.b2ManifoldPoint], i32 }
%struct.b2ManifoldPoint = type { %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, float, float, float, float, float, i16, i8 }
%struct.b2SimplexCache = type { i16, [3 x i8], [3 x i8] }
%struct.b2JointSim = type { i32, i32, i32, i32, %struct.b2Vec2, %struct.b2Vec2, float, float, float, float, %union.anon.0 }
%union.anon.0 = 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.b2IslandSim = type { i32 }

@.str = external hidden unnamed_addr constant [32 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [27 x i8], align 1
@b2_identityBodyState = external hidden local_unnamed_addr constant %struct.b2BodyState, align 4
@.str.3 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [28 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @b2DestroySolverSet(ptr noundef, i32 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: nounwind uwtable
define dso_local void @b2WakeSolverSet(ptr noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = icmp sgt i32 %1, 2
  br i1 %3, label %7, label %4

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

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

7:                                                ; preds = %2, %4
  %8 = getelementptr inbounds i8, ptr %0, i64 1072
  %9 = tail call ptr @b2SolverSetArray_Get(ptr noundef nonnull %8, i32 noundef %1)
  %10 = tail call ptr @b2SolverSetArray_Get(ptr noundef nonnull %8, i32 noundef 2)
  %11 = tail call ptr @b2SolverSetArray_Get(ptr noundef nonnull %8, i32 noundef 1)
  %12 = getelementptr inbounds i8, ptr %0, i64 1032
  %13 = load ptr, ptr %12, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %9, i64 8
  %15 = load i32, ptr %14, align 8, !tbaa !25
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph130, label %._crit_edge131

.lr.ph130:                                        ; preds = %7
  %17 = getelementptr inbounds i8, ptr %10, i64 8
  %18 = getelementptr inbounds i8, ptr %10, i64 16
  %19 = getelementptr inbounds i8, ptr %0, i64 1152
  %20 = getelementptr inbounds i8, ptr %11, i64 48
  %21 = getelementptr inbounds i8, ptr %10, i64 48
  %22 = getelementptr inbounds i8, ptr %10, i64 56
  %wide.trip.count = zext nneg i32 %15 to i64
  br label %28

._crit_edge131:                                   ; preds = %._crit_edge, %7
  %23 = getelementptr inbounds i8, ptr %9, i64 48
  %24 = getelementptr inbounds i8, ptr %9, i64 56
  %25 = load i32, ptr %24, align 8, !tbaa !27
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %.lr.ph134, label %._crit_edge135

.lr.ph134:                                        ; preds = %._crit_edge131
  %27 = getelementptr inbounds i8, ptr %0, i64 1152
  %wide.trip.count148 = zext nneg i32 %25 to i64
  br label %100

28:                                               ; preds = %.lr.ph130, %._crit_edge
  %indvars.iv = phi i64 [ 0, %.lr.ph130 ], [ %indvars.iv.next, %._crit_edge ]
  %29 = load ptr, ptr %9, align 8, !tbaa !28
  %30 = getelementptr inbounds %struct.b2BodySim, ptr %29, i64 %indvars.iv
  %31 = getelementptr inbounds i8, ptr %30, i64 88
  %32 = load i32, ptr %31, align 4, !tbaa !29
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds %struct.b2Body, ptr %13, i64 %33
  %35 = getelementptr inbounds i8, ptr %34, i64 40
  %36 = load i32, ptr %35, align 8, !tbaa !33
  %37 = icmp eq i32 %36, %1
  br i1 %37, label %41, label %38

38:                                               ; preds = %28
  %39 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 52) #5
  %.not119 = icmp eq i32 %39, 0
  br i1 %.not119, label %41, label %40

40:                                               ; preds = %38
  tail call void @llvm.trap()
  unreachable

41:                                               ; preds = %38, %28
  store i32 2, ptr %35, align 8, !tbaa !33
  %42 = load i32, ptr %17, align 8, !tbaa !25
  %43 = getelementptr inbounds i8, ptr %34, i64 44
  store i32 %42, ptr %43, align 4, !tbaa !35
  %44 = getelementptr inbounds i8, ptr %34, i64 100
  store float 0.000000e+00, ptr %44, align 4, !tbaa !36
  %45 = tail call ptr @b2BodySimArray_Add(ptr noundef %10)
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(100) %45, ptr noundef nonnull align 4 dereferenceable(100) %30, i64 100, i1 false)
  %46 = tail call ptr @b2BodyStateArray_Add(ptr noundef nonnull %18)
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(32) %46, ptr noundef nonnull align 4 dereferenceable(32) @b2_identityBodyState, i64 32, i1 false), !tbaa.struct !37
  %47 = getelementptr inbounds i8, ptr %34, i64 48
  %48 = load i32, ptr %47, align 8, !tbaa !40
  %.not120126 = icmp eq i32 %48, -1
  br i1 %.not120126, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %41, %94
  %.0106127 = phi i32 [ %55, %94 ], [ %48, %41 ]
  %49 = and i32 %.0106127, 1
  %50 = ashr i32 %.0106127, 1
  %51 = tail call ptr @b2ContactArray_Get(ptr noundef nonnull %19, i32 noundef %50)
  %52 = getelementptr inbounds i8, ptr %51, i64 12
  %53 = zext nneg i32 %49 to i64
  %54 = getelementptr inbounds [2 x %struct.b2ContactEdge], ptr %52, i64 0, i64 %53, i32 2
  %55 = load i32, ptr %54, align 4, !tbaa !41
  %56 = load i32, ptr %51, align 4, !tbaa !43
  switch i32 %56, label %57 [
    i32 1, label %62
    i32 2, label %94
  ], !llvm.loop !45

57:                                               ; preds = %.lr.ph
  %58 = icmp eq i32 %56, %1
  br i1 %58, label %94, label %59, !llvm.loop !45

59:                                               ; preds = %57
  %60 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 78) #5
  %.not125 = icmp eq i32 %60, 0
  br i1 %.not125, label %94, label %61, !llvm.loop !45

61:                                               ; preds = %59
  tail call void @llvm.trap()
  unreachable

62:                                               ; preds = %.lr.ph
  %63 = getelementptr inbounds i8, ptr %51, i64 8
  %64 = load i32, ptr %63, align 4, !tbaa !47
  %65 = tail call ptr @b2ContactSimArray_Get(ptr noundef nonnull %20, i32 noundef %64)
  %66 = getelementptr inbounds i8, ptr %51, i64 60
  %67 = load i32, ptr %66, align 4, !tbaa !48
  %68 = and i32 %67, 1
  %69 = icmp eq i32 %68, 0
  br i1 %69, label %70, label %74

70:                                               ; preds = %62
  %71 = getelementptr inbounds i8, ptr %65, i64 144
  %72 = load i32, ptr %71, align 4, !tbaa !49
  %73 = icmp eq i32 %72, 0
  br i1 %73, label %77, label %74

74:                                               ; preds = %70, %62
  %75 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 85) #5
  %.not122 = icmp eq i32 %75, 0
  br i1 %.not122, label %77, label %76

76:                                               ; preds = %74
  tail call void @llvm.trap()
  unreachable

77:                                               ; preds = %74, %70
  store i32 2, ptr %51, align 4, !tbaa !43
  %78 = load i32, ptr %22, align 8, !tbaa !27
  store i32 %78, ptr %63, align 4, !tbaa !47
  %79 = tail call ptr @b2ContactSimArray_Add(ptr noundef nonnull %21)
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(176) %79, ptr noundef nonnull align 4 dereferenceable(176) %65, i64 176, i1 false)
  %80 = tail call i32 @b2ContactSimArray_RemoveSwap(ptr noundef nonnull %20, i32 noundef %64)
  %.not123 = icmp eq i32 %80, -1
  br i1 %.not123, label %94, label %81

81:                                               ; preds = %77
  %82 = load ptr, ptr %20, align 8, !tbaa !53
  %83 = sext i32 %64 to i64
  %84 = getelementptr inbounds %struct.b2ContactSim, ptr %82, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !54
  %86 = tail call ptr @b2ContactArray_Get(ptr noundef nonnull %19, i32 noundef %85)
  %87 = getelementptr inbounds i8, ptr %86, i64 8
  %88 = load i32, ptr %87, align 4, !tbaa !47
  %89 = icmp eq i32 %88, %80
  br i1 %89, label %93, label %90

90:                                               ; preds = %81
  %91 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 98) #5
  %.not124 = icmp eq i32 %91, 0
  br i1 %.not124, label %93, label %92

92:                                               ; preds = %90
  tail call void @llvm.trap()
  unreachable

93:                                               ; preds = %90, %81
  store i32 %64, ptr %87, align 4, !tbaa !47
  br label %94

94:                                               ; preds = %77, %93, %57, %59, %.lr.ph
  %.not120 = icmp eq i32 %55, -1
  br i1 %.not120, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %94, %41
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge131, label %28, !llvm.loop !55

._crit_edge135:                                   ; preds = %131, %._crit_edge131
  %95 = getelementptr inbounds i8, ptr %9, i64 32
  %96 = getelementptr inbounds i8, ptr %9, i64 40
  %97 = load i32, ptr %96, align 8, !tbaa !56
  %98 = icmp sgt i32 %97, 0
  br i1 %98, label %.lr.ph138, label %._crit_edge139

.lr.ph138:                                        ; preds = %._crit_edge135
  %99 = getelementptr inbounds i8, ptr %0, i64 1112
  %wide.trip.count153 = zext nneg i32 %97 to i64
  br label %139

100:                                              ; preds = %.lr.ph134, %131
  %indvars.iv145 = phi i64 [ 0, %.lr.ph134 ], [ %indvars.iv.next146, %131 ]
  %101 = load ptr, ptr %23, align 8, !tbaa !53
  %102 = getelementptr inbounds %struct.b2ContactSim, ptr %101, i64 %indvars.iv145
  %103 = load i32, ptr %102, align 4, !tbaa !54
  %104 = tail call ptr @b2ContactArray_Get(ptr noundef nonnull %27, i32 noundef %103)
  %105 = getelementptr inbounds i8, ptr %104, i64 60
  %106 = load i32, ptr %105, align 4, !tbaa !48
  %107 = and i32 %106, 1
  %.not113 = icmp eq i32 %107, 0
  br i1 %.not113, label %108, label %111

108:                                              ; preds = %100
  %109 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, i32 noundef 111) #5
  %.not114 = icmp eq i32 %109, 0
  br i1 %.not114, label %111, label %110

110:                                              ; preds = %108
  tail call void @llvm.trap()
  unreachable

111:                                              ; preds = %100, %108
  %112 = getelementptr inbounds i8, ptr %102, i64 164
  %113 = load i32, ptr %112, align 4, !tbaa !57
  %114 = and i32 %113, 65536
  %.not115 = icmp eq i32 %114, 0
  br i1 %.not115, label %115, label %118

115:                                              ; preds = %111
  %116 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 112) #5
  %.not116 = icmp eq i32 %116, 0
  br i1 %.not116, label %118, label %117

117:                                              ; preds = %115
  tail call void @llvm.trap()
  unreachable

118:                                              ; preds = %111, %115
  %119 = getelementptr inbounds i8, ptr %102, i64 144
  %120 = load i32, ptr %119, align 4, !tbaa !49
  %121 = icmp sgt i32 %120, 0
  br i1 %121, label %125, label %122

122:                                              ; preds = %118
  %123 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.1, i32 noundef 113) #5
  %.not117 = icmp eq i32 %123, 0
  br i1 %.not117, label %125, label %124

124:                                              ; preds = %122
  tail call void @llvm.trap()
  unreachable

125:                                              ; preds = %118, %122
  %126 = load i32, ptr %104, align 4, !tbaa !43
  %127 = icmp eq i32 %126, %1
  br i1 %127, label %131, label %128

128:                                              ; preds = %125
  %129 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.1, i32 noundef 114) #5
  %.not118 = icmp eq i32 %129, 0
  br i1 %.not118, label %131, label %130

130:                                              ; preds = %128
  tail call void @llvm.trap()
  unreachable

131:                                              ; preds = %128, %125
  tail call void @b2AddContactToGraph(ptr noundef %0, ptr noundef nonnull %102, ptr noundef nonnull %104) #5
  store i32 2, ptr %104, align 4, !tbaa !43
  %indvars.iv.next146 = add nuw nsw i64 %indvars.iv145, 1
  %exitcond149.not = icmp eq i64 %indvars.iv.next146, %wide.trip.count148
  br i1 %exitcond149.not, label %._crit_edge135, label %100, !llvm.loop !58

._crit_edge139:                                   ; preds = %150, %._crit_edge135
  %132 = getelementptr inbounds i8, ptr %9, i64 64
  %133 = getelementptr inbounds i8, ptr %9, i64 72
  %134 = load i32, ptr %133, align 8, !tbaa !59
  %135 = icmp sgt i32 %134, 0
  br i1 %135, label %.lr.ph142, label %._crit_edge143

.lr.ph142:                                        ; preds = %._crit_edge139
  %136 = getelementptr inbounds i8, ptr %0, i64 1192
  %137 = getelementptr inbounds i8, ptr %10, i64 64
  %138 = getelementptr inbounds i8, ptr %10, i64 72
  %wide.trip.count158 = zext nneg i32 %134 to i64
  br label %151

139:                                              ; preds = %.lr.ph138, %150
  %indvars.iv150 = phi i64 [ 0, %.lr.ph138 ], [ %indvars.iv.next151, %150 ]
  %140 = load ptr, ptr %95, align 8, !tbaa !60
  %141 = getelementptr inbounds %struct.b2JointSim, ptr %140, i64 %indvars.iv150
  %142 = load i32, ptr %141, align 4, !tbaa !61
  %143 = tail call ptr @b2JointArray_Get(ptr noundef nonnull %99, i32 noundef %142)
  %144 = getelementptr inbounds i8, ptr %143, i64 8
  %145 = load i32, ptr %144, align 8, !tbaa !63
  %146 = icmp eq i32 %145, %1
  br i1 %146, label %150, label %147

147:                                              ; preds = %139
  %148 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.1, i32 noundef 127) #5
  %.not112 = icmp eq i32 %148, 0
  br i1 %.not112, label %150, label %149

149:                                              ; preds = %147
  tail call void @llvm.trap()
  unreachable

150:                                              ; preds = %147, %139
  tail call void @b2AddJointToGraph(ptr noundef %0, ptr noundef nonnull %141, ptr noundef nonnull %143) #5
  store i32 2, ptr %144, align 8, !tbaa !63
  %indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1
  %exitcond154.not = icmp eq i64 %indvars.iv.next151, %wide.trip.count153
  br i1 %exitcond154.not, label %._crit_edge139, label %139, !llvm.loop !65

._crit_edge143:                                   ; preds = %151, %._crit_edge139
  tail call void @b2DestroySolverSet(ptr noundef %0, i32 noundef %1)
  tail call void @b2ValidateSolverSets(ptr noundef %0) #5
  ret void

151:                                              ; preds = %.lr.ph142, %151
  %indvars.iv155 = phi i64 [ 0, %.lr.ph142 ], [ %indvars.iv.next156, %151 ]
  %152 = load ptr, ptr %132, align 8, !tbaa !66
  %153 = getelementptr inbounds %struct.b2IslandSim, ptr %152, i64 %indvars.iv155
  %154 = load i32, ptr %153, align 4, !tbaa !67
  %155 = tail call ptr @b2IslandArray_Get(ptr noundef nonnull %136, i32 noundef %154)
  store i32 2, ptr %155, align 4, !tbaa !69
  %156 = load i32, ptr %138, align 8, !tbaa !59
  %157 = getelementptr inbounds i8, ptr %155, i64 4
  store i32 %156, ptr %157, align 4, !tbaa !71
  %158 = tail call ptr @b2IslandSimArray_Add(ptr noundef nonnull %137)
  %159 = load i32, ptr %153, align 4
  store i32 %159, ptr %158, align 4
  %indvars.iv.next156 = add nuw nsw i64 %indvars.iv155, 1
  %exitcond159.not = icmp eq i64 %indvars.iv.next156, %wide.trip.count158
  br i1 %exitcond159.not, label %._crit_edge143, label %151, !llvm.loop !72
}

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @b2BodySimArray_Add(ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @b2BodyStateArray_Add(ptr noundef) local_unnamed_addr #1

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @b2ContactSimArray_Add(ptr noundef) local_unnamed_addr #1

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

declare void @b2AddContactToGraph(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

declare void @b2AddJointToGraph(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @b2IslandSimArray_Add(ptr noundef) local_unnamed_addr #1

declare void @b2ValidateSolverSets(ptr noundef) local_unnamed_addr #3

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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, !8, i64 1032}
!6 = !{!"b2World", !7, i64 0, !13, i64 40, !16, i64 336, !17, i64 1008, !12, i64 1032, !17, i64 1048, !12, i64 1072, !17, i64 1088, !12, i64 1112, !17, i64 1128, !12, i64 1152, !17, i64 1168, !12, i64 1192, !17, i64 1208, !17, i64 1232, !12, i64 1256, !12, i64 1272, !12, i64 1288, !12, i64 1304, !12, i64 1320, !12, i64 1336, !12, i64 1352, !12, i64 1368, !9, i64 1384, !9, i64 1416, !11, i64 1448, !12, i64 1456, !18, i64 1472, !18, i64 1488, !18, i64 1504, !18, i64 1520, !19, i64 1536, !11, i64 1544, !20, i64 1548, !21, i64 1556, !21, i64 1560, !21, i64 1564, !21, i64 1568, !21, i64 1572, !21, i64 1576, !21, i64 1580, !21, i64 1584, !8, i64 1592, !8, i64 1600, !22, i64 1608, !23, i64 1612, !8, i64 1704, !8, i64 1712, !8, i64 1720, !8, i64 1728, !11, i64 1736, !8, i64 1744, !8, i64 1752, !8, i64 1760, !8, i64 1768, !8, i64 1776, !21, i64 1784, !11, i64 1788, !11, i64 1792, !22, i64 1796, !24, i64 1798, !24, i64 1799, !24, i64 1800, !24, i64 1801, !24, i64 1802, !24, i64 1803}
!7 = !{!"b2ArenaAllocator", !8, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !12, i64 24}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"", !8, i64 0, !11, i64 8, !11, i64 12}
!13 = !{!"b2BroadPhase", !9, i64 0, !11, i64 216, !14, i64 224, !12, i64 240, !8, i64 256, !8, i64 264, !11, i64 272, !15, i64 276, !14, i64 280}
!14 = !{!"b2HashSet", !8, i64 0, !11, i64 8, !11, i64 12}
!15 = !{!"b2AtomicInt", !11, i64 0}
!16 = !{!"b2ConstraintGraph", !9, i64 0}
!17 = !{!"b2IdPool", !12, i64 0, !11, i64 16}
!18 = !{!"b2BitSet", !8, i64 0, !11, i64 8, !11, i64 12}
!19 = !{!"long", !9, i64 0}
!20 = !{!"b2Vec2", !21, i64 0, !21, i64 4}
!21 = !{!"float", !9, i64 0}
!22 = !{!"short", !9, i64 0}
!23 = !{!"b2Profile", !21, i64 0, !21, i64 4, !21, i64 8, !21, i64 12, !21, i64 16, !21, i64 20, !21, i64 24, !21, i64 28, !21, i64 32, !21, i64 36, !21, i64 40, !21, i64 44, !21, i64 48, !21, i64 52, !21, i64 56, !21, i64 60, !21, i64 64, !21, i64 68, !21, i64 72, !21, i64 76, !21, i64 80, !21, i64 84}
!24 = !{!"_Bool", !9, i64 0}
!25 = !{!26, !11, i64 8}
!26 = !{!"b2SolverSet", !12, i64 0, !12, i64 16, !12, i64 32, !12, i64 48, !12, i64 64, !11, i64 80}
!27 = !{!26, !11, i64 56}
!28 = !{!26, !8, i64 0}
!29 = !{!30, !11, i64 88}
!30 = !{!"b2BodySim", !31, i64 0, !20, i64 16, !32, i64 24, !20, i64 32, !20, i64 40, !20, i64 48, !21, i64 56, !21, i64 60, !21, i64 64, !21, i64 68, !21, i64 72, !21, i64 76, !21, i64 80, !21, i64 84, !11, i64 88, !24, i64 92, !24, i64 93, !24, i64 94, !24, i64 95, !24, i64 96}
!31 = !{!"b2Transform", !20, i64 0, !32, i64 8}
!32 = !{!"b2Rot", !21, i64 0, !21, i64 4}
!33 = !{!34, !11, i64 40}
!34 = !{!"b2Body", !9, i64 0, !8, 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, !21, i64 88, !21, i64 92, !21, i64 96, !21, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !22, i64 116, !24, i64 118, !24, i64 119, !24, i64 120, !24, i64 121}
!35 = !{!34, !11, i64 44}
!36 = !{!34, !21, i64 100}
!37 = !{i64 0, i64 4, !38, i64 4, i64 4, !38, i64 8, i64 4, !38, i64 12, i64 4, !39, i64 16, i64 4, !38, i64 20, i64 4, !38, i64 24, i64 4, !38, i64 28, i64 4, !38}
!38 = !{!21, !21, i64 0}
!39 = !{!11, !11, i64 0}
!40 = !{!34, !11, i64 48}
!41 = !{!42, !11, i64 8}
!42 = !{!"b2ContactEdge", !11, i64 0, !11, i64 4, !11, i64 8}
!43 = !{!44, !11, i64 0}
!44 = !{!"b2Contact", !11, i64 0, !11, i64 4, !11, i64 8, !9, i64 12, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !24, i64 64}
!45 = distinct !{!45, !46}
!46 = !{!"llvm.loop.mustprogress"}
!47 = !{!44, !11, i64 8}
!48 = !{!44, !11, i64 60}
!49 = !{!50, !11, i64 144}
!50 = !{!"b2ContactSim", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !21, i64 20, !21, i64 24, !21, i64 28, !21, i64 32, !51, i64 36, !21, i64 148, !21, i64 152, !21, i64 156, !21, i64 160, !11, i64 164, !52, i64 168}
!51 = !{!"b2Manifold", !20, i64 0, !21, i64 8, !9, i64 12, !11, i64 108}
!52 = !{!"b2SimplexCache", !22, i64 0, !9, i64 2, !9, i64 5}
!53 = !{!26, !8, i64 48}
!54 = !{!50, !11, i64 0}
!55 = distinct !{!55, !46}
!56 = !{!26, !11, i64 40}
!57 = !{!50, !11, i64 164}
!58 = distinct !{!58, !46}
!59 = !{!26, !11, i64 72}
!60 = !{!26, !8, i64 32}
!61 = !{!62, !11, i64 0}
!62 = !{!"b2JointSim", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !20, i64 16, !20, i64 24, !21, i64 32, !21, i64 36, !21, i64 40, !21, i64 44, !9, i64 48}
!63 = !{!64, !11, i64 8}
!64 = !{!"b2Joint", !8, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !9, i64 20, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !21, i64 60, !11, i64 64, !22, i64 68, !24, i64 70, !24, i64 71}
!65 = distinct !{!65, !46}
!66 = !{!26, !8, i64 64}
!67 = !{!68, !11, i64 0}
!68 = !{!"b2IslandSim", !11, i64 0}
!69 = !{!70, !11, i64 0}
!70 = !{!"b2Island", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !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}
!71 = !{!70, !11, i64 4}
!72 = distinct !{!72, !46}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass