; LLVM IR from bbenligiray/stag :: src/ED/ValidateEdgeSegments.ll (Z20ValidateEdgeSegmentsP7EdgeMapPhd)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.EdgeMap = type <{ i32, i32, ptr, ptr, ptr, i32, [4 x i8] }>
%struct.EdgeSegment = type { ptr, i32 }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z18ExtractNewSegmentsP7EdgeMap(ptr noundef) #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z20ValidateEdgeSegmentsP7EdgeMapPhd(ptr noundef %0, ptr noundef %1, double noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store double %2, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.EdgeMap, ptr %16, i32 0, i32 0
  %18 = load i32, ptr %17, align 8, !tbaa !11
  store i32 %18, ptr %7, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.EdgeMap, ptr %19, i32 0, i32 1
  %21 = load i32, ptr %20, align 4, !tbaa !15
  store i32 %21, ptr %8, align 4, !tbaa !14
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.EdgeMap, ptr %22, i32 0, i32 2
  %24 = load ptr, ptr %23, align 8, !tbaa !16
  %25 = load i32, ptr %7, align 4, !tbaa !14
  %26 = load i32, ptr %8, align 4, !tbaa !14
  %27 = mul nsw i32 %25, %26
  %28 = sext i32 %27 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %24, i8 0, i64 %28, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 32768, ptr %9, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %29 = load i32, ptr %9, align 4, !tbaa !14
  %30 = sext i32 %29 to i64
  %31 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %30, i64 8)
  %32 = extractvalue { i64, i1 } %31, 1
  %33 = extractvalue { i64, i1 } %31, 0
  %34 = select i1 %32, i64 -1, i64 %33
  %35 = call noalias noundef nonnull ptr @_Znam(i64 noundef %34) #8
  store ptr %35, ptr %10, align 8, !tbaa !5
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  %37 = load i32, ptr %9, align 4, !tbaa !14
  %38 = sext i32 %37 to i64
  %39 = mul i64 8, %38
  call void @llvm.memset.p0.i64(ptr align 8 %36, i8 0, i64 %39, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = load i32, ptr %7, align 4, !tbaa !14
  %42 = load i32, ptr %8, align 4, !tbaa !14
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  %44 = call noundef ptr @_ZL17ComputePrewitt3x3PhiiPd(ptr noundef %40, i32 noundef %41, i32 noundef %42, ptr noundef %43)
  store ptr %44, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !14
  br label %45

45:                                               ; preds = %68, %3
  %46 = load i32, ptr %13, align 4, !tbaa !14
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.EdgeMap, ptr %47, i32 0, i32 5
  %49 = load i32, ptr %48, align 8, !tbaa !17
  %50 = icmp slt i32 %46, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %71

52:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.EdgeMap, ptr %53, i32 0, i32 4
  %55 = load ptr, ptr %54, align 8, !tbaa !18
  %56 = load i32, ptr %13, align 4, !tbaa !14
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds %struct.EdgeSegment, ptr %55, i64 %57
  %59 = getelementptr inbounds %struct.EdgeSegment, ptr %58, i32 0, i32 1
  %60 = load i32, ptr %59, align 8, !tbaa !19
  store i32 %60, ptr %14, align 4, !tbaa !14
  %61 = load i32, ptr %14, align 4, !tbaa !14
  %62 = load i32, ptr %14, align 4, !tbaa !14
  %63 = sub nsw i32 %62, 1
  %64 = mul nsw i32 %61, %63
  %65 = sdiv i32 %64, 2
  %66 = load i32, ptr %12, align 4, !tbaa !14
  %67 = add nsw i32 %66, %65
  store i32 %67, ptr %12, align 4, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %68

68:                                               ; preds = %52
  %69 = load i32, ptr %13, align 4, !tbaa !14
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %13, align 4, !tbaa !14
  br label %45, !llvm.loop !21

71:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !14
  br label %72

72:                                               ; preds = %95, %71
  %73 = load i32, ptr %15, align 4, !tbaa !14
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.EdgeMap, ptr %74, i32 0, i32 5
  %76 = load i32, ptr %75, align 8, !tbaa !17
  %77 = icmp slt i32 %73, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %98

79:                                               ; preds = %72
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = load ptr, ptr %11, align 8, !tbaa !5
  %82 = load i32, ptr %15, align 4, !tbaa !14
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.EdgeMap, ptr %83, i32 0, i32 4
  %85 = load ptr, ptr %84, align 8, !tbaa !18
  %86 = load i32, ptr %15, align 4, !tbaa !14
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds %struct.EdgeSegment, ptr %85, i64 %87
  %89 = getelementptr inbounds %struct.EdgeSegment, ptr %88, i32 0, i32 1
  %90 = load i32, ptr %89, align 8, !tbaa !19
  %91 = sub nsw i32 %90, 1
  %92 = load i32, ptr %12, align 4, !tbaa !14
  %93 = load ptr, ptr %10, align 8, !tbaa !5
  %94 = load double, ptr %6, align 8, !tbaa !9
  call void @_ZL11TestSegmentP7EdgeMapPsiiiiPdd(ptr noundef %80, ptr noundef %81, i32 noundef %82, i32 noundef 0, i32 noundef %91, i32 noundef %92, ptr noundef %93, double noundef %94)
  br label %95

95:                                               ; preds = %79
  %96 = load i32, ptr %15, align 4, !tbaa !14
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %15, align 4, !tbaa !14
  br label %72, !llvm.loop !23

98:                                               ; preds = %78
  %99 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_Z18ExtractNewSegmentsP7EdgeMap(ptr noundef %99)
  %100 = load ptr, ptr %10, align 8, !tbaa !5
  %101 = icmp eq ptr %100, null
  br i1 %101, label %103, label %102

102:                                              ; preds = %98
  call void @_ZdaPv(ptr noundef %100) #9
  br label %103

103:                                              ; preds = %102, %98
  %104 = load ptr, ptr %11, align 8, !tbaa !5
  %105 = icmp eq ptr %104, null
  br i1 %105, label %107, label %106

106:                                              ; preds = %103
  call void @_ZdaPv(ptr noundef %104) #9
  br label %107

107:                                              ; preds = %106, %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #4

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #5

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZL17ComputePrewitt3x3PhiiPd(ptr noundef, i32 noundef, i32 noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL11TestSegmentP7EdgeMapPsiiiiPdd(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, double noundef) #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #6

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nobuiltin allocsize(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 = { nobuiltin nounwind "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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin 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 = !{!"double", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTS7EdgeMap", !13, i64 0, !13, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !13, i64 32}
!13 = !{!"int", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!12, !13, i64 4}
!16 = !{!12, !6, i64 8}
!17 = !{!12, !13, i64 32}
!18 = !{!12, !6, i64 24}
!19 = !{!20, !13, i64 8}
!20 = !{!"_ZTS11EdgeSegment", !6, i64 0, !13, i64 8}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.EdgeSegment = type { ptr, i32 }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z18ExtractNewSegmentsP7EdgeMap(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z20ValidateEdgeSegmentsP7EdgeMapPhd(ptr noundef %0, ptr noundef %1, double noundef %2) local_unnamed_addr #1 {
  %4 = load i32, ptr %0, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 4
  %6 = load i32, ptr %5, align 4, !tbaa !11
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  %8 = load ptr, ptr %7, align 8, !tbaa !12
  %9 = mul nsw i32 %6, %4
  %10 = sext i32 %9 to i64
  tail call void @llvm.memset.p0.i64(ptr align 1 %8, i8 0, i64 %10, i1 false)
  %11 = tail call noalias noundef nonnull dereferenceable(262144) ptr @_Znam(i64 noundef 262144) #6
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(262144) %11, i8 0, i64 262144, i1 false)
  %12 = tail call noundef ptr @_ZL17ComputePrewitt3x3PhiiPd(ptr noundef %1, i32 noundef %4, i32 noundef %6, ptr noundef nonnull %11)
  %13 = getelementptr inbounds i8, ptr %0, i64 32
  %14 = load i32, ptr %13, align 8, !tbaa !13
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %3
  %16 = getelementptr inbounds i8, ptr %0, i64 24
  %17 = load ptr, ptr %16, align 8, !tbaa !14
  %wide.trip.count = zext nneg i32 %14 to i64
  %min.iters.check = icmp ult i32 %14, 9
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  %.03337.ph = phi i32 [ 0, %.lr.ph ], [ %60, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.mod.vf = and i64 %wide.trip.count, 7
  %18 = icmp eq i64 %n.mod.vf, 0
  %19 = select i1 %18, i64 8, i64 %n.mod.vf
  %n.vec = sub nsw i64 %wide.trip.count, %19
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %57, %vector.body ]
  %vec.phi45 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %58, %vector.body ]
  %20 = or disjoint i64 %index, 1
  %21 = or disjoint i64 %index, 2
  %22 = or disjoint i64 %index, 3
  %23 = or disjoint i64 %index, 4
  %24 = or disjoint i64 %index, 5
  %25 = or disjoint i64 %index, 6
  %26 = or disjoint i64 %index, 7
  %27 = getelementptr inbounds %struct.EdgeSegment, ptr %17, i64 %index, i32 1
  %28 = getelementptr inbounds %struct.EdgeSegment, ptr %17, i64 %20, i32 1
  %29 = getelementptr inbounds %struct.EdgeSegment, ptr %17, i64 %21, i32 1
  %30 = getelementptr inbounds %struct.EdgeSegment, ptr %17, i64 %22, i32 1
  %31 = getelementptr inbounds %struct.EdgeSegment, ptr %17, i64 %23, i32 1
  %32 = getelementptr inbounds %struct.EdgeSegment, ptr %17, i64 %24, i32 1
  %33 = getelementptr inbounds %struct.EdgeSegment, ptr %17, i64 %25, i32 1
  %34 = getelementptr inbounds %struct.EdgeSegment, ptr %17, i64 %26, i32 1
  %35 = load i32, ptr %27, align 8, !tbaa !15
  %36 = load i32, ptr %28, align 8, !tbaa !15
  %37 = load i32, ptr %29, align 8, !tbaa !15
  %38 = load i32, ptr %30, align 8, !tbaa !15
  %39 = insertelement <4 x i32> poison, i32 %35, i64 0
  %40 = insertelement <4 x i32> %39, i32 %36, i64 1
  %41 = insertelement <4 x i32> %40, i32 %37, i64 2
  %42 = insertelement <4 x i32> %41, i32 %38, i64 3
  %43 = load i32, ptr %31, align 8, !tbaa !15
  %44 = load i32, ptr %32, align 8, !tbaa !15
  %45 = load i32, ptr %33, align 8, !tbaa !15
  %46 = load i32, ptr %34, align 8, !tbaa !15
  %47 = insertelement <4 x i32> poison, i32 %43, i64 0
  %48 = insertelement <4 x i32> %47, i32 %44, i64 1
  %49 = insertelement <4 x i32> %48, i32 %45, i64 2
  %50 = insertelement <4 x i32> %49, i32 %46, i64 3
  %51 = add nsw <4 x i32> %42, <i32 -1, i32 -1, i32 -1, i32 -1>
  %52 = add nsw <4 x i32> %50, <i32 -1, i32 -1, i32 -1, i32 -1>
  %53 = mul nsw <4 x i32> %51, %42
  %54 = mul nsw <4 x i32> %52, %50
  %55 = sdiv <4 x i32> %53, <i32 2, i32 2, i32 2, i32 2>
  %56 = sdiv <4 x i32> %54, <i32 2, i32 2, i32 2, i32 2>
  %57 = add <4 x i32> %55, %vec.phi
  %58 = add <4 x i32> %56, %vec.phi45
  %index.next = add nuw i64 %index, 8
  %59 = icmp eq i64 %index.next, %n.vec
  br i1 %59, label %middle.block, label %vector.body, !llvm.loop !17

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %58, %57
  %60 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  br label %scalar.ph.preheader

.preheader:                                       ; preds = %scalar.ph
  br i1 %15, label %.lr.ph39, label %._crit_edge

.lr.ph39:                                         ; preds = %.preheader
  %61 = getelementptr inbounds i8, ptr %0, i64 24
  br label %69

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %.03337 = phi i32 [ %67, %scalar.ph ], [ %.03337.ph, %scalar.ph.preheader ]
  %62 = getelementptr inbounds %struct.EdgeSegment, ptr %17, i64 %indvars.iv, i32 1
  %63 = load i32, ptr %62, align 8, !tbaa !15
  %64 = add nsw i32 %63, -1
  %65 = mul nsw i32 %64, %63
  %66 = sdiv i32 %65, 2
  %67 = add nsw i32 %66, %.03337
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %scalar.ph, !llvm.loop !21

._crit_edge:                                      ; preds = %69, %3, %.preheader
  tail call void @_Z18ExtractNewSegmentsP7EdgeMap(ptr noundef nonnull %0)
  tail call void @_ZdaPv(ptr noundef nonnull %11) #7
  %68 = icmp eq ptr %12, null
  br i1 %68, label %79, label %78

69:                                               ; preds = %.lr.ph39, %69
  %indvars.iv41 = phi i64 [ 0, %.lr.ph39 ], [ %indvars.iv.next42, %69 ]
  %70 = load ptr, ptr %61, align 8, !tbaa !14
  %71 = getelementptr inbounds %struct.EdgeSegment, ptr %70, i64 %indvars.iv41, i32 1
  %72 = load i32, ptr %71, align 8, !tbaa !15
  %73 = add nsw i32 %72, -1
  %74 = trunc nuw nsw i64 %indvars.iv41 to i32
  tail call void @_ZL11TestSegmentP7EdgeMapPsiiiiPdd(ptr noundef nonnull %0, ptr noundef %12, i32 noundef %74, i32 noundef 0, i32 noundef %73, i32 noundef %67, ptr noundef nonnull %11, double noundef %2)
  %indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
  %75 = load i32, ptr %13, align 8, !tbaa !13
  %76 = sext i32 %75 to i64
  %77 = icmp slt i64 %indvars.iv.next42, %76
  br i1 %77, label %69, label %._crit_edge, !llvm.loop !22

78:                                               ; preds = %._crit_edge
  tail call void @_ZdaPv(ptr noundef nonnull %12) #7
  br label %79

79:                                               ; preds = %78, %._crit_edge
  ret void
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZL17ComputePrewitt3x3PhiiPd(ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL11TestSegmentP7EdgeMapPsiiiiPdd(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, double noundef) local_unnamed_addr #1

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5

attributes #0 = { 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 #1 = { 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nobuiltin allocsize(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 = { nobuiltin nounwind "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { builtin allocsize(0) }
attributes #7 = { builtin 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 0}
!6 = !{!"_ZTS7EdgeMap", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16, !10, i64 24, !7, i64 32}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!6, !10, i64 8}
!13 = !{!6, !7, i64 32}
!14 = !{!6, !10, i64 24}
!15 = !{!16, !7, i64 8}
!16 = !{!"_ZTS11EdgeSegment", !10, i64 0, !7, i64 8}
!17 = distinct !{!17, !18, !19, !20}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !18, !20, !19}
!22 = distinct !{!22, !18}


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