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

; 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.b2ChainId = type { i32, i16, i16 }
%struct.b2BodyId = type { i32, i16, i16 }
%struct.b2Transform = type { %struct.b2Vec2, %struct.b2Rot }
%struct.b2Vec2 = type { float, float }
%struct.b2Rot = type { float, float }
%struct.b2ChainShape = type { i32, i32, i32, i32, i32, ptr, ptr, i16 }
%struct.b2ShapeDef = type { ptr, %struct.b2SurfaceMaterial, float, %struct.b2Filter, i8, i8, i8, i8, i8, i8, i8, i32 }
%struct.b2SurfaceMaterial = type { float, float, float, float, i32, i32 }
%struct.b2Filter = type { i64, i64, i32 }
%struct.b2ChainSegment = type { %struct.b2Vec2, %struct.b2Segment, %struct.b2Vec2, i32 }
%struct.b2Segment = type { %struct.b2Vec2, %struct.b2Vec2 }
%struct.b2ChainDef = type { ptr, ptr, i32, ptr, i32, %struct.b2Filter, i8, i8, 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.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.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.0, i16, i8, i8, i8, i8, i8 }
%struct.b2AABB = type { %struct.b2Vec2, %struct.b2Vec2 }
%union.anon.0 = type { %struct.b2Polygon }
%struct.b2Polygon = type { [8 x %struct.b2Vec2], [8 x %struct.b2Vec2], %struct.b2Vec2, float, i32 }

@.str.1 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [41 x i8], align 1

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

declare ptr @b2Alloc(i32 noundef) #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

declare zeroext i1 @b2IsValidFloat(float noundef) #1

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

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

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

declare ptr @b2GetWorldLocked(i32 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i64 @b2CreateChain(i64 %0, ptr noundef %1) #5 {
  %3 = alloca %struct.b2ChainId, align 4
  %4 = alloca %struct.b2BodyId, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca %struct.b2Transform, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.b2ChainShape, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca %struct.b2ShapeDef, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca %struct.b2ChainSegment, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  %27 = alloca ptr, align 8
  %28 = alloca %struct.b2ChainSegment, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca ptr, align 8
  store i64 %0, ptr %4, align 4
  store ptr %1, ptr %5, align 8, !tbaa !5
  br label %32

32:                                               ; preds = %2
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.b2ChainDef, ptr %33, i32 0, i32 8
  %35 = load i32, ptr %34, align 4, !tbaa !9
  %36 = icmp eq i32 %35, 1152023
  br i1 %36, label %41, label %37

37:                                               ; preds = %32
  %38 = call i32 @b2InternalAssertFcn(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 341)
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %40, label %41

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

41:                                               ; preds = %40, %37, %32
  br label %42

42:                                               ; preds = %41
  br label %43

43:                                               ; preds = %42
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.b2ChainDef, ptr %44, i32 0, i32 2
  %46 = load i32, ptr %45, align 8, !tbaa !15
  %47 = icmp sge i32 %46, 4
  br i1 %47, label %52, label %48

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

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

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

53:                                               ; preds = %52
  br label %54

54:                                               ; preds = %53
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.b2ChainDef, ptr %55, i32 0, i32 4
  %57 = load i32, ptr %56, align 8, !tbaa !16
  %58 = icmp eq i32 %57, 1
  br i1 %58, label %71, label %59

59:                                               ; preds = %54
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.b2ChainDef, ptr %60, i32 0, i32 4
  %62 = load i32, ptr %61, align 8, !tbaa !16
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.b2ChainDef, ptr %63, i32 0, i32 2
  %65 = load i32, ptr %64, align 8, !tbaa !15
  %66 = icmp eq i32 %62, %65
  br i1 %66, label %71, label %67

67:                                               ; preds = %59
  %68 = call i32 @b2InternalAssertFcn(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 343)
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %71

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

71:                                               ; preds = %70, %67, %59, %54
  br label %72

72:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %73 = getelementptr inbounds %struct.b2BodyId, ptr %4, i32 0, i32 1
  %74 = load i16, ptr %73, align 4, !tbaa !17
  %75 = zext i16 %74 to i32
  %76 = call ptr @b2GetWorldLocked(i32 noundef %75)
  store ptr %76, ptr %6, align 8, !tbaa !5
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = icmp eq ptr %77, null
  br i1 %78, label %79, label %83

79:                                               ; preds = %72
  %80 = getelementptr inbounds %struct.b2ChainId, ptr %3, i32 0, i32 0
  store i32 0, ptr %80, align 4, !tbaa !20
  %81 = getelementptr inbounds %struct.b2ChainId, ptr %3, i32 0, i32 1
  store i16 0, ptr %81, align 4, !tbaa !22
  %82 = getelementptr inbounds %struct.b2ChainId, ptr %3, i32 0, i32 2
  store i16 0, ptr %82, align 2, !tbaa !23
  store i32 1, ptr %7, align 4
  br label %573

83:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  %85 = load i64, ptr %4, align 4
  %86 = call ptr @b2GetBodyFullId(ptr noundef %84, i64 %85)
  store ptr %86, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #7
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = load ptr, ptr %8, align 8, !tbaa !5
  %89 = call { <2 x float>, <2 x float> } @b2GetBodyTransformQuick(ptr noundef %87, ptr noundef %88)
  %90 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %9, i32 0, i32 0
  %91 = extractvalue { <2 x float>, <2 x float> } %89, 0
  store <2 x float> %91, ptr %90, align 4
  %92 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %9, i32 0, i32 1
  %93 = extractvalue { <2 x float>, <2 x float> } %89, 1
  store <2 x float> %93, ptr %92, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.b2World, ptr %94, i32 0, i32 14
  %96 = call i32 @b2AllocId(ptr noundef %95)
  store i32 %96, ptr %10, align 4, !tbaa !24
  %97 = load i32, ptr %10, align 4, !tbaa !24
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.b2World, ptr %98, i32 0, i32 16
  %100 = getelementptr inbounds %struct.b2ChainShapeArray, ptr %99, i32 0, i32 1
  %101 = load i32, ptr %100, align 8, !tbaa !25
  %102 = icmp eq i32 %97, %101
  br i1 %102, label %103, label %114

103:                                              ; preds = %83
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.b2World, ptr %104, i32 0, i32 16
  call void @llvm.memset.p0.i64(ptr align 8 %11, i8 0, i64 48, i1 false)
  %106 = getelementptr inbounds %struct.b2ChainShape, ptr %11, i32 0, i32 0
  %107 = getelementptr inbounds %struct.b2ChainShape, ptr %11, i32 0, i32 1
  %108 = getelementptr inbounds %struct.b2ChainShape, ptr %11, i32 0, i32 2
  %109 = getelementptr inbounds %struct.b2ChainShape, ptr %11, i32 0, i32 3
  %110 = getelementptr inbounds %struct.b2ChainShape, ptr %11, i32 0, i32 4
  %111 = getelementptr inbounds %struct.b2ChainShape, ptr %11, i32 0, i32 5
  %112 = getelementptr inbounds %struct.b2ChainShape, ptr %11, i32 0, i32 6
  %113 = getelementptr inbounds %struct.b2ChainShape, ptr %11, i32 0, i32 7
  call void @b2ChainShapeArray_Push(ptr noundef %105, ptr noundef byval(%struct.b2ChainShape) align 8 %11)
  br label %133

114:                                              ; preds = %83
  br label %115

115:                                              ; preds = %114
  %116 = load ptr, ptr %6, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.b2World, ptr %116, i32 0, i32 16
  %118 = getelementptr inbounds %struct.b2ChainShapeArray, ptr %117, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8, !tbaa !38
  %120 = load i32, ptr %10, align 4, !tbaa !24
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds %struct.b2ChainShape, ptr %119, i64 %121
  %123 = getelementptr inbounds %struct.b2ChainShape, ptr %122, i32 0, i32 0
  %124 = load i32, ptr %123, align 8, !tbaa !39
  %125 = icmp eq i32 %124, -1
  br i1 %125, label %130, label %126

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

131:                                              ; preds = %130
  br label %132

132:                                              ; preds = %131
  br label %133

133:                                              ; preds = %132, %103
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %134 = load ptr, ptr %6, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.b2World, ptr %134, i32 0, i32 16
  %136 = load i32, ptr %10, align 4, !tbaa !24
  %137 = call ptr @b2ChainShapeArray_Get(ptr noundef %135, i32 noundef %136)
  store ptr %137, ptr %12, align 8, !tbaa !5
  %138 = load i32, ptr %10, align 4, !tbaa !24
  %139 = load ptr, ptr %12, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.b2ChainShape, ptr %139, i32 0, i32 0
  store i32 %138, ptr %140, align 8, !tbaa !39
  %141 = load ptr, ptr %8, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.b2Body, ptr %141, i32 0, i32 19
  %143 = load i32, ptr %142, align 4, !tbaa !41
  %144 = load ptr, ptr %12, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.b2ChainShape, ptr %144, i32 0, i32 1
  store i32 %143, ptr %145, align 4, !tbaa !43
  %146 = load ptr, ptr %8, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.b2Body, ptr %146, i32 0, i32 8
  %148 = load i32, ptr %147, align 8, !tbaa !44
  %149 = load ptr, ptr %12, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.b2ChainShape, ptr %149, i32 0, i32 2
  store i32 %148, ptr %150, align 8, !tbaa !45
  %151 = load ptr, ptr %12, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.b2ChainShape, ptr %151, i32 0, i32 7
  %153 = load i16, ptr %152, align 8, !tbaa !46
  %154 = zext i16 %153 to i32
  %155 = add nsw i32 %154, 1
  %156 = trunc i32 %155 to i16
  store i16 %156, ptr %152, align 8, !tbaa !46
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %157 = load ptr, ptr %5, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.b2ChainDef, ptr %157, i32 0, i32 4
  %159 = load i32, ptr %158, align 8, !tbaa !16
  store i32 %159, ptr %13, align 4, !tbaa !24
  %160 = load i32, ptr %13, align 4, !tbaa !24
  %161 = load ptr, ptr %12, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.b2ChainShape, ptr %161, i32 0, i32 4
  store i32 %160, ptr %162, align 8, !tbaa !47
  %163 = load i32, ptr %13, align 4, !tbaa !24
  %164 = sext i32 %163 to i64
  %165 = mul i64 %164, 24
  %166 = trunc i64 %165 to i32
  %167 = call ptr @b2Alloc(i32 noundef %166)
  %168 = load ptr, ptr %12, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.b2ChainShape, ptr %168, i32 0, i32 6
  store ptr %167, ptr %169, align 8, !tbaa !48
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !24
  br label %170

170:                                              ; preds = %252, %133
  %171 = load i32, ptr %14, align 4, !tbaa !24
  %172 = load i32, ptr %13, align 4, !tbaa !24
  %173 = icmp slt i32 %171, %172
  br i1 %173, label %175, label %174

174:                                              ; preds = %170
  store i32 10, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %255

175:                                              ; preds = %170
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %176 = load ptr, ptr %5, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.b2ChainDef, ptr %176, i32 0, i32 3
  %178 = load ptr, ptr %177, align 8, !tbaa !49
  %179 = load i32, ptr %14, align 4, !tbaa !24
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds %struct.b2SurfaceMaterial, ptr %178, i64 %180
  store ptr %181, ptr %15, align 8, !tbaa !5
  br label %182

182:                                              ; preds = %175
  %183 = load ptr, ptr %15, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.b2SurfaceMaterial, ptr %183, i32 0, i32 0
  %185 = load float, ptr %184, align 4, !tbaa !50
  %186 = call zeroext i1 @b2IsValidFloat(float noundef %185)
  br i1 %186, label %187, label %192

187:                                              ; preds = %182
  %188 = load ptr, ptr %15, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.b2SurfaceMaterial, ptr %188, i32 0, i32 0
  %190 = load float, ptr %189, align 4, !tbaa !50
  %191 = fcmp oge float %190, 0.000000e+00
  br i1 %191, label %196, label %192

192:                                              ; preds = %187, %182
  %193 = call i32 @b2InternalAssertFcn(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 379)
  %194 = icmp ne i32 %193, 0
  br i1 %194, label %195, label %196

195:                                              ; preds = %192
  call void @llvm.trap()
  br label %196

196:                                              ; preds = %195, %192, %187
  br label %197

197:                                              ; preds = %196
  br label %198

198:                                              ; preds = %197
  br label %199

199:                                              ; preds = %198
  %200 = load ptr, ptr %15, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.b2SurfaceMaterial, ptr %200, i32 0, i32 1
  %202 = load float, ptr %201, align 4, !tbaa !52
  %203 = call zeroext i1 @b2IsValidFloat(float noundef %202)
  br i1 %203, label %204, label %209

204:                                              ; preds = %199
  %205 = load ptr, ptr %15, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.b2SurfaceMaterial, ptr %205, i32 0, i32 1
  %207 = load float, ptr %206, align 4, !tbaa !52
  %208 = fcmp oge float %207, 0.000000e+00
  br i1 %208, label %213, label %209

209:                                              ; preds = %204, %199
  %210 = call i32 @b2InternalAssertFcn(ptr noundef @.str.8, ptr noundef @.str.1, i32 noundef 380)
  %211 = icmp ne i32 %210, 0
  br i1 %211, label %212, label %213

212:                                              ; preds = %209
  call void @llvm.trap()
  br label %213

213:                                              ; preds = %212, %209, %204
  br label %214

214:                                              ; preds = %213
  br label %215

215:                                              ; preds = %214
  br label %216

216:                                              ; preds = %215
  %217 = load ptr, ptr %15, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.b2SurfaceMaterial, ptr %217, i32 0, i32 2
  %219 = load float, ptr %218, align 4, !tbaa !53
  %220 = call zeroext i1 @b2IsValidFloat(float noundef %219)
  br i1 %220, label %221, label %226

221:                                              ; preds = %216
  %222 = load ptr, ptr %15, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.b2SurfaceMaterial, ptr %222, i32 0, i32 2
  %224 = load float, ptr %223, align 4, !tbaa !53
  %225 = fcmp oge float %224, 0.000000e+00
  br i1 %225, label %230, label %226

226:                                              ; preds = %221, %216
  %227 = call i32 @b2InternalAssertFcn(ptr noundef @.str.9, ptr noundef @.str.1, i32 noundef 381)
  %228 = icmp ne i32 %227, 0
  br i1 %228, label %229, label %230

229:                                              ; preds = %226
  call void @llvm.trap()
  br label %230

230:                                              ; preds = %229, %226, %221
  br label %231

231:                                              ; preds = %230
  br label %232

232:                                              ; preds = %231
  br label %233

233:                                              ; preds = %232
  %234 = load ptr, ptr %15, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.b2SurfaceMaterial, ptr %234, i32 0, i32 3
  %236 = load float, ptr %235, align 4, !tbaa !54
  %237 = call zeroext i1 @b2IsValidFloat(float noundef %236)
  br i1 %237, label %242, label %238

238:                                              ; preds = %233
  %239 = call i32 @b2InternalAssertFcn(ptr noundef @.str.10, ptr noundef @.str.1, i32 noundef 382)
  %240 = icmp ne i32 %239, 0
  br i1 %240, label %241, label %242

241:                                              ; preds = %238
  call void @llvm.trap()
  br label %242

242:                                              ; preds = %241, %238, %233
  br label %243

243:                                              ; preds = %242
  br label %244

244:                                              ; preds = %243
  %245 = load ptr, ptr %12, align 8, !tbaa !5
  %246 = getelementptr inbounds %struct.b2ChainShape, ptr %245, i32 0, i32 6
  %247 = load ptr, ptr %246, align 8, !tbaa !48
  %248 = load i32, ptr %14, align 4, !tbaa !24
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds %struct.b2SurfaceMaterial, ptr %247, i64 %249
  %251 = load ptr, ptr %15, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %250, ptr align 4 %251, i64 24, i1 false), !tbaa.struct !55
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %252

