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

; 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.b2DistanceOutput = type { %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, float, i32, i32 }
%struct.b2Vec2 = type { float, float }
%struct.b2ShapeProxy = type { [8 x %struct.b2Vec2], i32, float }
%struct.b2Transform = type { %struct.b2Vec2, %struct.b2Rot }
%struct.b2Rot = type { float, float }
%struct.b2Simplex = type { %struct.b2SimplexVertex, %struct.b2SimplexVertex, %struct.b2SimplexVertex, i32 }
%struct.b2SimplexVertex = type { %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, float, i32, i32 }
%struct.b2DistanceInput = type { %struct.b2ShapeProxy, %struct.b2ShapeProxy, %struct.b2Transform, %struct.b2Transform, i8 }

@.str = external hidden unnamed_addr constant [51 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@b2_lengthUnitsPerMeter = external global float, align 4

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

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

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @b2ShapeDistance(ptr dead_on_unwind noalias writable sret(%struct.b2DistanceOutput) align 4 %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4) #4 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca %struct.b2ShapeProxy, align 4
  %12 = alloca %struct.b2Transform, align 4
  %13 = alloca i32, align 4
  %14 = alloca %struct.b2Vec2, align 4
  %15 = alloca %struct.b2Simplex, align 4
  %16 = alloca i32, align 4
  %17 = alloca [3 x ptr], align 16
  %18 = alloca %struct.b2Vec2, align 4
  %19 = alloca [3 x i32], align 4
  %20 = alloca [3 x i32], align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca %struct.b2Vec2, align 4
  %26 = alloca %struct.b2Vec2, align 4
  %27 = alloca %struct.b2Vec2, align 4
  %28 = alloca %struct.b2Vec2, align 4
  %29 = alloca i32, align 4
  %30 = alloca ptr, align 8
  %31 = alloca %struct.b2Vec2, align 4
  %32 = alloca %struct.b2Vec2, align 4
  %33 = alloca i8, align 1
  %34 = alloca i32, align 4
  %35 = alloca %struct.b2Vec2, align 4
  %36 = alloca %struct.b2Vec2, align 4
  %37 = alloca %struct.b2Vec2, align 4
  %38 = alloca %struct.b2Vec2, align 4
  %39 = alloca %struct.b2Vec2, align 4
  %40 = alloca %struct.b2Vec2, align 4
  %41 = alloca float, align 4
  %42 = alloca float, align 4
  %43 = alloca %struct.b2Vec2, align 4
  %44 = alloca %struct.b2Vec2, align 4
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  store i32 %4, ptr %9, align 4, !tbaa !9
  br label %45

45:                                               ; preds = %5
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.b2DistanceInput, ptr %46, i32 0, i32 0
  %48 = getelementptr inbounds %struct.b2ShapeProxy, ptr %47, i32 0, i32 1
  %49 = load i32, ptr %48, align 4, !tbaa !11
  %50 = icmp sgt i32 %49, 0
  br i1 %50, label %51, label %57

51:                                               ; preds = %45
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.b2DistanceInput, ptr %52, i32 0, i32 1
  %54 = getelementptr inbounds %struct.b2ShapeProxy, ptr %53, i32 0, i32 1
  %55 = load i32, ptr %54, align 4, !tbaa !19
  %56 = icmp sgt i32 %55, 0
  br i1 %56, label %61, label %57

57:                                               ; preds = %51, %45
  %58 = call i32 @b2InternalAssertFcn(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 424)
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %61

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

61:                                               ; preds = %60, %57, %51
  br label %62

62:                                               ; preds = %61
  br label %63

63:                                               ; preds = %62
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.b2DistanceInput, ptr %64, i32 0, i32 0
  %66 = getelementptr inbounds %struct.b2ShapeProxy, ptr %65, i32 0, i32 2
  %67 = load float, ptr %66, align 4, !tbaa !20
  %68 = fcmp oge float %67, 0.000000e+00
  br i1 %68, label %73, label %69

69:                                               ; preds = %63
  %70 = call i32 @b2InternalAssertFcn(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 425)
  %71 = icmp ne i32 %70, 0
  br i1 %71, label %72, label %73

72:                                               ; preds = %69
  call void @llvm.trap()
  br label %73

73:                                               ; preds = %72, %69, %63
  br label %74

74:                                               ; preds = %73
  br label %75

75:                                               ; preds = %74
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.b2DistanceInput, ptr %76, i32 0, i32 1
  %78 = getelementptr inbounds %struct.b2ShapeProxy, ptr %77, i32 0, i32 2
  %79 = load float, ptr %78, align 4, !tbaa !21
  %80 = fcmp oge float %79, 0.000000e+00
  br i1 %80, label %85, label %81

81:                                               ; preds = %75
  %82 = call i32 @b2InternalAssertFcn(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 426)
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %84, label %85

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

85:                                               ; preds = %84, %81, %75
  br label %86

86:                                               ; preds = %85
  call void @llvm.memset.p0.i64(ptr align 4 %0, i8 0, i64 36, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.b2DistanceInput, ptr %87, i32 0, i32 0
  store ptr %88, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 72, ptr %11) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #9
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.b2DistanceInput, ptr %89, i32 0, i32 2
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.b2DistanceInput, ptr %91, i32 0, i32 3
  %93 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %90, i32 0, i32 0
  %94 = load <2 x float>, ptr %93, align 4
  %95 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %90, i32 0, i32 1
  %96 = load <2 x float>, ptr %95, align 4
  %97 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %92, i32 0, i32 0
  %98 = load <2 x float>, ptr %97, align 4
  %99 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %92, i32 0, i32 1
  %100 = load <2 x float>, ptr %99, align 4
  %101 = call { <2 x float>, <2 x float> } @b2InvMulTransforms(<2 x float> %94, <2 x float> %96, <2 x float> %98, <2 x float> %100)
  %102 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %12, i32 0, i32 0
  %103 = extractvalue { <2 x float>, <2 x float> } %101, 0
  store <2 x float> %103, ptr %102, align 4
  %104 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %12, i32 0, i32 1
  %105 = extractvalue { <2 x float>, <2 x float> } %101, 1
  store <2 x float> %105, ptr %104, align 4
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.b2DistanceInput, ptr %106, i32 0, i32 1
  %108 = getelementptr inbounds %struct.b2ShapeProxy, ptr %107, i32 0, i32 1
  %109 = load i32, ptr %108, align 4, !tbaa !19
  %110 = getelementptr inbounds %struct.b2ShapeProxy, ptr %11, i32 0, i32 1
  store i32 %109, ptr %110, align 4, !tbaa !22
  %111 = load ptr, ptr %6, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.b2DistanceInput, ptr %111, i32 0, i32 1
  %113 = getelementptr inbounds %struct.b2ShapeProxy, ptr %112, i32 0, i32 2
  %114 = load float, ptr %113, align 4, !tbaa !21
  %115 = getelementptr inbounds %struct.b2ShapeProxy, ptr %11, i32 0, i32 2
  store float %114, ptr %115, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %116

116:                                              ; preds = %139, %86
  %117 = load i32, ptr %13, align 4, !tbaa !9
  %118 = getelementptr inbounds %struct.b2ShapeProxy, ptr %11, i32 0, i32 1
  %119 = load i32, ptr %118, align 4, !tbaa !22
  %120 = icmp slt i32 %117, %119
  br i1 %120, label %122, label %121

121:                                              ; preds = %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  br label %142

122:                                              ; preds = %116
  %123 = getelementptr inbounds %struct.b2ShapeProxy, ptr %11, i32 0, i32 0
  %124 = load i32, ptr %13, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %123, i64 0, i64 %125
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #9
  %127 = load ptr, ptr %6, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.b2DistanceInput, ptr %127, i32 0, i32 1
  %129 = getelementptr inbounds %struct.b2ShapeProxy, ptr %128, i32 0, i32 0
  %130 = load i32, ptr %13, align 4, !tbaa !9
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %129, i64 0, i64 %131
  %133 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %12, i32 0, i32 0
  %134 = load <2 x float>, ptr %133, align 4
  %135 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %12, i32 0, i32 1
  %136 = load <2 x float>, ptr %135, align 4
  %137 = load <2 x float>, ptr %132, align 4
  %138 = call <2 x float> @b2TransformPoint(<2 x float> %134, <2 x float> %136, <2 x float> %137)
  store <2 x float> %138, ptr %14, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %126, ptr align 4 %14, i64 8, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #9
  br label %139

139:                                              ; preds = %122
  %140 = load i32, ptr %13, align 4, !tbaa !9
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %13, align 4, !tbaa !9
  br label %116, !llvm.loop !26

142:                                              ; preds = %121
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #9
  call void @llvm.lifetime.start.p0(i64 112, ptr %15) #9
  %143 = load ptr, ptr %7, align 8, !tbaa !5
  %144 = load ptr, ptr %10, align 8, !tbaa !5
  call void @b2MakeSimplexFromCache(ptr dead_on_unwind writable sret(%struct.b2Simplex) align 4 %15, ptr noundef %143, ptr noundef %144, ptr noundef %11)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #9
  store i32 0, ptr %16, align 4, !tbaa !9
  %145 = load ptr, ptr %8, align 8, !tbaa !5
  %146 = icmp ne ptr %145, null
  br i1 %146, label %147, label %158

147:                                              ; preds = %142
  %148 = load i32, ptr %16, align 4, !tbaa !9
  %149 = load i32, ptr %9, align 4, !tbaa !9
  %150 = icmp slt i32 %148, %149
  br i1 %150, label %151, label %158

151:                                              ; preds = %147
  %152 = load ptr, ptr %8, align 8, !tbaa !5
  %153 = load i32, ptr %16, align 4, !tbaa !9
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds %struct.b2Simplex, ptr %152, i64 %154
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %155, ptr align 4 %15, i64 112, i1 false), !tbaa.struct !28
  %156 = load i32, ptr %16, align 4, !tbaa !9
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %16, align 4, !tbaa !9
  br label %158

158:                                              ; preds = %151, %147, %142
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #9
  %159 = getelementptr inbounds %struct.b2Simplex, ptr %15, i32 0, i32 0
  store ptr %159, ptr %17, align 8, !tbaa !5
  %160 = getelementptr inbounds ptr, ptr %17, i64 1
  %161 = getelementptr inbounds %struct.b2Simplex, ptr %15, i32 0, i32 1
  store ptr %161, ptr %160, align 8, !tbaa !5
  %162 = getelementptr inbounds ptr, ptr %17, i64 2
  %163 = getelementptr inbounds %struct.b2Simplex, ptr %15, i32 0, i32 2
  store ptr %163, ptr %162, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #9
  call void @llvm.memset.p0.i64(ptr align 4 %18, i8 0, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %19) #9
  call void @llvm.lifetime.start.p0(i64 12, ptr %20) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #9
  store i32 20, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #9
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %164

164:                                              ; preds = %327, %158
  %165 = load i32, ptr %22, align 4, !tbaa !9
  %166 = icmp slt i32 %165, 20
  br i1 %166, label %167, label %328

167:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #9
  %168 = getelementptr inbounds %struct.b2Simplex, ptr %15, i32 0, i32 3
  %169 = load i32, ptr %168, align 4, !tbaa !29
  store i32 %169, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #9
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %170

170:                                              ; preds = %194, %167
  %171 = load i32, ptr %24, align 4, !tbaa !9
  %172 = load i32, ptr %23, align 4, !tbaa !9
  %173 = icmp slt i32 %171, %172
  br i1 %173, label %175, label %174

174:                                              ; preds = %170
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #9
  br label %197

175:                                              ; preds = %170
  %176 = load i32, ptr %24, align 4, !tbaa !9
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [3 x ptr], ptr %17, i64 0, i64 %177
  %179 = load ptr, ptr %178, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.b2SimplexVertex, ptr %179, i32 0, i32 4
  %181 = load i32, ptr %180, align 4, !tbaa !32
  %182 = load i32, ptr %24, align 4, !tbaa !9
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [3 x i32], ptr %19, i64 0, i64 %183
  store i32 %181, ptr %184, align 4, !tbaa !9
  %185 = load i32, ptr %24, align 4, !tbaa !9
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [3 x ptr], ptr %17, i64 0, i64 %186
  %188 = load ptr, ptr %187, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.b2SimplexVertex, ptr %188, i32 0, i32 5
  %190 = load i32, ptr %189, align 4, !tbaa !33
  %191 = load i32, ptr %24, align 4, !tbaa !9
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [3 x i32], ptr %20, i64 0, i64 %192
  store i32 %190, ptr %193, align 4, !tbaa !9
  br label %194

194:                                              ; preds = %175
  %195 = load i32, ptr %24, align 4, !tbaa !9
  %196 = add nsw i32 %195, 1
  store i32 %196, ptr %24, align 4, !tbaa !9
  br label %170, !llvm.loop !34

197:                                              ; preds = %174
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #9
  call void @llvm.memset.p0.i64(ptr align 4 %25, i8 0, i64 8, i1 false)
  %198 = getelementptr inbounds %struct.b2Simplex, ptr %15, i32 0, i32 3
  %199 = load i32, ptr %198, align 4, !tbaa !29
  switch i32 %199, label %209 [
    i32 1, label %200
    i32 2, label %205
    i32 3, label %207
  ]

200:                                              ; preds = %197
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #9
  %201 = getelementptr inbounds %struct.b2Simplex, ptr %15, i32 0, i32 0
  %202 = getelementptr inbounds %struct.b2SimplexVertex, ptr %201, i32 0, i32 2
  %203 = load <2 x float>, ptr %202, align 4
  %204 = call <2 x float> @b2Neg(<2 x float> %203)
  store <2 x float> %204, ptr %26, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 4 %26, i64 8, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #9
  br label %217

205:                                              ; preds = %197
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #9
  %206 = call <2 x float> @b2SolveSimplex2(ptr noundef %15)
  store <2 x float> %206, ptr %27, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 4 %27, i64 8, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #9
  br label %217

207:                                              ; preds = %197
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #9
  %208 = call <2 x float> @b2SolveSimplex3(ptr noundef %15)
  store <2 x float> %208, ptr %28, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 4 %28, i64 8, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #9
  br label %217

209:                                              ; preds = %197
  br label %210

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

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

214:                                              ; preds = %213, %210
  br label %215

215:                                              ; preds = %214
  br label %216

216:                                              ; preds = %215
  br label %217

217:                                              ; preds = %216, %207, %205, %200
  %218 = getelementptr inbounds %struct.b2Simplex, ptr %15, i32 0, i32 3
  %219 = load i32, ptr %218, align 4, !tbaa !29
  %220 = icmp eq i32 %219, 3
  br i1 %220, label %221, label %222

221:                                              ; preds = %217
  store i32 12, ptr %29, align 4
  br label %325

222:                                              ; preds = %217
  %223 = load ptr, ptr %8, align 8, !tbaa !5
  %224 = icmp ne ptr %223, null
  br i1 %224, label %225, label %236

225:                                              ; preds = %222
  %226 = load i32, ptr %16, align 4, !tbaa !9
  %227 = load i32, ptr %9, align 4, !tbaa !9
  %228 = icmp slt i32 %226, %227
  br i1 %228, label %229, label %236

229:                                              ; preds = %225
  %230 = load ptr, ptr %8, align 8, !tbaa !5
  %231 = load i32, ptr %16, align 4, !tbaa !9
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds %struct.b2Simplex, ptr %230, i64 %232
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %233, ptr align 4 %15, i64 112, i1 false), !tbaa.struct !28
  %234 = load i32, ptr %16, align 4, !tbaa !9
  %235 = add nsw i32 %234, 1
  store i32 %235, ptr %16, align 4, !tbaa !9
  br label %236

236:                                              ; preds = %229, %225, %222
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 4 %25, i64 8, i1 false), !tbaa.struct !24
  %237 = load <2 x float>, ptr %25, align 4
  %238 = load <2 x float>, ptr %25, align 4
  %239 = call float @b2Dot(<2 x float> %237, <2 x float> %238)
  %240 = fcmp olt float %239, 0x3D10000000000000
  br i1 %240, label %241, label %242

241:                                              ; preds = %236
  store i32 12, ptr %29, align 4
  br label %325

242:                                              ; preds = %236
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #9
  %243 = getelementptr inbounds %struct.b2Simplex, ptr %15, i32 0, i32 3
  %244 = load i32, ptr %243, align 4, !tbaa !29
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [3 x ptr], ptr %17, i64 0, i64 %245
  %247 = load ptr, ptr %246, align 8, !tbaa !5
  store ptr %247, ptr %30, align 8, !tbaa !5
  %248 = load ptr, ptr %10, align 8, !tbaa !5
  %249 = load <2 x float>, ptr %25, align 4
  %250 = call i32 @b2FindSupport(ptr noundef %248, <2 x float> %249)
  %251 = load ptr, ptr %30, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct.b2SimplexVertex, ptr %251, i32 0, i32 4
  store i32 %250, ptr %252, align 4, !tbaa !32
  %253 = load ptr, ptr %30, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct.b2SimplexVertex, ptr %253, i32 0, i32 0
  %255 = load ptr, ptr %10, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct.b2ShapeProxy, ptr %255, i32 0, i32 0
  %257 = load ptr, ptr %30, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.b2SimplexVertex, ptr %257, i32 0, i32 4
  %259 = load i32, ptr %258, align 4, !tbaa !32
  %260 = sext i32 %259 to i64
  %261 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %256, i64 0, i64 %260
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %254, ptr align 4 %261, i64 8, i1 false), !tbaa.struct !24
  %262 = load <2 x float>, ptr %25, align 4
  %263 = call <2 x float> @b2Neg(<2 x float> %262)
  store <2 x float> %263, ptr %31, align 4
  %264 = load <2 x float>, ptr %31, align 4
  %265 = call i32 @b2FindSupport(ptr noundef %11, <2 x float> %264)
  %266 = load ptr, ptr %30, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct.b2SimplexVertex, ptr %266, i32 0, i32 5
  store i32 %265, ptr %267, align 4, !tbaa !33
  %268 = load ptr, ptr %30, align 8, !tbaa !5
  %269 = getelementptr inbounds %struct.b2SimplexVertex, ptr %268, i32 0, i32 1
  %270 = getelementptr inbounds %struct.b2ShapeProxy, ptr %11, i32 0, i32 0
  %271 = load ptr, ptr %30, align 8, !tbaa !5
  %272 = getelementptr inbounds %struct.b2SimplexVertex, ptr %271, i32 0, i32 5
  %273 = load i32, ptr %272, align 4, !tbaa !33
  %274 = sext i32 %273 to i64
  %275 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %270, i64 0, i64 %274
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %269, ptr align 4 %275, i64 8, i1 false), !tbaa.struct !24
  %276 = load ptr, ptr %30, align 8, !tbaa !5
  %277 = getelementptr inbounds %struct.b2SimplexVertex, ptr %276, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #9
  %278 = load ptr, ptr %30, align 8, !tbaa !5
  %279 = getelementptr inbounds %struct.b2SimplexVertex, ptr %278, i32 0, i32 0
  %280 = load ptr, ptr %30, align 8, !tbaa !5
  %281 = getelementptr inbounds %struct.b2SimplexVertex, ptr %280, i32 0, i32 1
  %282 = load <2 x float>, ptr %279, align 4
  %283 = load <2 x float>, ptr %281, align 4
  %284 = call <2 x float> @b2Sub(<2 x float> %282, <2 x float> %283)
  store <2 x float> %284, ptr %32, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %277, ptr align 4 %32, i64 8, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #9
  %285 = load i32, ptr %22, align 4, !tbaa !9
  %286 = add nsw i32 %285, 1
  store i32 %286, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %33) #9
  store i8 0, ptr %33, align 1, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #9
  store i32 0, ptr %34, align 4, !tbaa !9
  br label %287

287:                                              ; preds = %312, %242
  %288 = load i32, ptr %34, align 4, !tbaa !9
  %289 = load i32, ptr %23, align 4, !tbaa !9
  %290 = icmp slt i32 %288, %289
  br i1 %290, label %292, label %291

291:                                              ; preds = %287
  store i32 19, ptr %29, align 4
  br label %315

292:                                              ; preds = %287
  %293 = load ptr, ptr %30, align 8, !tbaa !5
  %294 = getelementptr inbounds %struct.b2SimplexVertex, ptr %293, i32 0, i32 4
  %295 = load i32, ptr %294, align 4, !tbaa !32
  %296 = load i32, ptr %34, align 4, !tbaa !9
  %297 = sext i32 %296 to i64
  %298 = getelementptr inbounds [3 x i32], ptr %19, i64 0, i64 %297
  %299 = load i32, ptr %298, align 4, !tbaa !9
  %300 = icmp eq i32 %295, %299
  br i1 %300, label %301, label %311

301:                                              ; preds = %292
  %302 = load ptr, ptr %30, align 8, !tbaa !5
  %303 = getelementptr inbounds %struct.b2SimplexVertex, ptr %302, i32 0, i32 5
  %304 = load i32, ptr %303, align 4, !tbaa !33
  %305 = load i32, ptr %34, align 4, !tbaa !9
  %306 = sext i32 %305 to i64
  %307 = getelementptr inbounds [3 x i32], ptr %20, i64 0, i64 %306
  %308 = load i32, ptr %307, align 4, !tbaa !9
  %309 = icmp eq i32 %304, %308
  br i1 %309, label %310, label %311

310:                                              ; preds = %301
  store i8 1, ptr %33, align 1, !tbaa !35
  store i32 19, ptr %29, align 4
  br label %315

311:                                              ; preds = %301, %292
  br label %312

312:                                              ; preds = %311
  %313 = load i32, ptr %34, align 4, !tbaa !9
  %314 = add nsw i32 %313, 1
  store i32 %314, ptr %34, align 4, !tbaa !9
  br label %287, !llvm.loop !36

315:                                              ; preds = %310, %291
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #9
  br label %316

316:                                              ; preds = %315
  %317 = load i8, ptr %33, align 1, !tbaa !35, !range !37, !noundef !38
  %318 = trunc i8 %317 to i1
  br i1 %318, label %319, label %320

319:                                              ; preds = %316
  store i32 12, ptr %29, align 4
  br label %324

320:                                              ; preds = %316
  %321 = getelementptr inbounds %struct.b2Simplex, ptr %15, i32 0, i32 3
  %322 = load i32, ptr %321, align 4, !tbaa !29
  %323 = add nsw i32 %322, 1
  store i32 %323, ptr %321, align 4, !tbaa !29
  store i32 0, ptr %29, align 4
  br label %324

324:                                              ; preds = %320, %319
  call void @llvm.lifetime.end.p0(i64 1, ptr %33) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #9
  br label %325

325:                                              ; preds = %324, %241, %221
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #9
  %326 = load i32, ptr %29, align 4
  switch i32 %326, label %420 [
    i32 0, label %327
    i32 12, label %328
  ]

327:                                              ; preds = %325
  br label %164, !llvm.loop !39

328:                                              ; preds = %325, %164
  %329 = load ptr, ptr %8, align 8, !tbaa !5
  %330 = icmp ne ptr %329, null
  br i1 %330, label %331, label %342

331:                                              ; preds = %328
  %332 = load i32, ptr %16, align 4, !tbaa !9
  %333 = load i32, ptr %9, align 4, !tbaa !9
  %334 = icmp slt i32 %332, %333
  br i1 %334, label %335, label %342

335:                                              ; preds = %331
  %336 = load ptr, ptr %8, align 8, !tbaa !5
  %337 = load i32, ptr %16, align 4, !tbaa !9
  %338 = sext i32 %337 to i64
  %339 = getelementptr inbounds %struct.b2Simplex, ptr %336, i64 %338
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %339, ptr align 4 %15, i64 112, i1 false), !tbaa.struct !28
  %340 = load i32, ptr %16, align 4, !tbaa !9
  %341 = add nsw i32 %340, 1
  store i32 %341, ptr %16, align 4, !tbaa !9
  br label %342

342:                                              ; preds = %335, %331, %328
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #9
  %343 = load <2 x float>, ptr %18, align 4
  %344 = call <2 x float> @b2Normalize(<2 x float> %343)
  store <2 x float> %344, ptr %35, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #9
  %345 = load ptr, ptr %6, align 8, !tbaa !5
  %346 = getelementptr inbounds %struct.b2DistanceInput, ptr %345, i32 0, i32 2
  %347 = getelementptr inbounds %struct.b2Transform, ptr %346, i32 0, i32 1
  %348 = load <2 x float>, ptr %347, align 4
  %349 = load <2 x float>, ptr %35, align 4
  %350 = call <2 x float> @b2RotateVector(<2 x float> %348, <2 x float> %349)
  store <2 x float> %350, ptr %36, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %35, ptr align 4 %36, i64 8, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #9
  call void @b2ComputeSimplexWitnessPoints(ptr noundef %37, ptr noundef %38, ptr noundef %15)
  %351 = getelementptr inbounds %struct.b2DistanceOutput, ptr %0, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %351, ptr align 4 %35, i64 8, i1 false), !tbaa.struct !24
  %352 = load <2 x float>, ptr %37, align 4
  %353 = load <2 x float>, ptr %38, align 4
  %354 = call float @b2Distance(<2 x float> %352, <2 x float> %353)
  %355 = getelementptr inbounds %struct.b2DistanceOutput, ptr %0, i32 0, i32 3
  store float %354, ptr %355, align 4, !tbaa !40
  %356 = getelementptr inbounds %struct.b2DistanceOutput, ptr %0, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #9
  %357 = load ptr, ptr %6, align 8, !tbaa !5
  %358 = getelementptr inbounds %struct.b2DistanceInput, ptr %357, i32 0, i32 2
  %359 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %358, i32 0, i32 0
  %360 = load <2 x float>, ptr %359, align 4
  %361 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %358, i32 0, i32 1
  %362 = load <2 x float>, ptr %361, align 4
  %363 = load <2 x float>, ptr %37, align 4
  %364 = call <2 x float> @b2TransformPoint(<2 x float> %360, <2 x float> %362, <2 x float> %363)
  store <2 x float> %364, ptr %39, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %356, ptr align 4 %39, i64 8, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #9
  %365 = getelementptr inbounds %struct.b2DistanceOutput, ptr %0, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #9
  %366 = load ptr, ptr %6, align 8, !tbaa !5
  %367 = getelementptr inbounds %struct.b2DistanceInput, ptr %366, i32 0, i32 2
  %368 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %367, i32 0, i32 0
  %369 = load <2 x float>, ptr %368, align 4
  %370 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %367, i32 0, i32 1
  %371 = load <2 x float>, ptr %370, align 4
  %372 = load <2 x float>, ptr %38, align 4
  %373 = call <2 x float> @b2TransformPoint(<2 x float> %369, <2 x float> %371, <2 x float> %372)
  store <2 x float> %373, ptr %40, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %365, ptr align 4 %40, i64 8, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #9
  %374 = load i32, ptr %22, align 4, !tbaa !9
  %375 = getelementptr inbounds %struct.b2DistanceOutput, ptr %0, i32 0, i32 4
  store i32 %374, ptr %375, align 4, !tbaa !42
  %376 = load i32, ptr %16, align 4, !tbaa !9
  %377 = getelementptr inbounds %struct.b2DistanceOutput, ptr %0, i32 0, i32 5
  store i32 %376, ptr %377, align 4, !tbaa !43
  %378 = load ptr, ptr %7, align 8, !tbaa !5
  call void @b2MakeSimplexCache(ptr noundef %378, ptr noundef %15)
  %379 = load ptr, ptr %6, align 8, !tbaa !5
  %380 = getelementptr inbounds %struct.b2DistanceInput, ptr %379, i32 0, i32 4
  %381 = load i8, ptr %380, align 4, !tbaa !44, !range !37, !noundef !38
  %382 = trunc i8 %381 to i1
  br i1 %382, label %383, label %419

383:                                              ; preds = %342
  %384 = getelementptr inbounds %struct.b2DistanceOutput, ptr %0, i32 0, i32 3
  %385 = load float, ptr %384, align 4, !tbaa !40
  %386 = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !25
  %387 = fmul float 0x3F747AE140000000, %386
  %388 = fmul float 0x3FB99999A0000000, %387
  %389 = fcmp ogt float %385, %388
  br i1 %389, label %390, label %419

390:                                              ; preds = %383
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #9
  %391 = load ptr, ptr %6, align 8, !tbaa !5
  %392 = getelementptr inbounds %struct.b2DistanceInput, ptr %391, i32 0, i32 0
  %393 = getelementptr inbounds %struct.b2ShapeProxy, ptr %392, i32 0, i32 2
  %394 = load float, ptr %393, align 4, !tbaa !20
  store float %394, ptr %41, align 4, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #9
  %395 = load ptr, ptr %6, align 8, !tbaa !5
  %396 = getelementptr inbounds %struct.b2DistanceInput, ptr %395, i32 0, i32 1
  %397 = getelementptr inbounds %struct.b2ShapeProxy, ptr %396, i32 0, i32 2
  %398 = load float, ptr %397, align 4, !tbaa !21
  store float %398, ptr %42, align 4, !tbaa !25
  %399 = getelementptr inbounds %struct.b2DistanceOutput, ptr %0, i32 0, i32 3
  %400 = load float, ptr %399, align 4, !tbaa !40
  %401 = load float, ptr %41, align 4, !tbaa !25
  %402 = fsub float %400, %401
  %403 = load float, ptr %42, align 4, !tbaa !25
  %404 = fsub float %402, %403
  %405 = call float @b2MaxFloat(float noundef 0.000000e+00, float noundef %404)
  %406 = getelementptr inbounds %struct.b2DistanceOutput, ptr %0, i32 0, i32 3
  store float %405, ptr %406, align 4, !tbaa !40
  %407 = getelementptr inbounds %struct.b2DistanceOutput, ptr %0, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #9
  %408 = getelementptr inbounds %struct.b2DistanceOutput, ptr %0, i32 0, i32 0
  %409 = load float, ptr %41, align 4, !tbaa !25
  %410 = load <2 x float>, ptr %408, align 4
  %411 = load <2 x float>, ptr %35, align 4
  %412 = call <2 x float> @b2MulAdd(<2 x float> %410, float noundef %409, <2 x float> %411)
  store <2 x float> %412, ptr %43, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %407, ptr align 4 %43, i64 8, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #9
  %413 = getelementptr inbounds %struct.b2DistanceOutput, ptr %0, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #9
  %414 = getelementptr inbounds %struct.b2DistanceOutput, ptr %0, i32 0, i32 1
  %415 = load float, ptr %42, align 4, !tbaa !25
  %416 = load <2 x float>, ptr %414, align 4
  %417 = load <2 x float>, ptr %35, align 4
  %418 = call <2 x float> @b2MulSub(<2 x float> %416, float noundef %415, <2 x float> %417)
  store <2 x float> %418, ptr %44, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %413, ptr align 4 %44, i64 8, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #9
  br label %419

419:                                              ; preds = %390, %383, %342
  store i32 1, ptr %29, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 112, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 72, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  ret void

420:                                              ; preds = %325
  unreachable
}

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @b2MakeSimplexFromCache(ptr dead_on_unwind noalias writable sret(%struct.b2Simplex) align 4, ptr noundef, ptr noundef, ptr noundef) #4

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

; Function Attrs: nounwind uwtable
declare hidden <2 x float> @b2SolveSimplex2(ptr noundef) #4

; Function Attrs: nounwind uwtable
declare hidden <2 x float> @b2SolveSimplex3(ptr noundef) #4

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @b2MakeSimplexCache(ptr noundef, ptr noundef) #7

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2MaxFloat(float noundef, float noundef) #8

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 64}
!12 = !{!"b2DistanceInput", !13, i64 0, !13, i64 72, !15, i64 144, !15, i64 160, !18, i64 176}
!13 = !{!"b2ShapeProxy", !7, i64 0, !10, i64 64, !14, i64 68}
!14 = !{!"float", !7, i64 0}
!15 = !{!"b2Transform", !16, i64 0, !17, i64 8}
!16 = !{!"b2Vec2", !14, i64 0, !14, i64 4}
!17 = !{!"b2Rot", !14, i64 0, !14, i64 4}
!18 = !{!"_Bool", !7, i64 0}
!19 = !{!12, !10, i64 136}
!20 = !{!12, !14, i64 68}
!21 = !{!12, !14, i64 140}
!22 = !{!13, !10, i64 64}
!23 = !{!13, !14, i64 68}
!24 = !{i64 0, i64 4, !25, i64 4, i64 4, !25}
!25 = !{!14, !14, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{i64 0, i64 4, !25, i64 4, i64 4, !25, i64 8, i64 4, !25, i64 12, i64 4, !25, i64 16, i64 4, !25, i64 20, i64 4, !25, i64 24, i64 4, !25, i64 28, i64 4, !9, i64 32, i64 4, !9, i64 36, i64 4, !25, i64 40, i64 4, !25, i64 44, i64 4, !25, i64 48, i64 4, !25, i64 52, i64 4, !25, i64 56, i64 4, !25, i64 60, i64 4, !25, i64 64, i64 4, !9, i64 68, i64 4, !9, i64 72, i64 4, !25, i64 76, i64 4, !25, i64 80, i64 4, !25, i64 84, i64 4, !25, i64 88, i64 4, !25, i64 92, i64 4, !25, i64 96, i64 4, !25, i64 100, i64 4, !9, i64 104, i64 4, !9, i64 108, i64 4, !9}
!29 = !{!30, !10, i64 108}
!30 = !{!"b2Simplex", !31, i64 0, !31, i64 36, !31, i64 72, !10, i64 108}
!31 = !{!"b2SimplexVertex", !16, i64 0, !16, i64 8, !16, i64 16, !14, i64 24, !10, i64 28, !10, i64 32}
!32 = !{!31, !10, i64 28}
!33 = !{!31, !10, i64 32}
!34 = distinct !{!34, !27}
!35 = !{!18, !18, i64 0}
!36 = distinct !{!36, !27}
!37 = !{i8 0, i8 2}
!38 = !{}
!39 = distinct !{!39, !27}
!40 = !{!41, !14, i64 24}
!41 = !{!"b2DistanceOutput", !16, i64 0, !16, i64 8, !16, i64 16, !14, i64 24, !10, i64 28, !10, i64 32}
!42 = !{!41, !10, i64 28}
!43 = !{!41, !10, i64 32}
!44 = !{!12, !18, i64 176}


; 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.b2DistanceOutput = type { %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, float, i32, i32 }
%struct.b2Vec2 = type { float, float }
%struct.b2ShapeProxy = type { [8 x %struct.b2Vec2], i32, float }
%struct.b2Simplex = type { %struct.b2SimplexVertex, %struct.b2SimplexVertex, %struct.b2SimplexVertex, i32 }
%struct.b2SimplexVertex = type { %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, float, i32, i32 }

@.str = external hidden unnamed_addr constant [51 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@b2_lengthUnitsPerMeter = external local_unnamed_addr global float, align 4

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

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

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @b2ShapeDistance(ptr dead_on_unwind noalias nocapture writable writeonly sret(%struct.b2DistanceOutput) align 4 %0, ptr noundef %1, ptr noundef %2, ptr noundef writeonly %3, i32 noundef %4) local_unnamed_addr #4 {
  %6 = alloca %struct.b2ShapeProxy, align 4
  %7 = alloca %struct.b2Simplex, align 4
  %8 = alloca [3 x ptr], align 16
  %9 = alloca [3 x i32], align 4
  %10 = alloca [3 x i32], align 4
  %11 = alloca %struct.b2Vec2, align 8
  %12 = alloca %struct.b2Vec2, align 8
  %13 = getelementptr inbounds i8, ptr %1, i64 64
  %14 = load i32, ptr %13, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %16, label %20

16:                                               ; preds = %5
  %17 = getelementptr inbounds i8, ptr %1, i64 136
  %18 = load i32, ptr %17, align 4, !tbaa !16
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %23, label %20

20:                                               ; preds = %16, %5
  %21 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 424) #9
  %.not = icmp eq i32 %21, 0
  br i1 %.not, label %23, label %22

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

23:                                               ; preds = %20, %16
  %24 = getelementptr inbounds i8, ptr %1, i64 68
  %25 = load float, ptr %24, align 4, !tbaa !17
  %26 = fcmp ult float %25, 0.000000e+00
  br i1 %26, label %27, label %30

27:                                               ; preds = %23
  %28 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 425) #9
  %.not108 = icmp eq i32 %28, 0
  br i1 %.not108, label %30, label %29

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

30:                                               ; preds = %27, %23
  %31 = getelementptr inbounds i8, ptr %1, i64 72
  %32 = getelementptr inbounds i8, ptr %1, i64 140
  %33 = load float, ptr %32, align 4, !tbaa !18
  %34 = fcmp ult float %33, 0.000000e+00
  br i1 %34, label %35, label %38

35:                                               ; preds = %30
  %36 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 426) #9
  %.not109 = icmp eq i32 %36, 0
  br i1 %.not109, label %38, label %37

37:                                               ; preds = %35
  tail call void @llvm.trap()
  unreachable

38:                                               ; preds = %30, %35
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(36) %0, i8 0, i64 36, i1 false)
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %6) #9
  %39 = getelementptr inbounds i8, ptr %1, i64 144
  %40 = getelementptr inbounds i8, ptr %1, i64 160
  %41 = load <2 x float>, ptr %39, align 4
  %42 = getelementptr inbounds i8, ptr %1, i64 152
  %43 = load <2 x float>, ptr %42, align 4
  %44 = load <2 x float>, ptr %40, align 4
  %45 = getelementptr inbounds i8, ptr %1, i64 168
  %46 = load <2 x float>, ptr %45, align 4
  %47 = tail call { <2 x float>, <2 x float> } @b2InvMulTransforms(<2 x float> %41, <2 x float> %43, <2 x float> %44, <2 x float> %46)
  %48 = extractvalue { <2 x float>, <2 x float> } %47, 0
  %49 = extractvalue { <2 x float>, <2 x float> } %47, 1
  %50 = getelementptr inbounds i8, ptr %1, i64 136
  %51 = load i32, ptr %50, align 4, !tbaa !16
  %52 = getelementptr inbounds i8, ptr %6, i64 64
  store i32 %51, ptr %52, align 4, !tbaa !19
  %53 = load float, ptr %32, align 4, !tbaa !18
  %54 = getelementptr inbounds i8, ptr %6, i64 68
  store float %53, ptr %54, align 4, !tbaa !20
  %55 = icmp sgt i32 %51, 0
  br i1 %55, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %38
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %7) #9
  call void @b2MakeSimplexFromCache(ptr dead_on_unwind nonnull writable sret(%struct.b2Simplex) align 4 %7, ptr noundef %2, ptr noundef nonnull %1, ptr noundef nonnull %6)
  %.not110 = icmp ne ptr %3, null
  %56 = icmp sgt i32 %4, 0
  %or.cond = and i1 %.not110, %56
  br i1 %or.cond, label %64, label %65

.lr.ph:                                           ; preds = %38, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %38 ]
  %57 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %6, i64 0, i64 %indvars.iv
  %58 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %31, i64 0, i64 %indvars.iv
  %59 = load <2 x float>, ptr %58, align 4
  %60 = tail call <2 x float> @b2TransformPoint(<2 x float> %48, <2 x float> %49, <2 x float> %59)
  store <2 x float> %60, ptr %57, align 4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %61 = load i32, ptr %52, align 4, !tbaa !19
  %62 = sext i32 %61 to i64
  %63 = icmp slt i64 %indvars.iv.next, %62
  br i1 %63, label %.lr.ph, label %._crit_edge, !llvm.loop !21

64:                                               ; preds = %._crit_edge
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(112) %3, ptr noundef nonnull align 4 dereferenceable(112) %7, i64 112, i1 false), !tbaa.struct !23
  br label %65

65:                                               ; preds = %64, %._crit_edge
  %.094 = phi i32 [ 1, %64 ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #9
  store ptr %7, ptr %8, align 16, !tbaa !26
  %66 = getelementptr inbounds i8, ptr %8, i64 8
  %67 = getelementptr inbounds i8, ptr %7, i64 36
  store ptr %67, ptr %66, align 8, !tbaa !26
  %68 = getelementptr inbounds i8, ptr %8, i64 16
  %69 = getelementptr inbounds i8, ptr %7, i64 72
  store ptr %69, ptr %68, align 16, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #9
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #9
  %70 = getelementptr inbounds i8, ptr %7, i64 108
  %71 = getelementptr inbounds i8, ptr %7, i64 16
  %.pre = load i32, ptr %70, align 4, !tbaa !28
  br label %72

72:                                               ; preds = %65, %._crit_edge132
  %73 = phi i32 [ %.pre, %65 ], [ %155, %._crit_edge132 ]
  %.1135 = phi i32 [ %.094, %65 ], [ %.2, %._crit_edge132 ]
  %.sroa.047.0134 = phi <2 x float> [ zeroinitializer, %65 ], [ %.sroa.032.1, %._crit_edge132 ]
  %.095133 = phi i32 [ 0, %65 ], [ %142, %._crit_edge132 ]
  %74 = icmp sgt i32 %73, 0
  br i1 %74, label %.lr.ph127.preheader, label %._crit_edge128

.lr.ph127.preheader:                              ; preds = %72
  %wide.trip.count = zext nneg i32 %73 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %75 = icmp eq i32 %73, 1
  br i1 %75, label %._crit_edge128.loopexit.unr-lcssa, label %.lr.ph127.preheader.new

.lr.ph127.preheader.new:                          ; preds = %.lr.ph127.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.lr.ph127

._crit_edge128.loopexit.unr-lcssa:                ; preds = %.lr.ph127, %.lr.ph127.preheader
  %indvars.iv139.unr = phi i64 [ 0, %.lr.ph127.preheader ], [ %indvars.iv.next140.1, %.lr.ph127 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge128, label %.lr.ph127.epil

.lr.ph127.epil:                                   ; preds = %._crit_edge128.loopexit.unr-lcssa
  %76 = getelementptr inbounds [3 x ptr], ptr %8, i64 0, i64 %indvars.iv139.unr
  %77 = load ptr, ptr %76, align 8, !tbaa !26
  %78 = getelementptr inbounds i8, ptr %77, i64 28
  %79 = load i32, ptr %78, align 4, !tbaa !31
  %80 = getelementptr inbounds [3 x i32], ptr %9, i64 0, i64 %indvars.iv139.unr
  store i32 %79, ptr %80, align 4, !tbaa !25
  %81 = getelementptr inbounds i8, ptr %77, i64 32
  %82 = load i32, ptr %81, align 4, !tbaa !32
  %83 = getelementptr inbounds [3 x i32], ptr %10, i64 0, i64 %indvars.iv139.unr
  store i32 %82, ptr %83, align 4, !tbaa !25
  br label %._crit_edge128

._crit_edge128:                                   ; preds = %.lr.ph127.epil, %._crit_edge128.loopexit.unr-lcssa, %72
  switch i32 %73, label %107 [
    i32 1, label %100
    i32 2, label %103
    i32 3, label %105
  ]

.lr.ph127:                                        ; preds = %.lr.ph127, %.lr.ph127.preheader.new
  %indvars.iv139 = phi i64 [ 0, %.lr.ph127.preheader.new ], [ %indvars.iv.next140.1, %.lr.ph127 ]
  %niter = phi i64 [ 0, %.lr.ph127.preheader.new ], [ %niter.next.1, %.lr.ph127 ]
  %84 = getelementptr inbounds [3 x ptr], ptr %8, i64 0, i64 %indvars.iv139
  %85 = load ptr, ptr %84, align 16, !tbaa !26
  %86 = getelementptr inbounds i8, ptr %85, i64 28
  %87 = load i32, ptr %86, align 4, !tbaa !31
  %88 = getelementptr inbounds [3 x i32], ptr %9, i64 0, i64 %indvars.iv139
  store i32 %87, ptr %88, align 4, !tbaa !25
  %89 = getelementptr inbounds i8, ptr %85, i64 32
  %90 = load i32, ptr %89, align 4, !tbaa !32
  %91 = getelementptr inbounds [3 x i32], ptr %10, i64 0, i64 %indvars.iv139
  store i32 %90, ptr %91, align 4, !tbaa !25
  %indvars.iv.next140 = or disjoint i64 %indvars.iv139, 1
  %92 = getelementptr inbounds [3 x ptr], ptr %8, i64 0, i64 %indvars.iv.next140
  %93 = load ptr, ptr %92, align 8, !tbaa !26
  %94 = getelementptr inbounds i8, ptr %93, i64 28
  %95 = load i32, ptr %94, align 4, !tbaa !31
  %96 = getelementptr inbounds [3 x i32], ptr %9, i64 0, i64 %indvars.iv.next140
  store i32 %95, ptr %96, align 4, !tbaa !25
  %97 = getelementptr inbounds i8, ptr %93, i64 32
  %98 = load i32, ptr %97, align 4, !tbaa !32
  %99 = getelementptr inbounds [3 x i32], ptr %10, i64 0, i64 %indvars.iv.next140
  store i32 %98, ptr %99, align 4, !tbaa !25
  %indvars.iv.next140.1 = add nuw nsw i64 %indvars.iv139, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge128.loopexit.unr-lcssa, label %.lr.ph127, !llvm.loop !33

100:                                              ; preds = %._crit_edge128
  %101 = load <2 x float>, ptr %71, align 4
  %102 = call <2 x float> @b2Neg(<2 x float> %101)
  br label %110

103:                                              ; preds = %._crit_edge128
  %104 = call <2 x float> @b2SolveSimplex2(ptr noundef nonnull %7)
  br label %110

105:                                              ; preds = %._crit_edge128
  %106 = call <2 x float> @b2SolveSimplex3(ptr noundef nonnull %7)
  br label %110

107:                                              ; preds = %._crit_edge128
  %108 = call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 492) #9
  %.not111 = icmp eq i32 %108, 0
  br i1 %.not111, label %110, label %109

109:                                              ; preds = %107
  call void @llvm.trap()
  unreachable

110:                                              ; preds = %107, %105, %103, %100
  %.sroa.032.1 = phi <2 x float> [ zeroinitializer, %107 ], [ %106, %105 ], [ %104, %103 ], [ %102, %100 ]
  %111 = load i32, ptr %70, align 4, !tbaa !28
  %112 = icmp eq i32 %111, 3
  br i1 %112, label %.thread, label %113

113:                                              ; preds = %110
  %114 = icmp slt i32 %.1135, %4
  %or.cond113 = select i1 %.not110, i1 %114, i1 false
  br i1 %or.cond113, label %115, label %119

115:                                              ; preds = %113
  %116 = sext i32 %.1135 to i64
  %117 = getelementptr inbounds %struct.b2Simplex, ptr %3, i64 %116
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(112) %117, ptr noundef nonnull align 4 dereferenceable(112) %7, i64 112, i1 false), !tbaa.struct !23
  %118 = add nsw i32 %.1135, 1
  br label %119

119:                                              ; preds = %115, %113
  %.2 = phi i32 [ %118, %115 ], [ %.1135, %113 ]
  %120 = call float @b2Dot(<2 x float> %.sroa.032.1, <2 x float> %.sroa.032.1)
  %121 = fcmp olt float %120, 0x3D10000000000000
  br i1 %121, label %.thread, label %122

122:                                              ; preds = %119
  %123 = load i32, ptr %70, align 4, !tbaa !28
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [3 x ptr], ptr %8, i64 0, i64 %124
  %126 = load ptr, ptr %125, align 8, !tbaa !26
  %127 = call i32 @b2FindSupport(ptr noundef %1, <2 x float> %.sroa.032.1)
  %128 = getelementptr inbounds i8, ptr %126, i64 28
  store i32 %127, ptr %128, align 4, !tbaa !31
  %129 = sext i32 %127 to i64
  %130 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %1, i64 0, i64 %129
  %131 = load i64, ptr %130, align 4
  store i64 %131, ptr %126, align 4
  %132 = call <2 x float> @b2Neg(<2 x float> %.sroa.032.1)
  %133 = call i32 @b2FindSupport(ptr noundef nonnull %6, <2 x float> %132)
  %134 = getelementptr inbounds i8, ptr %126, i64 32
  store i32 %133, ptr %134, align 4, !tbaa !32
  %135 = getelementptr inbounds i8, ptr %126, i64 8
  %136 = sext i32 %133 to i64
  %137 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %6, i64 0, i64 %136
  %138 = load i64, ptr %137, align 4
  store i64 %138, ptr %135, align 4
  %139 = getelementptr inbounds i8, ptr %126, i64 16
  %140 = load <2 x float>, ptr %126, align 4
  %.cast = bitcast i64 %138 to <2 x float>
  %141 = call <2 x float> @b2Sub(<2 x float> %140, <2 x float> %.cast)
  store <2 x float> %141, ptr %139, align 4
  %142 = add nuw nsw i32 %.095133, 1
  br i1 %74, label %.lr.ph131, label %._crit_edge132

.lr.ph131:                                        ; preds = %122
  %143 = load i32, ptr %128, align 4, !tbaa !31
  %wide.trip.count145 = zext nneg i32 %73 to i64
  br label %144

144:                                              ; preds = %.lr.ph131, %153
  %indvars.iv142 = phi i64 [ 0, %.lr.ph131 ], [ %indvars.iv.next143, %153 ]
  %145 = getelementptr inbounds [3 x i32], ptr %9, i64 0, i64 %indvars.iv142
  %146 = load i32, ptr %145, align 4, !tbaa !25
  %147 = icmp eq i32 %143, %146
  br i1 %147, label %148, label %153

148:                                              ; preds = %144
  %149 = load i32, ptr %134, align 4, !tbaa !32
  %150 = getelementptr inbounds [3 x i32], ptr %10, i64 0, i64 %indvars.iv142
  %151 = load i32, ptr %150, align 4, !tbaa !25
  %152 = icmp eq i32 %149, %151
  br i1 %152, label %.thread, label %153

153:                                              ; preds = %144, %148
  %indvars.iv.next143 = add nuw nsw i64 %indvars.iv142, 1
  %exitcond146.not = icmp eq i64 %indvars.iv.next143, %wide.trip.count145
  br i1 %exitcond146.not, label %._crit_edge132, label %144, !llvm.loop !34

._crit_edge132:                                   ; preds = %153, %122
  %154 = load i32, ptr %70, align 4, !tbaa !28
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %70, align 4, !tbaa !28
  %exitcond147.not = icmp eq i32 %142, 20
  br i1 %exitcond147.not, label %.thread, label %72

.thread:                                          ; preds = %119, %110, %._crit_edge132, %148
  %.297 = phi i32 [ %142, %148 ], [ 20, %._crit_edge132 ], [ %.095133, %110 ], [ %.095133, %119 ]
  %.sroa.047.2 = phi <2 x float> [ %.sroa.032.1, %148 ], [ %.sroa.032.1, %._crit_edge132 ], [ %.sroa.047.0134, %110 ], [ %.sroa.032.1, %119 ]
  %.4 = phi i32 [ %.2, %148 ], [ %.2, %._crit_edge132 ], [ %.1135, %110 ], [ %.2, %119 ]
  %156 = icmp slt i32 %.4, %4
  %or.cond115 = select i1 %.not110, i1 %156, i1 false
  br i1 %or.cond115, label %157, label %161

157:                                              ; preds = %.thread
  %158 = sext i32 %.4 to i64
  %159 = getelementptr inbounds %struct.b2Simplex, ptr %3, i64 %158
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(112) %159, ptr noundef nonnull align 4 dereferenceable(112) %7, i64 112, i1 false), !tbaa.struct !23
  %160 = add nsw i32 %.4, 1
  br label %161

161:                                              ; preds = %157, %.thread
  %.5 = phi i32 [ %160, %157 ], [ %.4, %.thread ]
  %162 = call <2 x float> @b2Normalize(<2 x float> %.sroa.047.2)
  %163 = load <2 x float>, ptr %42, align 4
  %164 = call <2 x float> @b2RotateVector(<2 x float> %163, <2 x float> %162)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #9
  call void @b2ComputeSimplexWitnessPoints(ptr noundef nonnull %11, ptr noundef nonnull %12, ptr noundef nonnull %7)
  %165 = getelementptr inbounds i8, ptr %0, i64 16
  store <2 x float> %164, ptr %165, align 4
  %166 = load <2 x float>, ptr %11, align 8
  %167 = load <2 x float>, ptr %12, align 8
  %168 = call float @b2Distance(<2 x float> %166, <2 x float> %167)
  %169 = getelementptr inbounds i8, ptr %0, i64 24
  store float %168, ptr %169, align 4, !tbaa !35
  %170 = load <2 x float>, ptr %39, align 4
  %171 = load <2 x float>, ptr %42, align 4
  %172 = load <2 x float>, ptr %11, align 8
  %173 = call <2 x float> @b2TransformPoint(<2 x float> %170, <2 x float> %171, <2 x float> %172)
  store <2 x float> %173, ptr %0, align 4
  %174 = getelementptr inbounds i8, ptr %0, i64 8
  %175 = load <2 x float>, ptr %39, align 4
  %176 = load <2 x float>, ptr %42, align 4
  %177 = load <2 x float>, ptr %12, align 8
  %178 = call <2 x float> @b2TransformPoint(<2 x float> %175, <2 x float> %176, <2 x float> %177)
  store <2 x float> %178, ptr %174, align 4
  %179 = getelementptr inbounds i8, ptr %0, i64 28
  store i32 %.297, ptr %179, align 4, !tbaa !37
  %180 = getelementptr inbounds i8, ptr %0, i64 32
  store i32 %.5, ptr %180, align 4, !tbaa !38
  call void @b2MakeSimplexCache(ptr noundef %2, ptr noundef nonnull %7)
  %181 = getelementptr inbounds i8, ptr %1, i64 176
  %182 = load i8, ptr %181, align 4, !tbaa !39, !range !40, !noundef !41
  %183 = trunc nuw i8 %182 to i1
  br i1 %183, label %184, label %197

184:                                              ; preds = %161
  %185 = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !24
  %186 = fmul float %185, 0x3F747AE140000000
  %187 = fmul float %186, 0x3FB99999A0000000
  %188 = fcmp ogt float %168, %187
  br i1 %188, label %189, label %197

189:                                              ; preds = %184
  %190 = load float, ptr %24, align 4, !tbaa !17
  %191 = load float, ptr %32, align 4, !tbaa !18
  %192 = fsub float %168, %190
  %193 = fsub float %192, %191
  %194 = call float @b2MaxFloat(float noundef 0.000000e+00, float noundef %193)
  store float %194, ptr %169, align 4, !tbaa !35
  %195 = call <2 x float> @b2MulAdd(<2 x float> %173, float noundef %190, <2 x float> %164)
  store <2 x float> %195, ptr %0, align 4
  %196 = call <2 x float> @b2MulSub(<2 x float> %178, float noundef %191, <2 x float> %164)
  store <2 x float> %196, ptr %174, align 4
  br label %197

197:                                              ; preds = %189, %184, %161
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %6) #9
  ret void
}

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @b2MakeSimplexFromCache(ptr dead_on_unwind noalias writable sret(%struct.b2Simplex) align 4, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

; Function Attrs: nounwind uwtable
declare hidden <2 x float> @b2SolveSimplex2(ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden <2 x float> @b2SolveSimplex3(ptr noundef) local_unnamed_addr #4

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @b2MakeSimplexCache(ptr noundef, ptr noundef) local_unnamed_addr #7

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @b2MaxFloat(float noundef, float noundef) local_unnamed_addr #8

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint nounwind uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "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 = { cold noreturn nounwind memory(inaccessiblemem: write) }
attributes #7 = { 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 #8 = { 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 #9 = { 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 64}
!6 = !{!"b2DistanceInput", !7, i64 0, !7, i64 72, !12, i64 144, !12, i64 160, !15, i64 176}
!7 = !{!"b2ShapeProxy", !8, i64 0, !10, i64 64, !11, i64 68}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"float", !8, i64 0}
!12 = !{!"b2Transform", !13, i64 0, !14, i64 8}
!13 = !{!"b2Vec2", !11, i64 0, !11, i64 4}
!14 = !{!"b2Rot", !11, i64 0, !11, i64 4}
!15 = !{!"_Bool", !8, i64 0}
!16 = !{!6, !10, i64 136}
!17 = !{!6, !11, i64 68}
!18 = !{!6, !11, i64 140}
!19 = !{!7, !10, i64 64}
!20 = !{!7, !11, i64 68}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{i64 0, i64 4, !24, i64 4, i64 4, !24, i64 8, i64 4, !24, i64 12, i64 4, !24, i64 16, i64 4, !24, i64 20, i64 4, !24, i64 24, i64 4, !24, i64 28, i64 4, !25, i64 32, i64 4, !25, i64 36, i64 4, !24, i64 40, i64 4, !24, i64 44, i64 4, !24, i64 48, i64 4, !24, i64 52, i64 4, !24, i64 56, i64 4, !24, i64 60, i64 4, !24, i64 64, i64 4, !25, i64 68, i64 4, !25, i64 72, i64 4, !24, i64 76, i64 4, !24, i64 80, i64 4, !24, i64 84, i64 4, !24, i64 88, i64 4, !24, i64 92, i64 4, !24, i64 96, i64 4, !24, i64 100, i64 4, !25, i64 104, i64 4, !25, i64 108, i64 4, !25}
!24 = !{!11, !11, i64 0}
!25 = !{!10, !10, i64 0}
!26 = !{!27, !27, i64 0}
!27 = !{!"any pointer", !8, i64 0}
!28 = !{!29, !10, i64 108}
!29 = !{!"b2Simplex", !30, i64 0, !30, i64 36, !30, i64 72, !10, i64 108}
!30 = !{!"b2SimplexVertex", !13, i64 0, !13, i64 8, !13, i64 16, !11, i64 24, !10, i64 28, !10, i64 32}
!31 = !{!30, !10, i64 28}
!32 = !{!30, !10, i64 32}
!33 = distinct !{!33, !22}
!34 = distinct !{!34, !22}
!35 = !{!36, !11, i64 24}
!36 = !{!"b2DistanceOutput", !13, i64 0, !13, i64 8, !13, i64 16, !11, i64 24, !10, i64 28, !10, i64 32}
!37 = !{!36, !10, i64 28}
!38 = !{!36, !10, i64 32}
!39 = !{!6, !15, i64 176}
!40 = !{i8 0, i8 2}
!41 = !{}


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