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

; 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.b2Contact = type { i32, i32, i32, [2 x %struct.b2ContactEdge], i32, i32, i32, i32, i32, i32, i32, i8 }
%struct.b2ContactEdge = type { i32, i32, 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.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.b2Vec2 = type { float, float }
%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.b2Island = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }

@.str.1 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [39 x i8], align 1

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @b2LinkContact(ptr noundef %0, ptr noundef %1) #4 {
  %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 i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  br label %18

18:                                               ; preds = %2
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.b2Contact, ptr %19, i32 0, i32 10
  %21 = load i32, ptr %20, align 4, !tbaa !9
  %22 = and i32 %21, 1
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %28, label %24

24:                                               ; preds = %18
  %25 = call i32 @b2InternalAssertFcn(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 118)
  %26 = icmp ne i32 %25, 0
  br i1 %26, label %27, label %28

27:                                               ; preds = %24
  call void @llvm.trap()
  br label %28

28:                                               ; preds = %27, %24, %18
  br label %29

29:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.b2Contact, ptr %30, i32 0, i32 3
  %32 = getelementptr inbounds [2 x %struct.b2ContactEdge], ptr %31, i64 0, i64 0
  %33 = getelementptr inbounds %struct.b2ContactEdge, ptr %32, i32 0, i32 0
  %34 = load i32, ptr %33, align 4, !tbaa !13
  store i32 %34, ptr %5, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.b2Contact, ptr %35, i32 0, i32 3
  %37 = getelementptr inbounds [2 x %struct.b2ContactEdge], ptr %36, i64 0, i64 1
  %38 = getelementptr inbounds %struct.b2ContactEdge, ptr %37, i32 0, i32 0
  %39 = load i32, ptr %38, align 4, !tbaa !13
  store i32 %39, ptr %6, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %40 = load ptr, ptr %3, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.b2World, ptr %40, i32 0, i32 4
  %42 = load i32, ptr %5, align 4, !tbaa !15
  %43 = call ptr @b2BodyArray_Get(ptr noundef %41, i32 noundef %42)
  store ptr %43, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.b2World, ptr %44, i32 0, i32 4
  %46 = load i32, ptr %6, align 4, !tbaa !15
  %47 = call ptr @b2BodyArray_Get(ptr noundef %45, i32 noundef %46)
  store ptr %47, ptr %8, align 8, !tbaa !5
  br label %48

48:                                               ; preds = %29
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.b2Body, ptr %49, i32 0, i32 2
  %51 = load i32, ptr %50, align 8, !tbaa !16
  %52 = icmp ne i32 %51, 1
  br i1 %52, label %53, label %58

53:                                               ; preds = %48
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.b2Body, ptr %54, i32 0, i32 2
  %56 = load i32, ptr %55, align 8, !tbaa !16
  %57 = icmp ne i32 %56, 1
  br i1 %57, label %62, label %58

58:                                               ; preds = %53, %48
  %59 = call i32 @b2InternalAssertFcn(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 126)
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %61, label %62

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

62:                                               ; preds = %61, %58, %53
  br label %63

63:                                               ; preds = %62
  br label %64

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.b2Body, ptr %66, i32 0, i32 2
  %68 = load i32, ptr %67, align 8, !tbaa !16
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %79, label %70

70:                                               ; preds = %65
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.b2Body, ptr %71, i32 0, i32 2
  %73 = load i32, ptr %72, align 8, !tbaa !16
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %79, label %75

75:                                               ; preds = %70
  %76 = call i32 @b2InternalAssertFcn(ptr noundef @.str.6, ptr noundef @.str.1, i32 noundef 127)
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %78, label %79

78:                                               ; preds = %75
  call void @llvm.trap()
  br label %79

79:                                               ; preds = %78, %75, %70, %65
  br label %80

80:                                               ; preds = %79
  br label %81

81:                                               ; preds = %80
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.b2Body, ptr %82, i32 0, i32 2
  %84 = load i32, ptr %83, align 8, !tbaa !16
  %85 = icmp eq i32 %84, 2
  br i1 %85, label %86, label %96

86:                                               ; preds = %81
  %87 = load ptr, ptr %8, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.b2Body, ptr %87, i32 0, i32 2
  %89 = load i32, ptr %88, align 8, !tbaa !16
  %90 = icmp sge i32 %89, 3
  br i1 %90, label %91, label %96

91:                                               ; preds = %86
  %92 = load ptr, ptr %3, align 8, !tbaa !5
  %93 = load ptr, ptr %8, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.b2Body, ptr %93, i32 0, i32 2
  %95 = load i32, ptr %94, align 8, !tbaa !16
  call void @b2WakeSolverSet(ptr noundef %92, i32 noundef %95)
  br label %96

96:                                               ; preds = %91, %86, %81
  %97 = load ptr, ptr %8, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.b2Body, ptr %97, i32 0, i32 2
  %99 = load i32, ptr %98, align 8, !tbaa !16
  %100 = icmp eq i32 %99, 2
  br i1 %100, label %101, label %111

101:                                              ; preds = %96
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.b2Body, ptr %102, i32 0, i32 2
  %104 = load i32, ptr %103, align 8, !tbaa !16
  %105 = icmp sge i32 %104, 3
  br i1 %105, label %106, label %111

106:                                              ; preds = %101
  %107 = load ptr, ptr %3, align 8, !tbaa !5
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.b2Body, ptr %108, i32 0, i32 2
  %110 = load i32, ptr %109, align 8, !tbaa !16
  call void @b2WakeSolverSet(ptr noundef %107, i32 noundef %110)
  br label %111

111:                                              ; preds = %106, %101, %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %112 = load ptr, ptr %7, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.b2Body, ptr %112, i32 0, i32 11
  %114 = load i32, ptr %113, align 4, !tbaa !20
  store i32 %114, ptr %9, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %115 = load ptr, ptr %8, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.b2Body, ptr %115, i32 0, i32 11
  %117 = load i32, ptr %116, align 4, !tbaa !20
  store i32 %117, ptr %10, align 4, !tbaa !15
  br label %118

118:                                              ; preds = %111
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.b2Body, ptr %119, i32 0, i32 2
  %121 = load i32, ptr %120, align 8, !tbaa !16
  %122 = icmp ne i32 %121, 0
  br i1 %122, label %130, label %123

123:                                              ; preds = %118
  %124 = load i32, ptr %9, align 4, !tbaa !15
  %125 = icmp eq i32 %124, -1
  br i1 %125, label %130, label %126

126:                                              ; preds = %123
  %127 = call i32 @b2InternalAssertFcn(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 145)
  %128 = icmp ne i32 %127, 0
  br i1 %128, label %129, label %130

129:                                              ; preds = %126
  call void @llvm.trap()
  br label %130

130:                                              ; preds = %129, %126, %123, %118
  br label %131

131:                                              ; preds = %130
  br label %132

132:                                              ; preds = %131
  br label %133

133:                                              ; preds = %132
  %134 = load ptr, ptr %8, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.b2Body, ptr %134, i32 0, i32 2
  %136 = load i32, ptr %135, align 8, !tbaa !16
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %145, label %138

138:                                              ; preds = %133
  %139 = load i32, ptr %10, align 4, !tbaa !15
  %140 = icmp eq i32 %139, -1
  br i1 %140, label %145, label %141

141:                                              ; preds = %138
  %142 = call i32 @b2InternalAssertFcn(ptr noundef @.str.8, ptr noundef @.str.1, i32 noundef 146)
  %143 = icmp ne i32 %142, 0
  br i1 %143, label %144, label %145

144:                                              ; preds = %141
  call void @llvm.trap()
  br label %145

145:                                              ; preds = %144, %141, %138, %133
  br label %146

146:                                              ; preds = %145
  br label %147

147:                                              ; preds = %146
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %9, align 4, !tbaa !15
  %150 = icmp ne i32 %149, -1
  br i1 %150, label %158, label %151

151:                                              ; preds = %148
  %152 = load i32, ptr %10, align 4, !tbaa !15
  %153 = icmp ne i32 %152, -1
  br i1 %153, label %158, label %154

154:                                              ; preds = %151
  %155 = call i32 @b2InternalAssertFcn(ptr noundef @.str.9, ptr noundef @.str.1, i32 noundef 147)
  %156 = icmp ne i32 %155, 0
  br i1 %156, label %157, label %158

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

158:                                              ; preds = %157, %154, %151, %148
  br label %159

159:                                              ; preds = %158
  br label %160

160:                                              ; preds = %159
  %161 = load i32, ptr %9, align 4, !tbaa !15
  %162 = load i32, ptr %10, align 4, !tbaa !15
  %163 = icmp eq i32 %161, %162
  br i1 %163, label %164, label %168

164:                                              ; preds = %160
  %165 = load ptr, ptr %3, align 8, !tbaa !5
  %166 = load i32, ptr %9, align 4, !tbaa !15
  %167 = load ptr, ptr %4, align 8, !tbaa !5
  call void @b2AddContactToIsland(ptr noundef %165, i32 noundef %166, ptr noundef %167)
  store i32 1, ptr %11, align 4
  br label %304

168:                                              ; preds = %160
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store ptr null, ptr %12, align 8, !tbaa !5
  %169 = load i32, ptr %9, align 4, !tbaa !15
  %170 = icmp ne i32 %169, -1
  br i1 %170, label %171, label %204

171:                                              ; preds = %168
  %172 = load ptr, ptr %3, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.b2World, ptr %172, i32 0, i32 12
  %174 = load i32, ptr %9, align 4, !tbaa !15
  %175 = call ptr @b2IslandArray_Get(ptr noundef %173, i32 noundef %174)
  store ptr %175, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %176 = load ptr, ptr %12, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.b2Island, ptr %176, i32 0, i32 12
  %178 = load i32, ptr %177, align 4, !tbaa !21
  store i32 %178, ptr %13, align 4, !tbaa !15
  br label %179

179:                                              ; preds = %197, %171
  %180 = load i32, ptr %13, align 4, !tbaa !15
  %181 = icmp ne i32 %180, -1
  br i1 %181, label %182, label %203

182:                                              ; preds = %179
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %183 = load ptr, ptr %3, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.b2World, ptr %183, i32 0, i32 12
  %185 = load i32, ptr %13, align 4, !tbaa !15
  %186 = call ptr @b2IslandArray_Get(ptr noundef %184, i32 noundef %185)
  store ptr %186, ptr %14, align 8, !tbaa !5
  %187 = load ptr, ptr %14, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.b2Island, ptr %187, i32 0, i32 12
  %189 = load i32, ptr %188, align 4, !tbaa !21
  %190 = icmp ne i32 %189, -1
  br i1 %190, label %191, label %197

191:                                              ; preds = %182
  %192 = load ptr, ptr %14, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.b2Island, ptr %192, i32 0, i32 12
  %194 = load i32, ptr %193, align 4, !tbaa !21
  %195 = load ptr, ptr %12, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.b2Island, ptr %195, i32 0, i32 12
  store i32 %194, ptr %196, align 4, !tbaa !21
  br label %197

197:                                              ; preds = %191, %182
  %198 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %198, ptr %12, align 8, !tbaa !5
  %199 = load i32, ptr %13, align 4, !tbaa !15
  store i32 %199, ptr %9, align 4, !tbaa !15
  %200 = load ptr, ptr %12, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.b2Island, ptr %200, i32 0, i32 12
  %202 = load i32, ptr %201, align 4, !tbaa !21
  store i32 %202, ptr %13, align 4, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %179, !llvm.loop !23

203:                                              ; preds = %179
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %204

204:                                              ; preds = %203, %168
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store ptr null, ptr %15, align 8, !tbaa !5
  %205 = load i32, ptr %10, align 4, !tbaa !15
  %206 = icmp ne i32 %205, -1
  br i1 %206, label %207, label %242

207:                                              ; preds = %204
  %208 = load ptr, ptr %3, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.b2World, ptr %208, i32 0, i32 12
  %210 = load i32, ptr %10, align 4, !tbaa !15
  %211 = call ptr @b2IslandArray_Get(ptr noundef %209, i32 noundef %210)
  store ptr %211, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %212 = load ptr, ptr %15, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.b2Island, ptr %212, i32 0, i32 12
  %214 = load i32, ptr %213, align 4, !tbaa !21
  store i32 %214, ptr %16, align 4, !tbaa !15
  br label %215

