; 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.b2CastOutput = type { %struct.b2Vec2, %struct.b2Vec2, float, i32, i8 }
%struct.b2Vec2 = type { float, float }
%struct.b2Transform = type { %struct.b2Vec2, %struct.b2Rot }
%struct.b2Rot = type { float, float }
%struct.b2ShapeCastInput = type { %struct.b2ShapeProxy, %struct.b2Vec2, float, i8 }
%struct.b2ShapeProxy = type { [8 x %struct.b2Vec2], i32, 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.b2ChainSegment = type { %struct.b2Vec2, %struct.b2Segment, %struct.b2Vec2, i32 }
%struct.b2Segment = type { %struct.b2Vec2, %struct.b2Vec2 }

; 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 <2 x float> @b2InvTransformPoint(<2 x float>, <2 x float>, <2 x float>) #3

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @b2ShapeCastShape(ptr dead_on_unwind noalias writable sret(%struct.b2CastOutput) align 4 %0, ptr noundef %1, ptr noundef %2, <2 x float> %3, <2 x float> %4) #4 {
  %6 = alloca %struct.b2Transform, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %struct.b2ShapeCastInput, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.b2Vec2, align 4
  %12 = alloca %struct.b2Vec2, align 4
  %13 = alloca %struct.b2CastOutput, align 4
  %14 = alloca %struct.b2CastOutput, align 4
  %15 = alloca %struct.b2CastOutput, align 4
  %16 = alloca %struct.b2CastOutput, align 4
  %17 = alloca %struct.b2CastOutput, align 4
  %18 = alloca i32, align 4
  %19 = alloca %struct.b2Vec2, align 4
  %20 = alloca %struct.b2Vec2, align 4
  %21 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %6, i32 0, i32 0
  store <2 x float> %3, ptr %21, align 4
  %22 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %6, i32 0, i32 1
  store <2 x float> %4, ptr %22, align 4
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 88, ptr %9) #6
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %23, i64 88, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !11
  br label %24

24:                                               ; preds = %49, %5
  %25 = load i32, ptr %10, align 4, !tbaa !11
  %26 = getelementptr inbounds %struct.b2ShapeCastInput, ptr %9, i32 0, i32 0
  %27 = getelementptr inbounds %struct.b2ShapeProxy, ptr %26, i32 0, i32 1
  %28 = load i32, ptr %27, align 4, !tbaa !17
  %29 = icmp slt i32 %25, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %52

31:                                               ; preds = %24
  %32 = getelementptr inbounds %struct.b2ShapeCastInput, ptr %9, i32 0, i32 0
  %33 = getelementptr inbounds %struct.b2ShapeProxy, ptr %32, i32 0, i32 0
  %34 = load i32, ptr %10, align 4, !tbaa !11
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %33, i64 0, i64 %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.b2ShapeCastInput, ptr %37, i32 0, i32 0
  %39 = getelementptr inbounds %struct.b2ShapeProxy, ptr %38, i32 0, i32 0
  %40 = load i32, ptr %10, align 4, !tbaa !11
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %39, i64 0, i64 %41
  %43 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %6, i32 0, i32 0
  %44 = load <2 x float>, ptr %43, align 4
  %45 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %6, i32 0, i32 1
  %46 = load <2 x float>, ptr %45, align 4
  %47 = load <2 x float>, ptr %42, align 4
  %48 = call <2 x float> @b2InvTransformPoint(<2 x float> %44, <2 x float> %46, <2 x float> %47)
  store <2 x float> %48, ptr %11, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %36, ptr align 4 %11, i64 8, i1 false), !tbaa.struct !21
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %49

49:                                               ; preds = %31
  %50 = load i32, ptr %10, align 4, !tbaa !11
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %10, align 4, !tbaa !11
  br label %24, !llvm.loop !22

52:                                               ; preds = %30
  %53 = getelementptr inbounds %struct.b2ShapeCastInput, ptr %9, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %54 = getelementptr inbounds %struct.b2Transform, ptr %6, i32 0, i32 1
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.b2ShapeCastInput, ptr %55, i32 0, i32 1
  %57 = load <2 x float>, ptr %54, align 4
  %58 = load <2 x float>, ptr %56, align 4
  %59 = call <2 x float> @b2InvRotateVector(<2 x float> %57, <2 x float> %58)
  store <2 x float> %59, ptr %12, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %53, ptr align 4 %12, i64 8, i1 false), !tbaa.struct !21
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.memset.p0.i64(ptr align 4 %0, i8 0, i64 28, i1 false)
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.b2Shape, ptr %60, i32 0, i32 5
  %62 = load i32, ptr %61, align 4, !tbaa !24
  switch i32 %62, label %79 [
    i32 1, label %63
    i32 0, label %66
    i32 3, label %69
    i32 2, label %72
    i32 4, label %75
  ]

63:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 28, ptr %13) #6
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.b2Shape, ptr %64, i32 0, i32 19
  call void @b2ShapeCastCapsule(ptr dead_on_unwind writable sret(%struct.b2CastOutput) align 4 %13, ptr noundef %9, ptr noundef %65)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %0, ptr align 4 %13, i64 28, i1 false), !tbaa.struct !30
  call void @llvm.lifetime.end.p0(i64 28, ptr %13) #6
  br label %80

66:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 28, ptr %14) #6
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.b2Shape, ptr %67, i32 0, i32 19
  call void @b2ShapeCastCircle(ptr dead_on_unwind writable sret(%struct.b2CastOutput) align 4 %14, ptr noundef %9, ptr noundef %68)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %0, ptr align 4 %14, i64 28, i1 false), !tbaa.struct !30
  call void @llvm.lifetime.end.p0(i64 28, ptr %14) #6
  br label %80

69:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 28, ptr %15) #6
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.b2Shape, ptr %70, i32 0, i32 19
  call void @b2ShapeCastPolygon(ptr dead_on_unwind writable sret(%struct.b2CastOutput) align 4 %15, ptr noundef %9, ptr noundef %71)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %0, ptr align 4 %15, i64 28, i1 false), !tbaa.struct !30
  call void @llvm.lifetime.end.p0(i64 28, ptr %15) #6
  br label %80

72:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 28, ptr %16) #6
  %73 = load ptr, ptr %8, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.b2Shape, ptr %73, i32 0, i32 19
  call void @b2ShapeCastSegment(ptr dead_on_unwind writable sret(%struct.b2CastOutput) align 4 %16, ptr noundef %9, ptr noundef %74)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %0, ptr align 4 %16, i64 28, i1 false), !tbaa.struct !30
  call void @llvm.lifetime.end.p0(i64 28, ptr %16) #6
  br label %80

75:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 28, ptr %17) #6
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.b2Shape, ptr %76, i32 0, i32 19
  %78 = getelementptr inbounds %struct.b2ChainSegment, ptr %77, i32 0, i32 1
  call void @b2ShapeCastSegment(ptr dead_on_unwind writable sret(%struct.b2CastOutput) align 4 %17, ptr noundef %9, ptr noundef %78)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %0, ptr align 4 %17, i64 28, i1 false), !tbaa.struct !30
  call void @llvm.lifetime.end.p0(i64 28, ptr %17) #6
  br label %80

79:                                               ; preds = %52
  store i32 1, ptr %18, align 4
  br label %95

80:                                               ; preds = %75, %72, %69, %66, %63
  %81 = getelementptr inbounds %struct.b2CastOutput, ptr %0, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %82 = getelementptr inbounds %struct.b2CastOutput, ptr %0, i32 0, i32 1
  %83 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %6, i32 0, i32 0
  %84 = load <2 x float>, ptr %83, align 4
  %85 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %6, i32 0, i32 1
  %86 = load <2 x float>, ptr %85, align 4
  %87 = load <2 x float>, ptr %82, align 4
  %88 = call <2 x float> @b2TransformPoint(<2 x float> %84, <2 x float> %86, <2 x float> %87)
  store <2 x float> %88, ptr %19, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %81, ptr align 4 %19, i64 8, i1 false), !tbaa.struct !21
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  %89 = getelementptr inbounds %struct.b2CastOutput, ptr %0, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %90 = getelementptr inbounds %struct.b2Transform, ptr %6, i32 0, i32 1
  %91 = getelementptr inbounds %struct.b2CastOutput, ptr %0, i32 0, i32 0
  %92 = load <2 x float>, ptr %90, align 4
  %93 = load <2 x float>, ptr %91, align 4
  %94 = call <2 x float> @b2RotateVector(<2 x float> %92, <2 x float> %93)
  store <2 x float> %94, ptr %20, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %89, ptr align 4 %20, i64 8, i1 false), !tbaa.struct !21
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  store i32 1, ptr %18, align 4
  br label %95

95:                                               ; preds = %80, %79
  call void @llvm.lifetime.end.p0(i64 88, ptr %9) #6
  ret void
}

declare void @b2ShapeCastCapsule(ptr dead_on_unwind writable sret(%struct.b2CastOutput) align 4, ptr noundef, ptr noundef) #5

declare void @b2ShapeCastCircle(ptr dead_on_unwind writable sret(%struct.b2CastOutput) align 4, ptr noundef, ptr noundef) #5

declare void @b2ShapeCastPolygon(ptr dead_on_unwind writable sret(%struct.b2CastOutput) align 4, ptr noundef, ptr noundef) #5

declare void @b2ShapeCastSegment(ptr dead_on_unwind writable sret(%struct.b2CastOutput) align 4, ptr noundef, ptr noundef) #5

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 = { 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 = { 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 = !{i64 0, i64 64, !10, i64 64, i64 4, !11, i64 68, i64 4, !13, i64 72, i64 4, !13, i64 76, i64 4, !13, i64 80, i64 4, !13, i64 84, i64 1, !15}
!10 = !{!7, !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"_Bool", !7, i64 0}
!17 = !{!18, !12, i64 64}
!18 = !{!"b2ShapeCastInput", !19, i64 0, !20, i64 72, !14, i64 80, !16, i64 84}
!19 = !{!"b2ShapeProxy", !7, i64 0, !12, i64 64, !14, i64 68}
!20 = !{!"b2Vec2", !14, i64 0, !14, i64 4}
!21 = !{i64 0, i64 4, !13, i64 4, i64 4, !13}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!25, !12, i64 20}
!25 = !{!"b2Shape", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !14, i64 40, !12, i64 44, !26, i64 48, !26, i64 64, !20, i64 80, !12, i64 88, !27, i64 96, !6, i64 120, !12, i64 128, !7, i64 132, !29, i64 276, !16, i64 278, !16, i64 279, !16, i64 280, !16, i64 281, !16, i64 282}
!26 = !{!"b2AABB", !20, i64 0, !20, i64 8}
!27 = !{!"b2Filter", !28, i64 0, !28, i64 8, !12, i64 16}
!28 = !{!"long", !7, i64 0}
!29 = !{!"short", !7, i64 0}
!30 = !{i64 0, i64 4, !13, i64 4, i64 4, !13, i64 8, i64 4, !13, i64 12, i64 4, !13, i64 16, i64 4, !13, i64 20, i64 4, !11, i64 24, i64 1, !15}


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

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

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @b2ShapeCastShape(ptr dead_on_unwind noalias nocapture writable sret(%struct.b2CastOutput) align 4 %0, ptr nocapture noundef readonly %1, ptr noundef %2, <2 x float> %3, <2 x float> %4) local_unnamed_addr #4 {
  %6 = alloca %struct.b2ShapeCastInput, align 4
  call void @llvm.lifetime.start.p0(i64 88, ptr nonnull %6) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(88) %6, ptr noundef nonnull align 4 dereferenceable(88) %1, i64 88, i1 false), !tbaa.struct !5
  %7 = getelementptr inbounds i8, ptr %6, i64 64
  %8 = load i32, ptr %7, align 4, !tbaa !15
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %5
  %10 = getelementptr inbounds i8, ptr %6, i64 72
  %11 = getelementptr inbounds i8, ptr %1, i64 72
  %12 = load <2 x float>, ptr %11, align 4
  %13 = tail call <2 x float> @b2InvRotateVector(<2 x float> %4, <2 x float> %12)
  store <2 x float> %13, ptr %10, align 4
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %0, i8 0, i64 28, i1 false)
  %14 = getelementptr inbounds i8, ptr %2, i64 20
  %15 = load i32, ptr %14, align 4, !tbaa !19
  switch i32 %15, label %39 [
    i32 1, label %23
    i32 0, label %25
    i32 3, label %27
    i32 2, label %29
    i32 4, label %31
  ]

.lr.ph:                                           ; preds = %5, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %5 ]
  %16 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %6, i64 0, i64 %indvars.iv
  %17 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %1, i64 0, i64 %indvars.iv
  %18 = load <2 x float>, ptr %17, align 4
  %19 = tail call <2 x float> @b2InvTransformPoint(<2 x float> %3, <2 x float> %4, <2 x float> %18)
  store <2 x float> %19, ptr %16, align 4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %20 = load i32, ptr %7, align 4, !tbaa !15
  %21 = sext i32 %20 to i64
  %22 = icmp slt i64 %indvars.iv.next, %21
  br i1 %22, label %.lr.ph, label %._crit_edge, !llvm.loop !26

23:                                               ; preds = %._crit_edge
  %24 = getelementptr inbounds i8, ptr %2, i64 132
  call void @b2ShapeCastCapsule(ptr dead_on_unwind nonnull writable sret(%struct.b2CastOutput) align 4 %0, ptr noundef nonnull %6, ptr noundef nonnull %24) #6
  br label %33

25:                                               ; preds = %._crit_edge
  %26 = getelementptr inbounds i8, ptr %2, i64 132
  call void @b2ShapeCastCircle(ptr dead_on_unwind nonnull writable sret(%struct.b2CastOutput) align 4 %0, ptr noundef nonnull %6, ptr noundef nonnull %26) #6
  br label %33

27:                                               ; preds = %._crit_edge
  %28 = getelementptr inbounds i8, ptr %2, i64 132
  call void @b2ShapeCastPolygon(ptr dead_on_unwind nonnull writable sret(%struct.b2CastOutput) align 4 %0, ptr noundef nonnull %6, ptr noundef nonnull %28) #6
  br label %33

29:                                               ; preds = %._crit_edge
  %30 = getelementptr inbounds i8, ptr %2, i64 132
  call void @b2ShapeCastSegment(ptr dead_on_unwind nonnull writable sret(%struct.b2CastOutput) align 4 %0, ptr noundef nonnull %6, ptr noundef nonnull %30) #6
  br label %33

31:                                               ; preds = %._crit_edge
  %32 = getelementptr inbounds i8, ptr %2, i64 140
  call void @b2ShapeCastSegment(ptr dead_on_unwind nonnull writable sret(%struct.b2CastOutput) align 4 %0, ptr noundef nonnull %6, ptr noundef nonnull %32) #6
  br label %33

33:                                               ; preds = %31, %29, %27, %25, %23
  %34 = getelementptr inbounds i8, ptr %0, i64 8
  %35 = load <2 x float>, ptr %34, align 4
  %36 = call <2 x float> @b2TransformPoint(<2 x float> %3, <2 x float> %4, <2 x float> %35)
  store <2 x float> %36, ptr %34, align 4
  %37 = load <2 x float>, ptr %0, align 4
  %38 = call <2 x float> @b2RotateVector(<2 x float> %4, <2 x float> %37)
  store <2 x float> %38, ptr %0, align 4
  br label %39

39:                                               ; preds = %._crit_edge, %33
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %6) #6
  ret void
}

declare void @b2ShapeCastCapsule(ptr dead_on_unwind writable sret(%struct.b2CastOutput) align 4, ptr noundef, ptr noundef) local_unnamed_addr #5

declare void @b2ShapeCastCircle(ptr dead_on_unwind writable sret(%struct.b2CastOutput) align 4, ptr noundef, ptr noundef) local_unnamed_addr #5

declare void @b2ShapeCastPolygon(ptr dead_on_unwind writable sret(%struct.b2CastOutput) align 4, ptr noundef, ptr noundef) local_unnamed_addr #5

declare void @b2ShapeCastSegment(ptr dead_on_unwind writable sret(%struct.b2CastOutput) align 4, ptr noundef, ptr noundef) local_unnamed_addr #5

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 = { 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 = { 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 = !{i64 0, i64 64, !6, i64 64, i64 4, !9, i64 68, i64 4, !11, i64 72, i64 4, !11, i64 76, i64 4, !11, i64 80, i64 4, !11, i64 84, i64 1, !13}
!6 = !{!7, !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, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{!16, !10, i64 64}
!16 = !{!"b2ShapeCastInput", !17, i64 0, !18, i64 72, !12, i64 80, !14, i64 84}
!17 = !{!"b2ShapeProxy", !7, i64 0, !10, i64 64, !12, i64 68}
!18 = !{!"b2Vec2", !12, i64 0, !12, i64 4}
!19 = !{!20, !10, i64 20}
!20 = !{!"b2Shape", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !10, i64 44, !21, i64 48, !21, i64 64, !18, i64 80, !10, i64 88, !22, i64 96, !24, i64 120, !10, i64 128, !7, i64 132, !25, i64 276, !14, i64 278, !14, i64 279, !14, i64 280, !14, i64 281, !14, i64 282}
!21 = !{!"b2AABB", !18, i64 0, !18, i64 8}
!22 = !{!"b2Filter", !23, i64 0, !23, i64 8, !10, i64 16}
!23 = !{!"long", !7, i64 0}
!24 = !{!"any pointer", !7, i64 0}
!25 = !{!"short", !7, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass