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

; 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.b2ContactRegister = type { ptr, i8 }
%struct.b2SimplexCache = type { i16, [3 x i8], [3 x 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.b2Manifold = type { %struct.b2Vec2, float, [2 x %struct.b2ManifoldPoint], i32 }
%struct.b2Vec2 = type { float, float }
%struct.b2ManifoldPoint = type { %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, float, float, float, float, float, i16, i8 }
%struct.b2Shape = type { i32, i32, i32, i32, i32, i32, float, float, float, float, float, i32, %struct.b2AABB, %struct.b2AABB, %struct.b2Vec2, i32, %struct.b2Filter, ptr, i32, %union.anon, i16, i8, i8, i8, i8, i8 }
%struct.b2AABB = type { %struct.b2Vec2, %struct.b2Vec2 }
%struct.b2Filter = type { i64, i64, i32 }
%union.anon = type { %struct.b2Polygon }
%struct.b2Polygon = type { [8 x %struct.b2Vec2], [8 x %struct.b2Vec2], %struct.b2Vec2, float, 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.0 }
%struct.b2ContactSimArray = type { ptr, i32, i32 }
%struct.b2JointSimArray = type { ptr, i32, i32 }
%union.anon.0 = type { ptr }
%struct.b2BodyArray = type { ptr, i32, i32 }
%struct.b2SolverSetArray = type { ptr, i32, i32 }
%struct.b2JointArray = type { ptr, i32, i32 }
%struct.b2ContactArray = type { ptr, i32, i32 }
%struct.b2IslandArray = type { ptr, i32, i32 }
%struct.b2IdPool = type { %struct.b2IntArray, i32 }
%struct.b2ShapeArray = type { ptr, i32, i32 }
%struct.b2ChainShapeArray = type { ptr, i32, i32 }
%struct.b2SensorArray = type { ptr, i32, i32 }
%struct.b2TaskContextArray = type { ptr, i32, i32 }
%struct.b2SensorTaskContextArray = type { ptr, i32, i32 }
%struct.b2BodyMoveEventArray = type { ptr, i32, i32 }
%struct.b2SensorBeginTouchEventArray = type { ptr, i32, i32 }
%struct.b2ContactBeginTouchEventArray = type { ptr, i32, i32 }
%struct.b2SensorEndTouchEventArray = type { ptr, i32, i32 }
%struct.b2ContactEndTouchEventArray = type { ptr, i32, i32 }
%struct.b2ContactHitEventArray = type { ptr, i32, i32 }
%struct.b2BitSet = type { ptr, i32, i32 }
%struct.b2Profile = type { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float }
%struct.b2Body = type { [32 x i8], ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, float, float, float, i32, i32, i32, i16, i8, i8, i8, i8 }
%struct.b2SolverSet = type { %struct.b2BodySimArray, %struct.b2BodyStateArray, %struct.b2JointSimArray, %struct.b2ContactSimArray, %struct.b2IslandSimArray, i32 }
%struct.b2BodySimArray = type { ptr, i32, i32 }
%struct.b2BodyStateArray = type { ptr, i32, i32 }
%struct.b2IslandSimArray = type { ptr, i32, i32 }
%struct.b2ContactSim = type { i32, i32, i32, i32, i32, float, float, float, float, %struct.b2Manifold, float, float, float, float, i32, %struct.b2SimplexCache }

@.str = external hidden unnamed_addr constant [40 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [40 x i8], align 1
@s_registers = external hidden global [5 x [5 x %struct.b2ContactRegister]], align 16
@.str.3 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [77 x i8], align 1
@b2_emptySimplexCache = external hidden constant %struct.b2SimplexCache, align 2

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

; Function Attrs: nounwind uwtable
define dso_local void @b2CreateContact(ptr noundef %0, ptr noundef %1, ptr noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %struct.b2Contact, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  %25 = alloca i64, align 8
  %26 = alloca ptr, align 8
  %27 = alloca %struct.b2Manifold, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.b2Shape, ptr %28, i32 0, i32 5
  %30 = load i32, ptr %29, align 4, !tbaa !9
  store i32 %30, ptr %7, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.b2Shape, ptr %31, i32 0, i32 5
  %33 = load i32, ptr %32, align 4, !tbaa !9
  store i32 %33, ptr %8, align 4, !tbaa !19
  br label %34

34:                                               ; preds = %3
  %35 = load i32, ptr %7, align 4, !tbaa !19
  %36 = icmp ule i32 0, %35
  br i1 %36, label %37, label %40

37:                                               ; preds = %34
  %38 = load i32, ptr %7, align 4, !tbaa !19
  %39 = icmp ult i32 %38, 5
  br i1 %39, label %44, label %40

40:                                               ; preds = %37, %34
  %41 = call i32 @b2InternalAssertFcn(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 191)
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %44

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

44:                                               ; preds = %43, %40, %37
  br label %45

45:                                               ; preds = %44
  br label %46

46:                                               ; preds = %45
  br label %47

47:                                               ; preds = %46
  %48 = load i32, ptr %8, align 4, !tbaa !19
  %49 = icmp ule i32 0, %48
  br i1 %49, label %50, label %53

50:                                               ; preds = %47
  %51 = load i32, ptr %8, align 4, !tbaa !19
  %52 = icmp ult i32 %51, 5
  br i1 %52, label %57, label %53

53:                                               ; preds = %50, %47
  %54 = call i32 @b2InternalAssertFcn(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 192)
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %57

56:                                               ; preds = %53
  call void @llvm.trap()
  br label %57

57:                                               ; preds = %56, %53, %50
  br label %58

58:                                               ; preds = %57
  br label %59

59:                                               ; preds = %58
  %60 = load i32, ptr %7, align 4, !tbaa !19
  %61 = zext i32 %60 to i64
  %62 = getelementptr inbounds [5 x [5 x %struct.b2ContactRegister]], ptr @s_registers, i64 0, i64 %61
  %63 = load i32, ptr %8, align 4, !tbaa !19
  %64 = zext i32 %63 to i64
  %65 = getelementptr inbounds [5 x %struct.b2ContactRegister], ptr %62, i64 0, i64 %64
  %66 = getelementptr inbounds %struct.b2ContactRegister, ptr %65, i32 0, i32 0
  %67 = load ptr, ptr %66, align 16, !tbaa !20
  %68 = icmp eq ptr %67, null
  br i1 %68, label %69, label %70

69:                                               ; preds = %59
  store i32 1, ptr %9, align 4
  br label %457

70:                                               ; preds = %59
  %71 = load i32, ptr %7, align 4, !tbaa !19
  %72 = zext i32 %71 to i64
  %73 = getelementptr inbounds [5 x [5 x %struct.b2ContactRegister]], ptr @s_registers, i64 0, i64 %72
  %74 = load i32, ptr %8, align 4, !tbaa !19
  %75 = zext i32 %74 to i64
  %76 = getelementptr inbounds [5 x %struct.b2ContactRegister], ptr %73, i64 0, i64 %75
  %77 = getelementptr inbounds %struct.b2ContactRegister, ptr %76, i32 0, i32 1
  %78 = load i8, ptr %77, align 8, !tbaa !22, !range !23, !noundef !24
  %79 = trunc i8 %78 to i1
  %80 = zext i1 %79 to i32
  %81 = icmp eq i32 %80, 0
  br i1 %81, label %82, label %86

82:                                               ; preds = %70
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  call void @b2CreateContact(ptr noundef %83, ptr noundef %84, ptr noundef %85)
  store i32 1, ptr %9, align 4
  br label %457

86:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.b2World, ptr %87, i32 0, i32 4
  %89 = load ptr, ptr %5, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.b2Shape, ptr %89, i32 0, i32 1
  %91 = load i32, ptr %90, align 4, !tbaa !25
  %92 = call ptr @b2BodyArray_Get(ptr noundef %88, i32 noundef %91)
  store ptr %92, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.b2World, ptr %93, i32 0, i32 4
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.b2Shape, ptr %95, i32 0, i32 1
  %97 = load i32, ptr %96, align 4, !tbaa !25
  %98 = call ptr @b2BodyArray_Get(ptr noundef %94, i32 noundef %97)
  store ptr %98, ptr %11, align 8, !tbaa !5
  br label %99

99:                                               ; preds = %86
  %100 = load ptr, ptr %10, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.b2Body, ptr %100, i32 0, i32 2
  %102 = load i32, ptr %101, align 8, !tbaa !26
  %103 = icmp ne i32 %102, 1
  br i1 %103, label %104, label %109

104:                                              ; preds = %99
  %105 = load ptr, ptr %11, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.b2Body, ptr %105, i32 0, i32 2
  %107 = load i32, ptr %106, align 8, !tbaa !26
  %108 = icmp ne i32 %107, 1
  br i1 %108, label %113, label %109

109:                                              ; preds = %104, %99
  %110 = call i32 @b2InternalAssertFcn(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 210)
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %112, label %113

112:                                              ; preds = %109
  call void @llvm.trap()
  br label %113

113:                                              ; preds = %112, %109, %104
  br label %114

114:                                              ; preds = %113
  br label %115

115:                                              ; preds = %114
  br label %116

116:                                              ; preds = %115
  %117 = load ptr, ptr %10, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.b2Body, ptr %117, i32 0, i32 2
  %119 = load i32, ptr %118, align 8, !tbaa !26
  %120 = icmp ne i32 %119, 0
  br i1 %120, label %130, label %121

121:                                              ; preds = %116
  %122 = load ptr, ptr %11, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.b2Body, ptr %122, i32 0, i32 2
  %124 = load i32, ptr %123, align 8, !tbaa !26
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %130, label %126

126:                                              ; preds = %121
  %127 = call i32 @b2InternalAssertFcn(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 211)
  %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, %121, %116
  br label %131

131:                                              ; preds = %130
  br label %132

132:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %133 = load ptr, ptr %10, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.b2Body, ptr %133, i32 0, i32 2
  %135 = load i32, ptr %134, align 8, !tbaa !26
  %136 = icmp eq i32 %135, 2
  br i1 %136, label %142, label %137

137:                                              ; preds = %132
  %138 = load ptr, ptr %11, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.b2Body, ptr %138, i32 0, i32 2
  %140 = load i32, ptr %139, align 8, !tbaa !26
  %141 = icmp eq i32 %140, 2
  br i1 %141, label %142, label %143

142:                                              ; preds = %137, %132
  store i32 2, ptr %12, align 4, !tbaa !19
  br label %144

143:                                              ; preds = %137
  store i32 1, ptr %12, align 4, !tbaa !19
  br label %144

144:                                              ; preds = %143, %142
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.b2World, ptr %145, i32 0, i32 6
  %147 = load i32, ptr %12, align 4, !tbaa !19
  %148 = call ptr @b2SolverSetArray_Get(ptr noundef %146, i32 noundef %147)
  store ptr %148, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %149 = load ptr, ptr %4, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.b2World, ptr %149, i32 0, i32 9
  %151 = call i32 @b2AllocId(ptr noundef %150)
  store i32 %151, ptr %14, align 4, !tbaa !19
  %152 = load i32, ptr %14, align 4, !tbaa !19
  %153 = load ptr, ptr %4, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.b2World, ptr %153, i32 0, i32 10
  %155 = getelementptr inbounds %struct.b2ContactArray, ptr %154, i32 0, i32 1
  %156 = load i32, ptr %155, align 8, !tbaa !28
  %157 = icmp eq i32 %152, %156
  br i1 %157, label %158, label %173

158:                                              ; preds = %144
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.b2World, ptr %159, i32 0, i32 10
  call void @llvm.memset.p0.i64(ptr align 4 %15, i8 0, i64 68, i1 false)
  %161 = getelementptr inbounds %struct.b2Contact, ptr %15, i32 0, i32 0
  %162 = getelementptr inbounds %struct.b2Contact, ptr %15, i32 0, i32 1
  %163 = getelementptr inbounds %struct.b2Contact, ptr %15, i32 0, i32 2
  %164 = getelementptr inbounds %struct.b2Contact, ptr %15, i32 0, i32 3
  %165 = getelementptr inbounds %struct.b2Contact, ptr %15, i32 0, i32 4
  %166 = getelementptr inbounds %struct.b2Contact, ptr %15, i32 0, i32 5
  %167 = getelementptr inbounds %struct.b2Contact, ptr %15, i32 0, i32 6
  %168 = getelementptr inbounds %struct.b2Contact, ptr %15, i32 0, i32 7
  %169 = getelementptr inbounds %struct.b2Contact, ptr %15, i32 0, i32 8
  %170 = getelementptr inbounds %struct.b2Contact, ptr %15, i32 0, i32 9
  %171 = getelementptr inbounds %struct.b2Contact, ptr %15, i32 0, i32 10
  %172 = getelementptr inbounds %struct.b2Contact, ptr %15, i32 0, i32 11
  call void @b2ContactArray_Push(ptr noundef %160, ptr noundef byval(%struct.b2Contact) align 8 %15)
  br label %173

173:                                              ; preds = %158, %144
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %174 = load ptr, ptr %5, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.b2Shape, ptr %174, i32 0, i32 0
  %176 = load i32, ptr %175, align 8, !tbaa !39
  store i32 %176, ptr %16, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %177 = load ptr, ptr %6, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.b2Shape, ptr %177, i32 0, i32 0
  %179 = load i32, ptr %178, align 8, !tbaa !39
  store i32 %179, ptr %17, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %180 = load ptr, ptr %4, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.b2World, ptr %180, i32 0, i32 10
  %182 = load i32, ptr %14, align 4, !tbaa !19
  %183 = call ptr @b2ContactArray_Get(ptr noundef %181, i32 noundef %182)
  store ptr %183, ptr %18, align 8, !tbaa !5
  %184 = load i32, ptr %14, align 4, !tbaa !19
  %185 = load ptr, ptr %18, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.b2Contact, ptr %185, i32 0, i32 9
  store i32 %184, ptr %186, align 4, !tbaa !40
  %187 = load i32, ptr %12, align 4, !tbaa !19
  %188 = load ptr, ptr %18, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.b2Contact, ptr %188, i32 0, i32 0
  store i32 %187, ptr %189, align 4, !tbaa !42
  %190 = load ptr, ptr %18, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.b2Contact, ptr %190, i32 0, i32 1
  store i32 -1, ptr %191, align 4, !tbaa !43
  %192 = load ptr, ptr %13, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.b2SolverSet, ptr %192, i32 0, i32 3
  %194 = getelementptr inbounds %struct.b2ContactSimArray, ptr %193, i32 0, i32 1
  %195 = load i32, ptr %194, align 8, !tbaa !44
  %196 = load ptr, ptr %18, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.b2Contact, ptr %196, i32 0, i32 2
  store i32 %195, ptr %197, align 4, !tbaa !46
  %198 = load ptr, ptr %18, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.b2Contact, ptr %198, i32 0, i32 8
  store i32 -1, ptr %199, align 4, !tbaa !47
  %200 = load ptr, ptr %18, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.b2Contact, ptr %200, i32 0, i32 6
  store i32 -1, ptr %201, align 4, !tbaa !48
  %202 = load ptr, ptr %18, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.b2Contact, ptr %202, i32 0, i32 7
  store i32 -1, ptr %203, align 4, !tbaa !49
  %204 = load i32, ptr %16, align 4, !tbaa !19
  %205 = load ptr, ptr %18, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.b2Contact, ptr %205, i32 0, i32 4
  store i32 %204, ptr %206, align 4, !tbaa !50
  %207 = load i32, ptr %17, align 4, !tbaa !19
  %208 = load ptr, ptr %18, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.b2Contact, ptr %208, i32 0, i32 5
  store i32 %207, ptr %209, align 4, !tbaa !51
  %210 = load ptr, ptr %18, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.b2Contact, ptr %210, i32 0, i32 11
  store i8 0, ptr %211, align 4, !tbaa !52
  %212 = load ptr, ptr %18, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.b2Contact, ptr %212, i32 0, i32 10
  store i32 0, ptr %213, align 4, !tbaa !53
  br label %214

214:                                              ; preds = %173
  %215 = load ptr, ptr %5, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.b2Shape, ptr %215, i32 0, i32 4
  %217 = load i32, ptr %216, align 8, !tbaa !54
  %218 = icmp eq i32 %217, -1
  br i1 %218, label %219, label %224

219:                                              ; preds = %214
  %220 = load ptr, ptr %6, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.b2Shape, ptr %220, i32 0, i32 4
  %222 = load i32, ptr %221, align 8, !tbaa !54
  %223 = icmp eq i32 %222, -1
  br i1 %223, label %228, label %224

224:                                              ; preds = %219, %214
  %225 = call i32 @b2InternalAssertFcn(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 251)
  %226 = icmp ne i32 %225, 0
  br i1 %226, label %227, label %228

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

228:                                              ; preds = %227, %224, %219
  br label %229

229:                                              ; preds = %228
  br label %230

230:                                              ; preds = %229
  %231 = load ptr, ptr %5, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.b2Shape, ptr %231, i32 0, i32 22
  %233 = load i8, ptr %232, align 1, !tbaa !55, !range !23, !noundef !24
  %234 = trunc i8 %233 to i1
  br i1 %234, label %240, label %235

235:                                              ; preds = %230
  %236 = load ptr, ptr %6, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.b2Shape, ptr %236, i32 0, i32 22
  %238 = load i8, ptr %237, align 1, !tbaa !55, !range !23, !noundef !24
  %239 = trunc i8 %238 to i1
  br i1 %239, label %240, label %245

240:                                              ; preds = %235, %230
  %241 = load ptr, ptr %18, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.b2Contact, ptr %241, i32 0, i32 10
  %243 = load i32, ptr %242, align 4, !tbaa !53
  %244 = or i32 %243, 4
  store i32 %244, ptr %242, align 4, !tbaa !53
  br label %245

245:                                              ; preds = %240, %235
  %246 = load ptr, ptr %5, align 8, !tbaa !5
  %247 = getelementptr inbounds %struct.b2Shape, ptr %246, i32 0, i32 1
  %248 = load i32, ptr %247, align 4, !tbaa !25
  %249 = load ptr, ptr %18, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.b2Contact, ptr %249, i32 0, i32 3
  %251 = getelementptr inbounds [2 x %struct.b2ContactEdge], ptr %250, i64 0, i64 0
  %252 = getelementptr inbounds %struct.b2ContactEdge, ptr %251, i32 0, i32 0
  store i32 %248, ptr %252, align 4, !tbaa !56
  %253 = load ptr, ptr %18, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct.b2Contact, ptr %253, i32 0, i32 3
  %255 = getelementptr inbounds [2 x %struct.b2ContactEdge], ptr %254, i64 0, i64 0
  %256 = getelementptr inbounds %struct.b2ContactEdge, ptr %255, i32 0, i32 1
  store i32 -1, ptr %256, align 4, !tbaa !58
  %257 = load ptr, ptr %10, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.b2Body, ptr %257, i32 0, i32 4
  %259 = load i32, ptr %258, align 8, !tbaa !59
  %260 = load ptr, ptr %18, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.b2Contact, ptr %260, i32 0, i32 3
  %262 = getelementptr inbounds [2 x %struct.b2ContactEdge], ptr %261, i64 0, i64 0
  %263 = getelementptr inbounds %struct.b2ContactEdge, ptr %262, i32 0, i32 2
  store i32 %259, ptr %263, align 4, !tbaa !60
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %264 = load i32, ptr %14, align 4, !tbaa !19
  %265 = shl i32 %264, 1
  %266 = or i32 %265, 0
  store i32 %266, ptr %19, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %267 = load ptr, ptr %10, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct.b2Body, ptr %267, i32 0, i32 4
  %269 = load i32, ptr %268, align 8, !tbaa !59
  store i32 %269, ptr %20, align 4, !tbaa !19
  %270 = load i32, ptr %20, align 4, !tbaa !19
  %271 = icmp ne i32 %270, -1
  br i1 %271, label %272, label %286

272:                                              ; preds = %245
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %273 = load ptr, ptr %4, align 8, !tbaa !5
  %274 = getelementptr inbounds %struct.b2World, ptr %273, i32 0, i32 10
  %275 = load i32, ptr %20, align 4, !tbaa !19
  %276 = ashr i32 %275, 1
  %277 = call ptr @b2ContactArray_Get(ptr noundef %274, i32 noundef %276)
  store ptr %277, ptr %21, align 8, !tbaa !5
  %278 = load i32, ptr %19, align 4, !tbaa !19
  %279 = load ptr, ptr %21, align 8, !tbaa !5
  %280 = getelementptr inbounds %struct.b2Contact, ptr %279, i32 0, i32 3
  %281 = load i32, ptr %20, align 4, !tbaa !19
  %282 = and i32 %281, 1
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds [2 x %struct.b2ContactEdge], ptr %280, i64 0, i64 %283
  %285 = getelementptr inbounds %struct.b2ContactEdge, ptr %284, i32 0, i32 1
  store i32 %278, ptr %285, align 4, !tbaa !58
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %286

286:                                              ; preds = %272, %245
  %287 = load i32, ptr %19, align 4, !tbaa !19
  %288 = load ptr, ptr %10, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct.b2Body, ptr %288, i32 0, i32 4
  store i32 %287, ptr %289, align 8, !tbaa !59
  %290 = load ptr, ptr %10, align 8, !tbaa !5
  %291 = getelementptr inbounds %struct.b2Body, ptr %290, i32 0, i32 5
  %292 = load i32, ptr %291, align 4, !tbaa !61
  %293 = add nsw i32 %292, 1
  store i32 %293, ptr %291, align 4, !tbaa !61
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  %294 = load ptr, ptr %6, align 8, !tbaa !5
  %295 = getelementptr inbounds %struct.b2Shape, ptr %294, i32 0, i32 1
  %296 = load i32, ptr %295, align 4, !tbaa !25
  %297 = load ptr, ptr %18, align 8, !tbaa !5
  %298 = getelementptr inbounds %struct.b2Contact, ptr %297, i32 0, i32 3
  %299 = getelementptr inbounds [2 x %struct.b2ContactEdge], ptr %298, i64 0, i64 1
  %300 = getelementptr inbounds %struct.b2ContactEdge, ptr %299, i32 0, i32 0
  store i32 %296, ptr %300, align 4, !tbaa !56
  %301 = load ptr, ptr %18, align 8, !tbaa !5
  %302 = getelementptr inbounds %struct.b2Contact, ptr %301, i32 0, i32 3
  %303 = getelementptr inbounds [2 x %struct.b2ContactEdge], ptr %302, i64 0, i64 1
  %304 = getelementptr inbounds %struct.b2ContactEdge, ptr %303, i32 0, i32 1
  store i32 -1, ptr %304, align 4, !tbaa !58
  %305 = load ptr, ptr %11, align 8, !tbaa !5
  %306 = getelementptr inbounds %struct.b2Body, ptr %305, i32 0, i32 4
  %307 = load i32, ptr %306, align 8, !tbaa !59
  %308 = load ptr, ptr %18, align 8, !tbaa !5
  %309 = getelementptr inbounds %struct.b2Contact, ptr %308, i32 0, i32 3
  %310 = getelementptr inbounds [2 x %struct.b2ContactEdge], ptr %309, i64 0, i64 1
  %311 = getelementptr inbounds %struct.b2ContactEdge, ptr %310, i32 0, i32 2
  store i32 %307, ptr %311, align 4, !tbaa !60
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %312 = load i32, ptr %14, align 4, !tbaa !19
  %313 = shl i32 %312, 1
  %314 = or i32 %313, 1
  store i32 %314, ptr %22, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  %315 = load ptr, ptr %11, align 8, !tbaa !5
  %316 = getelementptr inbounds %struct.b2Body, ptr %315, i32 0, i32 4
  %317 = load i32, ptr %316, align 8, !tbaa !59
  store i32 %317, ptr %23, align 4, !tbaa !19
  %318 = load ptr, ptr %11, align 8, !tbaa !5
  %319 = getelementptr inbounds %struct.b2Body, ptr %318, i32 0, i32 4
  %320 = load i32, ptr %319, align 8, !tbaa !59
  %321 = icmp ne i32 %320, -1
  br i1 %321, label %322, label %336

322:                                              ; preds = %286
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %323 = load ptr, ptr %4, align 8, !tbaa !5
  %324 = getelementptr inbounds %struct.b2World, ptr %323, i32 0, i32 10
  %325 = load i32, ptr %23, align 4, !tbaa !19
  %326 = ashr i32 %325, 1
  %327 = call ptr @b2ContactArray_Get(ptr noundef %324, i32 noundef %326)
  store ptr %327, ptr %24, align 8, !tbaa !5
  %328 = load i32, ptr %22, align 4, !tbaa !19
  %329 = load ptr, ptr %24, align 8, !tbaa !5
  %330 = getelementptr inbounds %struct.b2Contact, ptr %329, i32 0, i32 3
  %331 = load i32, ptr %23, align 4, !tbaa !19
  %332 = and i32 %331, 1
  %333 = sext i32 %332 to i64
  %334 = getelementptr inbounds [2 x %struct.b2ContactEdge], ptr %330, i64 0, i64 %333
  %335 = getelementptr inbounds %struct.b2ContactEdge, ptr %334, i32 0, i32 1
  store i32 %328, ptr %335, align 4, !tbaa !58
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  br label %336

336:                                              ; preds = %322, %286
  %337 = load i32, ptr %22, align 4, !tbaa !19
  %338 = load ptr, ptr %11, align 8, !tbaa !5
  %339 = getelementptr inbounds %struct.b2Body, ptr %338, i32 0, i32 4
  store i32 %337, ptr %339, align 8, !tbaa !59
  %340 = load ptr, ptr %11, align 8, !tbaa !5
  %341 = getelementptr inbounds %struct.b2Body, ptr %340, i32 0, i32 5
  %342 = load i32, ptr %341, align 4, !tbaa !61
  %343 = add nsw i32 %342, 1
  store i32 %343, ptr %341, align 4, !tbaa !61
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %344 = load i32, ptr %16, align 4, !tbaa !19
  %345 = load i32, ptr %17, align 4, !tbaa !19
  %346 = icmp slt i32 %344, %345
  br i1 %346, label %347, label %354

347:                                              ; preds = %336
  %348 = load i32, ptr %16, align 4, !tbaa !19
  %349 = sext i32 %348 to i64
  %350 = shl i64 %349, 32
  %351 = load i32, ptr %17, align 4, !tbaa !19
  %352 = sext i32 %351 to i64
  %353 = or i64 %350, %352
  br label %361

354:                                              ; preds = %336
  %355 = load i32, ptr %17, align 4, !tbaa !19
  %356 = sext i32 %355 to i64
  %357 = shl i64 %356, 32
  %358 = load i32, ptr %16, align 4, !tbaa !19
  %359 = sext i32 %358 to i64
  %360 = or i64 %357, %359
  br label %361

361:                                              ; preds = %354, %347
  %362 = phi i64 [ %353, %347 ], [ %360, %354 ]
  store i64 %362, ptr %25, align 8, !tbaa !62
  %363 = load ptr, ptr %4, align 8, !tbaa !5
  %364 = getelementptr inbounds %struct.b2World, ptr %363, i32 0, i32 1
  %365 = getelementptr inbounds %struct.b2BroadPhase, ptr %364, i32 0, i32 8
  %366 = load i64, ptr %25, align 8, !tbaa !62
  %367 = call zeroext i1 @b2AddKey(ptr noundef %365, i64 noundef %366)
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %368 = load ptr, ptr %13, align 8, !tbaa !5
  %369 = getelementptr inbounds %struct.b2SolverSet, ptr %368, i32 0, i32 3
  %370 = call ptr @b2ContactSimArray_Add(ptr noundef %369)
  store ptr %370, ptr %26, align 8, !tbaa !5
  %371 = load i32, ptr %14, align 4, !tbaa !19
  %372 = load ptr, ptr %26, align 8, !tbaa !5
  %373 = getelementptr inbounds %struct.b2ContactSim, ptr %372, i32 0, i32 0
  store i32 %371, ptr %373, align 4, !tbaa !63
  %374 = load ptr, ptr %26, align 8, !tbaa !5
  %375 = getelementptr inbounds %struct.b2ContactSim, ptr %374, i32 0, i32 1
  store i32 -1, ptr %375, align 4, !tbaa !67
  %376 = load ptr, ptr %26, align 8, !tbaa !5
  %377 = getelementptr inbounds %struct.b2ContactSim, ptr %376, i32 0, i32 2
  store i32 -1, ptr %377, align 4, !tbaa !68
  %378 = load ptr, ptr %26, align 8, !tbaa !5
  %379 = getelementptr inbounds %struct.b2ContactSim, ptr %378, i32 0, i32 5
  store float 0.000000e+00, ptr %379, align 4, !tbaa !69
  %380 = load ptr, ptr %26, align 8, !tbaa !5
  %381 = getelementptr inbounds %struct.b2ContactSim, ptr %380, i32 0, i32 6
  store float 0.000000e+00, ptr %381, align 4, !tbaa !70
  %382 = load ptr, ptr %26, align 8, !tbaa !5
  %383 = getelementptr inbounds %struct.b2ContactSim, ptr %382, i32 0, i32 7
  store float 0.000000e+00, ptr %383, align 4, !tbaa !71
  %384 = load ptr, ptr %26, align 8, !tbaa !5
  %385 = getelementptr inbounds %struct.b2ContactSim, ptr %384, i32 0, i32 8
  store float 0.000000e+00, ptr %385, align 4, !tbaa !72
  %386 = load i32, ptr %16, align 4, !tbaa !19
  %387 = load ptr, ptr %26, align 8, !tbaa !5
  %388 = getelementptr inbounds %struct.b2ContactSim, ptr %387, i32 0, i32 3
  store i32 %386, ptr %388, align 4, !tbaa !73
  %389 = load i32, ptr %17, align 4, !tbaa !19
  %390 = load ptr, ptr %26, align 8, !tbaa !5
  %391 = getelementptr inbounds %struct.b2ContactSim, ptr %390, i32 0, i32 4
  store i32 %389, ptr %391, align 4, !tbaa !74
  %392 = load ptr, ptr %26, align 8, !tbaa !5
  %393 = getelementptr inbounds %struct.b2ContactSim, ptr %392, i32 0, i32 15
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %393, ptr align 2 @b2_emptySimplexCache, i64 8, i1 false), !tbaa.struct !75
  %394 = load ptr, ptr %26, align 8, !tbaa !5
  %395 = getelementptr inbounds %struct.b2ContactSim, ptr %394, i32 0, i32 9
  call void @llvm.memset.p0.i64(ptr align 4 %27, i8 0, i64 112, i1 false)
  %396 = getelementptr inbounds %struct.b2Manifold, ptr %27, i32 0, i32 0
  %397 = getelementptr inbounds %struct.b2Vec2, ptr %396, i32 0, i32 0
  %398 = getelementptr inbounds %struct.b2Vec2, ptr %396, i32 0, i32 1
  %399 = getelementptr inbounds %struct.b2Manifold, ptr %27, i32 0, i32 1
  %400 = getelementptr inbounds %struct.b2Manifold, ptr %27, i32 0, i32 2
  %401 = getelementptr inbounds %struct.b2Manifold, ptr %27, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %395, ptr align 4 %27, i64 112, i1 false), !tbaa.struct !78
  %402 = load ptr, ptr %4, align 8, !tbaa !5
  %403 = getelementptr inbounds %struct.b2World, ptr %402, i32 0, i32 42
  %404 = load ptr, ptr %403, align 8, !tbaa !80
  %405 = load ptr, ptr %5, align 8, !tbaa !5
  %406 = getelementptr inbounds %struct.b2Shape, ptr %405, i32 0, i32 7
  %407 = load float, ptr %406, align 4, !tbaa !81
  %408 = load ptr, ptr %5, align 8, !tbaa !5
  %409 = getelementptr inbounds %struct.b2Shape, ptr %408, i32 0, i32 11
  %410 = load i32, ptr %409, align 4, !tbaa !82
  %411 = load ptr, ptr %6, align 8, !tbaa !5
  %412 = getelementptr inbounds %struct.b2Shape, ptr %411, i32 0, i32 7
  %413 = load float, ptr %412, align 4, !tbaa !81
  %414 = load ptr, ptr %6, align 8, !tbaa !5
  %415 = getelementptr inbounds %struct.b2Shape, ptr %414, i32 0, i32 11
  %416 = load i32, ptr %415, align 4, !tbaa !82
  %417 = call float %404(float noundef %407, i32 noundef %410, float noundef %413, i32 noundef %416)
  %418 = load ptr, ptr %26, align 8, !tbaa !5
  %419 = getelementptr inbounds %struct.b2ContactSim, ptr %418, i32 0, i32 10
  store float %417, ptr %419, align 4, !tbaa !83
  %420 = load ptr, ptr %4, align 8, !tbaa !5
  %421 = getelementptr inbounds %struct.b2World, ptr %420, i32 0, i32 43
  %422 = load ptr, ptr %421, align 8, !tbaa !84
  %423 = load ptr, ptr %5, align 8, !tbaa !5
  %424 = getelementptr inbounds %struct.b2Shape, ptr %423, i32 0, i32 8
  %425 = load float, ptr %424, align 8, !tbaa !85
  %426 = load ptr, ptr %5, align 8, !tbaa !5
  %427 = getelementptr inbounds %struct.b2Shape, ptr %426, i32 0, i32 11
  %428 = load i32, ptr %427, align 4, !tbaa !82
  %429 = load ptr, ptr %6, align 8, !tbaa !5
  %430 = getelementptr inbounds %struct.b2Shape, ptr %429, i32 0, i32 8
  %431 = load float, ptr %430, align 8, !tbaa !85
  %432 = load ptr, ptr %6, align 8, !tbaa !5
  %433 = getelementptr inbounds %struct.b2Shape, ptr %432, i32 0, i32 11
  %434 = load i32, ptr %433, align 4, !tbaa !82
  %435 = call float %422(float noundef %425, i32 noundef %428, float noundef %431, i32 noundef %434)
  %436 = load ptr, ptr %26, align 8, !tbaa !5
  %437 = getelementptr inbounds %struct.b2ContactSim, ptr %436, i32 0, i32 11
  store float %435, ptr %437, align 4, !tbaa !86
  %438 = load ptr, ptr %26, align 8, !tbaa !5
  %439 = getelementptr inbounds %struct.b2ContactSim, ptr %438, i32 0, i32 13
  store float 0.000000e+00, ptr %439, align 4, !tbaa !87
  %440 = load ptr, ptr %26, align 8, !tbaa !5
  %441 = getelementptr inbounds %struct.b2ContactSim, ptr %440, i32 0, i32 14
  store i32 0, ptr %441, align 4, !tbaa !88
  %442 = load ptr, ptr %5, align 8, !tbaa !5
  %443 = getelementptr inbounds %struct.b2Shape, ptr %442, i32 0, i32 24
  %444 = load i8, ptr %443, align 1, !tbaa !89, !range !23, !noundef !24
  %445 = trunc i8 %444 to i1
  br i1 %445, label %451, label %446

446:                                              ; preds = %361
  %447 = load ptr, ptr %6, align 8, !tbaa !5
  %448 = getelementptr inbounds %struct.b2Shape, ptr %447, i32 0, i32 24
  %449 = load i8, ptr %448, align 1, !tbaa !89, !range !23, !noundef !24
  %450 = trunc i8 %449 to i1
  br i1 %450, label %451, label %456

451:                                              ; preds = %446, %361
  %452 = load ptr, ptr %26, align 8, !tbaa !5
  %453 = getelementptr inbounds %struct.b2ContactSim, ptr %452, i32 0, i32 14
  %454 = load i32, ptr %453, align 4, !tbaa !88
  %455 = or i32 %454, 2097152
  store i32 %455, ptr %453, align 4, !tbaa !88
  br label %456

456:                                              ; preds = %451, %446
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  store i32 0, ptr %9, align 4
  br label %457

457:                                              ; preds = %456, %82, %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  %458 = load i32, ptr %9, align 4
  switch i32 %458, label %460 [
    i32 0, label %459
    i32 1, label %459
  ]

459:                                              ; preds = %457, %457
  ret void

460:                                              ; preds = %457
  unreachable
}

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

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

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

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

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

declare i32 @b2AllocId(ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @b2ContactArray_Push(ptr noundef, ptr noundef byval(%struct.b2Contact) align 8) #5

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

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

declare zeroext i1 @b2AddKey(ptr noundef, i64 noundef) #3

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

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

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

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

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


; 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.b2ContactRegister = type { ptr, i8 }
%struct.b2SimplexCache = type { i16, [3 x i8], [3 x 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 }

@.str = external hidden unnamed_addr constant [40 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [40 x i8], align 1
@s_registers = external hidden local_unnamed_addr global [5 x [5 x %struct.b2ContactRegister]], align 16
@.str.3 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [77 x i8], align 1
@b2_emptySimplexCache = external hidden local_unnamed_addr constant %struct.b2SimplexCache, align 2

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

; Function Attrs: nounwind uwtable
define dso_local void @b2CreateContact(ptr noundef %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2) local_unnamed_addr #1 {
  %4 = alloca %struct.b2Contact, align 8
  br label %tailrecurse

tailrecurse:                                      ; preds = %24, %3
  %.tr143 = phi ptr [ %1, %3 ], [ %.tr144, %24 ]
  %.tr144 = phi ptr [ %2, %3 ], [ %.tr143, %24 ]
  %5 = getelementptr inbounds i8, ptr %.tr143, i64 20
  %6 = load i32, ptr %5, align 4, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %.tr144, i64 20
  %8 = load i32, ptr %7, align 4, !tbaa !5
  %9 = icmp ult i32 %6, 5
  br i1 %9, label %13, label %10

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

12:                                               ; preds = %10
  tail call void @llvm.trap()
  unreachable

13:                                               ; preds = %10, %tailrecurse
  %14 = icmp ult i32 %8, 5
  br i1 %14, label %18, label %15

15:                                               ; preds = %13
  %16 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 192) #5
  %.not133 = icmp eq i32 %16, 0
  br i1 %.not133, label %18, label %17

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

18:                                               ; preds = %13, %15
  %19 = zext i32 %6 to i64
  %20 = zext i32 %8 to i64
  %21 = getelementptr inbounds [5 x [5 x %struct.b2ContactRegister]], ptr @s_registers, i64 0, i64 %19, i64 %20
  %22 = load ptr, ptr %21, align 16, !tbaa !18
  %23 = icmp eq ptr %22, null
  br i1 %23, label %.loopexit, label %24

24:                                               ; preds = %18
  %25 = getelementptr inbounds i8, ptr %21, i64 8
  %26 = load i8, ptr %25, align 8, !tbaa !20, !range !21, !noundef !22
  %27 = icmp eq i8 %26, 0
  br i1 %27, label %tailrecurse, label %28

28:                                               ; preds = %24
  %29 = getelementptr inbounds i8, ptr %0, i64 1032
  %30 = getelementptr inbounds i8, ptr %.tr143, i64 4
  %31 = load i32, ptr %30, align 4, !tbaa !23
  %32 = tail call ptr @b2BodyArray_Get(ptr noundef nonnull %29, i32 noundef %31)
  %33 = getelementptr inbounds i8, ptr %.tr144, i64 4
  %34 = load i32, ptr %33, align 4, !tbaa !23
  %35 = tail call ptr @b2BodyArray_Get(ptr noundef nonnull %29, i32 noundef %34)
  %36 = getelementptr inbounds i8, ptr %32, i64 40
  %37 = load i32, ptr %36, align 8, !tbaa !24
  %.not134 = icmp eq i32 %37, 1
  br i1 %.not134, label %41, label %38

38:                                               ; preds = %28
  %39 = getelementptr inbounds i8, ptr %35, i64 40
  %40 = load i32, ptr %39, align 8, !tbaa !24
  %.not135 = icmp eq i32 %40, 1
  br i1 %.not135, label %41, label %44

41:                                               ; preds = %38, %28
  %42 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 210) #5
  %.not136 = icmp eq i32 %42, 0
  br i1 %.not136, label %._crit_edge, label %43

._crit_edge:                                      ; preds = %41
  %.pre = load i32, ptr %36, align 8, !tbaa !24
  br label %44

43:                                               ; preds = %41
  tail call void @llvm.trap()
  unreachable

44:                                               ; preds = %._crit_edge, %38
  %45 = phi i32 [ %.pre, %._crit_edge ], [ %37, %38 ]
  %.not137 = icmp eq i32 %45, 0
  br i1 %.not137, label %46, label %thread-pre-split

46:                                               ; preds = %44
  %47 = getelementptr inbounds i8, ptr %35, i64 40
  %48 = load i32, ptr %47, align 8, !tbaa !24
  %.not138 = icmp eq i32 %48, 0
  br i1 %.not138, label %49, label %thread-pre-split.thread

49:                                               ; preds = %46
  %50 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 211) #5
  %.not139 = icmp eq i32 %50, 0
  br i1 %.not139, label %.thread-pre-split_crit_edge, label %51

.thread-pre-split_crit_edge:                      ; preds = %49
  %.pr.pre = load i32, ptr %36, align 8, !tbaa !24
  br label %thread-pre-split

51:                                               ; preds = %49
  tail call void @llvm.trap()
  unreachable

thread-pre-split:                                 ; preds = %.thread-pre-split_crit_edge, %44
  %52 = phi i32 [ %45, %44 ], [ %.pr.pre, %.thread-pre-split_crit_edge ]
  %53 = icmp eq i32 %52, 2
  br i1 %53, label %57, label %thread-pre-split.thread

thread-pre-split.thread:                          ; preds = %46, %thread-pre-split
  %54 = getelementptr inbounds i8, ptr %35, i64 40
  %55 = load i32, ptr %54, align 8, !tbaa !24
  %56 = icmp eq i32 %55, 2
  %spec.select = select i1 %56, i32 2, i32 1
  br label %57

57:                                               ; preds = %thread-pre-split.thread, %thread-pre-split
  %.0 = phi i32 [ 2, %thread-pre-split ], [ %spec.select, %thread-pre-split.thread ]
  %58 = getelementptr inbounds i8, ptr %0, i64 1072
  %59 = tail call ptr @b2SolverSetArray_Get(ptr noundef nonnull %58, i32 noundef %.0)
  %60 = getelementptr inbounds i8, ptr %0, i64 1128
  %61 = tail call i32 @b2AllocId(ptr noundef nonnull %60) #5
  %62 = getelementptr inbounds i8, ptr %0, i64 1152
  %63 = getelementptr inbounds i8, ptr %0, i64 1160
  %64 = load i32, ptr %63, align 8, !tbaa !26
  %65 = icmp eq i32 %61, %64
  br i1 %65, label %66, label %67

66:                                               ; preds = %57
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(68) %4, i8 0, i64 68, i1 false)
  tail call void @b2ContactArray_Push(ptr noundef nonnull %62, ptr noundef nonnull byval(%struct.b2Contact) align 8 %4)
  br label %67

67:                                               ; preds = %66, %57
  %68 = load i32, ptr %.tr143, align 8, !tbaa !37
  %69 = load i32, ptr %.tr144, align 8, !tbaa !37
  %70 = tail call ptr @b2ContactArray_Get(ptr noundef nonnull %62, i32 noundef %61)
  %71 = getelementptr inbounds i8, ptr %70, i64 56
  store i32 %61, ptr %71, align 4, !tbaa !38
  store i32 %.0, ptr %70, align 4, !tbaa !40
  %72 = getelementptr inbounds i8, ptr %70, i64 4
  store i32 -1, ptr %72, align 4, !tbaa !41
  %73 = getelementptr inbounds i8, ptr %59, i64 48
  %74 = getelementptr inbounds i8, ptr %59, i64 56
  %75 = load i32, ptr %74, align 8, !tbaa !42
  %76 = getelementptr inbounds i8, ptr %70, i64 8
  store i32 %75, ptr %76, align 4, !tbaa !44
  %77 = getelementptr inbounds i8, ptr %70, i64 52
  store i32 -1, ptr %77, align 4, !tbaa !45
  %78 = getelementptr inbounds i8, ptr %70, i64 44
  store i32 -1, ptr %78, align 4, !tbaa !46
  %79 = getelementptr inbounds i8, ptr %70, i64 48
  store i32 -1, ptr %79, align 4, !tbaa !47
  %80 = getelementptr inbounds i8, ptr %70, i64 36
  store i32 %68, ptr %80, align 4, !tbaa !48
  %81 = getelementptr inbounds i8, ptr %70, i64 40
  store i32 %69, ptr %81, align 4, !tbaa !49
  %82 = getelementptr inbounds i8, ptr %70, i64 64
  store i8 0, ptr %82, align 4, !tbaa !50
  %83 = getelementptr inbounds i8, ptr %70, i64 60
  store i32 0, ptr %83, align 4, !tbaa !51
  %84 = getelementptr inbounds i8, ptr %.tr143, i64 16
  %85 = load i32, ptr %84, align 8, !tbaa !52
  %86 = icmp eq i32 %85, -1
  br i1 %86, label %87, label %91