252:                                              ; preds = %244
  %253 = load i32, ptr %14, align 4, !tbaa !24
  %254 = add nsw i32 %253, 1
  store i32 %254, ptr %14, align 4, !tbaa !24
  br label %170, !llvm.loop !57

255:                                              ; preds = %174
  %256 = load i32, ptr %10, align 4, !tbaa !24
  %257 = load ptr, ptr %8, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.b2Body, ptr %257, i32 0, i32 8
  store i32 %256, ptr %258, align 8, !tbaa !44
  call void @llvm.lifetime.start.p0(i64 80, ptr %16) #7
  call void @b2DefaultShapeDef(ptr dead_on_unwind writable sret(%struct.b2ShapeDef) align 8 %16)
  %259 = load ptr, ptr %5, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct.b2ChainDef, ptr %259, i32 0, i32 0
  %261 = load ptr, ptr %260, align 8, !tbaa !59
  %262 = getelementptr inbounds %struct.b2ShapeDef, ptr %16, i32 0, i32 0
  store ptr %261, ptr %262, align 8, !tbaa !60
  %263 = getelementptr inbounds %struct.b2ShapeDef, ptr %16, i32 0, i32 3
  %264 = load ptr, ptr %5, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct.b2ChainDef, ptr %264, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %263, ptr align 8 %265, i64 24, i1 false), !tbaa.struct !62
  %266 = load ptr, ptr %5, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct.b2ChainDef, ptr %266, i32 0, i32 7
  %268 = load i8, ptr %267, align 1, !tbaa !64, !range !65, !noundef !66
  %269 = trunc i8 %268 to i1
  %270 = getelementptr inbounds %struct.b2ShapeDef, ptr %16, i32 0, i32 5
  %271 = zext i1 %269 to i8
  store i8 %271, ptr %270, align 1, !tbaa !67
  %272 = getelementptr inbounds %struct.b2ShapeDef, ptr %16, i32 0, i32 6
  store i8 0, ptr %272, align 2, !tbaa !68
  %273 = getelementptr inbounds %struct.b2ShapeDef, ptr %16, i32 0, i32 7
  store i8 0, ptr %273, align 1, !tbaa !69
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %274 = load ptr, ptr %5, align 8, !tbaa !5
  %275 = getelementptr inbounds %struct.b2ChainDef, ptr %274, i32 0, i32 1
  %276 = load ptr, ptr %275, align 8, !tbaa !70
  store ptr %276, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %277 = load ptr, ptr %5, align 8, !tbaa !5
  %278 = getelementptr inbounds %struct.b2ChainDef, ptr %277, i32 0, i32 2
  %279 = load i32, ptr %278, align 8, !tbaa !15
  store i32 %279, ptr %18, align 4, !tbaa !24
  %280 = load ptr, ptr %5, align 8, !tbaa !5
  %281 = getelementptr inbounds %struct.b2ChainDef, ptr %280, i32 0, i32 6
  %282 = load i8, ptr %281, align 8, !tbaa !71, !range !65, !noundef !66
  %283 = trunc i8 %282 to i1
  br i1 %283, label %284, label %478

284:                                              ; preds = %255
  %285 = load i32, ptr %18, align 4, !tbaa !24
  %286 = load ptr, ptr %12, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct.b2ChainShape, ptr %286, i32 0, i32 3
  store i32 %285, ptr %287, align 4, !tbaa !72
  %288 = load ptr, ptr %12, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct.b2ChainShape, ptr %288, i32 0, i32 3
  %290 = load i32, ptr %289, align 4, !tbaa !72
  %291 = sext i32 %290 to i64
  %292 = mul i64 %291, 4
  %293 = trunc i64 %292 to i32
  %294 = call ptr @b2Alloc(i32 noundef %293)
  %295 = load ptr, ptr %12, align 8, !tbaa !5
  %296 = getelementptr inbounds %struct.b2ChainShape, ptr %295, i32 0, i32 5
  store ptr %294, ptr %296, align 8, !tbaa !73
  call void @llvm.lifetime.start.p0(i64 36, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %297 = load i32, ptr %18, align 4, !tbaa !24
  %298 = sub nsw i32 %297, 1
  store i32 %298, ptr %20, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 0, ptr %21, align 4, !tbaa !24
  br label %299

299:                                              ; preds = %363, %284
  %300 = load i32, ptr %21, align 4, !tbaa !24
  %301 = load i32, ptr %18, align 4, !tbaa !24
  %302 = sub nsw i32 %301, 2
  %303 = icmp slt i32 %300, %302
  br i1 %303, label %305, label %304

304:                                              ; preds = %299
  store i32 21, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %366

305:                                              ; preds = %299
  %306 = getelementptr inbounds %struct.b2ChainSegment, ptr %19, i32 0, i32 0
  %307 = load ptr, ptr %17, align 8, !tbaa !5
  %308 = load i32, ptr %20, align 4, !tbaa !24
  %309 = sext i32 %308 to i64
  %310 = getelementptr inbounds %struct.b2Vec2, ptr %307, i64 %309
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %306, ptr align 4 %310, i64 8, i1 false), !tbaa.struct !74
  %311 = getelementptr inbounds %struct.b2ChainSegment, ptr %19, i32 0, i32 1
  %312 = getelementptr inbounds %struct.b2Segment, ptr %311, i32 0, i32 0
  %313 = load ptr, ptr %17, align 8, !tbaa !5
  %314 = load i32, ptr %21, align 4, !tbaa !24
  %315 = sext i32 %314 to i64
  %316 = getelementptr inbounds %struct.b2Vec2, ptr %313, i64 %315
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %312, ptr align 4 %316, i64 8, i1 false), !tbaa.struct !74
  %317 = getelementptr inbounds %struct.b2ChainSegment, ptr %19, i32 0, i32 1
  %318 = getelementptr inbounds %struct.b2Segment, ptr %317, i32 0, i32 1
  %319 = load ptr, ptr %17, align 8, !tbaa !5
  %320 = load i32, ptr %21, align 4, !tbaa !24
  %321 = add nsw i32 %320, 1
  %322 = sext i32 %321 to i64
  %323 = getelementptr inbounds %struct.b2Vec2, ptr %319, i64 %322
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %318, ptr align 4 %323, i64 8, i1 false), !tbaa.struct !74
  %324 = getelementptr inbounds %struct.b2ChainSegment, ptr %19, i32 0, i32 2
  %325 = load ptr, ptr %17, align 8, !tbaa !5
  %326 = load i32, ptr %21, align 4, !tbaa !24
  %327 = add nsw i32 %326, 2
  %328 = sext i32 %327 to i64
  %329 = getelementptr inbounds %struct.b2Vec2, ptr %325, i64 %328
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %324, ptr align 4 %329, i64 8, i1 false), !tbaa.struct !74
  %330 = load i32, ptr %10, align 4, !tbaa !24
  %331 = getelementptr inbounds %struct.b2ChainSegment, ptr %19, i32 0, i32 3
  store i32 %330, ptr %331, align 4, !tbaa !75
  %332 = load i32, ptr %21, align 4, !tbaa !24
  store i32 %332, ptr %20, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %333 = load i32, ptr %13, align 4, !tbaa !24
  %334 = icmp eq i32 %333, 1
  br i1 %334, label %335, label %336

335:                                              ; preds = %305
  br label %338

336:                                              ; preds = %305
  %337 = load i32, ptr %21, align 4, !tbaa !24
  br label %338

338:                                              ; preds = %336, %335
  %339 = phi i32 [ 0, %335 ], [ %337, %336 ]
  store i32 %339, ptr %22, align 4, !tbaa !24
  %340 = getelementptr inbounds %struct.b2ShapeDef, ptr %16, i32 0, i32 1
  %341 = load ptr, ptr %5, align 8, !tbaa !5
  %342 = getelementptr inbounds %struct.b2ChainDef, ptr %341, i32 0, i32 3
  %343 = load ptr, ptr %342, align 8, !tbaa !49
  %344 = load i32, ptr %22, align 4, !tbaa !24
  %345 = sext i32 %344 to i64
  %346 = getelementptr inbounds %struct.b2SurfaceMaterial, ptr %343, i64 %345
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %340, ptr align 4 %346, i64 24, i1 false), !tbaa.struct !55
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %347 = load ptr, ptr %6, align 8, !tbaa !5
  %348 = load ptr, ptr %8, align 8, !tbaa !5
  %349 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %9, i32 0, i32 0
  %350 = load <2 x float>, ptr %349, align 4
  %351 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %9, i32 0, i32 1
  %352 = load <2 x float>, ptr %351, align 4
  %353 = call ptr @b2CreateShapeInternal(ptr noundef %347, ptr noundef %348, <2 x float> %350, <2 x float> %352, ptr noundef %16, ptr noundef %19, i32 noundef 4)
  store ptr %353, ptr %23, align 8, !tbaa !5
  %354 = load ptr, ptr %23, align 8, !tbaa !5
  %355 = getelementptr inbounds %struct.b2Shape, ptr %354, i32 0, i32 0
  %356 = load i32, ptr %355, align 8, !tbaa !78
  %357 = load ptr, ptr %12, align 8, !tbaa !5
  %358 = getelementptr inbounds %struct.b2ChainShape, ptr %357, i32 0, i32 5
  %359 = load ptr, ptr %358, align 8, !tbaa !73
  %360 = load i32, ptr %21, align 4, !tbaa !24
  %361 = sext i32 %360 to i64
  %362 = getelementptr inbounds i32, ptr %359, i64 %361
  store i32 %356, ptr %362, align 4, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %363

363:                                              ; preds = %338
  %364 = load i32, ptr %21, align 4, !tbaa !24
  %365 = add nsw i32 %364, 1
  store i32 %365, ptr %21, align 4, !tbaa !24
  br label %299, !llvm.loop !81

366:                                              ; preds = %304
  %367 = getelementptr inbounds %struct.b2ChainSegment, ptr %19, i32 0, i32 0
  %368 = load ptr, ptr %17, align 8, !tbaa !5
  %369 = load i32, ptr %18, align 4, !tbaa !24
  %370 = sub nsw i32 %369, 3
  %371 = sext i32 %370 to i64
  %372 = getelementptr inbounds %struct.b2Vec2, ptr %368, i64 %371
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %367, ptr align 4 %372, i64 8, i1 false), !tbaa.struct !74
  %373 = getelementptr inbounds %struct.b2ChainSegment, ptr %19, i32 0, i32 1
  %374 = getelementptr inbounds %struct.b2Segment, ptr %373, i32 0, i32 0
  %375 = load ptr, ptr %17, align 8, !tbaa !5
  %376 = load i32, ptr %18, align 4, !tbaa !24
  %377 = sub nsw i32 %376, 2
  %378 = sext i32 %377 to i64
  %379 = getelementptr inbounds %struct.b2Vec2, ptr %375, i64 %378
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %374, ptr align 4 %379, i64 8, i1 false), !tbaa.struct !74
  %380 = getelementptr inbounds %struct.b2ChainSegment, ptr %19, i32 0, i32 1
  %381 = getelementptr inbounds %struct.b2Segment, ptr %380, i32 0, i32 1
  %382 = load ptr, ptr %17, align 8, !tbaa !5
  %383 = load i32, ptr %18, align 4, !tbaa !24
  %384 = sub nsw i32 %383, 1
  %385 = sext i32 %384 to i64
  %386 = getelementptr inbounds %struct.b2Vec2, ptr %382, i64 %385
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %381, ptr align 4 %386, i64 8, i1 false), !tbaa.struct !74
  %387 = getelementptr inbounds %struct.b2ChainSegment, ptr %19, i32 0, i32 2
  %388 = load ptr, ptr %17, align 8, !tbaa !5
  %389 = getelementptr inbounds %struct.b2Vec2, ptr %388, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %387, ptr align 4 %389, i64 8, i1 false), !tbaa.struct !74
  %390 = load i32, ptr %10, align 4, !tbaa !24
  %391 = getelementptr inbounds %struct.b2ChainSegment, ptr %19, i32 0, i32 3
  store i32 %390, ptr %391, align 4, !tbaa !75
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  %392 = load i32, ptr %13, align 4, !tbaa !24
  %393 = icmp eq i32 %392, 1
  br i1 %393, label %394, label %395

394:                                              ; preds = %366
  br label %398

395:                                              ; preds = %366
  %396 = load i32, ptr %18, align 4, !tbaa !24
  %397 = sub nsw i32 %396, 2
  br label %398

398:                                              ; preds = %395, %394
  %399 = phi i32 [ 0, %394 ], [ %397, %395 ]
  store i32 %399, ptr %24, align 4, !tbaa !24
  %400 = getelementptr inbounds %struct.b2ShapeDef, ptr %16, i32 0, i32 1
  %401 = load ptr, ptr %5, align 8, !tbaa !5
  %402 = getelementptr inbounds %struct.b2ChainDef, ptr %401, i32 0, i32 3
  %403 = load ptr, ptr %402, align 8, !tbaa !49
  %404 = load i32, ptr %24, align 4, !tbaa !24
  %405 = sext i32 %404 to i64
  %406 = getelementptr inbounds %struct.b2SurfaceMaterial, ptr %403, i64 %405
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %400, ptr align 4 %406, i64 24, i1 false), !tbaa.struct !55
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %407 = load ptr, ptr %6, align 8, !tbaa !5
  %408 = load ptr, ptr %8, align 8, !tbaa !5
  %409 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %9, i32 0, i32 0
  %410 = load <2 x float>, ptr %409, align 4
  %411 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %9, i32 0, i32 1
  %412 = load <2 x float>, ptr %411, align 4
  %413 = call ptr @b2CreateShapeInternal(ptr noundef %407, ptr noundef %408, <2 x float> %410, <2 x float> %412, ptr noundef %16, ptr noundef %19, i32 noundef 4)
  store ptr %413, ptr %25, align 8, !tbaa !5
  %414 = load ptr, ptr %25, align 8, !tbaa !5
  %415 = getelementptr inbounds %struct.b2Shape, ptr %414, i32 0, i32 0
  %416 = load i32, ptr %415, align 8, !tbaa !78
  %417 = load ptr, ptr %12, align 8, !tbaa !5
  %418 = getelementptr inbounds %struct.b2ChainShape, ptr %417, i32 0, i32 5
  %419 = load ptr, ptr %418, align 8, !tbaa !73
  %420 = load i32, ptr %18, align 4, !tbaa !24
  %421 = sub nsw i32 %420, 2
  %422 = sext i32 %421 to i64
  %423 = getelementptr inbounds i32, ptr %419, i64 %422
  store i32 %416, ptr %423, align 4, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  %424 = getelementptr inbounds %struct.b2ChainSegment, ptr %19, i32 0, i32 0
  %425 = load ptr, ptr %17, align 8, !tbaa !5
  %426 = load i32, ptr %18, align 4, !tbaa !24
  %427 = sub nsw i32 %426, 2
  %428 = sext i32 %427 to i64
  %429 = getelementptr inbounds %struct.b2Vec2, ptr %425, i64 %428
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %424, ptr align 4 %429, i64 8, i1 false), !tbaa.struct !74
  %430 = getelementptr inbounds %struct.b2ChainSegment, ptr %19, i32 0, i32 1
  %431 = getelementptr inbounds %struct.b2Segment, ptr %430, i32 0, i32 0
  %432 = load ptr, ptr %17, align 8, !tbaa !5
  %433 = load i32, ptr %18, align 4, !tbaa !24
  %434 = sub nsw i32 %433, 1
  %435 = sext i32 %434 to i64
  %436 = getelementptr inbounds %struct.b2Vec2, ptr %432, i64 %435
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %431, ptr align 4 %436, i64 8, i1 false), !tbaa.struct !74
  %437 = getelementptr inbounds %struct.b2ChainSegment, ptr %19, i32 0, i32 1
  %438 = getelementptr inbounds %struct.b2Segment, ptr %437, i32 0, i32 1
  %439 = load ptr, ptr %17, align 8, !tbaa !5
  %440 = getelementptr inbounds %struct.b2Vec2, ptr %439, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %438, ptr align 4 %440, i64 8, i1 false), !tbaa.struct !74
  %441 = getelementptr inbounds %struct.b2ChainSegment, ptr %19, i32 0, i32 2
  %442 = load ptr, ptr %17, align 8, !tbaa !5
  %443 = getelementptr inbounds %struct.b2Vec2, ptr %442, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %441, ptr align 4 %443, i64 8, i1 false), !tbaa.struct !74
  %444 = load i32, ptr %10, align 4, !tbaa !24
  %445 = getelementptr inbounds %struct.b2ChainSegment, ptr %19, i32 0, i32 3
  store i32 %444, ptr %445, align 4, !tbaa !75
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  %446 = load i32, ptr %13, align 4, !tbaa !24
  %447 = icmp eq i32 %446, 1
  br i1 %447, label %448, label %449

448:                                              ; preds = %398
  br label %452

449:                                              ; preds = %398
  %450 = load i32, ptr %18, align 4, !tbaa !24
  %451 = sub nsw i32 %450, 1
  br label %452

452:                                              ; preds = %449, %448
  %453 = phi i32 [ 0, %448 ], [ %451, %449 ]
  store i32 %453, ptr %26, align 4, !tbaa !24
  %454 = getelementptr inbounds %struct.b2ShapeDef, ptr %16, i32 0, i32 1
  %455 = load ptr, ptr %5, align 8, !tbaa !5
  %456 = getelementptr inbounds %struct.b2ChainDef, ptr %455, i32 0, i32 3
  %457 = load ptr, ptr %456, align 8, !tbaa !49
  %458 = load i32, ptr %26, align 4, !tbaa !24
  %459 = sext i32 %458 to i64
  %460 = getelementptr inbounds %struct.b2SurfaceMaterial, ptr %457, i64 %459
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %454, ptr align 4 %460, i64 24, i1 false), !tbaa.struct !55
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %461 = load ptr, ptr %6, align 8, !tbaa !5
  %462 = load ptr, ptr %8, align 8, !tbaa !5
  %463 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %9, i32 0, i32 0
  %464 = load <2 x float>, ptr %463, align 4
  %465 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %9, i32 0, i32 1
  %466 = load <2 x float>, ptr %465, align 4
  %467 = call ptr @b2CreateShapeInternal(ptr noundef %461, ptr noundef %462, <2 x float> %464, <2 x float> %466, ptr noundef %16, ptr noundef %19, i32 noundef 4)
  store ptr %467, ptr %27, align 8, !tbaa !5
  %468 = load ptr, ptr %27, align 8, !tbaa !5
  %469 = getelementptr inbounds %struct.b2Shape, ptr %468, i32 0, i32 0
  %470 = load i32, ptr %469, align 8, !tbaa !78
  %471 = load ptr, ptr %12, align 8, !tbaa !5
  %472 = getelementptr inbounds %struct.b2ChainShape, ptr %471, i32 0, i32 5
  %473 = load ptr, ptr %472, align 8, !tbaa !73
  %474 = load i32, ptr %18, align 4, !tbaa !24
  %475 = sub nsw i32 %474, 1
  %476 = sext i32 %475 to i64
  %477 = getelementptr inbounds i32, ptr %473, i64 %476
  store i32 %470, ptr %477, align 4, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 36, ptr %19) #7
  br label %561

478:                                              ; preds = %255
  %479 = load i32, ptr %18, align 4, !tbaa !24
  %480 = sub nsw i32 %479, 3
  %481 = load ptr, ptr %12, align 8, !tbaa !5
  %482 = getelementptr inbounds %struct.b2ChainShape, ptr %481, i32 0, i32 3
  store i32 %480, ptr %482, align 4, !tbaa !72
  %483 = load ptr, ptr %12, align 8, !tbaa !5
  %484 = getelementptr inbounds %struct.b2ChainShape, ptr %483, i32 0, i32 3
  %485 = load i32, ptr %484, align 4, !tbaa !72
  %486 = sext i32 %485 to i64
  %487 = mul i64 %486, 4
  %488 = trunc i64 %487 to i32
  %489 = call ptr @b2Alloc(i32 noundef %488)
  %490 = load ptr, ptr %12, align 8, !tbaa !5
  %491 = getelementptr inbounds %struct.b2ChainShape, ptr %490, i32 0, i32 5
  store ptr %489, ptr %491, align 8, !tbaa !73
  call void @llvm.lifetime.start.p0(i64 36, ptr %28) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  store i32 0, ptr %29, align 4, !tbaa !24
  br label %492

492:                                              ; preds = %557, %478
  %493 = load i32, ptr %29, align 4, !tbaa !24
  %494 = load i32, ptr %18, align 4, !tbaa !24
  %495 = sub nsw i32 %494, 3
  %496 = icmp slt i32 %493, %495
  br i1 %496, label %498, label %497

497:                                              ; preds = %492
  store i32 24, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  br label %560

498:                                              ; preds = %492
  %499 = getelementptr inbounds %struct.b2ChainSegment, ptr %28, i32 0, i32 0
  %500 = load ptr, ptr %17, align 8, !tbaa !5
  %501 = load i32, ptr %29, align 4, !tbaa !24
  %502 = sext i32 %501 to i64
  %503 = getelementptr inbounds %struct.b2Vec2, ptr %500, i64 %502
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %499, ptr align 4 %503, i64 8, i1 false), !tbaa.struct !74
  %504 = getelementptr inbounds %struct.b2ChainSegment, ptr %28, i32 0, i32 1
  %505 = getelementptr inbounds %struct.b2Segment, ptr %504, i32 0, i32 0
  %506 = load ptr, ptr %17, align 8, !tbaa !5
  %507 = load i32, ptr %29, align 4, !tbaa !24
  %508 = add nsw i32 %507, 1
  %509 = sext i32 %508 to i64
  %510 = getelementptr inbounds %struct.b2Vec2, ptr %506, i64 %509
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %505, ptr align 4 %510, i64 8, i1 false), !tbaa.struct !74
  %511 = getelementptr inbounds %struct.b2ChainSegment, ptr %28, i32 0, i32 1
  %512 = getelementptr inbounds %struct.b2Segment, ptr %511, i32 0, i32 1
  %513 = load ptr, ptr %17, align 8, !tbaa !5
  %514 = load i32, ptr %29, align 4, !tbaa !24
  %515 = add nsw i32 %514, 2
  %516 = sext i32 %515 to i64
  %517 = getelementptr inbounds %struct.b2Vec2, ptr %513, i64 %516
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %512, ptr align 4 %517, i64 8, i1 false), !tbaa.struct !74
  %518 = getelementptr inbounds %struct.b2ChainSegment, ptr %28, i32 0, i32 2
  %519 = load ptr, ptr %17, align 8, !tbaa !5
  %520 = load i32, ptr %29, align 4, !tbaa !24
  %521 = add nsw i32 %520, 3
  %522 = sext i32 %521 to i64
  %523 = getelementptr inbounds %struct.b2Vec2, ptr %519, i64 %522
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %518, ptr align 4 %523, i64 8, i1 false), !tbaa.struct !74
  %524 = load i32, ptr %10, align 4, !tbaa !24
  %525 = getelementptr inbounds %struct.b2ChainSegment, ptr %28, i32 0, i32 3
  store i32 %524, ptr %525, align 4, !tbaa !75
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  %526 = load i32, ptr %13, align 4, !tbaa !24
  %527 = icmp eq i32 %526, 1
  br i1 %527, label %528, label %529

528:                                              ; preds = %498
  br label %532

529:                                              ; preds = %498
  %530 = load i32, ptr %29, align 4, !tbaa !24
  %531 = add nsw i32 %530, 1
  br label %532

532:                                              ; preds = %529, %528
  %533 = phi i32 [ 0, %528 ], [ %531, %529 ]
  store i32 %533, ptr %30, align 4, !tbaa !24
  %534 = getelementptr inbounds %struct.b2ShapeDef, ptr %16, i32 0, i32 1
  %535 = load ptr, ptr %5, align 8, !tbaa !5
  %536 = getelementptr inbounds %struct.b2ChainDef, ptr %535, i32 0, i32 3
  %537 = load ptr, ptr %536, align 8, !tbaa !49
  %538 = load i32, ptr %30, align 4, !tbaa !24
  %539 = sext i32 %538 to i64
  %540 = getelementptr inbounds %struct.b2SurfaceMaterial, ptr %537, i64 %539
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %534, ptr align 4 %540, i64 24, i1 false), !tbaa.struct !55
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #7
  %541 = load ptr, ptr %6, align 8, !tbaa !5
  %542 = load ptr, ptr %8, align 8, !tbaa !5
  %543 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %9, i32 0, i32 0
  %544 = load <2 x float>, ptr %543, align 4
  %545 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %9, i32 0, i32 1
  %546 = load <2 x float>, ptr %545, align 4
  %547 = call ptr @b2CreateShapeInternal(ptr noundef %541, ptr noundef %542, <2 x float> %544, <2 x float> %546, ptr noundef %16, ptr noundef %28, i32 noundef 4)
  store ptr %547, ptr %31, align 8, !tbaa !5
  %548 = load ptr, ptr %31, align 8, !tbaa !5
  %549 = getelementptr inbounds %struct.b2Shape, ptr %548, i32 0, i32 0
  %550 = load i32, ptr %549, align 8, !tbaa !78
  %551 = load ptr, ptr %12, align 8, !tbaa !5
  %552 = getelementptr inbounds %struct.b2ChainShape, ptr %551, i32 0, i32 5
  %553 = load ptr, ptr %552, align 8, !tbaa !73
  %554 = load i32, ptr %29, align 4, !tbaa !24
  %555 = sext i32 %554 to i64
  %556 = getelementptr inbounds i32, ptr %553, i64 %555
  store i32 %550, ptr %556, align 4, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  br label %557

557:                                              ; preds = %532
  %558 = load i32, ptr %29, align 4, !tbaa !24
  %559 = add nsw i32 %558, 1
  store i32 %559, ptr %29, align 4, !tbaa !24
  br label %492, !llvm.loop !82

560:                                              ; preds = %497
  call void @llvm.lifetime.end.p0(i64 36, ptr %28) #7
  br label %561

561:                                              ; preds = %560, %452
  %562 = getelementptr inbounds %struct.b2ChainId, ptr %3, i32 0, i32 0
  %563 = load i32, ptr %10, align 4, !tbaa !24
  %564 = add nsw i32 %563, 1
  store i32 %564, ptr %562, align 4, !tbaa !20
  %565 = getelementptr inbounds %struct.b2ChainId, ptr %3, i32 0, i32 1
  %566 = load ptr, ptr %6, align 8, !tbaa !5
  %567 = getelementptr inbounds %struct.b2World, ptr %566, i32 0, i32 59
  %568 = load i16, ptr %567, align 4, !tbaa !83
  store i16 %568, ptr %565, align 4, !tbaa !22
  %569 = getelementptr inbounds %struct.b2ChainId, ptr %3, i32 0, i32 2
  %570 = load ptr, ptr %12, align 8, !tbaa !5
  %571 = getelementptr inbounds %struct.b2ChainShape, ptr %570, i32 0, i32 7
  %572 = load i16, ptr %571, align 8, !tbaa !46
  store i16 %572, ptr %569, align 2, !tbaa !23
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %573

573:                                              ; preds = %561, %79
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %574 = load i64, ptr %3, align 4
  ret i64 %574
}

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

declare { <2 x float>, <2 x float> } @b2GetBodyTransformQuick(ptr noundef, ptr noundef) #1

