; LLVM IR from Mithreindeir/VelocityRaptor :: VelocityRaptor/src (vrCollision)

; 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.vrPolygonShape = type { ptr, i32, ptr, i32, %struct.vrVec2 }
%struct.vrVec2 = type { float, float }
%struct.vrEdge = type { %struct.vrVec2, %struct.vrVec2, %struct.vrVec2, %struct.vrVec2, %struct.vrVec2 }
%struct.vrProjection = type { float, float }

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

declare <2 x float> @vrVect(float noundef, float noundef) #1

; Function Attrs: nounwind uwtable
define dso_local float @vrPolyGetLeastAxis(ptr noundef byval(%struct.vrPolygonShape) align 8 %0, ptr noundef byval(%struct.vrPolygonShape) align 8 %1, ptr noundef %2, ptr noundef %3, <2 x float> %4) #2 {
  %6 = alloca float, align 4
  %7 = alloca %struct.vrVec2, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca float, align 4
  %11 = alloca %struct.vrEdge, align 4
  %12 = alloca %struct.vrVec2, align 4
  %13 = alloca i32, align 4
  %14 = alloca %struct.vrVec2, align 4
  %15 = alloca %struct.vrVec2, align 4
  %16 = alloca %struct.vrVec2, align 4
  %17 = alloca %struct.vrVec2, align 4
  %18 = alloca %struct.vrVec2, align 4
  %19 = alloca %struct.vrVec2, align 4
  %20 = alloca %struct.vrVec2, align 4
  %21 = alloca %struct.vrProjection, align 4
  %22 = alloca %struct.vrProjection, align 4
  %23 = alloca float, align 4
  %24 = alloca %struct.vrVec2, align 4
  store <2 x float> %4, ptr %7, align 4
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.vrPolygonShape, ptr %0, i32 0, i32 3
  %26 = load i32, ptr %25, align 8, !tbaa !9
  %27 = getelementptr inbounds %struct.vrPolygonShape, ptr %0, i32 0, i32 1
  %28 = load i32, ptr %27, align 8, !tbaa !14
  %29 = icmp ne i32 %26, %28
  br i1 %29, label %30, label %31

30:                                               ; preds = %5
  store float 0.000000e+00, ptr %6, align 4
  br label %131

31:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store float 1.000000e+06, ptr %10, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 40, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !16
  br label %32

32:                                               ; preds = %124, %31
  %33 = load i32, ptr %13, align 4, !tbaa !16
  %34 = getelementptr inbounds %struct.vrPolygonShape, ptr %0, i32 0, i32 1
  %35 = load i32, ptr %34, align 8, !tbaa !14
  %36 = icmp slt i32 %33, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %127

38:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %39 = getelementptr inbounds %struct.vrPolygonShape, ptr %0, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8, !tbaa !17
  %41 = load i32, ptr %13, align 4, !tbaa !16
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds %struct.vrVec2, ptr %40, i64 %42
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %43, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %44 = load i32, ptr %13, align 4, !tbaa !16
  %45 = getelementptr inbounds %struct.vrPolygonShape, ptr %0, i32 0, i32 1
  %46 = load i32, ptr %45, align 8, !tbaa !14
  %47 = sub nsw i32 %46, 1
  %48 = icmp slt i32 %44, %47
  br i1 %48, label %49, label %56

49:                                               ; preds = %38
  %50 = getelementptr inbounds %struct.vrPolygonShape, ptr %0, i32 0, i32 0
  %51 = load ptr, ptr %50, align 8, !tbaa !17
  %52 = load i32, ptr %13, align 4, !tbaa !16
  %53 = add nsw i32 %52, 1
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds %struct.vrVec2, ptr %51, i64 %54
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %55, i64 8, i1 false), !tbaa.struct !18
  br label %60

56:                                               ; preds = %38
  %57 = getelementptr inbounds %struct.vrPolygonShape, ptr %0, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8, !tbaa !17
  %59 = getelementptr inbounds %struct.vrVec2, ptr %58, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %59, i64 8, i1 false), !tbaa.struct !18
  br label %60

60:                                               ; preds = %56, %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %61 = load <2 x float>, ptr %16, align 4
  %62 = load <2 x float>, ptr %15, align 4
  %63 = call <2 x float> @vrSub(<2 x float> %61, <2 x float> %62)
  store <2 x float> %63, ptr %17, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %17, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %64 = getelementptr inbounds %struct.vrVec2, ptr %14, i32 0, i32 1
  %65 = load float, ptr %64, align 4, !tbaa !19
  %66 = getelementptr inbounds %struct.vrVec2, ptr %14, i32 0, i32 0
  %67 = load float, ptr %66, align 4, !tbaa !20
  %68 = fneg float %67
  %69 = call <2 x float> @vrVect(float noundef %65, float noundef %68)
  store <2 x float> %69, ptr %19, align 4
  %70 = load <2 x float>, ptr %19, align 4
  %71 = call <2 x float> @vrNormalize(<2 x float> %70)
  store <2 x float> %71, ptr %18, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %18, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %72 = getelementptr inbounds %struct.vrPolygonShape, ptr %0, i32 0, i32 2
  %73 = load ptr, ptr %72, align 8, !tbaa !21
  %74 = load i32, ptr %13, align 4, !tbaa !16
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds %struct.vrVec2, ptr %73, i64 %75
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 4 %76, i64 8, i1 false), !tbaa.struct !18
  %77 = load <2 x float>, ptr %20, align 4
  %78 = load <2 x float>, ptr %7, align 4
  %79 = call float @vrDot(<2 x float> %77, <2 x float> %78)
  %80 = fcmp oge float %79, 0.000000e+00
  br i1 %80, label %81, label %123

81:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %82 = load <2 x float>, ptr %20, align 4
  %83 = call <2 x float> @vrProject(ptr noundef byval(%struct.vrPolygonShape) align 8 %0, <2 x float> %82)
  store <2 x float> %83, ptr %21, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %84 = load <2 x float>, ptr %20, align 4
  %85 = call <2 x float> @vrProject(ptr noundef byval(%struct.vrPolygonShape) align 8 %1, <2 x float> %84)
  store <2 x float> %85, ptr %22, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  %86 = getelementptr inbounds %struct.vrProjection, ptr %22, i32 0, i32 0
  %87 = load float, ptr %86, align 4, !tbaa !22
  %88 = getelementptr inbounds %struct.vrProjection, ptr %21, i32 0, i32 0
  %89 = load float, ptr %88, align 4, !tbaa !22
  %90 = call float @vrMin(float noundef %87, float noundef %89)
  %91 = getelementptr inbounds %struct.vrProjection, ptr %22, i32 0, i32 1
  %92 = load float, ptr %91, align 4, !tbaa !24
  %93 = getelementptr inbounds %struct.vrProjection, ptr %21, i32 0, i32 1
  %94 = load float, ptr %93, align 4, !tbaa !24
  %95 = call float @vrMax(float noundef %92, float noundef %94)
  %96 = fsub float %90, %95
  store float %96, ptr %23, align 4, !tbaa !15
  %97 = load float, ptr %23, align 4, !tbaa !15
  %98 = load float, ptr %10, align 4, !tbaa !15
  %99 = fcmp ole float %97, %98
  br i1 %99, label %100, label %122

100:                                              ; preds = %81
  %101 = load float, ptr %23, align 4, !tbaa !15
  store float %101, ptr %10, align 4, !tbaa !15
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %20, i64 8, i1 false), !tbaa.struct !18
  %102 = getelementptr inbounds %struct.vrEdge, ptr %11, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %102, ptr align 4 %16, i64 8, i1 false), !tbaa.struct !18
  %103 = getelementptr inbounds %struct.vrEdge, ptr %11, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %103, ptr align 4 %15, i64 8, i1 false), !tbaa.struct !18
  %104 = getelementptr inbounds %struct.vrEdge, ptr %11, i32 0, i32 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  %105 = load <2 x float>, ptr %16, align 4
  %106 = load <2 x float>, ptr %15, align 4
  %107 = call <2 x float> @vrSub(<2 x float> %105, <2 x float> %106)
  store <2 x float> %107, ptr %24, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %104, ptr align 4 %24, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  %108 = load <2 x float>, ptr %16, align 4
  %109 = load <2 x float>, ptr %20, align 4
  %110 = call float @vrDot(<2 x float> %108, <2 x float> %109)
  %111 = load <2 x float>, ptr %15, align 4
  %112 = load <2 x float>, ptr %20, align 4
  %113 = call float @vrDot(<2 x float> %111, <2 x float> %112)
  %114 = fcmp ole float %110, %113
  br i1 %114, label %115, label %118

115:                                              ; preds = %100
  %116 = getelementptr inbounds %struct.vrEdge, ptr %11, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %116, ptr align 4 %16, i64 8, i1 false), !tbaa.struct !18
  %117 = getelementptr inbounds %struct.vrEdge, ptr %11, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %117, ptr align 4 %15, i64 8, i1 false), !tbaa.struct !18
  br label %121

118:                                              ; preds = %100
  %119 = getelementptr inbounds %struct.vrEdge, ptr %11, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %119, ptr align 4 %15, i64 8, i1 false), !tbaa.struct !18
  %120 = getelementptr inbounds %struct.vrEdge, ptr %11, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %120, ptr align 4 %16, i64 8, i1 false), !tbaa.struct !18
  br label %121

121:                                              ; preds = %118, %115
  br label %122

122:                                              ; preds = %121, %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  br label %123

123:                                              ; preds = %122, %60
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %13, align 4, !tbaa !16
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %13, align 4, !tbaa !16
  br label %32, !llvm.loop !25

127:                                              ; preds = %37
  %128 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %128, ptr align 4 %11, i64 40, i1 false), !tbaa.struct !27
  %129 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %129, ptr align 4 %12, i64 8, i1 false), !tbaa.struct !18
  %130 = load float, ptr %10, align 4, !tbaa !15
  store float %130, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %131

131:                                              ; preds = %127, %30
  %132 = load float, ptr %6, align 4
  ret float %132
}

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

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

declare <2 x float> @vrNormalize(<2 x float>) #1

declare float @vrDot(<2 x float>, <2 x float>) #1

; Function Attrs: nounwind uwtable
declare dso_local <2 x float> @vrProject(ptr noundef byval(%struct.vrPolygonShape) align 8, <2 x float>) #2

declare float @vrMin(float noundef, float noundef) #1

declare float @vrMax(float noundef, float noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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: readwrite) }
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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 24}
!10 = !{!"vrPolygonShape", !6, i64 0, !11, i64 8, !6, i64 16, !11, i64 24, !12, i64 28}
!11 = !{!"int", !7, i64 0}
!12 = !{!"vrVec2", !13, i64 0, !13, i64 4}
!13 = !{!"float", !7, i64 0}
!14 = !{!10, !11, i64 8}
!15 = !{!13, !13, i64 0}
!16 = !{!11, !11, i64 0}
!17 = !{!10, !6, i64 0}
!18 = !{i64 0, i64 4, !15, i64 4, i64 4, !15}
!19 = !{!12, !13, i64 4}
!20 = !{!12, !13, i64 0}
!21 = !{!10, !6, i64 16}
!22 = !{!23, !13, i64 0}
!23 = !{!"vrProjection", !13, i64 0, !13, i64 4}
!24 = !{!23, !13, i64 4}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{i64 0, i64 4, !15, i64 4, i64 4, !15, i64 8, i64 4, !15, i64 12, i64 4, !15, i64 16, i64 4, !15, i64 20, i64 4, !15, i64 24, i64 4, !15, i64 28, i64 4, !15, i64 32, i64 4, !15, i64 36, i64 4, !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.vrPolygonShape = type { ptr, i32, ptr, i32, %struct.vrVec2 }
%struct.vrVec2 = type { float, float }

declare <2 x float> @vrVect(float noundef, float noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local float @vrPolyGetLeastAxis(ptr noundef byval(%struct.vrPolygonShape) align 8 %0, ptr noundef byval(%struct.vrPolygonShape) align 8 %1, ptr nocapture noundef writeonly %2, ptr nocapture noundef writeonly %3, <2 x float> %4) local_unnamed_addr #1 {
  %6 = getelementptr inbounds i8, ptr %0, i64 24
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = load i32, ptr %8, align 8, !tbaa !13
  %.not = icmp eq i32 %7, %9
  br i1 %.not, label %.preheader, label %44

.preheader:                                       ; preds = %5
  %10 = icmp sgt i32 %7, 0
  br i1 %10, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %11 = getelementptr inbounds i8, ptr %0, i64 16
  br label %12

._crit_edge:                                      ; preds = %40, %.preheader
  %.sroa.032.0.lcssa = phi <2 x float> [ undef, %.preheader ], [ %.sroa.032.2, %40 ]
  %.sroa.033.0.lcssa = phi <2 x float> [ undef, %.preheader ], [ %.sroa.033.2, %40 ]
  %.sroa.4.0.lcssa = phi <2 x float> [ undef, %.preheader ], [ %.sroa.4.2, %40 ]
  %.sroa.5.0.lcssa = phi <2 x float> [ undef, %.preheader ], [ %.sroa.5.2, %40 ]
  %.sroa.7.0.lcssa = phi <2 x float> [ undef, %.preheader ], [ %.sroa.7.2, %40 ]
  %.sroa.9.0.lcssa = phi <2 x float> [ undef, %.preheader ], [ %.sroa.9.2, %40 ]
  %.040.lcssa = phi float [ 1.000000e+06, %.preheader ], [ %.2, %40 ]
  store <2 x float> %.sroa.033.0.lcssa, ptr %3, align 4
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 8
  store <2 x float> %.sroa.4.0.lcssa, ptr %.sroa.4.0..sroa_idx, align 4
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 16
  store <2 x float> %.sroa.5.0.lcssa, ptr %.sroa.5.0..sroa_idx, align 4
  %.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 24
  store <2 x float> %.sroa.7.0.lcssa, ptr %.sroa.7.0..sroa_idx, align 4
  %.sroa.9.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 32
  store <2 x float> %.sroa.9.0.lcssa, ptr %.sroa.9.0..sroa_idx, align 4
  store <2 x float> %.sroa.032.0.lcssa, ptr %2, align 4
  br label %44

12:                                               ; preds = %.lr.ph, %40
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %40 ]
  %13 = phi i32 [ %7, %.lr.ph ], [ %41, %40 ]
  %.04051 = phi float [ 1.000000e+06, %.lr.ph ], [ %.2, %40 ]
  %.sroa.9.050 = phi <2 x float> [ undef, %.lr.ph ], [ %.sroa.9.2, %40 ]
  %.sroa.7.049 = phi <2 x float> [ undef, %.lr.ph ], [ %.sroa.7.2, %40 ]
  %.sroa.5.048 = phi <2 x float> [ undef, %.lr.ph ], [ %.sroa.5.2, %40 ]
  %.sroa.4.047 = phi <2 x float> [ undef, %.lr.ph ], [ %.sroa.4.2, %40 ]
  %.sroa.033.046 = phi <2 x float> [ undef, %.lr.ph ], [ %.sroa.033.2, %40 ]
  %.sroa.032.045 = phi <2 x float> [ undef, %.lr.ph ], [ %.sroa.032.2, %40 ]
  %14 = load ptr, ptr %0, align 8, !tbaa !14
  %15 = getelementptr inbounds %struct.vrVec2, ptr %14, i64 %indvars.iv
  %.sroa.020.0.copyload = load <2 x float>, ptr %15, align 4
  %16 = add nsw i32 %13, -1
  %17 = sext i32 %16 to i64
  %18 = icmp slt i64 %indvars.iv, %17
  %19 = getelementptr inbounds i8, ptr %15, i64 8
  %.sroa.013.0.in = select i1 %18, ptr %19, ptr %14
  %.sroa.013.0 = load <2 x float>, ptr %.sroa.013.0.in, align 4
  %20 = tail call <2 x float> @vrSub(<2 x float> %.sroa.013.0, <2 x float> %.sroa.020.0.copyload) #2
  %.sroa.026.4.vec.extract = extractelement <2 x float> %20, i64 1
  %.sroa.026.0.vec.extract = extractelement <2 x float> %20, i64 0
  %21 = fneg float %.sroa.026.0.vec.extract
  %22 = tail call <2 x float> @vrVect(float noundef %.sroa.026.4.vec.extract, float noundef %21) #2
  %23 = tail call <2 x float> @vrNormalize(<2 x float> %22) #2
  %24 = load ptr, ptr %11, align 8, !tbaa !15
  %25 = getelementptr inbounds %struct.vrVec2, ptr %24, i64 %indvars.iv
  %.sroa.04.0.copyload = load <2 x float>, ptr %25, align 4
  %26 = tail call float @vrDot(<2 x float> %.sroa.04.0.copyload, <2 x float> %4) #2
  %27 = fcmp ult float %26, 0.000000e+00
  br i1 %27, label %40, label %28

28:                                               ; preds = %12
  %29 = tail call <2 x float> @vrProject(ptr noundef nonnull byval(%struct.vrPolygonShape) align 8 %0, <2 x float> %.sroa.04.0.copyload)
  %30 = tail call <2 x float> @vrProject(ptr noundef nonnull byval(%struct.vrPolygonShape) align 8 %1, <2 x float> %.sroa.04.0.copyload)
  %.sroa.02.0.vec.extract = extractelement <2 x float> %30, i64 0
  %.sroa.03.0.vec.extract = extractelement <2 x float> %29, i64 0
  %31 = tail call float @vrMin(float noundef %.sroa.02.0.vec.extract, float noundef %.sroa.03.0.vec.extract) #2
  %.sroa.02.4.vec.extract = extractelement <2 x float> %30, i64 1
  %.sroa.03.4.vec.extract = extractelement <2 x float> %29, i64 1
  %32 = tail call float @vrMax(float noundef %.sroa.02.4.vec.extract, float noundef %.sroa.03.4.vec.extract) #2
  %33 = fsub float %31, %32
  %34 = fcmp ugt float %33, %.04051
  br i1 %34, label %40, label %35

35:                                               ; preds = %28
  %36 = tail call <2 x float> @vrSub(<2 x float> %.sroa.013.0, <2 x float> %.sroa.020.0.copyload) #2
  %37 = tail call float @vrDot(<2 x float> %.sroa.013.0, <2 x float> %.sroa.04.0.copyload) #2
  %38 = tail call float @vrDot(<2 x float> %.sroa.020.0.copyload, <2 x float> %.sroa.04.0.copyload) #2
  %39 = fcmp ugt float %37, %38
  %.sroa.020.0.copyload..sroa.013.0 = select i1 %39, <2 x float> %.sroa.020.0.copyload, <2 x float> %.sroa.013.0
  %.sroa.013.0..sroa.020.0.copyload = select i1 %39, <2 x float> %.sroa.013.0, <2 x float> %.sroa.020.0.copyload
  br label %40

40:                                               ; preds = %28, %35, %12
  %.sroa.032.2 = phi <2 x float> [ %.sroa.032.045, %12 ], [ %.sroa.032.045, %28 ], [ %.sroa.04.0.copyload, %35 ]
  %.sroa.033.2 = phi <2 x float> [ %.sroa.033.046, %12 ], [ %.sroa.033.046, %28 ], [ %.sroa.020.0.copyload, %35 ]
  %.sroa.4.2 = phi <2 x float> [ %.sroa.4.047, %12 ], [ %.sroa.4.047, %28 ], [ %.sroa.013.0, %35 ]
  %.sroa.5.2 = phi <2 x float> [ %.sroa.5.048, %12 ], [ %.sroa.5.048, %28 ], [ %.sroa.020.0.copyload..sroa.013.0, %35 ]
  %.sroa.7.2 = phi <2 x float> [ %.sroa.7.049, %12 ], [ %.sroa.7.049, %28 ], [ %.sroa.013.0..sroa.020.0.copyload, %35 ]
  %.sroa.9.2 = phi <2 x float> [ %.sroa.9.050, %12 ], [ %.sroa.9.050, %28 ], [ %36, %35 ]
  %.2 = phi float [ %.04051, %12 ], [ %.04051, %28 ], [ %33, %35 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %41 = load i32, ptr %8, align 8, !tbaa !13
  %42 = sext i32 %41 to i64
  %43 = icmp slt i64 %indvars.iv.next, %42
  br i1 %43, label %12, label %._crit_edge, !llvm.loop !16

44:                                               ; preds = %5, %._crit_edge
  %.0 = phi float [ %.040.lcssa, %._crit_edge ], [ 0.000000e+00, %5 ]
  ret float %.0
}

declare <2 x float> @vrSub(<2 x float>, <2 x float>) local_unnamed_addr #0

declare <2 x float> @vrNormalize(<2 x float>) local_unnamed_addr #0

declare float @vrDot(<2 x float>, <2 x float>) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local <2 x float> @vrProject(ptr noundef byval(%struct.vrPolygonShape) align 8, <2 x float>) local_unnamed_addr #1

declare float @vrMin(float noundef, float noundef) local_unnamed_addr #0

declare float @vrMax(float noundef, float noundef) local_unnamed_addr #0

attributes #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 #1 = { 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 #2 = { 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 24}
!6 = !{!"vrPolygonShape", !7, i64 0, !10, i64 8, !7, i64 16, !10, i64 24, !11, i64 28}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"vrVec2", !12, i64 0, !12, i64 4}
!12 = !{!"float", !8, i64 0}
!13 = !{!6, !10, i64 8}
!14 = !{!6, !7, i64 0}
!15 = !{!6, !7, i64 16}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


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