87:                                               ; preds = %67
  %88 = getelementptr inbounds i8, ptr %.tr144, i64 16
  %89 = load i32, ptr %88, align 8, !tbaa !52
  %90 = icmp eq i32 %89, -1
  br i1 %90, label %94, label %91

91:                                               ; preds = %87, %67
  %92 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 251) #5
  %.not140 = icmp eq i32 %92, 0
  br i1 %.not140, label %94, label %93

93:                                               ; preds = %91
  tail call void @llvm.trap()
  unreachable

94:                                               ; preds = %91, %87
  %95 = getelementptr inbounds i8, ptr %.tr143, i64 279
  %96 = load i8, ptr %95, align 1, !tbaa !53, !range !21, !noundef !22
  %97 = trunc nuw i8 %96 to i1
  br i1 %97, label %102, label %98

98:                                               ; preds = %94
  %99 = getelementptr inbounds i8, ptr %.tr144, i64 279
  %100 = load i8, ptr %99, align 1, !tbaa !53, !range !21, !noundef !22
  %101 = trunc nuw i8 %100 to i1
  br i1 %101, label %102, label %105

102:                                              ; preds = %98, %94
  %103 = load i32, ptr %83, align 4, !tbaa !51
  %104 = or i32 %103, 4
  store i32 %104, ptr %83, align 4, !tbaa !51
  br label %105

105:                                              ; preds = %102, %98
  %106 = load i32, ptr %30, align 4, !tbaa !23
  %107 = getelementptr inbounds i8, ptr %70, i64 12
  store i32 %106, ptr %107, align 4, !tbaa !54
  %108 = getelementptr inbounds i8, ptr %70, i64 16
  store i32 -1, ptr %108, align 4, !tbaa !56
  %109 = getelementptr inbounds i8, ptr %32, i64 48
  %110 = load i32, ptr %109, align 8, !tbaa !57
  %111 = getelementptr inbounds i8, ptr %70, i64 20
  store i32 %110, ptr %111, align 4, !tbaa !58
  %112 = shl i32 %61, 1
  %.not141 = icmp eq i32 %110, -1
  br i1 %.not141, label %120, label %113

113:                                              ; preds = %105
  %114 = ashr i32 %110, 1
  %115 = tail call ptr @b2ContactArray_Get(ptr noundef nonnull %62, i32 noundef %114)
  %116 = getelementptr inbounds i8, ptr %115, i64 12
  %117 = and i32 %110, 1
  %118 = zext nneg i32 %117 to i64
  %119 = getelementptr inbounds [2 x %struct.b2ContactEdge], ptr %116, i64 0, i64 %118, i32 1
  store i32 %112, ptr %119, align 4, !tbaa !56
  br label %120