215:                                              ; preds = %235, %207
  %216 = load ptr, ptr %15, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.b2Island, ptr %216, i32 0, i32 12
  %218 = load i32, ptr %217, align 4, !tbaa !21
  %219 = icmp ne i32 %218, -1
  br i1 %219, label %220, label %241

220:                                              ; preds = %215
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %221 = load ptr, ptr %3, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.b2World, ptr %221, i32 0, i32 12
  %223 = load i32, ptr %16, align 4, !tbaa !15
  %224 = call ptr @b2IslandArray_Get(ptr noundef %222, i32 noundef %223)
  store ptr %224, ptr %17, align 8, !tbaa !5
  %225 = load ptr, ptr %17, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.b2Island, ptr %225, i32 0, i32 12
  %227 = load i32, ptr %226, align 4, !tbaa !21
  %228 = icmp ne i32 %227, -1
  br i1 %228, label %229, label %235

229:                                              ; preds = %220
  %230 = load ptr, ptr %17, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.b2Island, ptr %230, i32 0, i32 12
  %232 = load i32, ptr %231, align 4, !tbaa !21
  %233 = load ptr, ptr %15, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.b2Island, ptr %233, i32 0, i32 12
  store i32 %232, ptr %234, align 4, !tbaa !21
  br label %235

235:                                              ; preds = %229, %220
  %236 = load ptr, ptr %17, align 8, !tbaa !5
  store ptr %236, ptr %15, align 8, !tbaa !5
  %237 = load i32, ptr %16, align 4, !tbaa !15
  store i32 %237, ptr %10, align 4, !tbaa !15
  %238 = load ptr, ptr %15, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.b2Island, ptr %238, i32 0, i32 12
  %240 = load i32, ptr %239, align 4, !tbaa !21
  store i32 %240, ptr %16, align 4, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %215, !llvm.loop !25

241:                                              ; preds = %215
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %242

242:                                              ; preds = %241, %204
  br label %243

243:                                              ; preds = %242
  %244 = load ptr, ptr %12, align 8, !tbaa !5
  %245 = icmp ne ptr %244, null
  br i1 %245, label %253, label %246

246:                                              ; preds = %243
  %247 = load ptr, ptr %15, align 8, !tbaa !5
  %248 = icmp ne ptr %247, null
  br i1 %248, label %253, label %249

249:                                              ; preds = %246
  %250 = call i32 @b2InternalAssertFcn(ptr noundef @.str.10, ptr noundef @.str.1, i32 noundef 198)
  %251 = icmp ne i32 %250, 0
  br i1 %251, label %252, label %253

252:                                              ; preds = %249
  call void @llvm.trap()
  br label %253

253:                                              ; preds = %252, %249, %246, %243
  br label %254

254:                                              ; preds = %253
  br label %255

255:                                              ; preds = %254
  %256 = load ptr, ptr %12, align 8, !tbaa !5
  %257 = load ptr, ptr %15, align 8, !tbaa !5
  %258 = icmp ne ptr %256, %257
  br i1 %258, label %259, label %292

259:                                              ; preds = %255
  %260 = load ptr, ptr %12, align 8, !tbaa !5
  %261 = icmp ne ptr %260, null
  br i1 %261, label %262, label %292

262:                                              ; preds = %259
  %263 = load ptr, ptr %15, align 8, !tbaa !5
  %264 = icmp ne ptr %263, null
  br i1 %264, label %265, label %292

265:                                              ; preds = %262
  br label %266

266:                                              ; preds = %265
  %267 = load ptr, ptr %12, align 8, !tbaa !5
  %268 = load ptr, ptr %15, align 8, !tbaa !5
  %269 = icmp ne ptr %267, %268
  br i1 %269, label %274, label %270

270:                                              ; preds = %266
  %271 = call i32 @b2InternalAssertFcn(ptr noundef @.str.11, ptr noundef @.str.1, i32 noundef 203)
  %272 = icmp ne i32 %271, 0
  br i1 %272, label %273, label %274

273:                                              ; preds = %270
  call void @llvm.trap()
  br label %274

274:                                              ; preds = %273, %270, %266
  br label %275

275:                                              ; preds = %274
  br label %276

276:                                              ; preds = %275
  br label %277

277:                                              ; preds = %276
  %278 = load ptr, ptr %15, align 8, !tbaa !5
  %279 = getelementptr inbounds %struct.b2Island, ptr %278, i32 0, i32 12
  %280 = load i32, ptr %279, align 4, !tbaa !21
  %281 = icmp eq i32 %280, -1
  br i1 %281, label %286, label %282

282:                                              ; preds = %277
  %283 = call i32 @b2InternalAssertFcn(ptr noundef @.str.12, ptr noundef @.str.1, i32 noundef 204)
  %284 = icmp ne i32 %283, 0
  br i1 %284, label %285, label %286

285:                                              ; preds = %282
  call void @llvm.trap()
  br label %286

286:                                              ; preds = %285, %282, %277
  br label %287

287:                                              ; preds = %286
  br label %288

288:                                              ; preds = %287
  %289 = load i32, ptr %9, align 4, !tbaa !15
  %290 = load ptr, ptr %15, align 8, !tbaa !5
  %291 = getelementptr inbounds %struct.b2Island, ptr %290, i32 0, i32 12
  store i32 %289, ptr %291, align 4, !tbaa !21
  br label %292

292:                                              ; preds = %288, %262, %259, %255
  %293 = load ptr, ptr %12, align 8, !tbaa !5
  %294 = icmp ne ptr %293, null
  br i1 %294, label %295, label %299

295:                                              ; preds = %292
  %296 = load ptr, ptr %3, align 8, !tbaa !5
  %297 = load i32, ptr %9, align 4, !tbaa !15
  %298 = load ptr, ptr %4, align 8, !tbaa !5
  call void @b2AddContactToIsland(ptr noundef %296, i32 noundef %297, ptr noundef %298)
  br label %303

299:                                              ; preds = %292
  %300 = load ptr, ptr %3, align 8, !tbaa !5
  %301 = load i32, ptr %10, align 4, !tbaa !15
  %302 = load ptr, ptr %4, align 8, !tbaa !5
  call void @b2AddContactToIsland(ptr noundef %300, i32 noundef %301, ptr noundef %302)
  br label %303

303:                                              ; preds = %299, %295
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  store i32 0, ptr %11, align 4
  br label %304

304:                                              ; preds = %303, %164
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  %305 = load i32, ptr %11, align 4
  switch i32 %305, label %307 [
    i32 0, label %306
    i32 1, label %306
  ]

306:                                              ; preds = %304, %304
  ret void

307:                                              ; preds = %304
  unreachable
}

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

declare void @b2WakeSolverSet(ptr noundef, i32 noundef) #0

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 60}
!10 = !{!"b2Contact", !11, i64 0, !11, i64 4, !11, i64 8, !7, i64 12, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !12, i64 64}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{!14, !11, i64 0}
!14 = !{!"b2ContactEdge", !11, i64 0, !11, i64 4, !11, i64 8}
!15 = !{!11, !11, i64 0}
!16 = !{!17, !11, i64 40}
!17 = !{!"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, !18, i64 88, !18, i64 92, !18, i64 96, !18, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !19, i64 116, !12, i64 118, !12, i64 119, !12, i64 120, !12, i64 121}
!18 = !{!"float", !7, i64 0}
!19 = !{!"short", !7, i64 0}
!20 = !{!17, !11, i64 76}
!21 = !{!22, !11, i64 48}
!22 = !{!"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}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}


; 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"

@.str.1 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [39 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 ptr @b2IslandArray_Get(ptr noundef, i32 noundef) local_unnamed_addr #2

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

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

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

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

19:                                               ; preds = %9
  %20 = getelementptr inbounds i8, ptr %16, i64 40
  %21 = load i32, ptr %20, align 8, !tbaa !13
  %.not103 = icmp eq i32 %21, 1
  br i1 %.not103, label %22, label %25

22:                                               ; preds = %19, %9
  %23 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 126) #4
  %.not104 = icmp eq i32 %23, 0
  br i1 %.not104, label %._crit_edge, label %24

._crit_edge:                                      ; preds = %22
  %.pre = load i32, ptr %17, align 8, !tbaa !13
  br label %25

24:                                               ; preds = %22
  tail call void @llvm.trap()
  unreachable

25:                                               ; preds = %._crit_edge, %19
  %26 = phi i32 [ %.pre, %._crit_edge ], [ %18, %19 ]
  %.not105 = icmp eq i32 %26, 0
  br i1 %.not105, label %27, label %thread-pre-split

27:                                               ; preds = %25
  %28 = getelementptr inbounds i8, ptr %16, i64 40
  %29 = load i32, ptr %28, align 8, !tbaa !13
  %.not106 = icmp eq i32 %29, 0
  br i1 %.not106, label %30, label %thread-pre-split.thread

30:                                               ; preds = %27
  %31 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, i32 noundef 127) #4
  %.not107 = icmp eq i32 %31, 0
  br i1 %.not107, label %.thread-pre-split_crit_edge, label %32

.thread-pre-split_crit_edge:                      ; preds = %30
  %.pr.pre = load i32, ptr %17, align 8, !tbaa !13
  br label %thread-pre-split

32:                                               ; preds = %30
  tail call void @llvm.trap()
  unreachable

thread-pre-split:                                 ; preds = %.thread-pre-split_crit_edge, %25
  %.pre138142 = phi i32 [ %26, %25 ], [ %.pr.pre, %.thread-pre-split_crit_edge ]
  %33 = icmp eq i32 %.pre138142, 2
  br i1 %33, label %34, label %thread-pre-split.thread

34:                                               ; preds = %thread-pre-split
  %35 = getelementptr inbounds i8, ptr %16, i64 40
  %36 = load i32, ptr %35, align 8, !tbaa !13
  %37 = icmp sgt i32 %36, 2
  br i1 %37, label %38, label %thread-pre-split.thread

38:                                               ; preds = %34
  tail call void @b2WakeSolverSet(ptr noundef %0, i32 noundef %36) #4
  %.pre138.pre = load i32, ptr %17, align 8, !tbaa !13
  br label %thread-pre-split.thread

thread-pre-split.thread:                          ; preds = %27, %38, %34, %thread-pre-split
  %.pre138 = phi i32 [ %.pre138.pre, %38 ], [ 2, %34 ], [ %.pre138142, %thread-pre-split ], [ 0, %27 ]
  %39 = getelementptr inbounds i8, ptr %16, i64 40
  %40 = load i32, ptr %39, align 8, !tbaa !13
  %41 = icmp eq i32 %40, 2
  %42 = icmp sgt i32 %.pre138, 2
  %or.cond189 = select i1 %41, i1 %42, i1 false
  br i1 %or.cond189, label %43, label %44

43:                                               ; preds = %thread-pre-split.thread
  tail call void @b2WakeSolverSet(ptr noundef %0, i32 noundef %.pre138) #4
  %.pre137 = load i32, ptr %17, align 8, !tbaa !13
  br label %44

44:                                               ; preds = %43, %thread-pre-split.thread
  %45 = phi i32 [ %.pre137, %43 ], [ %.pre138, %thread-pre-split.thread ]
  %46 = getelementptr inbounds i8, ptr %15, i64 76
  %47 = load i32, ptr %46, align 4, !tbaa !18
  %48 = getelementptr inbounds i8, ptr %16, i64 76
  %49 = load i32, ptr %48, align 4, !tbaa !18
  %50 = icmp ne i32 %45, 0
  %51 = icmp eq i32 %47, -1
  %or.cond = select i1 %50, i1 true, i1 %51
  br i1 %or.cond, label %55, label %52

52:                                               ; preds = %44
  %53 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 145) #4
  %.not108 = icmp eq i32 %53, 0
  br i1 %.not108, label %55, label %54

54:                                               ; preds = %52
  tail call void @llvm.trap()
  unreachable

55:                                               ; preds = %44, %52
  %56 = load i32, ptr %39, align 8, !tbaa !13
  %57 = icmp ne i32 %56, 0
  %58 = icmp eq i32 %49, -1
  %or.cond3 = select i1 %57, i1 true, i1 %58
  br i1 %or.cond3, label %63, label %59

59:                                               ; preds = %55
  %60 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.1, i32 noundef 146) #4
  %.not109 = icmp eq i32 %60, 0
  br i1 %.not109, label %.thread, label %62

.thread:                                          ; preds = %59
  %61 = icmp ne i32 %47, -1
  br label %69

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

63:                                               ; preds = %55
  %64 = icmp ne i32 %47, -1
  %65 = icmp ne i32 %49, -1
  %or.cond5 = select i1 %64, i1 true, i1 %65
  br i1 %or.cond5, label %69, label %66

66:                                               ; preds = %63
  %67 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.1, i32 noundef 147) #4
  %.not110 = icmp eq i32 %67, 0
  br i1 %.not110, label %.thread146, label %68

68:                                               ; preds = %66
  tail call void @llvm.trap()
  unreachable

69:                                               ; preds = %.thread, %63
  %70 = phi i1 [ true, %.thread ], [ %65, %63 ]
  %71 = phi i1 [ %61, %.thread ], [ %64, %63 ]
  %72 = icmp eq i32 %47, %49
  br i1 %72, label %.thread146, label %73

.thread146:                                       ; preds = %66, %69
  tail call void @b2AddContactToIsland(ptr noundef %0, i32 noundef %47, ptr noundef nonnull %1)
  br label %106

73:                                               ; preds = %69
  br i1 %71, label %74, label %.loopexit

74:                                               ; preds = %73
  %75 = getelementptr inbounds i8, ptr %0, i64 1192
  %76 = tail call ptr @b2IslandArray_Get(ptr noundef nonnull %75, i32 noundef %47)
  %77 = getelementptr inbounds i8, ptr %76, i64 48
  %.091124 = load i32, ptr %77, align 4, !tbaa !19
  %.not111125 = icmp eq i32 %.091124, -1
  br i1 %.not111125, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %74, %81
  %.091127 = phi i32 [ %.091.pre, %81 ], [ %.091124, %74 ]
  %.092126 = phi ptr [ %78, %81 ], [ %76, %74 ]
  %78 = tail call ptr @b2IslandArray_Get(ptr noundef nonnull %75, i32 noundef %.091127)
  %79 = getelementptr inbounds i8, ptr %78, i64 48
  %80 = load i32, ptr %79, align 4, !tbaa !19
  %.not116 = icmp eq i32 %80, -1
  br i1 %.not116, label %.thread148, label %81

.thread148:                                       ; preds = %.lr.ph
  br i1 %70, label %83, label %.thread173.thread

81:                                               ; preds = %.lr.ph
  %82 = getelementptr inbounds i8, ptr %.092126, i64 48
  store i32 %80, ptr %82, align 4, !tbaa !19
  %.091.pre = load i32, ptr %79, align 4, !tbaa !19
  %.not111 = icmp eq i32 %.091.pre, -1
  br i1 %.not111, label %.loopexit, label %.lr.ph, !llvm.loop !21

.loopexit:                                        ; preds = %81, %74, %73
  %.193 = phi ptr [ null, %73 ], [ %76, %74 ], [ %78, %81 ]
  %.1 = phi i32 [ -1, %73 ], [ %47, %74 ], [ %.091127, %81 ]
  br i1 %70, label %83, label %92

83:                                               ; preds = %.thread148, %.loopexit
  %.1158 = phi i32 [ %.091127, %.thread148 ], [ %.1, %.loopexit ]
  %.193157 = phi ptr [ %78, %.thread148 ], [ %.193, %.loopexit ]
  %84 = getelementptr inbounds i8, ptr %0, i64 1192
  %85 = tail call ptr @b2IslandArray_Get(ptr noundef nonnull %84, i32 noundef %49)
  %86 = getelementptr inbounds i8, ptr %85, i64 48
  %.086129 = load i32, ptr %86, align 4, !tbaa !19
  %.not112130 = icmp eq i32 %.086129, -1
  br i1 %.not112130, label %.thread159, label %.lr.ph132

.lr.ph132:                                        ; preds = %83, %90
  %.pn = phi ptr [ %87, %90 ], [ %85, %83 ]
  %.086131 = phi i32 [ %.086.pre, %90 ], [ %.086129, %83 ]
  %87 = tail call ptr @b2IslandArray_Get(ptr noundef nonnull %84, i32 noundef %.086131)
  %88 = getelementptr inbounds i8, ptr %87, i64 48
  %89 = load i32, ptr %88, align 4, !tbaa !19
  %.not115 = icmp eq i32 %89, -1
  br i1 %.not115, label %.thread159, label %90

90:                                               ; preds = %.lr.ph132
  %91 = getelementptr inbounds i8, ptr %.pn, i64 48
  store i32 %89, ptr %91, align 4, !tbaa !19
  %.086.pre = load i32, ptr %88, align 4, !tbaa !19
  %.not112 = icmp eq i32 %.086.pre, -1
  br i1 %.not112, label %.thread159, label %.lr.ph132, !llvm.loop !23

92:                                               ; preds = %.loopexit
  %.not144 = icmp eq ptr %.193, null
  br i1 %.not144, label %.thread162, label %.thread173.thread

.thread162:                                       ; preds = %92
  %93 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.1, i32 noundef 198) #4
  %.not113 = icmp eq i32 %93, 0
  br i1 %.not113, label %.thread173, label %94

94:                                               ; preds = %.thread162
  tail call void @llvm.trap()
  unreachable

.thread159:                                       ; preds = %.lr.ph132, %90, %83
  %.089.lcssa = phi i32 [ %49, %83 ], [ %.086131, %90 ], [ %.086131, %.lr.ph132 ]
  %.087.lcssa = phi ptr [ %85, %83 ], [ %87, %90 ], [ %87, %.lr.ph132 ]
  %95 = icmp ne ptr %.193157, null
  %96 = icmp ne ptr %.193157, %.087.lcssa
  %or.cond9 = and i1 %95, %96
  br i1 %or.cond9, label %97, label %105

97:                                               ; preds = %.thread159
  %98 = getelementptr inbounds i8, ptr %.087.lcssa, i64 48
  %99 = load i32, ptr %98, align 4, !tbaa !19
  %100 = icmp eq i32 %99, -1
  br i1 %100, label %104, label %101

101:                                              ; preds = %97
  %102 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.1, i32 noundef 204) #4
  %.not114 = icmp eq i32 %102, 0
  br i1 %.not114, label %104, label %103

103:                                              ; preds = %101
  tail call void @llvm.trap()
  unreachable

104:                                              ; preds = %101, %97
  store i32 %.1158, ptr %98, align 4, !tbaa !19
  br label %.thread173.thread

105:                                              ; preds = %.thread159
  br i1 %95, label %.thread173.thread, label %.thread173

.thread173.thread:                                ; preds = %.thread148, %92, %104, %105
  %.1155180183 = phi i32 [ %.1158, %105 ], [ %.1158, %104 ], [ %.091127, %.thread148 ], [ %.1, %92 ]
  tail call void @b2AddContactToIsland(ptr noundef %0, i32 noundef %.1155180183, ptr noundef %1)
  br label %106

.thread173:                                       ; preds = %.thread162, %105
  %.190122181182 = phi i32 [ %.089.lcssa, %105 ], [ -1, %.thread162 ]
  tail call void @b2AddContactToIsland(ptr noundef %0, i32 noundef %.190122181182, ptr noundef %1)
  br label %106

106:                                              ; preds = %.thread173.thread, %.thread173, %.thread146
  ret void
}

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

declare void @b2WakeSolverSet(ptr noundef, i32 noundef) local_unnamed_addr #0

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

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"="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 = { 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 }

!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 60}
!6 = !{!"b2Contact", !7, i64 0, !7, i64 4, !7, i64 8, !8, i64 12, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !10, i64 64}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_Bool", !8, i64 0}
!11 = !{!12, !7, i64 0}
!12 = !{!"b2ContactEdge", !7, i64 0, !7, i64 4, !7, i64 8}
!13 = !{!14, !7, i64 40}
!14 = !{!"b2Body", !8, i64 0, !15, 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, !16, i64 88, !16, i64 92, !16, i64 96, !16, i64 100, !7, i64 104, !7, i64 108, !7, i64 112, !17, i64 116, !10, i64 118, !10, i64 119, !10, i64 120, !10, i64 121}
!15 = !{!"any pointer", !8, i64 0}
!16 = !{!"float", !8, i64 0}
!17 = !{!"short", !8, i64 0}
!18 = !{!14, !7, i64 76}
!19 = !{!20, !7, i64 48}
!20 = !{!"b2Island", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}


; Effective O3 passes: ADCEPass,ConstraintEliminationPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass