; LLVM IR from tangjz/acm-icpc :: 51nod (1967)

; 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"

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@u = external dso_local global [400005 x i32], align 16
@v = external dso_local global [400005 x i32], align 16
@deg = external dso_local global [100005 x i32], align 16
@dsu = external dso_local global [100005 x i32], align 16
@seq = external dso_local global [100005 x i32], align 16
@p = external dso_local global [100005 x i32], align 16
@dir = external dso_local global [400005 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; 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: mustprogress uwtable
declare dso_local noundef i32 @_Z8dsu_findi(i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3addi(i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsii(i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %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 i32, align 4
  store i32 0, ptr %1, align 4
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  call void @llvm.memset.p0.i64(ptr align 16 @p, i8 -1, i64 400020, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @dsu, i8 -1, i64 400020, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %10

10:                                               ; preds = %40, %0
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = load i32, ptr @m, align 4, !tbaa !5
  %13 = icmp sle i32 %11, %12
  br i1 %13, label %15, label %14

14:                                               ; preds = %10
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %43

15:                                               ; preds = %10
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds i32, ptr @u, i64 %17
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds i32, ptr @v, i64 %20
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %18, ptr noundef %21)
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [400005 x i32], ptr @u, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [100005 x i32], ptr @deg, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr %28, align 4, !tbaa !5
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [400005 x i32], ptr @v, i64 0, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [100005 x i32], ptr @deg, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %36, align 4, !tbaa !5
  %39 = load i32, ptr %2, align 4, !tbaa !5
  call void @_Z3addi(i32 noundef %39)
  br label %40

40:                                               ; preds = %15
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %2, align 4, !tbaa !5
  br label %10, !llvm.loop !9

43:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %111, %43
  %45 = load i32, ptr %5, align 4, !tbaa !5
  %46 = load i32, ptr @n, align 4, !tbaa !5
  %47 = icmp sle i32 %45, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %114

49:                                               ; preds = %44
  %50 = load i32, ptr %5, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [100005 x i32], ptr @deg, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = and i32 %53, 1
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %107

56:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %57 = load i32, ptr %5, align 4, !tbaa !5
  %58 = call noundef i32 @_Z8dsu_findi(i32 noundef %57)
  store i32 %58, ptr %6, align 4, !tbaa !5
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [100005 x i32], ptr @seq, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %64, label %101

64:                                               ; preds = %56
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %3, align 4, !tbaa !5
  %67 = load i32, ptr %6, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [100005 x i32], ptr @seq, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = load i32, ptr @m, align 4, !tbaa !5
  %72 = load i32, ptr %3, align 4, !tbaa !5
  %73 = add nsw i32 %71, %72
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [400005 x i32], ptr @u, i64 0, i64 %74
  store i32 %70, ptr %75, align 4, !tbaa !5
  %76 = load i32, ptr %5, align 4, !tbaa !5
  %77 = load i32, ptr @m, align 4, !tbaa !5
  %78 = load i32, ptr %3, align 4, !tbaa !5
  %79 = add nsw i32 %77, %78
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [400005 x i32], ptr @v, i64 0, i64 %80
  store i32 %76, ptr %81, align 4, !tbaa !5
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [100005 x i32], ptr @seq, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [100005 x i32], ptr @deg, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %87, align 4, !tbaa !5
  %90 = load i32, ptr %5, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [100005 x i32], ptr @deg, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %92, align 4, !tbaa !5
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [100005 x i32], ptr @seq, i64 0, i64 %96
  store i32 0, ptr %97, align 4, !tbaa !5
  %98 = load i32, ptr @m, align 4, !tbaa !5
  %99 = load i32, ptr %3, align 4, !tbaa !5
  %100 = add nsw i32 %98, %99
  call void @_Z3addi(i32 noundef %100)
  br label %106

101:                                              ; preds = %56
  %102 = load i32, ptr %5, align 4, !tbaa !5
  %103 = load i32, ptr %6, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [100005 x i32], ptr @seq, i64 0, i64 %104
  store i32 %102, ptr %105, align 4, !tbaa !5
  br label %106

106:                                              ; preds = %101, %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %110

107:                                              ; preds = %49
  %108 = load i32, ptr %4, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %4, align 4, !tbaa !5
  br label %110

110:                                              ; preds = %107, %106
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %5, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %5, align 4, !tbaa !5
  br label %44, !llvm.loop !11

114:                                              ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %129, %114
  %116 = load i32, ptr %7, align 4, !tbaa !5
  %117 = load i32, ptr @n, align 4, !tbaa !5
  %118 = icmp sle i32 %116, %117
  br i1 %118, label %120, label %119

119:                                              ; preds = %115
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %132

120:                                              ; preds = %115
  %121 = load i32, ptr %7, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [100005 x i32], ptr @p, i64 0, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = icmp ne i32 %124, -1
  br i1 %125, label %126, label %128

126:                                              ; preds = %120
  %127 = load i32, ptr %7, align 4, !tbaa !5
  call void @_Z3dfsii(i32 noundef %127, i32 noundef -1)
  br label %128

128:                                              ; preds = %126, %120
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %7, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %7, align 4, !tbaa !5
  br label %115, !llvm.loop !12

132:                                              ; preds = %119
  %133 = load i32, ptr %4, align 4, !tbaa !5
  %134 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %133)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %135

135:                                              ; preds = %150, %132
  %136 = load i32, ptr %8, align 4, !tbaa !5
  %137 = load i32, ptr @m, align 4, !tbaa !5
  %138 = icmp slt i32 %136, %137
  br i1 %138, label %140, label %139

139:                                              ; preds = %135
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %153

140:                                              ; preds = %135
  %141 = load i32, ptr %8, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [400005 x i8], ptr @dir, i64 0, i64 %142
  %144 = load i8, ptr %143, align 1, !tbaa !13, !range !15, !noundef !16
  %145 = trunc i8 %144 to i1
  %146 = zext i1 %145 to i64
  %147 = select i1 %145, i8 49, i8 48
  %148 = sext i8 %147 to i32
  %149 = call i32 @putchar(i32 noundef %148)
  br label %150

150:                                              ; preds = %140
  %151 = load i32, ptr %8, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %8, align 4, !tbaa !5
  br label %135, !llvm.loop !17

153:                                              ; preds = %139
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  ret i32 0
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #3

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

declare i32 @printf(ptr noundef, ...) #3

; Function Attrs: inlinehint mustprogress uwtable
declare i32 @putchar(i32 noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 norecurse 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 = { "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: write) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !10}


; 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"

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@u = external dso_local global [400005 x i32], align 16
@v = external dso_local global [400005 x i32], align 16
@deg = external dso_local local_unnamed_addr global [100005 x i32], align 16
@dsu = external dso_local local_unnamed_addr global [100005 x i32], align 16
@seq = external dso_local local_unnamed_addr global [100005 x i32], align 16
@p = external dso_local local_unnamed_addr global [100005 x i32], align 16
@dir = external dso_local local_unnamed_addr global [400005 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400020) @p, i8 -1, i64 400020, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400020) @dsu, i8 -1, i64 400020, i1 false)
  %2 = load i32, ptr @m, align 4, !tbaa !5
  %.not45 = icmp slt i32 %2, 1
  br i1 %.not45, label %.preheader44, label %.lr.ph

.preheader44:                                     ; preds = %.lr.ph, %0
  %3 = load i32, ptr @n, align 4, !tbaa !5
  %.not3947 = icmp slt i32 %3, 1
  br i1 %.not3947, label %._crit_edge, label %.lr.ph51

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %4 = getelementptr inbounds i32, ptr @u, i64 %indvars.iv
  %5 = getelementptr inbounds i32, ptr @v, i64 %indvars.iv
  %6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %7 = load i32, ptr %4, align 4, !tbaa !5
  %8 = sext i32 %7 to i64
  %9 = getelementptr inbounds [100005 x i32], ptr @deg, i64 0, i64 %8
  %10 = load i32, ptr %9, align 4, !tbaa !5
  %11 = add nsw i32 %10, 1
  store i32 %11, ptr %9, align 4, !tbaa !5
  %12 = load i32, ptr %5, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds [100005 x i32], ptr @deg, i64 0, i64 %13
  %15 = load i32, ptr %14, align 4, !tbaa !5
  %16 = add nsw i32 %15, 1
  store i32 %16, ptr %14, align 4, !tbaa !5
  %17 = trunc nuw nsw i64 %indvars.iv to i32
  tail call void @_Z3addi(i32 noundef %17)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %18 = load i32, ptr @m, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %.not.not = icmp slt i64 %indvars.iv, %19
  br i1 %.not.not, label %.lr.ph, label %.preheader44, !llvm.loop !9

.preheader:                                       ; preds = %45
  %.not4052 = icmp slt i32 %46, 1
  br i1 %.not4052, label %._crit_edge, label %.lr.ph54

.lr.ph51:                                         ; preds = %.preheader44, %45
  %indvars.iv60 = phi i64 [ %indvars.iv.next61, %45 ], [ 1, %.preheader44 ]
  %.03549 = phi i32 [ %.1, %45 ], [ 0, %.preheader44 ]
  %.03648 = phi i32 [ %.2, %45 ], [ 0, %.preheader44 ]
  %20 = getelementptr inbounds [100005 x i32], ptr @deg, i64 0, i64 %indvars.iv60
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = and i32 %21, 1
  %.not42 = icmp eq i32 %22, 0
  br i1 %.not42, label %43, label %23

23:                                               ; preds = %.lr.ph51
  %24 = trunc nuw nsw i64 %indvars.iv60 to i32
  %25 = tail call noundef i32 @_Z8dsu_findi(i32 noundef %24)
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [100005 x i32], ptr @seq, i64 0, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %.not43 = icmp eq i32 %28, 0
  br i1 %.not43, label %42, label %29

29:                                               ; preds = %23
  %30 = add nsw i32 %.03648, 1
  %31 = load i32, ptr @m, align 4, !tbaa !5
  %32 = add nsw i32 %31, %30
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [400005 x i32], ptr @u, i64 0, i64 %33
  store i32 %28, ptr %34, align 4, !tbaa !5
  %35 = getelementptr inbounds [400005 x i32], ptr @v, i64 0, i64 %33
  store i32 %24, ptr %35, align 4, !tbaa !5
  %36 = sext i32 %28 to i64
  %37 = getelementptr inbounds [100005 x i32], ptr @deg, i64 0, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %37, align 4, !tbaa !5
  %40 = load i32, ptr %20, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %20, align 4, !tbaa !5
  store i32 0, ptr %27, align 4, !tbaa !5
  tail call void @_Z3addi(i32 noundef %32)
  br label %45

42:                                               ; preds = %23
  store i32 %24, ptr %27, align 4, !tbaa !5
  br label %45

43:                                               ; preds = %.lr.ph51
  %44 = add nsw i32 %.03549, 1
  br label %45

45:                                               ; preds = %29, %42, %43
  %.2 = phi i32 [ %.03648, %43 ], [ %30, %29 ], [ %.03648, %42 ]
  %.1 = phi i32 [ %44, %43 ], [ %.03549, %29 ], [ %.03549, %42 ]
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %46 = load i32, ptr @n, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %.not39.not = icmp slt i64 %indvars.iv60, %47
  br i1 %.not39.not, label %.lr.ph51, label %.preheader, !llvm.loop !11

._crit_edge:                                      ; preds = %56, %.preheader44, %.preheader
  %.035.lcssa71 = phi i32 [ %.1, %.preheader ], [ 0, %.preheader44 ], [ %.1, %56 ]
  %48 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.035.lcssa71)
  %49 = load i32, ptr @m, align 4, !tbaa !5
  %50 = icmp sgt i32 %49, 0
  br i1 %50, label %.lr.ph57, label %._crit_edge58

.lr.ph54:                                         ; preds = %.preheader, %56
  %51 = phi i32 [ %57, %56 ], [ %46, %.preheader ]
  %indvars.iv63 = phi i64 [ %indvars.iv.next64, %56 ], [ 1, %.preheader ]
  %52 = getelementptr inbounds [100005 x i32], ptr @p, i64 0, i64 %indvars.iv63
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %.not41 = icmp eq i32 %53, -1
  br i1 %.not41, label %56, label %54

54:                                               ; preds = %.lr.ph54
  %55 = trunc nuw nsw i64 %indvars.iv63 to i32
  tail call void @_Z3dfsii(i32 noundef %55, i32 noundef -1)
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %.lr.ph54, %54
  %57 = phi i32 [ %51, %.lr.ph54 ], [ %.pre, %54 ]
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %58 = sext i32 %57 to i64
  %.not40.not = icmp slt i64 %indvars.iv63, %58
  br i1 %.not40.not, label %.lr.ph54, label %._crit_edge, !llvm.loop !12

._crit_edge58:                                    ; preds = %.lr.ph57, %._crit_edge
  ret i32 0

.lr.ph57:                                         ; preds = %._crit_edge, %.lr.ph57
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %.lr.ph57 ], [ 0, %._crit_edge ]
  %59 = getelementptr inbounds [400005 x i8], ptr @dir, i64 0, i64 %indvars.iv66
  %60 = load i8, ptr %59, align 1, !tbaa !13, !range !15, !noundef !16
  %61 = trunc nuw i8 %60 to i1
  %62 = select i1 %61, i32 49, i32 48
  %63 = tail call i32 @putchar(i32 noundef %62)
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %64 = load i32, ptr @m, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = icmp slt i64 %indvars.iv.next67, %65
  br i1 %66, label %.lr.ph57, label %._crit_edge58, !llvm.loop !17
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nofree nounwind uwtable
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4

attributes #0 = { 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 #1 = { mustprogress norecurse 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 = { nofree 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { inlinehint mustprogress nofree 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" }

!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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !10}


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