; LLVM IR from tangjz/acm-icpc :: lydsy/3068.ll (Z4dfs3ii)

; 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.Edge = type { i32, i32 }
%"struct.std::pair" = type { i32, i32 }

@lnk = external dso_local global [500001 x i32], align 16
@f = external dso_local global [500001 x i32], align 16
@g = external dso_local global [500001 x i32], align 16
@old_f = external dso_local global [500001 x i32], align 16
@tot = external dso_local global i64, align 8
@sz = external dso_local global [500001 x i64], align 16
@old_sz = external dso_local global [500001 x i64], align 16
@sum = external dso_local global [500001 x i64], align 16
@ans = external dso_local global i64, align 8
@e = external dso_local global [1000003 x %struct.Edge], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z5reseti(i32 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 @_Z4dfs3ii(i32 noundef %0, i32 noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::pair", align 4
  %9 = alloca %"struct.std::pair", align 4
  %10 = alloca i64, align 8
  store i32 %0, ptr %3, align 4, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !5
  %11 = load i32, ptr %3, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds [500001 x i32], ptr @f, i64 0, i64 %12
  %14 = load i32, ptr %13, align 4, !tbaa !5
  %15 = load i32, ptr %3, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [500001 x i32], ptr @old_f, i64 0, i64 %16
  store i32 %14, ptr %17, align 4, !tbaa !5
  %18 = load i32, ptr %3, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [500001 x i64], ptr @sz, i64 0, i64 %19
  %21 = load i64, ptr %20, align 8, !tbaa !9
  %22 = load i32, ptr %3, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [500001 x i64], ptr @old_sz, i64 0, i64 %23
  store i64 %21, ptr %24, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [500001 x i32], ptr @lnk, i64 0, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !5
  store i32 %28, ptr %5, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %143, %2
  %30 = load i32, ptr %5, align 4, !tbaa !5
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %33, label %32

32:                                               ; preds = %29
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %149

33:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %34 = load i32, ptr %5, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [1000003 x %struct.Edge], ptr @e, i64 0, i64 %35
  %37 = getelementptr inbounds %struct.Edge, ptr %36, i32 0, i32 1
  %38 = load i32, ptr %37, align 4, !tbaa !11
  store i32 %38, ptr %7, align 4, !tbaa !5
  %39 = load i32, ptr %7, align 4, !tbaa !5
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = icmp eq i32 %39, %40
  br i1 %41, label %42, label %43

42:                                               ; preds = %33
  store i32 4, ptr %6, align 4
  br label %140

43:                                               ; preds = %33
  %44 = load i64, ptr @tot, align 8, !tbaa !9
  %45 = load i32, ptr %7, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [500001 x i64], ptr @sz, i64 0, i64 %46
  %48 = load i64, ptr %47, align 8, !tbaa !9
  %49 = sub nsw i64 %44, %48
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [500001 x i64], ptr @sz, i64 0, i64 %51
  store i64 %49, ptr %52, align 8, !tbaa !9
  %53 = load i32, ptr %7, align 4, !tbaa !5
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [500001 x i32], ptr @old_f, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = icmp eq i32 %53, %57
  br i1 %58, label %59, label %64

59:                                               ; preds = %43
  %60 = load i32, ptr %3, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [500001 x i32], ptr @g, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  br label %69

64:                                               ; preds = %43
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [500001 x i32], ptr @old_f, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %64, %59
  %70 = phi i32 [ %63, %59 ], [ %68, %64 ]
  %71 = load i32, ptr %3, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [500001 x i32], ptr @f, i64 0, i64 %72
  store i32 %70, ptr %73, align 4, !tbaa !5
  %74 = load i32, ptr %3, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [500001 x i32], ptr @f, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [500001 x i64], ptr @sz, i64 0, i64 %78
  %80 = load i64, ptr %79, align 8, !tbaa !9
  %81 = load i64, ptr @tot, align 8, !tbaa !9
  %82 = load i32, ptr %3, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [500001 x i64], ptr @old_sz, i64 0, i64 %83
  %85 = load i64, ptr %84, align 8, !tbaa !9
  %86 = sub nsw i64 %81, %85
  %87 = icmp slt i64 %80, %86
  br i1 %87, label %88, label %93

88:                                               ; preds = %69
  %89 = load i32, ptr %4, align 4, !tbaa !5
  %90 = load i32, ptr %3, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [500001 x i32], ptr @f, i64 0, i64 %91
  store i32 %89, ptr %92, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %88, %69
  %94 = load i32, ptr %3, align 4, !tbaa !5
  call void @_Z5reseti(i32 noundef %94)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = call i64 @_Z5checki(i32 noundef %95)
  store i64 %96, ptr %8, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %97 = load i32, ptr %3, align 4, !tbaa !5
  %98 = call i64 @_Z5checki(i32 noundef %97)
  store i64 %98, ptr %9, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %99 = getelementptr inbounds %"struct.std::pair", ptr %8, i32 0, i32 0
  %100 = load i32, ptr %99, align 4, !tbaa !13
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [500001 x i64], ptr @sum, i64 0, i64 %101
  %103 = load i64, ptr %102, align 8, !tbaa !9
  %104 = getelementptr inbounds %"struct.std::pair", ptr %9, i32 0, i32 0
  %105 = load i32, ptr %104, align 4, !tbaa !13
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [500001 x i64], ptr @sum, i64 0, i64 %106
  %108 = load i64, ptr %107, align 8, !tbaa !9
  %109 = add nsw i64 %103, %108
  %110 = load i32, ptr %3, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [500001 x i64], ptr @sum, i64 0, i64 %111
  %113 = load i64, ptr %112, align 8, !tbaa !9
  %114 = sub nsw i64 %109, %113
  %115 = load i64, ptr @tot, align 8, !tbaa !9
  %116 = load i32, ptr %7, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [500001 x i64], ptr @sz, i64 0, i64 %117
  %119 = load i64, ptr %118, align 8, !tbaa !9
  %120 = sub nsw i64 %115, %119
  %121 = getelementptr inbounds %"struct.std::pair", ptr %8, i32 0, i32 1
  %122 = load i32, ptr %121, align 4, !tbaa !15
  %123 = add nsw i32 %122, 1
  %124 = sext i32 %123 to i64
  %125 = mul nsw i64 %120, %124
  %126 = sub nsw i64 %114, %125
  %127 = load i32, ptr %7, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [500001 x i64], ptr @sz, i64 0, i64 %128
  %130 = load i64, ptr %129, align 8, !tbaa !9
  %131 = getelementptr inbounds %"struct.std::pair", ptr %9, i32 0, i32 1
  %132 = load i32, ptr %131, align 4, !tbaa !15
  %133 = sext i32 %132 to i64
  %134 = mul nsw i64 %130, %133
  %135 = sub nsw i64 %126, %134
  store i64 %135, ptr %10, align 8, !tbaa !9
  %136 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @ans, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %137 = load i64, ptr %136, align 8, !tbaa !9
  store i64 %137, ptr @ans, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  %138 = load i32, ptr %7, align 4, !tbaa !5
  %139 = load i32, ptr %3, align 4, !tbaa !5
  call void @_Z4dfs3ii(i32 noundef %138, i32 noundef %139)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  store i32 0, ptr %6, align 4
  br label %140

140:                                              ; preds = %93, %42
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  %141 = load i32, ptr %6, align 4
  switch i32 %141, label %165 [
    i32 0, label %142
    i32 4, label %143
  ]

142:                                              ; preds = %140
  br label %143

143:                                              ; preds = %142, %140
  %144 = load i32, ptr %5, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [1000003 x %struct.Edge], ptr @e, i64 0, i64 %145
  %147 = getelementptr inbounds %struct.Edge, ptr %146, i32 0, i32 0
  %148 = load i32, ptr %147, align 8, !tbaa !16
  store i32 %148, ptr %5, align 4, !tbaa !5
  br label %29, !llvm.loop !17

149:                                              ; preds = %32
  %150 = load i32, ptr %3, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [500001 x i32], ptr @old_f, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = load i32, ptr %3, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [500001 x i32], ptr @f, i64 0, i64 %155
  store i32 %153, ptr %156, align 4, !tbaa !5
  %157 = load i32, ptr %3, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [500001 x i64], ptr @old_sz, i64 0, i64 %158
  %160 = load i64, ptr %159, align 8, !tbaa !9
  %161 = load i32, ptr %3, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [500001 x i64], ptr @sz, i64 0, i64 %162
  store i64 %160, ptr %163, align 8, !tbaa !9
  %164 = load i32, ptr %3, align 4, !tbaa !5
  call void @_Z5reseti(i32 noundef %164)
  ret void

165:                                              ; preds = %140
  unreachable
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i64 @_Z5checki(i32 noundef) #3

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

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 = { 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 #4 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !6, i64 4}
!12 = !{!"_ZTS4Edge", !6, i64 0, !6, i64 4}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!15 = !{!14, !6, i64 4}
!16 = !{!12, !6, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


; 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.Edge = type { i32, i32 }

@lnk = external dso_local local_unnamed_addr global [500001 x i32], align 16
@f = external dso_local local_unnamed_addr global [500001 x i32], align 16
@g = external dso_local local_unnamed_addr global [500001 x i32], align 16
@old_f = external dso_local local_unnamed_addr global [500001 x i32], align 16
@tot = external dso_local local_unnamed_addr global i64, align 8
@sz = external dso_local local_unnamed_addr global [500001 x i64], align 16
@old_sz = external dso_local local_unnamed_addr global [500001 x i64], align 16
@sum = external dso_local local_unnamed_addr global [500001 x i64], align 16
@ans = external dso_local global i64, align 8
@e = external dso_local local_unnamed_addr global [1000003 x %struct.Edge], align 16

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

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

; Function Attrs: mustprogress 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 @_Z4dfs3ii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #2 {
  %3 = alloca i64, align 8
  %4 = sext i32 %0 to i64
  %5 = getelementptr inbounds [500001 x i32], ptr @f, i64 0, i64 %4
  %6 = load i32, ptr %5, align 4, !tbaa !5
  %7 = getelementptr inbounds [500001 x i32], ptr @old_f, i64 0, i64 %4
  store i32 %6, ptr %7, align 4, !tbaa !5
  %8 = getelementptr inbounds [500001 x i64], ptr @sz, i64 0, i64 %4
  %9 = load i64, ptr %8, align 8, !tbaa !9
  %10 = getelementptr inbounds [500001 x i64], ptr @old_sz, i64 0, i64 %4
  store i64 %9, ptr %10, align 8, !tbaa !9
  %11 = getelementptr inbounds [500001 x i32], ptr @lnk, i64 0, i64 %4
  %.046 = load i32, ptr %11, align 4, !tbaa !5
  %.not47 = icmp eq i32 %.046, 0
  br i1 %.not47, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %12 = getelementptr inbounds [500001 x i32], ptr @g, i64 0, i64 %4
  %13 = getelementptr inbounds [500001 x i64], ptr @sum, i64 0, i64 %4
  br label %16

._crit_edge.loopexit:                             ; preds = %59
  %.pre = load i32, ptr %7, align 4, !tbaa !5
  %.pre49 = load i64, ptr %10, align 8, !tbaa !9
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %2
  %14 = phi i64 [ %.pre49, %._crit_edge.loopexit ], [ %9, %2 ]
  %15 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %6, %2 ]
  store i32 %15, ptr %5, align 4, !tbaa !5
  store i64 %14, ptr %8, align 8, !tbaa !9
  call void @_Z5reseti(i32 noundef %0)
  ret void

16:                                               ; preds = %.lr.ph, %59
  %.048 = phi i32 [ %.046, %.lr.ph ], [ %.0, %59 ]
  %17 = sext i32 %.048 to i64
  %18 = getelementptr inbounds [1000003 x %struct.Edge], ptr @e, i64 0, i64 %17
  %19 = getelementptr inbounds i8, ptr %18, i64 4
  %20 = load i32, ptr %19, align 4, !tbaa !11
  %21 = icmp eq i32 %20, %1
  br i1 %21, label %59, label %22

22:                                               ; preds = %16
  %23 = load i64, ptr @tot, align 8, !tbaa !9
  %24 = sext i32 %20 to i64
  %25 = getelementptr inbounds [500001 x i64], ptr @sz, i64 0, i64 %24
  %26 = load i64, ptr %25, align 8, !tbaa !9
  %27 = sub nsw i64 %23, %26
  store i64 %27, ptr %8, align 8, !tbaa !9
  %28 = load i32, ptr %7, align 4, !tbaa !5
  %29 = icmp eq i32 %20, %28
  br i1 %29, label %30, label %32

30:                                               ; preds = %22
  %31 = load i32, ptr %12, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %22, %30
  %33 = phi i32 [ %31, %30 ], [ %28, %22 ]
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [500001 x i64], ptr @sz, i64 0, i64 %34
  %36 = load i64, ptr %35, align 8, !tbaa !9
  %37 = load i64, ptr %10, align 8, !tbaa !9
  %38 = sub nsw i64 %23, %37
  %39 = icmp slt i64 %36, %38
  %spec.store.select = select i1 %39, i32 %1, i32 %33
  store i32 %spec.store.select, ptr %5, align 4
  call void @_Z5reseti(i32 noundef %0)
  %40 = call i64 @_Z5checki(i32 noundef %20)
  %41 = call i64 @_Z5checki(i32 noundef %0)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %sext = shl i64 %40, 32
  %42 = ashr exact i64 %sext, 32
  %43 = getelementptr inbounds [500001 x i64], ptr @sum, i64 0, i64 %42
  %44 = load i64, ptr %43, align 8, !tbaa !9
  %sext39 = shl i64 %41, 32
  %45 = ashr exact i64 %sext39, 32
  %46 = getelementptr inbounds [500001 x i64], ptr @sum, i64 0, i64 %45
  %47 = load i64, ptr %46, align 8, !tbaa !9
  %48 = load i64, ptr %13, align 8, !tbaa !9
  %49 = load i64, ptr @tot, align 8, !tbaa !9
  %50 = load i64, ptr %25, align 8, !tbaa !9
  %.neg = sub i64 %50, %49
  %sext40 = add i64 %40, 4294967296
  %51 = ashr i64 %sext40, 32
  %.neg41 = mul i64 %.neg, %51
  %52 = ashr i64 %41, 32
  %53 = mul nsw i64 %50, %52
  %.neg45 = add i64 %47, %44
  %54 = add i64 %48, %53
  %55 = sub i64 %.neg45, %54
  %56 = add i64 %55, %.neg41
  store i64 %56, ptr %3, align 8, !tbaa !9
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @ans, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %58 = load i64, ptr %57, align 8, !tbaa !9
  store i64 %58, ptr @ans, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @_Z4dfs3ii(i32 noundef %20, i32 noundef %0)
  br label %59

59:                                               ; preds = %16, %32
  %.0 = load i32, ptr %18, align 8, !tbaa !5
  %.not = icmp eq i32 %.0, 0
  br i1 %.not, label %._crit_edge.loopexit, label %16, !llvm.loop !13
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i64 @_Z5checki(i32 noundef) local_unnamed_addr #3

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

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 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 = { 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 #4 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !6, i64 4}
!12 = !{!"_ZTS4Edge", !6, i64 0, !6, i64 4}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,LoopSimplifyPass,ReassociatePass,SROAPass,SimplifyCFGPass