declare i32 @b2AllocId(ptr noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @b2ChainShapeArray_Push(ptr noundef, ptr noundef byval(%struct.b2ChainShape) align 8) #6

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

declare void @b2DefaultShapeDef(ptr dead_on_unwind writable sret(%struct.b2ShapeDef) align 8) #1

; Function Attrs: nounwind uwtable
declare hidden ptr @b2CreateShapeInternal(ptr noundef, ptr noundef, <2 x float>, <2 x float>, ptr noundef, ptr noundef, i32 noundef) #5

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { cold noreturn nounwind memory(inaccessiblemem: write) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #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 68}
!10 = !{!"b2ChainDef", !6, i64 0, !6, i64 8, !11, i64 16, !6, i64 24, !11, i64 32, !12, i64 40, !14, i64 64, !14, i64 65, !11, i64 68}
!11 = !{!"int", !7, i64 0}
!12 = !{!"b2Filter", !13, i64 0, !13, i64 8, !11, i64 16}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{!10, !11, i64 16}
!16 = !{!10, !11, i64 32}
!17 = !{!18, !19, i64 4}
!18 = !{!"b2BodyId", !11, i64 0, !19, i64 4, !19, i64 6}
!19 = !{!"short", !7, i64 0}
!20 = !{!21, !11, i64 0}
!21 = !{!"b2ChainId", !11, i64 0, !19, i64 4, !19, i64 6}
!22 = !{!21, !19, i64 4}
!23 = !{!21, !19, i64 6}
!24 = !{!11, !11, i64 0}
!25 = !{!26, !11, i64 1280}
!26 = !{!"b2World", !27, i64 0, !29, i64 40, !32, i64 336, !33, i64 1008, !28, i64 1032, !33, i64 1048, !28, i64 1072, !33, i64 1088, !28, i64 1112, !33, i64 1128, !28, i64 1152, !33, i64 1168, !28, i64 1192, !33, i64 1208, !33, i64 1232, !28, i64 1256, !28, i64 1272, !28, i64 1288, !28, i64 1304, !28, i64 1320, !28, i64 1336, !28, i64 1352, !28, i64 1368, !7, i64 1384, !7, i64 1416, !11, i64 1448, !28, i64 1456, !34, i64 1472, !34, i64 1488, !34, i64 1504, !34, i64 1520, !13, i64 1536, !11, i64 1544, !35, i64 1548, !36, i64 1556, !36, i64 1560, !36, i64 1564, !36, i64 1568, !36, i64 1572, !36, i64 1576, !36, i64 1580, !36, i64 1584, !6, i64 1592, !6, i64 1600, !19, i64 1608, !37, 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, !36, i64 1784, !11, i64 1788, !11, i64 1792, !19, i64 1796, !14, i64 1798, !14, i64 1799, !14, i64 1800, !14, i64 1801, !14, i64 1802, !14, i64 1803}
!27 = !{!"b2ArenaAllocator", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !28, i64 24}
!28 = !{!"", !6, i64 0, !11, i64 8, !11, i64 12}
!29 = !{!"b2BroadPhase", !7, i64 0, !11, i64 216, !30, i64 224, !28, i64 240, !6, i64 256, !6, i64 264, !11, i64 272, !31, i64 276, !30, i64 280}
!30 = !{!"b2HashSet", !6, i64 0, !11, i64 8, !11, i64 12}
!31 = !{!"b2AtomicInt", !11, i64 0}
!32 = !{!"b2ConstraintGraph", !7, i64 0}
!33 = !{!"b2IdPool", !28, i64 0, !11, i64 16}
!34 = !{!"b2BitSet", !6, i64 0, !11, i64 8, !11, i64 12}
!35 = !{!"b2Vec2", !36, i64 0, !36, i64 4}
!36 = !{!"float", !7, i64 0}
!37 = !{!"b2Profile", !36, i64 0, !36, i64 4, !36, i64 8, !36, i64 12, !36, i64 16, !36, i64 20, !36, i64 24, !36, i64 28, !36, i64 32, !36, i64 36, !36, i64 40, !36, i64 44, !36, i64 48, !36, i64 52, !36, i64 56, !36, i64 60, !36, i64 64, !36, i64 68, !36, i64 72, !36, i64 76, !36, i64 80, !36, i64 84}
!38 = !{!26, !6, i64 1272}
!39 = !{!40, !11, i64 0}
!40 = !{!"b2ChainShape", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !6, i64 24, !6, i64 32, !19, i64 40}
!41 = !{!42, !11, i64 108}
!42 = !{!"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, !36, i64 88, !36, i64 92, !36, i64 96, !36, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !19, i64 116, !14, i64 118, !14, i64 119, !14, i64 120, !14, i64 121}
!43 = !{!40, !11, i64 4}
!44 = !{!42, !11, i64 64}
!45 = !{!40, !11, i64 8}
!46 = !{!40, !19, i64 40}
!47 = !{!40, !11, i64 16}
!48 = !{!40, !6, i64 32}
!49 = !{!10, !6, i64 24}
!50 = !{!51, !36, i64 0}
!51 = !{!"b2SurfaceMaterial", !36, i64 0, !36, i64 4, !36, i64 8, !36, i64 12, !11, i64 16, !11, i64 20}
!52 = !{!51, !36, i64 4}
!53 = !{!51, !36, i64 8}
!54 = !{!51, !36, i64 12}
!55 = !{i64 0, i64 4, !56, i64 4, i64 4, !56, i64 8, i64 4, !56, i64 12, i64 4, !56, i64 16, i64 4, !24, i64 20, i64 4, !24}
!56 = !{!36, !36, i64 0}
!57 = distinct !{!57, !58}
!58 = !{!"llvm.loop.mustprogress"}
!59 = !{!10, !6, i64 0}
!60 = !{!61, !6, i64 0}
!61 = !{!"b2ShapeDef", !6, i64 0, !51, i64 8, !36, i64 32, !12, i64 40, !14, i64 64, !14, i64 65, !14, i64 66, !14, i64 67, !14, i64 68, !14, i64 69, !14, i64 70, !11, i64 72}
!62 = !{i64 0, i64 8, !63, i64 8, i64 8, !63, i64 16, i64 4, !24}
!63 = !{!13, !13, i64 0}
!64 = !{!10, !14, i64 65}
!65 = !{i8 0, i8 2}
!66 = !{}
!67 = !{!61, !14, i64 65}
!68 = !{!61, !14, i64 66}
!69 = !{!61, !14, i64 67}
!70 = !{!10, !6, i64 8}
!71 = !{!10, !14, i64 64}
!72 = !{!40, !11, i64 12}
!73 = !{!40, !6, i64 24}
!74 = !{i64 0, i64 4, !56, i64 4, i64 4, !56}
!75 = !{!76, !11, i64 32}
!76 = !{!"b2ChainSegment", !35, i64 0, !77, i64 8, !35, i64 24, !11, i64 32}
!77 = !{!"b2Segment", !35, i64 0, !35, i64 8}
!78 = !{!79, !11, i64 0}
!79 = !{!"b2Shape", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !36, i64 24, !36, i64 28, !36, i64 32, !36, i64 36, !36, i64 40, !11, i64 44, !80, i64 48, !80, i64 64, !35, i64 80, !11, i64 88, !12, i64 96, !6, i64 120, !11, i64 128, !7, i64 132, !19, i64 276, !14, i64 278, !14, i64 279, !14, i64 280, !14, i64 281, !14, i64 282}
!80 = !{!"b2AABB", !35, i64 0, !35, i64 8}
!81 = distinct !{!81, !58}
!82 = distinct !{!82, !58}
!83 = !{!26, !19, i64 1796}


; 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.b2ChainShape = type { i32, i32, i32, i32, i32, ptr, ptr, i16 }
%struct.b2ShapeDef = type { ptr, %struct.b2SurfaceMaterial, float, %struct.b2Filter, i8, i8, i8, i8, i8, i8, i8, i32 }
%struct.b2SurfaceMaterial = type { float, float, float, float, i32, i32 }
%struct.b2Filter = type { i64, i64, i32 }
%struct.b2ChainSegment = type { %struct.b2Vec2, %struct.b2Segment, %struct.b2Vec2, i32 }
%struct.b2Segment = type { %struct.b2Vec2, %struct.b2Vec2 }
%struct.b2Vec2 = type { float, float }

@.str.1 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [41 x i8], align 1

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

declare ptr @b2Alloc(i32 noundef) local_unnamed_addr #1

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

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

declare zeroext i1 @b2IsValidFloat(float noundef) local_unnamed_addr #1

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

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

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

declare ptr @b2GetWorldLocked(i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i64 @b2CreateChain(i64 %0, ptr nocapture noundef readonly %1) local_unnamed_addr #5 {
  %3 = alloca %struct.b2ChainShape, align 8
  %4 = alloca %struct.b2ShapeDef, align 8
  %5 = alloca %struct.b2ChainSegment, align 8
  %6 = alloca %struct.b2ChainSegment, align 8
  %.sroa.2.0.extract.shift = lshr i64 %0, 32
  %7 = getelementptr inbounds i8, ptr %1, i64 68
  %8 = load i32, ptr %7, align 4, !tbaa !5
  %9 = icmp eq i32 %8, 1152023
  br i1 %9, label %13, label %10

10:                                               ; preds = %2
  %11 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 341) #7
  %.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, %2
  %14 = getelementptr inbounds i8, ptr %1, i64 16
  %15 = load i32, ptr %14, align 8, !tbaa !14
  %16 = icmp sgt i32 %15, 3
  br i1 %16, label %20, label %17

17:                                               ; preds = %13
  %18 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 342) #7
  %.not156 = icmp eq i32 %18, 0
  br i1 %.not156, label %20, label %19

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

20:                                               ; preds = %17, %13
  %21 = getelementptr inbounds i8, ptr %1, i64 32
  %22 = load i32, ptr %21, align 8, !tbaa !15
  %23 = icmp eq i32 %22, 1
  br i1 %23, label %30, label %24

24:                                               ; preds = %20
  %25 = load i32, ptr %14, align 8, !tbaa !14
  %26 = icmp eq i32 %22, %25
  br i1 %26, label %30, label %27

27:                                               ; preds = %24
  %28 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 343) #7
  %.not157 = icmp eq i32 %28, 0
  br i1 %.not157, label %30, label %29

29:                                               ; preds = %27
  tail call void @llvm.trap()
  unreachable

30:                                               ; preds = %20, %24, %27
  %31 = trunc nuw i64 %.sroa.2.0.extract.shift to i32
  %32 = and i32 %31, 65535
  %33 = tail call ptr @b2GetWorldLocked(i32 noundef %32) #7
  %34 = icmp eq ptr %33, null
  br i1 %34, label %255, label %35

35:                                               ; preds = %30
  %36 = tail call ptr @b2GetBodyFullId(ptr noundef nonnull %33, i64 %0) #7
  %37 = tail call { <2 x float>, <2 x float> } @b2GetBodyTransformQuick(ptr noundef nonnull %33, ptr noundef %36) #7
  %38 = extractvalue { <2 x float>, <2 x float> } %37, 0
  %39 = extractvalue { <2 x float>, <2 x float> } %37, 1
  %40 = getelementptr inbounds i8, ptr %33, i64 1232
  %41 = tail call i32 @b2AllocId(ptr noundef nonnull %40) #7
  %42 = getelementptr inbounds i8, ptr %33, i64 1272
  %43 = getelementptr inbounds i8, ptr %33, i64 1280
  %44 = load i32, ptr %43, align 8, !tbaa !16
  %45 = icmp eq i32 %41, %44
  br i1 %45, label %46, label %47

46:                                               ; preds = %35
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %3, i8 0, i64 48, i1 false)
  tail call void @b2ChainShapeArray_Push(ptr noundef nonnull %42, ptr noundef nonnull byval(%struct.b2ChainShape) align 8 %3)
  br label %56

47:                                               ; preds = %35
  %48 = load ptr, ptr %42, align 8, !tbaa !30
  %49 = sext i32 %41 to i64
  %50 = getelementptr inbounds %struct.b2ChainShape, ptr %48, i64 %49
  %51 = load i32, ptr %50, align 8, !tbaa !31
  %52 = icmp eq i32 %51, -1
  br i1 %52, label %56, label %53

53:                                               ; preds = %47
  %54 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, i32 noundef 362) #7
  %.not158 = icmp eq i32 %54, 0
  br i1 %.not158, label %56, label %55

55:                                               ; preds = %53
  tail call void @llvm.trap()
  unreachable

56:                                               ; preds = %47, %53, %46
  %57 = tail call ptr @b2ChainShapeArray_Get(ptr noundef nonnull %42, i32 noundef %41)
  store i32 %41, ptr %57, align 8, !tbaa !31
  %58 = getelementptr inbounds i8, ptr %36, i64 108
  %59 = load i32, ptr %58, align 4, !tbaa !33
  %60 = getelementptr inbounds i8, ptr %57, i64 4
  store i32 %59, ptr %60, align 4, !tbaa !35
  %61 = getelementptr inbounds i8, ptr %36, i64 64
  %62 = load i32, ptr %61, align 8, !tbaa !36
  %63 = getelementptr inbounds i8, ptr %57, i64 8
  store i32 %62, ptr %63, align 8, !tbaa !37
  %64 = getelementptr inbounds i8, ptr %57, i64 40
  %65 = load i16, ptr %64, align 8, !tbaa !38
  %66 = add i16 %65, 1
  store i16 %66, ptr %64, align 8, !tbaa !38
  %67 = load i32, ptr %21, align 8, !tbaa !15
  %.fr173 = freeze i32 %67
  %68 = getelementptr inbounds i8, ptr %57, i64 16
  store i32 %.fr173, ptr %68, align 8, !tbaa !39
  %69 = mul i32 %.fr173, 24
  %70 = tail call ptr @b2Alloc(i32 noundef %69) #7
  %71 = getelementptr inbounds i8, ptr %57, i64 32
  store ptr %70, ptr %71, align 8, !tbaa !40
  %72 = icmp sgt i32 %.fr173, 0
  br i1 %72, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %56
  %73 = getelementptr inbounds i8, ptr %1, i64 24
  %wide.trip.count = zext nneg i32 %.fr173 to i64
  br label %88

._crit_edge:                                      ; preds = %126, %56
  store i32 %41, ptr %61, align 8, !tbaa !36
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %4) #7
  call void @b2DefaultShapeDef(ptr dead_on_unwind nonnull writable sret(%struct.b2ShapeDef) align 8 %4) #7
  %74 = load ptr, ptr %1, align 8, !tbaa !41
  store ptr %74, ptr %4, align 8, !tbaa !42
  %75 = getelementptr inbounds i8, ptr %4, i64 40
  %76 = getelementptr inbounds i8, ptr %1, i64 40
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %75, ptr noundef nonnull align 8 dereferenceable(24) %76, i64 24, i1 false), !tbaa.struct !45
  %77 = getelementptr inbounds i8, ptr %1, i64 65
  %78 = load i8, ptr %77, align 1, !tbaa !48, !range !49, !noundef !50
  %79 = getelementptr inbounds i8, ptr %4, i64 65
  store i8 %78, ptr %79, align 1, !tbaa !51
  %80 = getelementptr inbounds i8, ptr %4, i64 66
  store i8 0, ptr %80, align 2, !tbaa !52
  %81 = getelementptr inbounds i8, ptr %4, i64 67
  store i8 0, ptr %81, align 1, !tbaa !53
  %82 = getelementptr inbounds i8, ptr %1, i64 8
  %83 = load ptr, ptr %82, align 8, !tbaa !54
  %84 = load i32, ptr %14, align 8, !tbaa !14
  %85 = getelementptr inbounds i8, ptr %1, i64 64
  %86 = load i8, ptr %85, align 8, !tbaa !55, !range !49, !noundef !50
  %87 = trunc nuw i8 %86 to i1
  br i1 %87, label %129, label %202

88:                                               ; preds = %.lr.ph, %126
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %126 ]
  %89 = load ptr, ptr %73, align 8, !tbaa !56
  %90 = getelementptr inbounds %struct.b2SurfaceMaterial, ptr %89, i64 %indvars.iv
  %91 = load float, ptr %90, align 4, !tbaa !57
  %92 = tail call zeroext i1 @b2IsValidFloat(float noundef %91) #7
  br i1 %92, label %93, label %96

93:                                               ; preds = %88
  %94 = load float, ptr %90, align 4, !tbaa !57
  %95 = fcmp ult float %94, 0.000000e+00
  br i1 %95, label %96, label %99

96:                                               ; preds = %93, %88
  %97 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 379) #7
  %.not159 = icmp eq i32 %97, 0
  br i1 %.not159, label %99, label %98

98:                                               ; preds = %96
  tail call void @llvm.trap()
  unreachable

99:                                               ; preds = %93, %96
  %100 = getelementptr inbounds i8, ptr %90, i64 4
  %101 = load float, ptr %100, align 4, !tbaa !58
  %102 = tail call zeroext i1 @b2IsValidFloat(float noundef %101) #7
  br i1 %102, label %103, label %106

103:                                              ; preds = %99
  %104 = load float, ptr %100, align 4, !tbaa !58
  %105 = fcmp ult float %104, 0.000000e+00
  br i1 %105, label %106, label %109

106:                                              ; preds = %103, %99
  %107 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.1, i32 noundef 380) #7
  %.not160 = icmp eq i32 %107, 0
  br i1 %.not160, label %109, label %108

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

109:                                              ; preds = %103, %106
  %110 = getelementptr inbounds i8, ptr %90, i64 8
  %111 = load float, ptr %110, align 4, !tbaa !59
  %112 = tail call zeroext i1 @b2IsValidFloat(float noundef %111) #7
  br i1 %112, label %113, label %116

113:                                              ; preds = %109
  %114 = load float, ptr %110, align 4, !tbaa !59
  %115 = fcmp ult float %114, 0.000000e+00
  br i1 %115, label %116, label %119

116:                                              ; preds = %113, %109
  %117 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.1, i32 noundef 381) #7
  %.not161 = icmp eq i32 %117, 0
  br i1 %.not161, label %119, label %118

118:                                              ; preds = %116
  tail call void @llvm.trap()
  unreachable

119:                                              ; preds = %113, %116
  %120 = getelementptr inbounds i8, ptr %90, i64 12
  %121 = load float, ptr %120, align 4, !tbaa !60
  %122 = tail call zeroext i1 @b2IsValidFloat(float noundef %121) #7
  br i1 %122, label %126, label %123

123:                                              ; preds = %119
  %124 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.1, i32 noundef 382) #7
  %.not162 = icmp eq i32 %124, 0
  br i1 %.not162, label %126, label %125

125:                                              ; preds = %123
  tail call void @llvm.trap()
  unreachable

126:                                              ; preds = %123, %119
  %127 = load ptr, ptr %71, align 8, !tbaa !40
  %128 = getelementptr inbounds %struct.b2SurfaceMaterial, ptr %127, i64 %indvars.iv
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(24) %128, ptr noundef nonnull align 4 dereferenceable(24) %90, i64 24, i1 false), !tbaa.struct !61
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %88, !llvm.loop !63

129:                                              ; preds = %._crit_edge
  %130 = getelementptr inbounds i8, ptr %57, i64 12
  store i32 %84, ptr %130, align 4, !tbaa !65
  %131 = shl i32 %84, 2
  %132 = call ptr @b2Alloc(i32 noundef %131) #7
  %133 = getelementptr inbounds i8, ptr %57, i64 24
  store ptr %132, ptr %133, align 8, !tbaa !66
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %5) #7
  %134 = add nsw i32 %84, -1
  %135 = add i32 %84, -2
  %136 = icmp sgt i32 %84, 2
  br i1 %136, label %.lr.ph171, label %._crit_edge172

.lr.ph171:                                        ; preds = %129
  %137 = getelementptr inbounds i8, ptr %5, i64 8
  %138 = getelementptr inbounds i8, ptr %5, i64 16
  %139 = getelementptr inbounds i8, ptr %5, i64 24
  %140 = getelementptr inbounds i8, ptr %5, i64 32
  %141 = icmp eq i32 %.fr173, 1
  %142 = getelementptr inbounds i8, ptr %4, i64 8
  %143 = getelementptr inbounds i8, ptr %1, i64 24
  %wide.trip.count189 = zext nneg i32 %135 to i64
  br label %183

._crit_edge172:                                   ; preds = %183, %129
  %144 = sext i32 %84 to i64
  %145 = getelementptr %struct.b2Vec2, ptr %83, i64 %144
  %146 = getelementptr i8, ptr %145, i64 -24
  %147 = load i64, ptr %146, align 4
  store i64 %147, ptr %5, align 8
  %148 = getelementptr inbounds i8, ptr %5, i64 8
  %149 = sext i32 %135 to i64
  %150 = getelementptr inbounds %struct.b2Vec2, ptr %83, i64 %149
  %151 = load i64, ptr %150, align 4
  store i64 %151, ptr %148, align 8
  %152 = getelementptr inbounds i8, ptr %5, i64 16
  %153 = sext i32 %134 to i64
  %154 = getelementptr inbounds %struct.b2Vec2, ptr %83, i64 %153
  %155 = load i64, ptr %154, align 4
  store i64 %155, ptr %152, align 8
  %156 = getelementptr inbounds i8, ptr %5, i64 24
  %157 = load i64, ptr %83, align 4
  store i64 %157, ptr %156, align 8
  %158 = getelementptr inbounds i8, ptr %5, i64 32
  store i32 %41, ptr %158, align 8, !tbaa !67
  %159 = icmp eq i32 %.fr173, 1
  %160 = select i1 %159, i32 0, i32 %135
  %161 = getelementptr inbounds i8, ptr %4, i64 8
  %162 = getelementptr inbounds i8, ptr %1, i64 24
  %163 = load ptr, ptr %162, align 8, !tbaa !56
  %164 = sext i32 %160 to i64
  %165 = getelementptr inbounds %struct.b2SurfaceMaterial, ptr %163, i64 %164
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %161, ptr noundef nonnull align 4 dereferenceable(24) %165, i64 24, i1 false), !tbaa.struct !61
  %166 = call ptr @b2CreateShapeInternal(ptr noundef nonnull %33, ptr noundef %36, <2 x float> %38, <2 x float> %39, ptr noundef nonnull %4, ptr noundef nonnull %5, i32 noundef 4)
  %167 = load i32, ptr %166, align 8, !tbaa !70
  %168 = load ptr, ptr %133, align 8, !tbaa !66
  %169 = getelementptr inbounds i32, ptr %168, i64 %149
  store i32 %167, ptr %169, align 4, !tbaa !47
  %170 = load i64, ptr %150, align 4
  store i64 %170, ptr %5, align 8
  %171 = load i64, ptr %154, align 4
  store i64 %171, ptr %148, align 8
  %172 = load i64, ptr %83, align 4
  store i64 %172, ptr %152, align 8
  %173 = getelementptr inbounds i8, ptr %83, i64 8
  %174 = load i64, ptr %173, align 4
  store i64 %174, ptr %156, align 8
  store i32 %41, ptr %158, align 8, !tbaa !67
  %175 = select i1 %159, i32 0, i32 %134
  %176 = load ptr, ptr %162, align 8, !tbaa !56
  %177 = sext i32 %175 to i64
  %178 = getelementptr inbounds %struct.b2SurfaceMaterial, ptr %176, i64 %177
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %161, ptr noundef nonnull align 4 dereferenceable(24) %178, i64 24, i1 false), !tbaa.struct !61
  %179 = call ptr @b2CreateShapeInternal(ptr noundef nonnull %33, ptr noundef %36, <2 x float> %38, <2 x float> %39, ptr noundef nonnull %4, ptr noundef nonnull %5, i32 noundef 4)
  %180 = load i32, ptr %179, align 8, !tbaa !70
  %181 = load ptr, ptr %133, align 8, !tbaa !66
  %182 = getelementptr inbounds i32, ptr %181, i64 %153
  store i32 %180, ptr %182, align 4, !tbaa !47
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %5) #7
  br label %243

183:                                              ; preds = %.lr.ph171, %183
  %indvars.iv186 = phi i64 [ 0, %.lr.ph171 ], [ %indvars.iv.next187, %183 ]
  %.0149169 = phi i32 [ %134, %.lr.ph171 ], [ %193, %183 ]
  %184 = sext i32 %.0149169 to i64
  %185 = getelementptr inbounds %struct.b2Vec2, ptr %83, i64 %184
  %186 = load i64, ptr %185, align 4
  store i64 %186, ptr %5, align 8
  %187 = getelementptr inbounds %struct.b2Vec2, ptr %83, i64 %indvars.iv186
  %188 = load i64, ptr %187, align 4
  store i64 %188, ptr %137, align 8
  %indvars.iv.next187 = add nuw nsw i64 %indvars.iv186, 1
  %189 = getelementptr inbounds %struct.b2Vec2, ptr %83, i64 %indvars.iv.next187
  %190 = load i64, ptr %189, align 4
  store i64 %190, ptr %138, align 8
  %191 = getelementptr inbounds i8, ptr %187, i64 16
  %192 = load i64, ptr %191, align 4
  store i64 %192, ptr %139, align 8
  store i32 %41, ptr %140, align 8, !tbaa !67
  %193 = trunc nuw nsw i64 %indvars.iv186 to i32
  %194 = and i64 %indvars.iv186, 4294967295
  %195 = load ptr, ptr %143, align 8, !tbaa !56
  %196 = select i1 %141, i64 0, i64 %194
  %197 = getelementptr inbounds %struct.b2SurfaceMaterial, ptr %195, i64 %196
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %142, ptr noundef nonnull align 4 dereferenceable(24) %197, i64 24, i1 false), !tbaa.struct !61
  %198 = call ptr @b2CreateShapeInternal(ptr noundef nonnull %33, ptr noundef %36, <2 x float> %38, <2 x float> %39, ptr noundef nonnull %4, ptr noundef nonnull %5, i32 noundef 4)
  %199 = load i32, ptr %198, align 8, !tbaa !70
  %200 = load ptr, ptr %133, align 8, !tbaa !66
  %201 = getelementptr inbounds i32, ptr %200, i64 %indvars.iv186
  store i32 %199, ptr %201, align 4, !tbaa !47
  %exitcond190.not = icmp eq i64 %indvars.iv.next187, %wide.trip.count189
  br i1 %exitcond190.not, label %._crit_edge172, label %183, !llvm.loop !73

202:                                              ; preds = %._crit_edge
  %203 = add nsw i32 %84, -3
  %204 = getelementptr inbounds i8, ptr %57, i64 12
  store i32 %203, ptr %204, align 4, !tbaa !65
  %205 = shl i32 %203, 2
  %206 = call ptr @b2Alloc(i32 noundef %205) #7
  %207 = getelementptr inbounds i8, ptr %57, i64 24
  store ptr %206, ptr %207, align 8, !tbaa !66
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %6) #7
  %208 = icmp sgt i32 %84, 3
  br i1 %208, label %.lr.ph166, label %._crit_edge167

.lr.ph166:                                        ; preds = %202
  %209 = getelementptr inbounds i8, ptr %6, i64 8
  %210 = getelementptr inbounds i8, ptr %6, i64 16
  %211 = getelementptr inbounds i8, ptr %6, i64 24
  %212 = getelementptr inbounds i8, ptr %6, i64 32
  %213 = icmp eq i32 %.fr173, 1
  %214 = getelementptr inbounds i8, ptr %4, i64 8
  %215 = getelementptr inbounds i8, ptr %1, i64 24
  %wide.trip.count184 = zext nneg i32 %203 to i64
  br i1 %213, label %.lr.ph166.split.us, label %.lr.ph166.split

.lr.ph166.split.us:                               ; preds = %.lr.ph166, %.lr.ph166.split.us
  %indvars.iv181 = phi i64 [ %indvars.iv.next182, %.lr.ph166.split.us ], [ 0, %.lr.ph166 ]
  %216 = getelementptr inbounds %struct.b2Vec2, ptr %83, i64 %indvars.iv181
  %217 = load i64, ptr %216, align 4
  store i64 %217, ptr %6, align 8
  %indvars.iv.next182 = add nuw nsw i64 %indvars.iv181, 1
  %218 = getelementptr inbounds %struct.b2Vec2, ptr %83, i64 %indvars.iv.next182
  %219 = load i64, ptr %218, align 4
  store i64 %219, ptr %209, align 8
  %220 = getelementptr inbounds i8, ptr %216, i64 16
  %221 = load i64, ptr %220, align 4
  store i64 %221, ptr %210, align 8
  %222 = getelementptr inbounds i8, ptr %216, i64 24
  %223 = load i64, ptr %222, align 4
  store i64 %223, ptr %211, align 8
  store i32 %41, ptr %212, align 8, !tbaa !67
  %224 = load ptr, ptr %215, align 8, !tbaa !56
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %214, ptr noundef nonnull align 4 dereferenceable(24) %224, i64 24, i1 false), !tbaa.struct !61
  %225 = call ptr @b2CreateShapeInternal(ptr noundef nonnull %33, ptr noundef %36, <2 x float> %38, <2 x float> %39, ptr noundef nonnull %4, ptr noundef nonnull %6, i32 noundef 4)
  %226 = load i32, ptr %225, align 8, !tbaa !70
  %227 = load ptr, ptr %207, align 8, !tbaa !66
  %228 = getelementptr inbounds i32, ptr %227, i64 %indvars.iv181
  store i32 %226, ptr %228, align 4, !tbaa !47
  %exitcond185.not = icmp eq i64 %indvars.iv.next182, %wide.trip.count184
  br i1 %exitcond185.not, label %._crit_edge167, label %.lr.ph166.split.us, !llvm.loop !74

._crit_edge167:                                   ; preds = %.lr.ph166.split, %.lr.ph166.split.us, %202
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %6) #7
  br label %243

.lr.ph166.split:                                  ; preds = %.lr.ph166, %.lr.ph166.split
  %indvars.iv176 = phi i64 [ %indvars.iv.next177, %.lr.ph166.split ], [ 0, %.lr.ph166 ]
  %229 = getelementptr inbounds %struct.b2Vec2, ptr %83, i64 %indvars.iv176
  %230 = load i64, ptr %229, align 4
  store i64 %230, ptr %6, align 8
  %indvars.iv.next177 = add nuw nsw i64 %indvars.iv176, 1
  %231 = getelementptr inbounds %struct.b2Vec2, ptr %83, i64 %indvars.iv.next177
  %232 = load i64, ptr %231, align 4
  store i64 %232, ptr %209, align 8
  %233 = getelementptr inbounds i8, ptr %229, i64 16
  %234 = load i64, ptr %233, align 4
  store i64 %234, ptr %210, align 8
  %235 = getelementptr inbounds i8, ptr %229, i64 24
  %236 = load i64, ptr %235, align 4
  store i64 %236, ptr %211, align 8
  store i32 %41, ptr %212, align 8, !tbaa !67
  %237 = load ptr, ptr %215, align 8, !tbaa !56
  %238 = getelementptr inbounds %struct.b2SurfaceMaterial, ptr %237, i64 %indvars.iv.next177
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %214, ptr noundef nonnull align 4 dereferenceable(24) %238, i64 24, i1 false), !tbaa.struct !61
  %239 = call ptr @b2CreateShapeInternal(ptr noundef nonnull %33, ptr noundef %36, <2 x float> %38, <2 x float> %39, ptr noundef nonnull %4, ptr noundef nonnull %6, i32 noundef 4)
  %240 = load i32, ptr %239, align 8, !tbaa !70
  %241 = load ptr, ptr %207, align 8, !tbaa !66
  %242 = getelementptr inbounds i32, ptr %241, i64 %indvars.iv176
  store i32 %240, ptr %242, align 4, !tbaa !47
  %exitcond180.not = icmp eq i64 %indvars.iv.next177, %wide.trip.count184
  br i1 %exitcond180.not, label %._crit_edge167, label %.lr.ph166.split, !llvm.loop !74

243:                                              ; preds = %._crit_edge167, %._crit_edge172
  %244 = add nsw i32 %41, 1
  %245 = getelementptr inbounds i8, ptr %33, i64 1796
  %246 = load i16, ptr %245, align 4, !tbaa !75
  %247 = load i16, ptr %64, align 8, !tbaa !38
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %4) #7
  %248 = zext i16 %247 to i64
  %249 = shl nuw i64 %248, 48
  %250 = zext i16 %246 to i64
  %251 = shl nuw nsw i64 %250, 32
  %252 = zext i32 %244 to i64
  %253 = or disjoint i64 %251, %252
  %254 = or disjoint i64 %253, %249
  br label %255

255:                                              ; preds = %30, %243
  %.sroa.0146.0.insert.insert = phi i64 [ %254, %243 ], [ 0, %30 ]
  ret i64 %.sroa.0146.0.insert.insert
}

declare ptr @b2GetBodyFullId(ptr noundef, i64) local_unnamed_addr #1

declare { <2 x float>, <2 x float> } @b2GetBodyTransformQuick(ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @b2AllocId(ptr noundef) local_unnamed_addr #1

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

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

declare void @b2DefaultShapeDef(ptr dead_on_unwind writable sret(%struct.b2ShapeDef) align 8) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden ptr @b2CreateShapeInternal(ptr noundef, ptr noundef, <2 x float>, <2 x float>, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #5

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

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass