; LLVM IR from mtsamis/box2d-optimized :: src/collision (b2_polygon_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.b2Vec2 = type { float, float }
%struct.b2Transform = type { %struct.b2Vec2, %struct.b2Rot }
%struct.b2Rot = type { float, float }
%class.b2PolygonShape = type <{ %class.b2Shape, %struct.b2Vec2, [8 x %struct.b2Vec2], [8 x %struct.b2Vec2], i32, [4 x i8] }>
%class.b2Shape = type { ptr, i32, float }

; 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_Z5b2MulRK5b2RotRK6b2Vec2(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK6b2Vec213LengthSquaredEv(ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZN6b2Vec29NormalizeEv(ptr noundef nonnull align 4 dereferenceable(8)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_Z6b2MulTRK5b2RotRK6b2Vec2(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #5

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK14b2PolygonShape15ComputeDistanceERK11b2TransformRK6b2Vec2PfPS3_(ptr noundef nonnull align 8 dereferenceable(156) %0, ptr noundef nonnull align 4 dereferenceable(16) %1, ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %3, ptr noundef %4) unnamed_addr #6 align 2 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %struct.b2Vec2, align 4
  %12 = alloca %struct.b2Vec2, align 4
  %13 = alloca float, align 4
  %14 = alloca %struct.b2Vec2, align 4
  %15 = alloca i32, align 4
  %16 = alloca float, align 4
  %17 = alloca %struct.b2Vec2, align 4
  %18 = alloca %struct.b2Vec2, align 4
  %19 = alloca float, align 4
  %20 = alloca i32, align 4
  %21 = alloca %struct.b2Vec2, align 4
  %22 = alloca float, align 4
  %23 = alloca %struct.b2Vec2, align 4
  %24 = alloca %struct.b2Vec2, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  %25 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.b2Transform, ptr %26, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.b2Transform, ptr %29, i32 0, i32 0
  %31 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %28, ptr noundef nonnull align 4 dereferenceable(8) %30)
  store <2 x float> %31, ptr %12, align 4
  %32 = call <2 x float> @_Z6b2MulTRK5b2RotRK6b2Vec2(ptr noundef nonnull align 4 dereferenceable(8) %27, ptr noundef nonnull align 4 dereferenceable(8) %12)
  store <2 x float> %32, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store float 0xC7EFFFFFE0000000, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %11, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 0, ptr %15, align 4, !tbaa !12
  br label %33

33:                                               ; preds = %60, %5
  %34 = load i32, ptr %15, align 4, !tbaa !12
  %35 = getelementptr inbounds %class.b2PolygonShape, ptr %25, i32 0, i32 4
  %36 = load i32, ptr %35, align 8, !tbaa !14
  %37 = icmp slt i32 %34, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %63

39:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %40 = getelementptr inbounds %class.b2PolygonShape, ptr %25, i32 0, i32 3
  %41 = load i32, ptr %15, align 4, !tbaa !12
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %40, i64 0, i64 %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %44 = getelementptr inbounds %class.b2PolygonShape, ptr %25, i32 0, i32 2
  %45 = load i32, ptr %15, align 4, !tbaa !12
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %44, i64 0, i64 %46
  %48 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %47)
  store <2 x float> %48, ptr %17, align 4
  %49 = call noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %43, ptr noundef nonnull align 4 dereferenceable(8) %17)
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  store float %49, ptr %16, align 4, !tbaa !9
  %50 = load float, ptr %16, align 4, !tbaa !9
  %51 = load float, ptr %13, align 4, !tbaa !9
  %52 = fcmp ogt float %50, %51
  br i1 %52, label %53, label %59

53:                                               ; preds = %39
  %54 = load float, ptr %16, align 4, !tbaa !9
  store float %54, ptr %13, align 4, !tbaa !9
  %55 = getelementptr inbounds %class.b2PolygonShape, ptr %25, i32 0, i32 3
  %56 = load i32, ptr %15, align 4, !tbaa !12
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %55, i64 0, i64 %57
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 8 %58, i64 8, i1 false), !tbaa.struct !11
  br label %59

59:                                               ; preds = %53, %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %60

60:                                               ; preds = %59
  %61 = load i32, ptr %15, align 4, !tbaa !12
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %15, align 4, !tbaa !12
  br label %33, !llvm.loop !19

63:                                               ; preds = %38
  %64 = load float, ptr %13, align 4, !tbaa !9
  %65 = fcmp ogt float %64, 0.000000e+00
  br i1 %65, label %66, label %102

66:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 4 %14, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %67 = load float, ptr %13, align 4, !tbaa !9
  %68 = load float, ptr %13, align 4, !tbaa !9
  %69 = fmul float %67, %68
  store float %69, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  store i32 0, ptr %20, align 4, !tbaa !12
  br label %70

70:                                               ; preds = %89, %66
  %71 = load i32, ptr %20, align 4, !tbaa !12
  %72 = getelementptr inbounds %class.b2PolygonShape, ptr %25, i32 0, i32 4
  %73 = load i32, ptr %72, align 8, !tbaa !14
  %74 = icmp slt i32 %71, %73
  br i1 %74, label %76, label %75

75:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  br label %92

76:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %77 = getelementptr inbounds %class.b2PolygonShape, ptr %25, i32 0, i32 2
  %78 = load i32, ptr %20, align 4, !tbaa !12
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %77, i64 0, i64 %79
  %81 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %80)
  store <2 x float> %81, ptr %21, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  %82 = call noundef float @_ZNK6b2Vec213LengthSquaredEv(ptr noundef nonnull align 4 dereferenceable(8) %21)
  store float %82, ptr %22, align 4, !tbaa !9
  %83 = load float, ptr %19, align 4, !tbaa !9
  %84 = load float, ptr %22, align 4, !tbaa !9
  %85 = fcmp ogt float %83, %84
  br i1 %85, label %86, label %88

86:                                               ; preds = %76
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 4 %21, i64 8, i1 false), !tbaa.struct !11
  %87 = load float, ptr %22, align 4, !tbaa !9
  store float %87, ptr %19, align 4, !tbaa !9
  br label %88

88:                                               ; preds = %86, %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  br label %89

89:                                               ; preds = %88
  %90 = load i32, ptr %20, align 4, !tbaa !12
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %20, align 4, !tbaa !12
  br label %70, !llvm.loop !21

92:                                               ; preds = %75
  %93 = load float, ptr %19, align 4, !tbaa !9
  %94 = call float @sqrtf(float noundef %93) #8
  %95 = load ptr, ptr %9, align 8, !tbaa !5
  store float %94, ptr %95, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.b2Transform, ptr %96, i32 0, i32 1
  %98 = call <2 x float> @_Z5b2MulRK5b2RotRK6b2Vec2(ptr noundef nonnull align 4 dereferenceable(8) %97, ptr noundef nonnull align 4 dereferenceable(8) %18)
  store <2 x float> %98, ptr %23, align 4
  %99 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %99, ptr align 4 %23, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  %100 = load ptr, ptr %10, align 8, !tbaa !5
  %101 = call noundef float @_ZN6b2Vec29NormalizeEv(ptr noundef nonnull align 4 dereferenceable(8) %100)
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %109

102:                                              ; preds = %63
  %103 = load float, ptr %13, align 4, !tbaa !9
  %104 = load ptr, ptr %9, align 8, !tbaa !5
  store float %103, ptr %104, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  %105 = load ptr, ptr %7, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.b2Transform, ptr %105, i32 0, i32 1
  %107 = call <2 x float> @_Z5b2MulRK5b2RotRK6b2Vec2(ptr noundef nonnull align 4 dereferenceable(8) %106, ptr noundef nonnull align 4 dereferenceable(8) %14)
  store <2 x float> %107, ptr %24, align 4
  %108 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %108, ptr align 4 %24, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  br label %109

109:                                              ; preds = %102, %92
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  ret void
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress 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 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 #4 = { mustprogress 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress 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 #7 = { 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 #8 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{i64 0, i64 4, !9, i64 4, i64 4, !9}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !13, i64 152}
!15 = !{!"_ZTS14b2PolygonShape", !16, i64 0, !18, i64 16, !7, i64 24, !7, i64 88, !13, i64 152}
!16 = !{!"_ZTS7b2Shape", !17, i64 8, !10, i64 12}
!17 = !{!"_ZTSN7b2Shape4TypeE", !7, i64 0}
!18 = !{!"_ZTS6b2Vec2", !10, i64 0, !10, i64 4}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}


; 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 }

; 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_Z5b2MulRK5b2RotRK6b2Vec2(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK6b2Vec213LengthSquaredEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZN6b2Vec29NormalizeEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_Z6b2MulTRK5b2RotRK6b2Vec2(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK14b2PolygonShape15ComputeDistanceERK11b2TransformRK6b2Vec2PfPS3_(ptr noundef nonnull align 8 dereferenceable(156) %0, ptr noundef nonnull align 4 dereferenceable(16) %1, ptr noundef nonnull align 4 dereferenceable(8) %2, ptr nocapture noundef writeonly %3, ptr noundef %4) unnamed_addr #5 align 2 {
  %6 = alloca %struct.b2Vec2, align 8
  %7 = alloca %struct.b2Vec2, align 8
  %8 = alloca %struct.b2Vec2, align 8
  %9 = alloca %struct.b2Vec2, align 8
  %10 = alloca %struct.b2Vec2, align 8
  %11 = alloca %struct.b2Vec2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %12 = getelementptr inbounds i8, ptr %1, i64 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %13 = tail call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(8) %1)
  store <2 x float> %13, ptr %7, align 8
  %14 = call <2 x float> @_Z6b2MulTRK5b2RotRK6b2Vec2(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(8) %7)
  store <2 x float> %14, ptr %6, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  store <2 x float> %14, ptr %8, align 8
  %15 = getelementptr inbounds i8, ptr %0, i64 152
  %16 = load i32, ptr %15, align 8, !tbaa !5
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge.thread

.lr.ph:                                           ; preds = %5
  %18 = bitcast <2 x float> %14 to i64
  %19 = getelementptr inbounds i8, ptr %0, i64 88
  %20 = getelementptr inbounds i8, ptr %0, i64 24
  br label %22

._crit_edge:                                      ; preds = %31
  %21 = fcmp ogt float %.1, 0.000000e+00
  br i1 %21, label %36, label %._crit_edge.thread

22:                                               ; preds = %.lr.ph, %31
  %23 = phi i64 [ %18, %.lr.ph ], [ %32, %31 ]
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %31 ]
  %.037 = phi float [ 0xC7EFFFFFE0000000, %.lr.ph ], [ %.1, %31 ]
  %24 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %19, i64 0, i64 %indvars.iv
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %25 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %20, i64 0, i64 %indvars.iv
  %26 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(8) %25)
  store <2 x float> %26, ptr %9, align 8
  %27 = call noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %24, ptr noundef nonnull align 4 dereferenceable(8) %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  %28 = fcmp ogt float %27, %.037
  br i1 %28, label %29, label %31

29:                                               ; preds = %22
  %30 = load i64, ptr %24, align 8
  store i64 %30, ptr %8, align 8
  br label %31

31:                                               ; preds = %29, %22
  %32 = phi i64 [ %30, %29 ], [ %23, %22 ]
  %.1 = phi float [ %27, %29 ], [ %.037, %22 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %33 = load i32, ptr %15, align 8, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = icmp slt i64 %indvars.iv.next, %34
  br i1 %35, label %22, label %._crit_edge, !llvm.loop !14

36:                                               ; preds = %._crit_edge
  %37 = icmp sgt i32 %33, 0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  store i64 %32, ptr %10, align 8
  %38 = fmul float %.1, %.1
  br i1 %37, label %.lr.ph41, label %._crit_edge42

.lr.ph41:                                         ; preds = %36
  %39 = getelementptr inbounds i8, ptr %0, i64 24
  br label %43

._crit_edge42:                                    ; preds = %50, %36
  %.031.lcssa = phi float [ %38, %36 ], [ %.132, %50 ]
  %40 = call float @sqrtf(float noundef %.031.lcssa) #7
  store float %40, ptr %3, align 4, !tbaa !16
  %41 = call <2 x float> @_Z5b2MulRK5b2RotRK6b2Vec2(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(8) %10)
  store <2 x float> %41, ptr %4, align 4
  %42 = call noundef float @_ZN6b2Vec29NormalizeEv(ptr noundef nonnull align 4 dereferenceable(8) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  br label %55

43:                                               ; preds = %.lr.ph41, %50
  %indvars.iv45 = phi i64 [ 0, %.lr.ph41 ], [ %indvars.iv.next46, %50 ]
  %.03139 = phi float [ %38, %.lr.ph41 ], [ %.132, %50 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %44 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %39, i64 0, i64 %indvars.iv45
  %45 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(8) %44)
  store <2 x float> %45, ptr %11, align 8
  %46 = call noundef float @_ZNK6b2Vec213LengthSquaredEv(ptr noundef nonnull align 4 dereferenceable(8) %11)
  %47 = fcmp ogt float %.03139, %46
  br i1 %47, label %48, label %50

48:                                               ; preds = %43
  %49 = load i64, ptr %11, align 8
  store i64 %49, ptr %10, align 8
  br label %50

50:                                               ; preds = %48, %43
  %.132 = phi float [ %46, %48 ], [ %.03139, %43 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  %indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
  %51 = load i32, ptr %15, align 8, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = icmp slt i64 %indvars.iv.next46, %52
  br i1 %53, label %43, label %._crit_edge42, !llvm.loop !17

._crit_edge.thread:                               ; preds = %5, %._crit_edge
  %.0.lcssa49 = phi float [ %.1, %._crit_edge ], [ 0xC7EFFFFFE0000000, %5 ]
  store float %.0.lcssa49, ptr %3, align 4, !tbaa !16
  %54 = call <2 x float> @_Z5b2MulRK5b2RotRK6b2Vec2(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(8) %8)
  store <2 x float> %54, ptr %4, align 4
  br label %55

55:                                               ; preds = %._crit_edge.thread, %._crit_edge42
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  ret void
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress 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 #2 = { mustprogress 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 #3 = { mustprogress 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 #4 = { inlinehint mustprogress 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 = { mustprogress 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 = { 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 #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, !13, i64 152}
!6 = !{!"_ZTS14b2PolygonShape", !7, i64 0, !12, i64 16, !9, i64 24, !9, i64 88, !13, i64 152}
!7 = !{!"_ZTS7b2Shape", !8, i64 8, !11, i64 12}
!8 = !{!"_ZTSN7b2Shape4TypeE", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"float", !9, i64 0}
!12 = !{!"_ZTS6b2Vec2", !11, i64 0, !11, i64 4}
!13 = !{!"int", !9, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!11, !11, i64 0}
!17 = distinct !{!17, !15}


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