; LLVM IR from atlantis13579/Riemann :: Src/Geometry (ConvexHull2)

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

%"class.Maths::TVector2" = type { float, float }

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector2IfEmiERKS1_(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector2") align 4, ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Riemann15RotatingCaliperERKSt6vectorIN5Maths8TVector2IfEESaIS3_EEPiS8_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1, ptr noundef %2) #4 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca float, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.Maths::TVector2", align 4
  %12 = alloca %"class.Maths::TVector2", align 4
  %13 = alloca %"class.Maths::TVector2", align 4
  %14 = alloca %"class.Maths::TVector2", align 4
  %15 = alloca float, align 4
  %16 = alloca %"class.Maths::TVector2", align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = call noundef i64 @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #5
  %19 = icmp ult i64 %18, 1
  br i1 %19, label %20, label %21

20:                                               ; preds = %3
  br label %106

21:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store float 0.000000e+00, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = call noundef i64 @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #5
  %24 = trunc i64 %23 to i32
  store i32 %24, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 1, ptr %10, align 4, !tbaa !11
  br label %25

25:                                               ; preds = %102, %21
  %26 = load i32, ptr %9, align 4, !tbaa !11
  %27 = load i32, ptr %8, align 4, !tbaa !11
  %28 = sub nsw i32 %27, 1
  %29 = icmp slt i32 %26, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %105

31:                                               ; preds = %25
  br label %32

32:                                               ; preds = %77, %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = load i32, ptr %9, align 4, !tbaa !11
  %35 = add nsw i32 %34, 1
  %36 = load i32, ptr %8, align 4, !tbaa !11
  %37 = srem i32 %35, %36
  %38 = sext i32 %37 to i64
  %39 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %38) #5
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = load i32, ptr %9, align 4, !tbaa !11
  %42 = sext i32 %41 to i64
  %43 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %40, i64 noundef %42) #5
  call void @_ZNK5Maths8TVector2IfEmiERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector2") align 4 %11, ptr noundef nonnull align 4 dereferenceable(8) %39, ptr noundef nonnull align 4 dereferenceable(8) %43)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = load i32, ptr %10, align 4, !tbaa !11
  %46 = sext i32 %45 to i64
  %47 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %44, i64 noundef %46) #5
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = load i32, ptr %9, align 4, !tbaa !11
  %50 = sext i32 %49 to i64
  %51 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %48, i64 noundef %50) #5
  call void @_ZNK5Maths8TVector2IfEmiERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector2") align 4 %12, ptr noundef nonnull align 4 dereferenceable(8) %47, ptr noundef nonnull align 4 dereferenceable(8) %51)
  %52 = call noundef float @_ZNK5Maths8TVector2IfE5CrossERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %12)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = load i32, ptr %9, align 4, !tbaa !11
  %55 = add nsw i32 %54, 1
  %56 = load i32, ptr %8, align 4, !tbaa !11
  %57 = srem i32 %55, %56
  %58 = sext i32 %57 to i64
  %59 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %53, i64 noundef %58) #5
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = load i32, ptr %9, align 4, !tbaa !11
  %62 = sext i32 %61 to i64
  %63 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %60, i64 noundef %62) #5
  call void @_ZNK5Maths8TVector2IfEmiERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector2") align 4 %13, ptr noundef nonnull align 4 dereferenceable(8) %59, ptr noundef nonnull align 4 dereferenceable(8) %63)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = load i32, ptr %10, align 4, !tbaa !11
  %66 = add nsw i32 %65, 1
  %67 = load i32, ptr %8, align 4, !tbaa !11
  %68 = srem i32 %66, %67
  %69 = sext i32 %68 to i64
  %70 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %64, i64 noundef %69) #5
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = load i32, ptr %9, align 4, !tbaa !11
  %73 = sext i32 %72 to i64
  %74 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %71, i64 noundef %73) #5
  call void @_ZNK5Maths8TVector2IfEmiERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector2") align 4 %14, ptr noundef nonnull align 4 dereferenceable(8) %70, ptr noundef nonnull align 4 dereferenceable(8) %74)
  %75 = call noundef float @_ZNK5Maths8TVector2IfE5CrossERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 4 dereferenceable(8) %14)
  %76 = fcmp ole float %52, %75
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br i1 %76, label %77, label %82

77:                                               ; preds = %32
  %78 = load i32, ptr %10, align 4, !tbaa !11
  %79 = add nsw i32 %78, 1
  %80 = load i32, ptr %8, align 4, !tbaa !11
  %81 = srem i32 %79, %80
  store i32 %81, ptr %10, align 4, !tbaa !11
  br label %32, !llvm.loop !13

82:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = load i32, ptr %9, align 4, !tbaa !11
  %85 = sext i32 %84 to i64
  %86 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %83, i64 noundef %85) #5
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = load i32, ptr %10, align 4, !tbaa !11
  %89 = sext i32 %88 to i64
  %90 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %87, i64 noundef %89) #5
  call void @_ZNK5Maths8TVector2IfEmiERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector2") align 4 %16, ptr noundef nonnull align 4 dereferenceable(8) %86, ptr noundef nonnull align 4 dereferenceable(8) %90)
  %91 = call noundef float @_ZNK5Maths8TVector2IfE12SquareLengthEv(ptr noundef nonnull align 4 dereferenceable(8) %16)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  store float %91, ptr %15, align 4, !tbaa !9
  %92 = load float, ptr %15, align 4, !tbaa !9
  %93 = load float, ptr %7, align 4, !tbaa !9
  %94 = fcmp ogt float %92, %93
  br i1 %94, label %95, label %101