120:                                              ; preds = %113, %105
  store i32 %112, ptr %109, align 8, !tbaa !57
  %121 = getelementptr inbounds i8, ptr %32, i64 52
  %122 = load i32, ptr %121, align 4, !tbaa !59
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %121, align 4, !tbaa !59
  %124 = load i32, ptr %33, align 4, !tbaa !23
  %125 = getelementptr inbounds i8, ptr %70, i64 24
  store i32 %124, ptr %125, align 4, !tbaa !54
  %126 = getelementptr inbounds i8, ptr %70, i64 28
  store i32 -1, ptr %126, align 4, !tbaa !56
  %127 = getelementptr inbounds i8, ptr %35, i64 48
  %128 = load i32, ptr %127, align 8, !tbaa !57
  %129 = getelementptr inbounds i8, ptr %70, i64 32
  store i32 %128, ptr %129, align 4, !tbaa !58
  %130 = or disjoint i32 %112, 1
  %.not142 = icmp eq i32 %128, -1
  br i1 %.not142, label %138, label %131

131:                                              ; preds = %120
  %132 = ashr i32 %128, 1
  %133 = tail call ptr @b2ContactArray_Get(ptr noundef nonnull %62, i32 noundef %132)
  %134 = getelementptr inbounds i8, ptr %133, i64 12
  %135 = and i32 %128, 1
  %136 = zext nneg i32 %135 to i64
  %137 = getelementptr inbounds [2 x %struct.b2ContactEdge], ptr %134, i64 0, i64 %136, i32 1
  store i32 %130, ptr %137, align 4, !tbaa !56
  br label %138

138:                                              ; preds = %131, %120
  store i32 %130, ptr %127, align 8, !tbaa !57
  %139 = getelementptr inbounds i8, ptr %35, i64 52
  %140 = load i32, ptr %139, align 4, !tbaa !59
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %139, align 4, !tbaa !59
  %142 = icmp slt i32 %68, %69
  %143 = sext i32 %68 to i64
  %144 = shl nsw i64 %143, 32
  %145 = sext i32 %69 to i64
  %146 = or i64 %144, %145
  %147 = shl nsw i64 %145, 32
  %148 = or i64 %147, %143
  %149 = select i1 %142, i64 %146, i64 %148
  %150 = getelementptr inbounds i8, ptr %0, i64 320
  %151 = tail call zeroext i1 @b2AddKey(ptr noundef nonnull %150, i64 noundef %149) #5
  %152 = tail call ptr @b2ContactSimArray_Add(ptr noundef nonnull %73)
  store i32 %61, ptr %152, align 4, !tbaa !60
  %153 = getelementptr inbounds i8, ptr %152, i64 4
  store i32 -1, ptr %153, align 4, !tbaa !64
  %154 = getelementptr inbounds i8, ptr %152, i64 8
  store i32 -1, ptr %154, align 4, !tbaa !65
  %155 = getelementptr inbounds i8, ptr %152, i64 20
  %156 = getelementptr inbounds i8, ptr %152, i64 12
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %155, i8 0, i64 16, i1 false)
  store i32 %68, ptr %156, align 4, !tbaa !66
  %157 = getelementptr inbounds i8, ptr %152, i64 16
  store i32 %69, ptr %157, align 4, !tbaa !67
  %158 = getelementptr inbounds i8, ptr %152, i64 168
  %159 = load i64, ptr @b2_emptySimplexCache, align 2
  store i64 %159, ptr %158, align 4
  %160 = getelementptr inbounds i8, ptr %152, i64 36
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(112) %160, i8 0, i64 112, i1 false)
  %161 = getelementptr inbounds i8, ptr %0, i64 1592
  %162 = load ptr, ptr %161, align 8, !tbaa !68
  %163 = getelementptr inbounds i8, ptr %.tr143, i64 28
  %164 = load float, ptr %163, align 4, !tbaa !69
  %165 = getelementptr inbounds i8, ptr %.tr143, i64 44
  %166 = load i32, ptr %165, align 4, !tbaa !70
  %167 = getelementptr inbounds i8, ptr %.tr144, i64 28
  %168 = load float, ptr %167, align 4, !tbaa !69
  %169 = getelementptr inbounds i8, ptr %.tr144, i64 44
  %170 = load i32, ptr %169, align 4, !tbaa !70
  %171 = tail call float %162(float noundef %164, i32 noundef %166, float noundef %168, i32 noundef %170) #5
  %172 = getelementptr inbounds i8, ptr %152, i64 148
  store float %171, ptr %172, align 4, !tbaa !71
  %173 = getelementptr inbounds i8, ptr %0, i64 1600
  %174 = load ptr, ptr %173, align 8, !tbaa !72
  %175 = getelementptr inbounds i8, ptr %.tr143, i64 32
  %176 = load float, ptr %175, align 8, !tbaa !73
  %177 = load i32, ptr %165, align 4, !tbaa !70
  %178 = getelementptr inbounds i8, ptr %.tr144, i64 32
  %179 = load float, ptr %178, align 8, !tbaa !73
  %180 = load i32, ptr %169, align 4, !tbaa !70
  %181 = tail call float %174(float noundef %176, i32 noundef %177, float noundef %179, i32 noundef %180) #5
  %182 = getelementptr inbounds i8, ptr %152, i64 152
  store float %181, ptr %182, align 4, !tbaa !74
  %183 = getelementptr inbounds i8, ptr %152, i64 160
  store float 0.000000e+00, ptr %183, align 4, !tbaa !75
  %184 = getelementptr inbounds i8, ptr %152, i64 164
  store i32 0, ptr %184, align 4, !tbaa !76
  %185 = getelementptr inbounds i8, ptr %.tr143, i64 281
  %186 = load i8, ptr %185, align 1, !tbaa !77, !range !21, !noundef !22
  %187 = trunc nuw i8 %186 to i1
  br i1 %187, label %192, label %188

188:                                              ; preds = %138
  %189 = getelementptr inbounds i8, ptr %.tr144, i64 281
  %190 = load i8, ptr %189, align 1, !tbaa !77, !range !21, !noundef !22
  %191 = trunc nuw i8 %190 to i1
  br i1 %191, label %192, label %.loopexit

192:                                              ; preds = %188, %138
  store i32 2097152, ptr %184, align 4, !tbaa !76
  br label %.loopexit

.loopexit:                                        ; preds = %18, %188, %192
  ret void
}

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

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

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

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

declare i32 @b2AllocId(ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @b2ContactArray_Push(ptr noundef, ptr noundef byval(%struct.b2Contact) align 8) local_unnamed_addr #4

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

declare zeroext i1 @b2AddKey(ptr noundef, i64 noundef) local_unnamed_addr #2

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

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

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass