; 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.b2ShapeExtent = type { float, float }
%struct.b2Vec2 = type { float, float }
%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 }
%struct.b2Filter = type { i64, i64, i32 }
%union.anon.0 = type { %struct.b2Polygon }
%struct.b2Polygon = type { [8 x %struct.b2Vec2], [8 x %struct.b2Vec2], %struct.b2Vec2, float, i32 }
%struct.b2Capsule = type { %struct.b2Vec2, %struct.b2Vec2, float }
%struct.b2Circle = type { %struct.b2Vec2, float }
%struct.b2Segment = type { %struct.b2Vec2, %struct.b2Vec2 }
%struct.b2ChainSegment = type { %struct.b2Vec2, %struct.b2Segment, %struct.b2Vec2, i32 }

@b2_lengthUnitsPerMeter = external global float, align 4

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

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

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local <2 x float> @b2ComputeShapeExtent(ptr noundef %0, <2 x float> %1) #5 {
  %3 = alloca %struct.b2ShapeExtent, align 4
  %4 = alloca %struct.b2Vec2, align 4
  %5 = alloca ptr, align 8
  %6 = alloca float, align 4
  %7 = alloca %struct.b2Vec2, align 4
  %8 = alloca %struct.b2Vec2, align 4
  %9 = alloca float, align 4
  %10 = alloca %struct.b2Vec2, align 4
  %11 = alloca ptr, align 8
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %struct.b2Vec2, align 4
  %17 = alloca float, align 4
  %18 = alloca %struct.b2Vec2, align 4
  %19 = alloca float, align 4
  %20 = alloca %struct.b2Vec2, align 4
  %21 = alloca %struct.b2Vec2, align 4
  %22 = alloca %struct.b2Vec2, align 4
  %23 = alloca %struct.b2Vec2, align 4
  %24 = alloca %struct.b2Vec2, align 4
  store <2 x float> %1, ptr %4, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 4 %3, i8 0, i64 8, i1 false)
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.b2Shape, ptr %25, i32 0, i32 5
  %27 = load i32, ptr %26, align 4, !tbaa !9
  switch i32 %27, label %178 [
    i32 1, label %28
    i32 0, label %56
    i32 3, label %74
    i32 2, label %134
    i32 4, label %155
  ]

28:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.b2Shape, ptr %29, i32 0, i32 19
  %31 = getelementptr inbounds %struct.b2Capsule, ptr %30, i32 0, i32 2
  %32 = load float, ptr %31, align 4, !tbaa !19
  store float %32, ptr %6, align 4, !tbaa !20
  %33 = load float, ptr %6, align 4, !tbaa !20
  %34 = getelementptr inbounds %struct.b2ShapeExtent, ptr %3, i32 0, i32 0
  store float %33, ptr %34, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.b2Shape, ptr %35, i32 0, i32 19
  %37 = getelementptr inbounds %struct.b2Capsule, ptr %36, i32 0, i32 0
  %38 = load <2 x float>, ptr %37, align 4
  %39 = load <2 x float>, ptr %4, align 4
  %40 = call <2 x float> @b2Sub(<2 x float> %38, <2 x float> %39)
  store <2 x float> %40, ptr %7, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.b2Shape, ptr %41, i32 0, i32 19
  %43 = getelementptr inbounds %struct.b2Capsule, ptr %42, i32 0, i32 1
  %44 = load <2 x float>, ptr %43, align 4
  %45 = load <2 x float>, ptr %4, align 4
  %46 = call <2 x float> @b2Sub(<2 x float> %44, <2 x float> %45)
  store <2 x float> %46, ptr %8, align 4
  %47 = load <2 x float>, ptr %7, align 4
  %48 = call float @b2LengthSquared(<2 x float> %47)
  %49 = load <2 x float>, ptr %8, align 4
  %50 = call float @b2LengthSquared(<2 x float> %49)
  %51 = call float @b2MaxFloat(float noundef %48, float noundef %50)
  %52 = call float @sqrtf(float noundef %51) #7
  %53 = load float, ptr %6, align 4, !tbaa !20
  %54 = fadd float %52, %53
  %55 = getelementptr inbounds %struct.b2ShapeExtent, ptr %3, i32 0, i32 1
  store float %54, ptr %55, align 4, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %179

56:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.b2Shape, ptr %57, i32 0, i32 19
  %59 = getelementptr inbounds %struct.b2Circle, ptr %58, i32 0, i32 1
  %60 = load float, ptr %59, align 4, !tbaa !19
  store float %60, ptr %9, align 4, !tbaa !20
  %61 = load float, ptr %9, align 4, !tbaa !20
  %62 = getelementptr inbounds %struct.b2ShapeExtent, ptr %3, i32 0, i32 0
  store float %61, ptr %62, align 4, !tbaa !21
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.b2Shape, ptr %63, i32 0, i32 19
  %65 = getelementptr inbounds %struct.b2Circle, ptr %64, i32 0, i32 0
  %66 = load <2 x float>, ptr %65, align 4
  %67 = load <2 x float>, ptr %4, align 4
  %68 = call <2 x float> @b2Sub(<2 x float> %66, <2 x float> %67)
  store <2 x float> %68, ptr %10, align 4
  %69 = load <2 x float>, ptr %10, align 4
  %70 = call float @b2Length(<2 x float> %69)
  %71 = load float, ptr %9, align 4, !tbaa !20
  %72 = fadd float %70, %71
  %73 = getelementptr inbounds %struct.b2ShapeExtent, ptr %3, i32 0, i32 1
  store float %72, ptr %73, align 4, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %179

74:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.b2Shape, ptr %75, i32 0, i32 19
  store ptr %76, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %77 = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !20
  %78 = fmul float 1.000000e+05, %77
  store float %78, ptr %12, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store float 0.000000e+00, ptr %13, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %79 = load ptr, ptr %11, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.b2Polygon, ptr %79, i32 0, i32 4
  %81 = load i32, ptr %80, align 4, !tbaa !24
  store i32 %81, ptr %14, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !26
  br label %82

82:                                               ; preds = %117, %74
  %83 = load i32, ptr %15, align 4, !tbaa !26
  %84 = load i32, ptr %14, align 4, !tbaa !26
  %85 = icmp slt i32 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %120

87:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %88 = load ptr, ptr %11, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.b2Polygon, ptr %88, i32 0, i32 0
  %90 = load i32, ptr %15, align 4, !tbaa !26
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %89, i64 0, i64 %91
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %92, i64 8, i1 false), !tbaa.struct !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %93 = load ptr, ptr %11, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.b2Polygon, ptr %93, i32 0, i32 1
  %95 = load i32, ptr %15, align 4, !tbaa !26
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %94, i64 0, i64 %96
  %98 = load ptr, ptr %11, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.b2Polygon, ptr %98, i32 0, i32 2
  %100 = load <2 x float>, ptr %16, align 4
  %101 = load <2 x float>, ptr %99, align 4
  %102 = call <2 x float> @b2Sub(<2 x float> %100, <2 x float> %101)
  store <2 x float> %102, ptr %18, align 4
  %103 = load <2 x float>, ptr %97, align 4
  %104 = load <2 x float>, ptr %18, align 4
  %105 = call float @b2Dot(<2 x float> %103, <2 x float> %104)
  store float %105, ptr %17, align 4, !tbaa !20
  %106 = load float, ptr %12, align 4, !tbaa !20
  %107 = load float, ptr %17, align 4, !tbaa !20
  %108 = call float @b2MinFloat(float noundef %106, float noundef %107)
  store float %108, ptr %12, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %109 = load <2 x float>, ptr %16, align 4
  %110 = load <2 x float>, ptr %4, align 4
  %111 = call <2 x float> @b2Sub(<2 x float> %109, <2 x float> %110)
  store <2 x float> %111, ptr %20, align 4
  %112 = load <2 x float>, ptr %20, align 4
  %113 = call float @b2LengthSquared(<2 x float> %112)
  store float %113, ptr %19, align 4, !tbaa !20
  %114 = load float, ptr %13, align 4, !tbaa !20
  %115 = load float, ptr %19, align 4, !tbaa !20
  %116 = call float @b2MaxFloat(float noundef %114, float noundef %115)
  store float %116, ptr %13, align 4, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %117