95:                                               ; preds = %82
  %96 = load float, ptr %15, align 4, !tbaa !9
  store float %96, ptr %7, align 4, !tbaa !9
  %97 = load i32, ptr %9, align 4, !tbaa !11
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  store i32 %97, ptr %98, align 4, !tbaa !11
  %99 = load i32, ptr %10, align 4, !tbaa !11
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  store i32 %99, ptr %100, align 4, !tbaa !11
  br label %101

101:                                              ; preds = %95, %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %102

102:                                              ; preds = %101
  %103 = load i32, ptr %9, align 4, !tbaa !11
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %9, align 4, !tbaa !11
  br label %25, !llvm.loop !15

105:                                              ; preds = %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %106

106:                                              ; preds = %105, %20
  ret void
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { inlinehint 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 #3 = { 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 #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 = { 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 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


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

%"class.Maths::TVector2" = 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 nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector2IfEmiERKS1_(ptr dead_on_unwind noalias writable sret(%"class.Maths::TVector2") align 4, ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Riemann15RotatingCaliperERKSt6vectorIN5Maths8TVector2IfEESaIS3_EEPiS8_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr nocapture noundef writeonly %1, ptr nocapture noundef writeonly %2) local_unnamed_addr #4 {
  %4 = alloca %"class.Maths::TVector2", align 4
  %5 = alloca %"class.Maths::TVector2", align 4
  %6 = alloca %"class.Maths::TVector2", align 4
  %7 = alloca %"class.Maths::TVector2", align 4
  %8 = alloca %"class.Maths::TVector2", align 4
  %9 = tail call noundef i64 @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  %10 = icmp eq i64 %9, 0
  br i1 %10, label %.loopexit, label %11

11:                                               ; preds = %3
  %12 = tail call noundef i64 @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  %13 = trunc i64 %12 to i32
  %14 = icmp sgt i32 %13, 1
  br i1 %14, label %.preheader.preheader, label %.loopexit

.preheader.preheader:                             ; preds = %11
  %15 = add i64 %12, 4294967295
  %wide.trip.count = and i64 %15, 4294967295
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %39
  %indvars.iv = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next, %39 ]
  %.044 = phi float [ 0.000000e+00, %.preheader.preheader ], [ %.1, %39 ]
  %.03643 = phi i32 [ 1, %.preheader.preheader ], [ %.137, %39 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  br label %16

16:                                               ; preds = %.preheader, %16
  %.137 = phi i32 [ %26, %16 ], [ %.03643, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %17 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv.next) #5
  %18 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv) #5
  call void @_ZNK5Maths8TVector2IfEmiERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector2") align 4 %4, ptr noundef nonnull align 4 dereferenceable(8) %17, ptr noundef nonnull align 4 dereferenceable(8) %18)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %19 = sext i32 %.137 to i64
  %20 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %19) #5
  %21 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv) #5
  call void @_ZNK5Maths8TVector2IfEmiERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector2") align 4 %5, ptr noundef nonnull align 4 dereferenceable(8) %20, ptr noundef nonnull align 4 dereferenceable(8) %21)
  %22 = call noundef float @_ZNK5Maths8TVector2IfE5CrossERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(8) %5)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %23 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv.next) #5
  %24 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv) #5
  call void @_ZNK5Maths8TVector2IfEmiERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector2") align 4 %6, ptr noundef nonnull align 4 dereferenceable(8) %23, ptr noundef nonnull align 4 dereferenceable(8) %24)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %25 = add nsw i32 %.137, 1
  %26 = srem i32 %25, %13
  %27 = sext i32 %26 to i64
  %28 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %27) #5
  %29 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv) #5
  call void @_ZNK5Maths8TVector2IfEmiERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector2") align 4 %7, ptr noundef nonnull align 4 dereferenceable(8) %28, ptr noundef nonnull align 4 dereferenceable(8) %29)
  %30 = call noundef float @_ZNK5Maths8TVector2IfE5CrossERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(8) %7)
  %31 = fcmp ugt float %22, %30
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br i1 %31, label %32, label %16, !llvm.loop !5

32:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %33 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv) #5
  %34 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt6vectorIN5Maths8TVector2IfEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %19) #5
  call void @_ZNK5Maths8TVector2IfEmiERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector2") align 4 %8, ptr noundef nonnull align 4 dereferenceable(8) %33, ptr noundef nonnull align 4 dereferenceable(8) %34)
  %35 = call noundef float @_ZNK5Maths8TVector2IfE12SquareLengthEv(ptr noundef nonnull align 4 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  %36 = fcmp ogt float %35, %.044
  br i1 %36, label %37, label %39

37:                                               ; preds = %32
  %38 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %38, ptr %1, align 4, !tbaa !7
  store i32 %.137, ptr %2, align 4, !tbaa !7
  br label %39

39:                                               ; preds = %37, %32
  %.1 = phi float [ %35, %37 ], [ %.044, %32 ]
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %.preheader, !llvm.loop !11

.loopexit:                                        ; preds = %39, %11, %3
  ret void
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { inlinehint 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 #3 = { 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 #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 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = distinct !{!11, !6}


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