; LLVM IR from ArefMq/SoccerBallDetection :: src/modules/edgeimage.ll (ZN7MVision9EdgeImage6refineERKNS_8Vector2DES3_)

; 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::Image::Pixel" = type { i8, i8, i8 }
%"class.MVision::Vector2D" = type { float, float }

@_ZN7MVision9EdgeImage5blackE = external dso_local global %"class.MVision::Image::Pixel", align 1
@_ZN7MVision9EdgeImage3redE = external dso_local global %"class.MVision::Image::Pixel", align 1

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

declare void @_ZN7MVision8Vector2DC1Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7MVision9EdgeImage6refineERKNS_8Vector2DES3_(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef nonnull align 4 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(8) %2) #2 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"class.MVision::Vector2D", align 4
  %11 = alloca %"class.MVision::Vector2D", align 4
  %12 = alloca %"class.MVision::Vector2D", align 4
  %13 = alloca %"class.MVision::Image::Pixel", align 1
  %14 = alloca %"class.MVision::Image::Pixel", align 1
  %15 = alloca %"class.MVision::Vector2D", align 4
  %16 = alloca %"class.MVision::Vector2D", align 4
  %17 = alloca %"class.MVision::Image::Pixel", align 1
  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
  %18 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = call noundef float @_ZNK7MVision8Vector2D1yEv(ptr noundef nonnull align 4 dereferenceable(8) %19)
  %21 = fptosi float %20 to i32
  store i32 %21, ptr %7, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %107, %3
  %23 = load i32, ptr %7, align 4, !tbaa !9
  %24 = sitofp i32 %23 to float
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = call noundef float @_ZNK7MVision8Vector2D1yEv(ptr noundef nonnull align 4 dereferenceable(8) %25)
  %27 = fcmp olt float %24, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %22
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %110

29:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = call noundef float @_ZNK7MVision8Vector2D1xEv(ptr noundef nonnull align 4 dereferenceable(8) %30)
  %32 = fptosi float %31 to i32
  store i32 %32, ptr %9, align 4, !tbaa !9
  br label %33

33:                                               ; preds = %103, %29
  %34 = load i32, ptr %9, align 4, !tbaa !9
  %35 = sitofp i32 %34 to float
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = call noundef float @_ZNK7MVision8Vector2D1xEv(ptr noundef nonnull align 4 dereferenceable(8) %36)
  %38 = fcmp olt float %35, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %33
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %106

40:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %41 = load i32, ptr %9, align 4, !tbaa !9
  %42 = sitofp i32 %41 to float
  %43 = load i32, ptr %7, align 4, !tbaa !9
  %44 = sitofp i32 %43 to float
  call void @_ZN7MVision8Vector2DC1Eff(ptr noundef nonnull align 4 dereferenceable(8) %10, float noundef %42, float noundef %44)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %45 = load i32, ptr %9, align 4, !tbaa !9
  %46 = sub nsw i32 %45, 1
  %47 = sitofp i32 %46 to float
  %48 = load i32, ptr %7, align 4, !tbaa !9
  %49 = sub nsw i32 %48, 1
  %50 = sitofp i32 %49 to float
  call void @_ZN7MVision8Vector2DC1Eff(ptr noundef nonnull align 4 dereferenceable(8) %11, float noundef %47, float noundef %50)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %51 = load i32, ptr %9, align 4, !tbaa !9
  %52 = add nsw i32 %51, 1
  %53 = sitofp i32 %52 to float
  %54 = load i32, ptr %7, align 4, !tbaa !9
  %55 = add nsw i32 %54, 1
  %56 = sitofp i32 %55 to float
  call void @_ZN7MVision8Vector2DC1Eff(ptr noundef nonnull align 4 dereferenceable(8) %12, float noundef %53, float noundef %56)
  call void @llvm.lifetime.start.p0(i64 3, ptr %13) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %13, ptr align 1 @_ZN7MVision9EdgeImage5blackE, i64 3, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.start.p0(i64 3, ptr %14) #6
  %57 = call i24 @_ZN7MVision9EdgeImage13calculateEdgeERKNS_8Vector2DES3_S3_i(ptr noundef nonnull align 8 dereferenceable(128) %18, ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(8) %12, i32 noundef 60)
  store i24 %57, ptr %14, align 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %13, ptr align 1 %14, i64 3, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 3, ptr %14) #6
  %58 = call noundef float @_ZNK7MVision8Vector2D1xEv(ptr noundef nonnull align 4 dereferenceable(8) %10)
  %59 = fptosi float %58 to i32
  %60 = call noundef float @_ZNK7MVision8Vector2D1yEv(ptr noundef nonnull align 4 dereferenceable(8) %10)
  %61 = fptosi float %60 to i32
  %62 = getelementptr inbounds %"class.MVision::Image::Pixel", ptr %13, i32 0, i32 0
  %63 = load i8, ptr %62, align 1, !tbaa !13
  %64 = zext i8 %63 to i32
  %65 = icmp sgt i32 %64, 100
  br i1 %65, label %66, label %67

66:                                               ; preds = %40
  br label %68

67:                                               ; preds = %40
  br label %68

68:                                               ; preds = %67, %66
  %69 = phi ptr [ @_ZN7MVision9EdgeImage3redE, %66 ], [ @_ZN7MVision9EdgeImage5blackE, %67 ]
  call void @_ZN7MVision9EdgeImage12setSafePixelEiiRKNS_5Image5PixelE(ptr noundef nonnull align 8 dereferenceable(128) %18, i32 noundef %59, i32 noundef %61, ptr noundef nonnull align 1 dereferenceable(3) %69)
  %70 = getelementptr inbounds %"class.MVision::Image::Pixel", ptr %13, i32 0, i32 0
  %71 = load i8, ptr %70, align 1, !tbaa !13
  %72 = zext i8 %71 to i32
  %73 = icmp slt i32 %72, 128
  br i1 %73, label %74, label %102

74:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %75 = load i32, ptr %9, align 4, !tbaa !9
  %76 = sub nsw i32 %75, 2
  %77 = sitofp i32 %76 to float
  %78 = load i32, ptr %7, align 4, !tbaa !9
  %79 = sub nsw i32 %78, 2
  %80 = sitofp i32 %79 to float
  call void @_ZN7MVision8Vector2DC1Eff(ptr noundef nonnull align 4 dereferenceable(8) %15, float noundef %77, float noundef %80)
  %81 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN7MVision8Vector2DaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %15)
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %82 = load i32, ptr %9, align 4, !tbaa !9
  %83 = add nsw i32 %82, 2
  %84 = sitofp i32 %83 to float
  %85 = load i32, ptr %7, align 4, !tbaa !9
  %86 = add nsw i32 %85, 2
  %87 = sitofp i32 %86 to float
  call void @_ZN7MVision8Vector2DC1Eff(ptr noundef nonnull align 4 dereferenceable(8) %16, float noundef %84, float noundef %87)
  %88 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN7MVision8Vector2DaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(8) %16)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 3, ptr %17) #6
  %89 = call i24 @_ZN7MVision9EdgeImage13calculateEdgeERKNS_8Vector2DES3_S3_i(ptr noundef nonnull align 8 dereferenceable(128) %18, ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(8) %12, i32 noundef 120)
  store i24 %89, ptr %17, align 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %13, ptr align 1 %17, i64 3, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 3, ptr %17) #6
  %90 = call noundef float @_ZNK7MVision8Vector2D1xEv(ptr noundef nonnull align 4 dereferenceable(8) %10)
  %91 = fptosi float %90 to i32
  %92 = call noundef float @_ZNK7MVision8Vector2D1yEv(ptr noundef nonnull align 4 dereferenceable(8) %10)
  %93 = fptosi float %92 to i32
  %94 = getelementptr inbounds %"class.MVision::Image::Pixel", ptr %13, i32 0, i32 0
  %95 = load i8, ptr %94, align 1, !tbaa !13
  %96 = zext i8 %95 to i32
  %97 = icmp sgt i32 %96, 140
  br i1 %97, label %98, label %99

98:                                               ; preds = %74
  br label %100

99:                                               ; preds = %74
  br label %100

100:                                              ; preds = %99, %98
  %101 = phi ptr [ @_ZN7MVision9EdgeImage3redE, %98 ], [ @_ZN7MVision9EdgeImage5blackE, %99 ]
  call void @_ZN7MVision9EdgeImage12setSafePixelEiiRKNS_5Image5PixelE(ptr noundef nonnull align 8 dereferenceable(128) %18, i32 noundef %91, i32 noundef %93, ptr noundef nonnull align 1 dereferenceable(3) %101)
  br label %102

102:                                              ; preds = %100, %68
  call void @llvm.lifetime.end.p0(i64 3, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %103

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

106:                                              ; preds = %39
  br label %107

107:                                              ; preds = %106
  %108 = load i32, ptr %7, align 4, !tbaa !9
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %7, align 4, !tbaa !9
  br label %22, !llvm.loop !17

110:                                              ; preds = %28
  ret void
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i24 @_ZN7MVision9EdgeImage13calculateEdgeERKNS_8Vector2DES3_S3_i(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8), i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN7MVision9EdgeImage12setSafePixelEiiRKNS_5Image5PixelE(ptr noundef nonnull align 8 dereferenceable(128), i32 noundef, i32 noundef, ptr noundef nonnull align 1 dereferenceable(3)) #5 align 2

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

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


; 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::Image::Pixel" = type { i8, i8, i8 }
%"class.MVision::Vector2D" = type { float, float }

@_ZN7MVision9EdgeImage5blackE = external dso_local global %"class.MVision::Image::Pixel", align 1
@_ZN7MVision9EdgeImage3redE = external dso_local global %"class.MVision::Image::Pixel", align 1

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

declare void @_ZN7MVision8Vector2DC1Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #1

; 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 uwtable
define dso_local void @_ZN7MVision9EdgeImage6refineERKNS_8Vector2DES3_(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef nonnull align 4 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(8) %2) local_unnamed_addr #2 align 2 {
  %4 = alloca %"class.MVision::Vector2D", align 4
  %5 = alloca %"class.MVision::Vector2D", align 4
  %6 = alloca %"class.MVision::Vector2D", align 4
  %7 = alloca %"class.MVision::Vector2D", align 4
  %8 = alloca %"class.MVision::Vector2D", align 4
  %9 = tail call noundef float @_ZNK7MVision8Vector2D1yEv(ptr noundef nonnull align 4 dereferenceable(8) %1)
  %10 = fptosi float %9 to i32
  %11 = sitofp i32 %10 to float
  %12 = tail call noundef float @_ZNK7MVision8Vector2D1yEv(ptr noundef nonnull align 4 dereferenceable(8) %2)
  %13 = fcmp ogt float %12, %11
  br i1 %13, label %.lr.ph32, label %._crit_edge33

._crit_edge33:                                    ; preds = %._crit_edge, %3
  ret void

.lr.ph32:                                         ; preds = %3, %._crit_edge
  %14 = phi float [ %.pre-phi35, %._crit_edge ], [ %11, %3 ]
  %.030 = phi i32 [ %.pre-phi, %._crit_edge ], [ %10, %3 ]
  %15 = call noundef float @_ZNK7MVision8Vector2D1xEv(ptr noundef nonnull align 4 dereferenceable(8) %1)
  %16 = fptosi float %15 to i32
  %17 = sitofp i32 %16 to float
  %18 = call noundef float @_ZNK7MVision8Vector2D1xEv(ptr noundef nonnull align 4 dereferenceable(8) %2)
  %19 = fcmp ogt float %18, %17
  br i1 %19, label %.lr.ph, label %.lr.ph32.._crit_edge_crit_edge

.lr.ph32.._crit_edge_crit_edge:                   ; preds = %.lr.ph32
  %.pre = add nsw i32 %.030, 1
  %.pre34 = sitofp i32 %.pre to float
  br label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph32
  %20 = add nsw i32 %.030, -1
  %21 = sitofp i32 %20 to float
  %22 = add nsw i32 %.030, 1
  %23 = sitofp i32 %22 to float
  %24 = add nsw i32 %.030, -2
  %25 = sitofp i32 %24 to float
  %26 = add nsw i32 %.030, 2
  %27 = sitofp i32 %26 to float
  br label %30

._crit_edge:                                      ; preds = %58, %.lr.ph32.._crit_edge_crit_edge
  %.pre-phi35 = phi float [ %.pre34, %.lr.ph32.._crit_edge_crit_edge ], [ %23, %58 ]
  %.pre-phi = phi i32 [ %.pre, %.lr.ph32.._crit_edge_crit_edge ], [ %22, %58 ]
  %28 = call noundef float @_ZNK7MVision8Vector2D1yEv(ptr noundef nonnull align 4 dereferenceable(8) %2)
  %29 = fcmp ogt float %28, %.pre-phi35
  br i1 %29, label %.lr.ph32, label %._crit_edge33, !llvm.loop !5

30:                                               ; preds = %.lr.ph, %58
  %31 = phi float [ %17, %.lr.ph ], [ %35, %58 ]
  %.02629 = phi i32 [ %16, %.lr.ph ], [ %34, %58 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  call void @_ZN7MVision8Vector2DC1Eff(ptr noundef nonnull align 4 dereferenceable(8) %4, float noundef %31, float noundef %14)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %32 = add nsw i32 %.02629, -1
  %33 = sitofp i32 %32 to float
  call void @_ZN7MVision8Vector2DC1Eff(ptr noundef nonnull align 4 dereferenceable(8) %5, float noundef %33, float noundef %21)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %34 = add nsw i32 %.02629, 1
  %35 = sitofp i32 %34 to float
  call void @_ZN7MVision8Vector2DC1Eff(ptr noundef nonnull align 4 dereferenceable(8) %6, float noundef %35, float noundef %23)
  %36 = call i24 @_ZN7MVision9EdgeImage13calculateEdgeERKNS_8Vector2DES3_S3_i(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(8) %6, i32 noundef 60)
  %37 = call noundef float @_ZNK7MVision8Vector2D1xEv(ptr noundef nonnull align 4 dereferenceable(8) %4)
  %38 = fptosi float %37 to i32
  %39 = call noundef float @_ZNK7MVision8Vector2D1yEv(ptr noundef nonnull align 4 dereferenceable(8) %4)
  %40 = fptosi float %39 to i32
  %41 = and i24 %36, 255
  %42 = icmp ugt i24 %41, 100
  %_ZN7MVision9EdgeImage3redE._ZN7MVision9EdgeImage5blackE = select i1 %42, ptr @_ZN7MVision9EdgeImage3redE, ptr @_ZN7MVision9EdgeImage5blackE
  call void @_ZN7MVision9EdgeImage12setSafePixelEiiRKNS_5Image5PixelE(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %38, i32 noundef %40, ptr noundef nonnull align 1 dereferenceable(3) %_ZN7MVision9EdgeImage3redE._ZN7MVision9EdgeImage5blackE)
  %43 = icmp ult i24 %41, 128
  br i1 %43, label %44, label %58

44:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %45 = add nsw i32 %.02629, -2
  %46 = sitofp i32 %45 to float
  call void @_ZN7MVision8Vector2DC1Eff(ptr noundef nonnull align 4 dereferenceable(8) %7, float noundef %46, float noundef %25)
  %47 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN7MVision8Vector2DaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(8) %7)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %48 = add nsw i32 %.02629, 2
  %49 = sitofp i32 %48 to float
  call void @_ZN7MVision8Vector2DC1Eff(ptr noundef nonnull align 4 dereferenceable(8) %8, float noundef %49, float noundef %27)
  %50 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN7MVision8Vector2DaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  %51 = call i24 @_ZN7MVision9EdgeImage13calculateEdgeERKNS_8Vector2DES3_S3_i(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(8) %6, i32 noundef 120)
  %52 = call noundef float @_ZNK7MVision8Vector2D1xEv(ptr noundef nonnull align 4 dereferenceable(8) %4)
  %53 = fptosi float %52 to i32
  %54 = call noundef float @_ZNK7MVision8Vector2D1yEv(ptr noundef nonnull align 4 dereferenceable(8) %4)
  %55 = fptosi float %54 to i32
  %56 = and i24 %51, 255
  %57 = icmp ugt i24 %56, 140
  %_ZN7MVision9EdgeImage3redE._ZN7MVision9EdgeImage5blackE1 = select i1 %57, ptr @_ZN7MVision9EdgeImage3redE, ptr @_ZN7MVision9EdgeImage5blackE
  call void @_ZN7MVision9EdgeImage12setSafePixelEiiRKNS_5Image5PixelE(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %53, i32 noundef %55, ptr noundef nonnull align 1 dereferenceable(3) %_ZN7MVision9EdgeImage3redE._ZN7MVision9EdgeImage5blackE1)
  br label %58

58:                                               ; preds = %44, %30
  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
  %59 = call noundef float @_ZNK7MVision8Vector2D1xEv(ptr noundef nonnull align 4 dereferenceable(8) %2)
  %60 = fcmp ogt float %59, %35
  br i1 %60, label %30, label %._crit_edge, !llvm.loop !7
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i24 @_ZN7MVision9EdgeImage13calculateEdgeERKNS_8Vector2DES3_S3_i(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN7MVision9EdgeImage12setSafePixelEiiRKNS_5Image5PixelE(ptr noundef nonnull align 8 dereferenceable(128), i32 noundef, i32 noundef, ptr noundef nonnull align 1 dereferenceable(3)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZN7MVision8Vector2DaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8), 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 = { "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"="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 = { 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 #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 = distinct !{!7, !6}


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