117:                                              ; preds = %87
  %118 = load i32, ptr %15, align 4, !tbaa !26
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %15, align 4, !tbaa !26
  br label %82, !llvm.loop !28

120:                                              ; preds = %86
  %121 = load float, ptr %12, align 4, !tbaa !20
  %122 = load ptr, ptr %11, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.b2Polygon, ptr %122, i32 0, i32 3
  %124 = load float, ptr %123, align 4, !tbaa !30
  %125 = fadd float %121, %124
  %126 = getelementptr inbounds %struct.b2ShapeExtent, ptr %3, i32 0, i32 0
  store float %125, ptr %126, align 4, !tbaa !21
  %127 = load float, ptr %13, align 4, !tbaa !20
  %128 = call float @sqrtf(float noundef %127) #7
  %129 = load ptr, ptr %11, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.b2Polygon, ptr %129, i32 0, i32 3
  %131 = load float, ptr %130, align 4, !tbaa !30
  %132 = fadd float %128, %131
  %133 = getelementptr inbounds %struct.b2ShapeExtent, ptr %3, i32 0, i32 1
  store float %132, ptr %133, align 4, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %179

134:                                              ; preds = %2
  %135 = getelementptr inbounds %struct.b2ShapeExtent, ptr %3, i32 0, i32 0
  store float 0.000000e+00, ptr %135, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %136 = load ptr, ptr %5, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.b2Shape, ptr %136, i32 0, i32 19
  %138 = getelementptr inbounds %struct.b2Segment, ptr %137, i32 0, i32 0
  %139 = load <2 x float>, ptr %138, align 4
  %140 = load <2 x float>, ptr %4, align 4
  %141 = call <2 x float> @b2Sub(<2 x float> %139, <2 x float> %140)
  store <2 x float> %141, ptr %21, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %142 = load ptr, ptr %5, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.b2Shape, ptr %142, i32 0, i32 19
  %144 = getelementptr inbounds %struct.b2Segment, ptr %143, i32 0, i32 1
  %145 = load <2 x float>, ptr %144, align 4
  %146 = load <2 x float>, ptr %4, align 4
  %147 = call <2 x float> @b2Sub(<2 x float> %145, <2 x float> %146)
  store <2 x float> %147, ptr %22, align 4
  %148 = load <2 x float>, ptr %21, align 4
  %149 = call float @b2LengthSquared(<2 x float> %148)
  %150 = load <2 x float>, ptr %22, align 4
  %151 = call float @b2LengthSquared(<2 x float> %150)
  %152 = call float @b2MaxFloat(float noundef %149, float noundef %151)
  %153 = call float @sqrtf(float noundef %152) #7
  %154 = getelementptr inbounds %struct.b2ShapeExtent, ptr %3, i32 0, i32 1
  store float %153, ptr %154, align 4, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %179

155:                                              ; preds = %2
  %156 = getelementptr inbounds %struct.b2ShapeExtent, ptr %3, i32 0, i32 0
  store float 0.000000e+00, ptr %156, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %157 = load ptr, ptr %5, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.b2Shape, ptr %157, i32 0, i32 19
  %159 = getelementptr inbounds %struct.b2ChainSegment, ptr %158, i32 0, i32 1
  %160 = getelementptr inbounds %struct.b2Segment, ptr %159, i32 0, i32 0
  %161 = load <2 x float>, ptr %160, align 4
  %162 = load <2 x float>, ptr %4, align 4
  %163 = call <2 x float> @b2Sub(<2 x float> %161, <2 x float> %162)
  store <2 x float> %163, ptr %23, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %164 = load ptr, ptr %5, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.b2Shape, ptr %164, i32 0, i32 19
  %166 = getelementptr inbounds %struct.b2ChainSegment, ptr %165, i32 0, i32 1
  %167 = getelementptr inbounds %struct.b2Segment, ptr %166, i32 0, i32 1
  %168 = load <2 x float>, ptr %167, align 4
  %169 = load <2 x float>, ptr %4, align 4
  %170 = call <2 x float> @b2Sub(<2 x float> %168, <2 x float> %169)
  store <2 x float> %170, ptr %24, align 4
  %171 = load <2 x float>, ptr %23, align 4
  %172 = call float @b2LengthSquared(<2 x float> %171)
  %173 = load <2 x float>, ptr %24, align 4
  %174 = call float @b2LengthSquared(<2 x float> %173)
  %175 = call float @b2MaxFloat(float noundef %172, float noundef %174)
  %176 = call float @sqrtf(float noundef %175) #7
  %177 = getelementptr inbounds %struct.b2ShapeExtent, ptr %3, i32 0, i32 1
  store float %176, ptr %177, align 4, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %179

178:                                              ; preds = %2
  br label %179

179:                                              ; preds = %178, %155, %134, %120, %56, %28
  %180 = load <2 x float>, ptr %3, align 4
  ret <2 x float> %180
}

; Function Attrs: nounwind
declare float @sqrtf(float noundef) #6

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

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind 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 = { nounwind "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 20}
!10 = !{!"b2Shape", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !11, i64 44, !13, i64 48, !13, i64 64, !14, i64 80, !11, i64 88, !15, i64 96, !6, i64 120, !11, i64 128, !7, i64 132, !17, i64 276, !18, i64 278, !18, i64 279, !18, i64 280, !18, i64 281, !18, i64 282}
!11 = !{!"int", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!"b2AABB", !14, i64 0, !14, i64 8}
!14 = !{!"b2Vec2", !12, i64 0, !12, i64 4}
!15 = !{!"b2Filter", !16, i64 0, !16, i64 8, !11, i64 16}
!16 = !{!"long", !7, i64 0}
!17 = !{!"short", !7, i64 0}
!18 = !{!"_Bool", !7, i64 0}
!19 = !{!7, !7, i64 0}
!20 = !{!12, !12, i64 0}
!21 = !{!22, !12, i64 0}
!22 = !{!"b2ShapeExtent", !12, i64 0, !12, i64 4}
!23 = !{!22, !12, i64 4}
!24 = !{!25, !11, i64 140}
!25 = !{!"b2Polygon", !7, i64 0, !7, i64 64, !14, i64 128, !12, i64 136, !11, i64 140}
!26 = !{!11, !11, i64 0}
!27 = !{i64 0, i64 4, !20, i64 4, i64 4, !20}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!25, !12, i64 136}


; 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.b2Vec2 = type { float, float }

@b2_lengthUnitsPerMeter = external local_unnamed_addr global float, align 4

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local <2 x float> @b2ComputeShapeExtent(ptr nocapture noundef readonly %0, <2 x float> %1) local_unnamed_addr #2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 20
  %4 = load i32, ptr %3, align 4, !tbaa !5
  switch i32 %4, label %78 [
    i32 1, label %5
    i32 0, label %19
    i32 3, label %27
    i32 2, label %56
    i32 4, label %67
  ]

5:                                                ; preds = %2
  %6 = getelementptr inbounds i8, ptr %0, i64 132
  %7 = getelementptr inbounds i8, ptr %0, i64 148
  %8 = load float, ptr %7, align 4, !tbaa !18
  %.sroa.049.0.vec.insert = insertelement <2 x float> poison, float %8, i64 0
  %9 = load <2 x float>, ptr %6, align 4
  %10 = tail call <2 x float> @b2Sub(<2 x float> %9, <2 x float> %1)
  %11 = getelementptr inbounds i8, ptr %0, i64 140
  %12 = load <2 x float>, ptr %11, align 4
  %13 = tail call <2 x float> @b2Sub(<2 x float> %12, <2 x float> %1)
  %14 = tail call float @b2LengthSquared(<2 x float> %10)
  %15 = tail call float @b2LengthSquared(<2 x float> %13)
  %16 = tail call float @b2MaxFloat(float noundef %14, float noundef %15)
  %17 = tail call float @sqrtf(float noundef %16) #4
  %18 = fadd float %8, %17
  %.sroa.049.4.vec.insert = insertelement <2 x float> %.sroa.049.0.vec.insert, float %18, i64 1
  br label %78

19:                                               ; preds = %2
  %20 = getelementptr inbounds i8, ptr %0, i64 132
  %21 = getelementptr inbounds i8, ptr %0, i64 140
  %22 = load float, ptr %21, align 4, !tbaa !18
  %.sroa.049.0.vec.insert52 = insertelement <2 x float> poison, float %22, i64 0
  %23 = load <2 x float>, ptr %20, align 4
  %24 = tail call <2 x float> @b2Sub(<2 x float> %23, <2 x float> %1)
  %25 = tail call float @b2Length(<2 x float> %24)
  %26 = fadd float %22, %25
  %.sroa.049.4.vec.insert60 = insertelement <2 x float> %.sroa.049.0.vec.insert52, float %26, i64 1
  br label %78

27:                                               ; preds = %2
  %28 = getelementptr inbounds i8, ptr %0, i64 132
  %29 = load float, ptr @b2_lengthUnitsPerMeter, align 4, !tbaa !19
  %30 = fmul float %29, 1.000000e+05
  %31 = getelementptr inbounds i8, ptr %0, i64 272
  %32 = load i32, ptr %31, align 4, !tbaa !20
  %33 = icmp sgt i32 %32, 0
  br i1 %33, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %27
  %34 = getelementptr inbounds i8, ptr %0, i64 196
  %35 = getelementptr inbounds i8, ptr %0, i64 260
  %wide.trip.count = zext nneg i32 %32 to i64
  br label %45

._crit_edge:                                      ; preds = %45, %27
  %.067.lcssa = phi float [ 0.000000e+00, %27 ], [ %55, %45 ]
  %.0.lcssa = phi float [ %30, %27 ], [ %52, %45 ]
  %36 = getelementptr inbounds i8, ptr %0, i64 268
  %37 = load float, ptr %36, align 4, !tbaa !22
  %38 = tail call float @sqrtf(float noundef %.067.lcssa) #4
  %39 = load float, ptr %36, align 4, !tbaa !22
  %40 = insertelement <2 x float> poison, float %.0.lcssa, i64 0
  %41 = insertelement <2 x float> %40, float %38, i64 1
  %42 = insertelement <2 x float> poison, float %37, i64 0
  %43 = insertelement <2 x float> %42, float %39, i64 1
  %44 = fadd <2 x float> %41, %43
  br label %78

45:                                               ; preds = %.lr.ph, %45
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %45 ]
  %.071 = phi float [ %30, %.lr.ph ], [ %52, %45 ]
  %.06770 = phi float [ 0.000000e+00, %.lr.ph ], [ %55, %45 ]
  %46 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %28, i64 0, i64 %indvars.iv
  %.sroa.07.0.copyload = load <2 x float>, ptr %46, align 4
  %47 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %34, i64 0, i64 %indvars.iv
  %48 = load <2 x float>, ptr %35, align 4
  %49 = tail call <2 x float> @b2Sub(<2 x float> %.sroa.07.0.copyload, <2 x float> %48)
  %50 = load <2 x float>, ptr %47, align 4
  %51 = tail call float @b2Dot(<2 x float> %50, <2 x float> %49)
  %52 = tail call float @b2MinFloat(float noundef %.071, float noundef %51)
  %53 = tail call <2 x float> @b2Sub(<2 x float> %.sroa.07.0.copyload, <2 x float> %1)
  %54 = tail call float @b2LengthSquared(<2 x float> %53)
  %55 = tail call float @b2MaxFloat(float noundef %.06770, float noundef %54)
  %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 %45, !llvm.loop !23

56:                                               ; preds = %2
  %57 = getelementptr inbounds i8, ptr %0, i64 132
  %58 = load <2 x float>, ptr %57, align 4
  %59 = tail call <2 x float> @b2Sub(<2 x float> %58, <2 x float> %1)
  %60 = getelementptr inbounds i8, ptr %0, i64 140
  %61 = load <2 x float>, ptr %60, align 4
  %62 = tail call <2 x float> @b2Sub(<2 x float> %61, <2 x float> %1)
  %63 = tail call float @b2LengthSquared(<2 x float> %59)
  %64 = tail call float @b2LengthSquared(<2 x float> %62)
  %65 = tail call float @b2MaxFloat(float noundef %63, float noundef %64)
  %66 = tail call float @sqrtf(float noundef %65) #4
  %.sroa.049.4.vec.insert64 = insertelement <2 x float> <float 0.000000e+00, float poison>, float %66, i64 1
  br label %78

67:                                               ; preds = %2
  %68 = getelementptr inbounds i8, ptr %0, i64 140
  %69 = load <2 x float>, ptr %68, align 4
  %70 = tail call <2 x float> @b2Sub(<2 x float> %69, <2 x float> %1)
  %71 = getelementptr inbounds i8, ptr %0, i64 148
  %72 = load <2 x float>, ptr %71, align 4
  %73 = tail call <2 x float> @b2Sub(<2 x float> %72, <2 x float> %1)
  %74 = tail call float @b2LengthSquared(<2 x float> %70)
  %75 = tail call float @b2LengthSquared(<2 x float> %73)
  %76 = tail call float @b2MaxFloat(float noundef %74, float noundef %75)
  %77 = tail call float @sqrtf(float noundef %76) #4
  %.sroa.049.4.vec.insert66 = insertelement <2 x float> <float 0.000000e+00, float poison>, float %77, i64 1
  br label %78

78:                                               ; preds = %2, %67, %56, %._crit_edge, %19, %5
  %.sroa.049.0 = phi <2 x float> [ zeroinitializer, %2 ], [ %.sroa.049.4.vec.insert66, %67 ], [ %.sroa.049.4.vec.insert64, %56 ], [ %44, %._crit_edge ], [ %.sroa.049.4.vec.insert60, %19 ], [ %.sroa.049.4.vec.insert, %5 ]
  ret <2 x float> %.sroa.049.0
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @sqrtf(float noundef) local_unnamed_addr #3

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 20}
!6 = !{!"b2Shape", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !7, i64 44, !11, i64 48, !11, i64 64, !12, i64 80, !7, i64 88, !13, i64 96, !15, i64 120, !7, i64 128, !8, i64 132, !16, i64 276, !17, i64 278, !17, i64 279, !17, i64 280, !17, i64 281, !17, i64 282}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!"b2AABB", !12, i64 0, !12, i64 8}
!12 = !{!"b2Vec2", !10, i64 0, !10, i64 4}
!13 = !{!"b2Filter", !14, i64 0, !14, i64 8, !7, i64 16}
!14 = !{!"long", !8, i64 0}
!15 = !{!"any pointer", !8, i64 0}
!16 = !{!"short", !8, i64 0}
!17 = !{!"_Bool", !8, i64 0}
!18 = !{!8, !8, i64 0}
!19 = !{!10, !10, i64 0}
!20 = !{!21, !7, i64 140}
!21 = !{!"b2Polygon", !8, i64 0, !8, i64 64, !12, i64 128, !10, i64 136, !7, i64 140}
!22 = !{!21, !10, i64 136}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


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