; LLVM IR from atlantis13579/Riemann :: Src/Geometry/Polygon2.ll (ZN7Riemann11MinAreaRectEPKN5Maths8TVector2IfEEiRS2_PS2_)

; 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: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector2IfEplERKS1_(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)) #1 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZN5Maths8TVector2IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #2 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 void @_ZN5Maths8TVector2IfEC2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef float @_ZN7Riemann11MinAreaRectEPKN5Maths8TVector2IfEEiRS2_PS2_(ptr noundef %0, i32 noundef %1, ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %3) #4 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca float, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.Maths::TVector2", align 4
  %14 = alloca %"class.Maths::TVector2", align 4
  %15 = alloca %"class.Maths::TVector2", align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca i32, align 4
  %21 = alloca %"class.Maths::TVector2", align 4
  %22 = alloca float, align 4
  %23 = alloca float, align 4
  %24 = alloca %"class.Maths::TVector2", align 4
  %25 = alloca %"class.Maths::TVector2", align 4
  %26 = alloca %"class.Maths::TVector2", align 4
  %27 = alloca %"class.Maths::TVector2", align 4
  %28 = alloca %"class.Maths::TVector2", align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store float 0x47EFFFFFE0000000, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %29 = load i32, ptr %6, align 4, !tbaa !9
  %30 = sub nsw i32 %29, 1
  store i32 %30, ptr %11, align 4, !tbaa !9
  br label %31

31:                                               ; preds = %109, %4
  %32 = load i32, ptr %10, align 4, !tbaa !9
  %33 = load i32, ptr %6, align 4, !tbaa !9
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  store i32 2, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %113

36:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = load i32, ptr %10, align 4, !tbaa !9
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds %"class.Maths::TVector2", ptr %37, i64 %39
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = load i32, ptr %11, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds %"class.Maths::TVector2", ptr %41, i64 %43
  call void @_ZNK5Maths8TVector2IfEmiERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector2") align 4 %14, ptr noundef nonnull align 4 dereferenceable(8) %40, ptr noundef nonnull align 4 dereferenceable(8) %44)
  call void @_ZNK5Maths8TVector2IfE4UnitEv(ptr dead_on_unwind writable sret(%"class.Maths::TVector2") align 4 %13, ptr noundef nonnull align 4 dereferenceable(8) %14)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %45 = getelementptr inbounds %"class.Maths::TVector2", ptr %13, i32 0, i32 1
  %46 = load float, ptr %45, align 4, !tbaa !13
  %47 = fneg float %46
  %48 = getelementptr inbounds %"class.Maths::TVector2", ptr %13, i32 0, i32 0
  %49 = load float, ptr %48, align 4, !tbaa !15
  call void @_ZN5Maths8TVector2IfEC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %15, float noundef %47, float noundef %49)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store float 0.000000e+00, ptr %16, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store float 0.000000e+00, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store float 0.000000e+00, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store float 0.000000e+00, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %50

50:                                               ; preds = %74, %36
  %51 = load i32, ptr %20, align 4, !tbaa !9
  %52 = load i32, ptr %6, align 4, !tbaa !9
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %50
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %77

55:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = load i32, ptr %20, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds %"class.Maths::TVector2", ptr %56, i64 %58
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = load i32, ptr %11, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds %"class.Maths::TVector2", ptr %60, i64 %62
  call void @_ZNK5Maths8TVector2IfEmiERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector2") align 4 %21, ptr noundef nonnull align 4 dereferenceable(8) %59, ptr noundef nonnull align 4 dereferenceable(8) %63)
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %64 = call noundef float @_ZNK5Maths8TVector2IfE3DotERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %21, ptr noundef nonnull align 4 dereferenceable(8) %13)
  store float %64, ptr %22, align 4, !tbaa !11
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %22)
  %66 = load float, ptr %65, align 4, !tbaa !11
  store float %66, ptr %16, align 4, !tbaa !11
  %67 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %22)
  %68 = load float, ptr %67, align 4, !tbaa !11
  store float %68, ptr %18, align 4, !tbaa !11
  %69 = call noundef float @_ZNK5Maths8TVector2IfE3DotERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %21, ptr noundef nonnull align 4 dereferenceable(8) %15)
  store float %69, ptr %22, align 4, !tbaa !11
  %70 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %22)
  %71 = load float, ptr %70, align 4, !tbaa !11
  store float %71, ptr %17, align 4, !tbaa !11
  %72 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %19, ptr noundef nonnull align 4 dereferenceable(4) %22)
  %73 = load float, ptr %72, align 4, !tbaa !11
  store float %73, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  br label %74

74:                                               ; preds = %55
  %75 = load i32, ptr %20, align 4, !tbaa !9
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %20, align 4, !tbaa !9
  br label %50, !llvm.loop !16

77:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %78 = load float, ptr %18, align 4, !tbaa !11
  %79 = load float, ptr %16, align 4, !tbaa !11
  %80 = fsub float %78, %79
  %81 = load float, ptr %19, align 4, !tbaa !11
  %82 = load float, ptr %17, align 4, !tbaa !11
  %83 = fsub float %81, %82
  %84 = fmul float %80, %83
  store float %84, ptr %23, align 4, !tbaa !11
  %85 = load float, ptr %23, align 4, !tbaa !11
  %86 = load float, ptr %9, align 4, !tbaa !11
  %87 = fcmp olt float %85, %86
  br i1 %87, label %88, label %108

88:                                               ; preds = %77
  %89 = load float, ptr %23, align 4, !tbaa !11
  store float %89, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = load i32, ptr %11, align 4, !tbaa !9
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds %"class.Maths::TVector2", ptr %90, i64 %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  %94 = load float, ptr %16, align 4, !tbaa !11
  %95 = load float, ptr %18, align 4, !tbaa !11
  %96 = fadd float %94, %95
  call void @_ZN5MathsmlIfEENS_8TVector2IT_EES2_RKS3_(ptr dead_on_unwind writable sret(%"class.Maths::TVector2") align 4 %27, float noundef %96, ptr noundef nonnull align 4 dereferenceable(8) %13)
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  %97 = load float, ptr %17, align 4, !tbaa !11
  %98 = load float, ptr %19, align 4, !tbaa !11
  %99 = fadd float %97, %98
  call void @_ZN5MathsmlIfEENS_8TVector2IT_EES2_RKS3_(ptr dead_on_unwind writable sret(%"class.Maths::TVector2") align 4 %28, float noundef %99, ptr noundef nonnull align 4 dereferenceable(8) %15)
  call void @_ZNK5Maths8TVector2IfEplERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector2") align 4 %26, ptr noundef nonnull align 4 dereferenceable(8) %27, ptr noundef nonnull align 4 dereferenceable(8) %28)
  call void @_ZN5MathsmlIfEENS_8TVector2IT_EES2_RKS3_(ptr dead_on_unwind writable sret(%"class.Maths::TVector2") align 4 %25, float noundef 5.000000e-01, ptr noundef nonnull align 4 dereferenceable(8) %26)
  call void @_ZNK5Maths8TVector2IfEplERKS1_(ptr dead_on_unwind writable sret(%"class.Maths::TVector2") align 4 %24, ptr noundef nonnull align 4 dereferenceable(8) %93, ptr noundef nonnull align 4 dereferenceable(8) %25)
  %100 = load ptr, ptr %7, align 8, !tbaa !5
  %101 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN5Maths8TVector2IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %100, ptr noundef nonnull align 4 dereferenceable(8) %24)
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  %102 = load ptr, ptr %8, align 8, !tbaa !5
  %103 = getelementptr inbounds %"class.Maths::TVector2", ptr %102, i64 0
  %104 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN5Maths8TVector2IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %103, ptr noundef nonnull align 4 dereferenceable(8) %13)
  %105 = load ptr, ptr %8, align 8, !tbaa !5
  %106 = getelementptr inbounds %"class.Maths::TVector2", ptr %105, i64 1
  %107 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN5Maths8TVector2IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %106, ptr noundef nonnull align 4 dereferenceable(8) %15)
  br label %108

108:                                              ; preds = %88, %77
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %110, ptr %11, align 4, !tbaa !9
  %111 = load i32, ptr %10, align 4, !tbaa !9
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %10, align 4, !tbaa !9
  br label %31, !llvm.loop !18

113:                                              ; preds = %35
  %114 = load float, ptr %9, align 4, !tbaa !11
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  ret float %114
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK5Maths8TVector2IfE3DotERKS1_(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 nonnull align 4 dereferenceable(4) ptr @_ZSt3minIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2

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

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


; 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: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Maths8TVector2IfEplERKS1_(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 #1 align 2

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

; 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 #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZN5Maths8TVector2IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2 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 void @_ZN5Maths8TVector2IfEC2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef float @_ZN7Riemann11MinAreaRectEPKN5Maths8TVector2IfEEiRS2_PS2_(ptr noundef %0, i32 noundef %1, ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %3) local_unnamed_addr #4 {
  %5 = alloca %"class.Maths::TVector2", align 4
  %6 = alloca %"class.Maths::TVector2", align 4
  %7 = alloca %"class.Maths::TVector2", align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca %"class.Maths::TVector2", align 4
  %13 = alloca float, align 4
  %14 = alloca %"class.Maths::TVector2", align 4
  %15 = alloca %"class.Maths::TVector2", align 4
  %16 = alloca %"class.Maths::TVector2", align 4
  %17 = alloca %"class.Maths::TVector2", align 4
  %18 = alloca %"class.Maths::TVector2", align 4
  %19 = icmp sgt i32 %1, 0
  br i1 %19, label %.lr.ph34, label %._crit_edge35

.lr.ph34:                                         ; preds = %4
  %20 = add nsw i32 %1, -1
  %21 = getelementptr inbounds i8, ptr %5, i64 4
  %22 = getelementptr inbounds i8, ptr %3, i64 8
  %wide.trip.count40 = zext nneg i32 %1 to i64
  br label %.lr.ph.preheader

._crit_edge35:                                    ; preds = %52, %4
  %.0.lcssa = phi float [ 0x47EFFFFFE0000000, %4 ], [ %.1, %52 ]
  ret float %.0.lcssa

.lr.ph.preheader:                                 ; preds = %52, %.lr.ph34
  %indvars.iv37 = phi i64 [ 0, %.lr.ph34 ], [ %indvars.iv.next38, %52 ]
  %.032 = phi float [ 0x47EFFFFFE0000000, %.lr.ph34 ], [ %.1, %52 ]
  %.02531 = phi i32 [ %20, %.lr.ph34 ], [ %53, %52 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %23 = getelementptr inbounds %"class.Maths::TVector2", ptr %0, i64 %indvars.iv37
  %24 = sext i32 %.02531 to i64
  %25 = getelementptr inbounds %"class.Maths::TVector2", ptr %0, i64 %24
  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) %25)
  call void @_ZNK5Maths8TVector2IfE4UnitEv(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector2") align 4 %5, ptr noundef nonnull align 4 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %26 = load float, ptr %21, align 4, !tbaa !5
  %27 = fneg float %26
  %28 = load float, ptr %5, align 4, !tbaa !10
  call void @_ZN5Maths8TVector2IfEC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %7, float noundef %27, float noundef %28)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  store float 0.000000e+00, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #5
  store float 0.000000e+00, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #5
  store float 0.000000e+00, ptr %10, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #5
  store float 0.000000e+00, ptr %11, align 4, !tbaa !11
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph
  %.pre = load float, ptr %10, align 4, !tbaa !11
  %.pre42 = load float, ptr %8, align 4, !tbaa !11
  %.pre43 = load float, ptr %9, align 4, !tbaa !11
  %29 = fsub float %.pre, %.pre42
  %30 = fsub float %43, %.pre43
  %31 = fmul float %29, %30
  %32 = fcmp olt float %31, %.032
  br i1 %32, label %44, label %52

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #5
  %33 = getelementptr inbounds %"class.Maths::TVector2", ptr %0, i64 %indvars.iv
  call void @_ZNK5Maths8TVector2IfEmiERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector2") align 4 %12, ptr noundef nonnull align 4 dereferenceable(8) %33, ptr noundef nonnull align 4 dereferenceable(8) %25)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #5
  %34 = call noundef float @_ZNK5Maths8TVector2IfE3DotERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(8) %5)
  store float %34, ptr %13, align 4, !tbaa !11
  %35 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %36 = load float, ptr %35, align 4, !tbaa !11
  store float %36, ptr %8, align 4, !tbaa !11
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %38 = load float, ptr %37, align 4, !tbaa !11
  store float %38, ptr %10, align 4, !tbaa !11
  %39 = call noundef float @_ZNK5Maths8TVector2IfE3DotERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(8) %7)
  store float %39, ptr %13, align 4, !tbaa !11
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %41 = load float, ptr %40, align 4, !tbaa !11
  store float %41, ptr %9, align 4, !tbaa !11
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %43 = load float, ptr %42, align 4, !tbaa !11
  store float %43, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count40
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !12

44:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #5
  %45 = fadd float %.pre, %.pre42
  call void @_ZN5MathsmlIfEENS_8TVector2IT_EES2_RKS3_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector2") align 4 %17, float noundef %45, ptr noundef nonnull align 4 dereferenceable(8) %5)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #5
  %46 = load float, ptr %9, align 4, !tbaa !11
  %47 = load float, ptr %11, align 4, !tbaa !11
  %48 = fadd float %46, %47
  call void @_ZN5MathsmlIfEENS_8TVector2IT_EES2_RKS3_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector2") align 4 %18, float noundef %48, ptr noundef nonnull align 4 dereferenceable(8) %7)
  call void @_ZNK5Maths8TVector2IfEplERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector2") align 4 %16, ptr noundef nonnull align 4 dereferenceable(8) %17, ptr noundef nonnull align 4 dereferenceable(8) %18)
  call void @_ZN5MathsmlIfEENS_8TVector2IT_EES2_RKS3_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector2") align 4 %15, float noundef 5.000000e-01, ptr noundef nonnull align 4 dereferenceable(8) %16)
  call void @_ZNK5Maths8TVector2IfEplERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.Maths::TVector2") align 4 %14, ptr noundef nonnull align 4 dereferenceable(8) %25, ptr noundef nonnull align 4 dereferenceable(8) %15)
  %49 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN5Maths8TVector2IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(8) %14)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  %50 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN5Maths8TVector2IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(8) %5)
  %51 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN5Maths8TVector2IfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %22, ptr noundef nonnull align 4 dereferenceable(8) %7)
  br label %52

52:                                               ; preds = %44, %._crit_edge
  %.1 = phi float [ %31, %44 ], [ %.032, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  %indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
  %53 = trunc nuw nsw i64 %indvars.iv37 to i32
  %exitcond41.not = icmp eq i64 %indvars.iv.next38, %wide.trip.count40
  br i1 %exitcond41.not, label %._crit_edge35, label %.lr.ph.preheader, !llvm.loop !14
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK5Maths8TVector2IfE3DotERKS1_(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 nonnull align 4 dereferenceable(4) ptr @_ZSt3minIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 4}
!6 = !{!"_ZTSN5Maths8TVector2IfEE", !7, i64 0, !7, i64 4}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}


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