; LLVM IR from ArefMq/SoccerBallDetection :: src/modules/FRHT.ll (ZN7MVision4FRHT11checkCircleERKNS_8Vector2DES3_S3_)

; 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.MVision::Circle" = type { %"class.MVision::Vector2D", float }
%"class.MVision::Vector2D" = type { float, float }
%"class.MVision::FRHT" = type { %class.Debugable, ptr, %"class.std::vector" }
%class.Debugable = type { ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<MVision::Circle, std::allocator<MVision::Circle>>::_Vector_impl" }
%"struct.std::_Vector_base<MVision::Circle, std::allocator<MVision::Circle>>::_Vector_impl" = type { %"struct.std::_Vector_base<MVision::Circle, std::allocator<MVision::Circle>>::_Vector_impl_data" }
%"struct.std::_Vector_base<MVision::Circle, std::allocator<MVision::Circle>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK7MVision8Vector2D1yEv(ptr noundef nonnull align 4 dereferenceable(8)) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7MVision4FRHT11checkCircleERKNS_8Vector2DES3_S3_(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 4 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(8) %3) #2 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"class.MVision::Circle", align 4
  %10 = alloca { <2 x float>, float }, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %12 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #6
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  %14 = load ptr, ptr %7, align 8, !tbaa !5
  %15 = load ptr, ptr %8, align 8, !tbaa !5
  %16 = call { <2 x float>, float } @_ZN7MVision4FRHT10fitACircleERKNS_8Vector2DES3_S3_(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 4 dereferenceable(8) %14, ptr noundef nonnull align 4 dereferenceable(8) %15)
  store { <2 x float>, float } %16, ptr %10, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 8 %10, i64 12, i1 false)
  %17 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK7MVision6Circle11translationEv(ptr noundef nonnull align 4 dereferenceable(12) %9)
  %18 = call noundef float @_ZNK7MVision8Vector2D1xEv(ptr noundef nonnull align 4 dereferenceable(8) %17)
  %19 = call noundef zeroext i1 @_ZSt5isnanf(float noundef %18)
  br i1 %19, label %20, label %21

20:                                               ; preds = %4
  store i32 1, ptr %11, align 4
  br label %46

21:                                               ; preds = %4
  %22 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK7MVision6Circle11translationEv(ptr noundef nonnull align 4 dereferenceable(12) %9)
  %23 = call noundef float @_ZNK7MVision8Vector2D1yEv(ptr noundef nonnull align 4 dereferenceable(8) %22)
  %24 = call noundef zeroext i1 @_ZSt5isnanf(float noundef %23)
  br i1 %24, label %25, label %26

25:                                               ; preds = %21
  store i32 1, ptr %11, align 4
  br label %46

26:                                               ; preds = %21
  %27 = call noundef float @_ZNK7MVision6Circle7radiousEv(ptr noundef nonnull align 4 dereferenceable(12) %9)
  %28 = call noundef zeroext i1 @_ZSt5isnanf(float noundef %27)
  br i1 %28, label %29, label %30

29:                                               ; preds = %26
  store i32 1, ptr %11, align 4
  br label %46

30:                                               ; preds = %26
  %31 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK7MVision6Circle11translationEv(ptr noundef nonnull align 4 dereferenceable(12) %9)
  %32 = call noundef float @_ZNK7MVision8Vector2D1xEv(ptr noundef nonnull align 4 dereferenceable(8) %31)
  %33 = call noundef zeroext i1 @_ZSt5isinff(float noundef %32)
  br i1 %33, label %34, label %35

34:                                               ; preds = %30
  store i32 1, ptr %11, align 4
  br label %46

35:                                               ; preds = %30
  %36 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK7MVision6Circle11translationEv(ptr noundef nonnull align 4 dereferenceable(12) %9)
  %37 = call noundef float @_ZNK7MVision8Vector2D1yEv(ptr noundef nonnull align 4 dereferenceable(8) %36)
  %38 = call noundef zeroext i1 @_ZSt5isinff(float noundef %37)
  br i1 %38, label %39, label %40

39:                                               ; preds = %35
  store i32 1, ptr %11, align 4
  br label %46

40:                                               ; preds = %35
  %41 = call noundef float @_ZNK7MVision6Circle7radiousEv(ptr noundef nonnull align 4 dereferenceable(12) %9)
  %42 = call noundef zeroext i1 @_ZSt5isinff(float noundef %41)
  br i1 %42, label %43, label %44

43:                                               ; preds = %40
  store i32 1, ptr %11, align 4
  br label %46

44:                                               ; preds = %40
  %45 = getelementptr inbounds %"class.MVision::FRHT", ptr %12, i32 0, i32 2
  call void @_ZNSt6vectorIN7MVision6CircleESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %45, ptr noundef nonnull align 4 dereferenceable(12) %9)
  store i32 0, ptr %11, align 4
  br label %46

46:                                               ; preds = %44, %43, %39, %34, %29, %25, %20
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #6
  %47 = load i32, ptr %11, align 4
  switch i32 %47, label %49 [
    i32 0, label %48
    i32 1, label %48
  ]

48:                                               ; preds = %46, %46
  ret void

49:                                               ; preds = %46
  unreachable
}

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

; 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: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSt5isnanf(float noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNK7MVision6Circle11translationEv(ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK7MVision6Circle7radiousEv(ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSt5isinff(float noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN7MVision6CircleESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) #5 align 2

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


; 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.MVision::Circle" = type { %"class.MVision::Vector2D", float }
%"class.MVision::Vector2D" = 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 nounwind uwtable
declare dso_local noundef float @_ZNK7MVision8Vector2D1yEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7MVision4FRHT11checkCircleERKNS_8Vector2DES3_S3_(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 4 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(8) %3) local_unnamed_addr #2 align 2 {
  %5 = alloca %"class.MVision::Circle", align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #5
  %6 = tail call { <2 x float>, float } @_ZN7MVision4FRHT10fitACircleERKNS_8Vector2DES3_S3_(ptr noundef nonnull align 4 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(8) %3)
  %.fca.0.extract = extractvalue { <2 x float>, float } %6, 0
  %.fca.1.extract = extractvalue { <2 x float>, float } %6, 1
  store <2 x float> %.fca.0.extract, ptr %5, align 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 8
  store float %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  %7 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK7MVision6Circle11translationEv(ptr noundef nonnull align 4 dereferenceable(12) %5)
  %8 = call noundef float @_ZNK7MVision8Vector2D1xEv(ptr noundef nonnull align 4 dereferenceable(8) %7)
  %9 = call noundef zeroext i1 @_ZSt5isnanf(float noundef %8)
  br i1 %9, label %30, label %10

10:                                               ; preds = %4
  %11 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK7MVision6Circle11translationEv(ptr noundef nonnull align 4 dereferenceable(12) %5)
  %12 = call noundef float @_ZNK7MVision8Vector2D1yEv(ptr noundef nonnull align 4 dereferenceable(8) %11)
  %13 = call noundef zeroext i1 @_ZSt5isnanf(float noundef %12)
  br i1 %13, label %30, label %14

14:                                               ; preds = %10
  %15 = call noundef float @_ZNK7MVision6Circle7radiousEv(ptr noundef nonnull align 4 dereferenceable(12) %5)
  %16 = call noundef zeroext i1 @_ZSt5isnanf(float noundef %15)
  br i1 %16, label %30, label %17

17:                                               ; preds = %14
  %18 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK7MVision6Circle11translationEv(ptr noundef nonnull align 4 dereferenceable(12) %5)
  %19 = call noundef float @_ZNK7MVision8Vector2D1xEv(ptr noundef nonnull align 4 dereferenceable(8) %18)
  %20 = call noundef zeroext i1 @_ZSt5isinff(float noundef %19)
  br i1 %20, label %30, label %21

21:                                               ; preds = %17
  %22 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK7MVision6Circle11translationEv(ptr noundef nonnull align 4 dereferenceable(12) %5)
  %23 = call noundef float @_ZNK7MVision8Vector2D1yEv(ptr noundef nonnull align 4 dereferenceable(8) %22)
  %24 = call noundef zeroext i1 @_ZSt5isinff(float noundef %23)
  br i1 %24, label %30, label %25

25:                                               ; preds = %21
  %26 = call noundef float @_ZNK7MVision6Circle7radiousEv(ptr noundef nonnull align 4 dereferenceable(12) %5)
  %27 = call noundef zeroext i1 @_ZSt5isinff(float noundef %26)
  br i1 %27, label %30, label %28

28:                                               ; preds = %25
  %29 = getelementptr inbounds i8, ptr %0, i64 24
  call void @_ZNSt6vectorIN7MVision6CircleESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %29, ptr noundef nonnull align 4 dereferenceable(12) %5)
  br label %30

30:                                               ; preds = %25, %21, %17, %14, %10, %4, %28
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #5
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSt5isnanf(float noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNK7MVision6Circle11translationEv(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK7MVision6Circle7radiousEv(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSt5isinff(float noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN7MVision6CircleESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #4 align 2

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


; Effective O3 passes: GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass