; LLVM IR from tangjz/acm-icpc :: self_training/2014-12-07 (I)

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

@e = external dso_local global [23333 x %struct.Edge], align 16
@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@lnk = external dso_local global [6666 x i32], align 16
@pre = external dso_local global [6666 x i32], align 16
@cnt = external dso_local global i32, align 4
@bcc = external dso_local global [6666 x i32], align 16
@d = external dso_local global [6666 x i32], align 16
@ans = external dso_local global i32, align 4
@used = external dso_local global [23333 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z6tarjanii(i32 noundef, 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
declare dso_local void @_Z3dfsi(i32 noundef) #0

; 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 %struct.Edge, align 4
  %5 = alloca %struct.Edge, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %12

12:                                               ; preds = %143, %0
  %13 = load i32, ptr @t, align 4, !tbaa !5
  %14 = add nsw i32 %13, -1
  store i32 %14, ptr @t, align 4, !tbaa !5
  %15 = icmp ne i32 %13, 0
  br i1 %15, label %16, label %148

16:                                               ; preds = %12
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @m)
  store i32 0, ptr @cnt, align 4, !tbaa !5
  store i32 0, ptr @tot, align 4, !tbaa !5
  store i32 0, ptr @ans, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 16 @d, i8 0, i64 26664, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @pre, i8 0, i64 26664, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @bcc, i8 0, i64 26664, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @lnk, i8 -1, i64 26664, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @used, i8 0, i64 23333, i1 false)
  br label %18

18:                                               ; preds = %22, %16
  %19 = load i32, ptr @m, align 4, !tbaa !5
  %20 = add nsw i32 %19, -1
  store i32 %20, ptr @m, align 4, !tbaa !5
  %21 = icmp ne i32 %19, 0
  br i1 %21, label %22, label %54

22:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %2, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %24 = getelementptr inbounds %struct.Edge, ptr %4, i32 0, i32 0
  %25 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %25, ptr %24, align 4, !tbaa !9
  %26 = getelementptr inbounds %struct.Edge, ptr %4, i32 0, i32 1
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [6666 x i32], ptr @lnk, i64 0, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !5
  store i32 %30, ptr %26, align 4, !tbaa !11
  %31 = load i32, ptr @tot, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [23333 x %struct.Edge], ptr @e, i64 0, i64 %32
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %33, ptr align 4 %4, i64 8, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  %34 = load i32, ptr @tot, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr @tot, align 4, !tbaa !5
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [6666 x i32], ptr @lnk, i64 0, i64 %37
  store i32 %34, ptr %38, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %39 = getelementptr inbounds %struct.Edge, ptr %5, i32 0, i32 0
  %40 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %40, ptr %39, align 4, !tbaa !9
  %41 = getelementptr inbounds %struct.Edge, ptr %5, i32 0, i32 1
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [6666 x i32], ptr @lnk, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  store i32 %45, ptr %41, align 4, !tbaa !11
  %46 = load i32, ptr @tot, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [23333 x %struct.Edge], ptr @e, i64 0, i64 %47
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %48, ptr align 4 %5, i64 8, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  %49 = load i32, ptr @tot, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr @tot, align 4, !tbaa !5
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [6666 x i32], ptr @lnk, i64 0, i64 %52
  store i32 %49, ptr %53, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %18, !llvm.loop !13

54:                                               ; preds = %18
  store i32 0, ptr @tot, align 4, !tbaa !5
  %55 = call noundef i32 @_Z6tarjanii(i32 noundef 1, i32 noundef -1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %72, %54
  %57 = load i32, ptr %6, align 4, !tbaa !5
  %58 = load i32, ptr @n, align 4, !tbaa !5
  %59 = icmp sle i32 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %75

61:                                               ; preds = %56
  %62 = load i32, ptr %6, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [6666 x i32], ptr @bcc, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %71, label %67

67:                                               ; preds = %61
  %68 = load i32, ptr @cnt, align 4, !tbaa !5
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr @cnt, align 4, !tbaa !5
  %70 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z3dfsi(i32 noundef %70)
  br label %71

71:                                               ; preds = %67, %61
  br label %72

72:                                               ; preds = %71
  %73 = load i32, ptr %6, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %6, align 4, !tbaa !5
  br label %56, !llvm.loop !15

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

76:                                               ; preds = %121, %75
  %77 = load i32, ptr %7, align 4, !tbaa !5
  %78 = load i32, ptr @n, align 4, !tbaa !5
  %79 = icmp sle i32 %77, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %76
  store i32 9, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %124

81:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %82 = load i32, ptr %7, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [6666 x i32], ptr @lnk, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  store i32 %85, ptr %9, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %114, %81
  %87 = load i32, ptr %9, align 4, !tbaa !5
  %88 = icmp ne i32 %87, -1
  br i1 %88, label %90, label %89

89:                                               ; preds = %86
  store i32 12, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %120

90:                                               ; preds = %86
  %91 = load i32, ptr %7, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [6666 x i32], ptr @bcc, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = load i32, ptr %9, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [23333 x %struct.Edge], ptr @e, i64 0, i64 %96
  %98 = getelementptr inbounds %struct.Edge, ptr %97, i32 0, i32 0
  %99 = load i32, ptr %98, align 8, !tbaa !9
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [6666 x i32], ptr @bcc, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = icmp ne i32 %94, %102
  br i1 %103, label %104, label %113

104:                                              ; preds = %90
  %105 = load i32, ptr %7, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [6666 x i32], ptr @bcc, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [6666 x i32], ptr @d, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %110, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %104, %90
  br label %114

114:                                              ; preds = %113
  %115 = load i32, ptr %9, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [23333 x %struct.Edge], ptr @e, i64 0, i64 %116
  %118 = getelementptr inbounds %struct.Edge, ptr %117, i32 0, i32 1
  %119 = load i32, ptr %118, align 4, !tbaa !11
  store i32 %119, ptr %9, align 4, !tbaa !5
  br label %86, !llvm.loop !16

120:                                              ; preds = %89
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %7, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %7, align 4, !tbaa !5
  br label %76, !llvm.loop !17

124:                                              ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %125

125:                                              ; preds = %140, %124
  %126 = load i32, ptr %10, align 4, !tbaa !5
  %127 = load i32, ptr @cnt, align 4, !tbaa !5
  %128 = icmp sle i32 %126, %127
  br i1 %128, label %130, label %129

129:                                              ; preds = %125
  store i32 15, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %143

130:                                              ; preds = %125
  %131 = load i32, ptr %10, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [6666 x i32], ptr @d, i64 0, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = icmp eq i32 %134, 1
  br i1 %135, label %136, label %139

136:                                              ; preds = %130
  %137 = load i32, ptr @ans, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr @ans, align 4, !tbaa !5
  br label %139

139:                                              ; preds = %136, %130
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr %10, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %10, align 4, !tbaa !5
  br label %125, !llvm.loop !18

143:                                              ; preds = %129
  %144 = load i32, ptr @ans, align 4, !tbaa !5
  %145 = add nsw i32 %144, 1
  %146 = ashr i32 %145, 1
  %147 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %146)
  br label %12, !llvm.loop !19

148:                                              ; preds = %12
  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

; 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) #5

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!10, !6, i64 0}
!10 = !{!"_ZTS4Edge", !6, i64 0, !6, i64 4}
!11 = !{!10, !6, i64 4}
!12 = !{i64 0, i64 4, !5, i64 4, i64 4, !5}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}


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

@e = external dso_local local_unnamed_addr global [23333 x %struct.Edge], align 16
@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@lnk = external dso_local local_unnamed_addr global [6666 x i32], align 16
@pre = external dso_local local_unnamed_addr global [6666 x i32], align 16
@cnt = external dso_local local_unnamed_addr global i32, align 4
@bcc = external dso_local local_unnamed_addr global [6666 x i32], align 16
@d = external dso_local local_unnamed_addr global [6666 x i32], align 16
@ans = external dso_local local_unnamed_addr global i32, align 4
@used = external dso_local local_unnamed_addr global [23333 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z6tarjanii(i32 noundef, 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
declare dso_local void @_Z3dfsi(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %4 = load i32, ptr @t, align 4, !tbaa !5
  %5 = add nsw i32 %4, -1
  store i32 %5, ptr @t, align 4, !tbaa !5
  %.not47 = icmp eq i32 %4, 0
  br i1 %.not47, label %._crit_edge50, label %.lr.ph49

.lr.ph49:                                         ; preds = %0, %._crit_edge46
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @m)
  store i32 0, ptr @cnt, align 4, !tbaa !5
  store i32 0, ptr @tot, align 4, !tbaa !5
  store i32 0, ptr @ans, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(26664) @d, i8 0, i64 26664, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(26664) @pre, i8 0, i64 26664, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(26664) @bcc, i8 0, i64 26664, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(26664) @lnk, i8 -1, i64 26664, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(23333) @used, i8 0, i64 23333, i1 false)
  %7 = load i32, ptr @m, align 4, !tbaa !5
  %8 = add nsw i32 %7, -1
  store i32 %8, ptr @m, align 4, !tbaa !5
  %.not2129 = icmp eq i32 %7, 0
  br i1 %.not2129, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph49, %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = load i32, ptr %1, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds [6666 x i32], ptr @lnk, i64 0, i64 %12
  %14 = load i32, ptr %13, align 4, !tbaa !5
  %15 = load i32, ptr @tot, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [23333 x %struct.Edge], ptr @e, i64 0, i64 %16
  store i32 %10, ptr %17, align 8, !tbaa !5
  %.sroa.416.0..sroa_idx = getelementptr inbounds i8, ptr %17, i64 4
  store i32 %14, ptr %.sroa.416.0..sroa_idx, align 4, !tbaa !5
  %18 = add nsw i32 %15, 1
  store i32 %15, ptr %13, align 4, !tbaa !5
  %19 = sext i32 %10 to i64
  %20 = getelementptr inbounds [6666 x i32], ptr @lnk, i64 0, i64 %19
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = sext i32 %18 to i64
  %23 = getelementptr inbounds [23333 x %struct.Edge], ptr @e, i64 0, i64 %22
  store i32 %11, ptr %23, align 8, !tbaa !5
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %23, i64 4
  store i32 %21, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !5
  %24 = add nsw i32 %15, 2
  store i32 %24, ptr @tot, align 4, !tbaa !5
  store i32 %18, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %25 = load i32, ptr @m, align 4, !tbaa !5
  %26 = add nsw i32 %25, -1
  store i32 %26, ptr @m, align 4, !tbaa !5
  %.not21 = icmp eq i32 %25, 0
  br i1 %.not21, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph49
  store i32 0, ptr @tot, align 4, !tbaa !5
  %27 = call noundef i32 @_Z6tarjanii(i32 noundef 1, i32 noundef -1)
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %.not2230 = icmp slt i32 %28, 1
  br i1 %.not2230, label %.preheader, label %.lr.ph33

.preheader28:                                     ; preds = %37
  %.not2340 = icmp slt i32 %38, 1
  br i1 %.not2340, label %.preheader, label %.lr.ph42.preheader

.lr.ph42.preheader:                               ; preds = %.preheader28
  %29 = add nuw i32 %38, 1
  %wide.trip.count = zext i32 %29 to i64
  br label %.lr.ph42

.lr.ph33:                                         ; preds = %._crit_edge, %37
  %30 = phi i32 [ %38, %37 ], [ %28, %._crit_edge ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %37 ], [ 1, %._crit_edge ]
  %31 = getelementptr inbounds [6666 x i32], ptr @bcc, i64 0, i64 %indvars.iv
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %.not27 = icmp eq i32 %32, 0
  br i1 %.not27, label %33, label %37

33:                                               ; preds = %.lr.ph33
  %34 = load i32, ptr @cnt, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr @cnt, align 4, !tbaa !5
  %36 = trunc nuw nsw i64 %indvars.iv to i32
  call void @_Z3dfsi(i32 noundef %36)
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %.lr.ph33, %33
  %38 = phi i32 [ %30, %.lr.ph33 ], [ %.pre, %33 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %39 = sext i32 %38 to i64
  %.not22.not = icmp slt i64 %indvars.iv, %39
  br i1 %.not22.not, label %.lr.ph33, label %.preheader28, !llvm.loop !11

.preheader:                                       ; preds = %._crit_edge39, %._crit_edge, %.preheader28
  %40 = load i32, ptr @cnt, align 4, !tbaa !5
  %ans.promoted = load i32, ptr @ans, align 4, !tbaa !5
  %.not2443 = icmp slt i32 %40, 1
  br i1 %.not2443, label %._crit_edge46, label %.lr.ph45.preheader

.lr.ph45.preheader:                               ; preds = %.preheader
  %41 = zext nneg i32 %40 to i64
  %xtraiter = and i64 %41, 1
  %42 = icmp eq i32 %40, 1
  br i1 %42, label %._crit_edge46.loopexit.unr-lcssa, label %.lr.ph45.preheader.new

.lr.ph45.preheader.new:                           ; preds = %.lr.ph45.preheader
  %unroll_iter = and i64 %41, 2147483646
  br label %.lr.ph45

.lr.ph42:                                         ; preds = %.lr.ph42.preheader, %._crit_edge39
  %indvars.iv53 = phi i64 [ 1, %.lr.ph42.preheader ], [ %indvars.iv.next54, %._crit_edge39 ]
  %43 = getelementptr inbounds [6666 x i32], ptr @lnk, i64 0, i64 %indvars.iv53
  %.01734 = load i32, ptr %43, align 4, !tbaa !5
  %.not2535 = icmp eq i32 %.01734, -1
  br i1 %.not2535, label %._crit_edge39, label %.lr.ph38

.lr.ph38:                                         ; preds = %.lr.ph42
  %44 = getelementptr inbounds [6666 x i32], ptr @bcc, i64 0, i64 %indvars.iv53
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [6666 x i32], ptr @d, i64 0, i64 %46
  br label %48

._crit_edge39:                                    ; preds = %58, %.lr.ph42
  %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next54, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %.lr.ph42, !llvm.loop !12

48:                                               ; preds = %.lr.ph38, %58
  %.01736 = phi i32 [ %.01734, %.lr.ph38 ], [ %.017, %58 ]
  %49 = sext i32 %.01736 to i64
  %50 = getelementptr inbounds [23333 x %struct.Edge], ptr @e, i64 0, i64 %49
  %51 = load i32, ptr %50, align 8, !tbaa !13
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [6666 x i32], ptr @bcc, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %.not26 = icmp eq i32 %45, %54
  br i1 %.not26, label %58, label %55

55:                                               ; preds = %48
  %56 = load i32, ptr %47, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %47, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %48, %55
  %59 = getelementptr inbounds i8, ptr %50, i64 4
  %.017 = load i32, ptr %59, align 4, !tbaa !5
  %.not25 = icmp eq i32 %.017, -1
  br i1 %.not25, label %._crit_edge39, label %48, !llvm.loop !15

._crit_edge46.loopexit.unr-lcssa:                 ; preds = %83, %.lr.ph45.preheader
  %.lcssa65.ph = phi i32 [ poison, %.lr.ph45.preheader ], [ %84, %83 ]
  %indvars.iv56.unr = phi i64 [ 1, %.lr.ph45.preheader ], [ %indvars.iv.next57.1, %83 ]
  %.unr = phi i32 [ %ans.promoted, %.lr.ph45.preheader ], [ %84, %83 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge46, label %.lr.ph45.epil

.lr.ph45.epil:                                    ; preds = %._crit_edge46.loopexit.unr-lcssa
  %60 = getelementptr inbounds [6666 x i32], ptr @d, i64 0, i64 %indvars.iv56.unr
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = icmp eq i32 %61, 1
  br i1 %62, label %63, label %._crit_edge46

63:                                               ; preds = %.lr.ph45.epil
  %64 = add nsw i32 %.unr, 1
  store i32 %64, ptr @ans, align 4, !tbaa !5
  br label %._crit_edge46

._crit_edge46:                                    ; preds = %._crit_edge46.loopexit.unr-lcssa, %63, %.lr.ph45.epil, %.preheader
  %65 = phi i32 [ %ans.promoted, %.preheader ], [ %.lcssa65.ph, %._crit_edge46.loopexit.unr-lcssa ], [ %.unr, %.lr.ph45.epil ], [ %64, %63 ]
  %66 = add nsw i32 %65, 1
  %67 = ashr i32 %66, 1
  %68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %67)
  %69 = load i32, ptr @t, align 4, !tbaa !5
  %70 = add nsw i32 %69, -1
  store i32 %70, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %69, 0
  br i1 %.not, label %._crit_edge50, label %.lr.ph49, !llvm.loop !16

.lr.ph45:                                         ; preds = %83, %.lr.ph45.preheader.new
  %indvars.iv56 = phi i64 [ 1, %.lr.ph45.preheader.new ], [ %indvars.iv.next57.1, %83 ]
  %71 = phi i32 [ %ans.promoted, %.lr.ph45.preheader.new ], [ %84, %83 ]
  %niter = phi i64 [ 0, %.lr.ph45.preheader.new ], [ %niter.next.1, %83 ]
  %72 = getelementptr inbounds [6666 x i32], ptr @d, i64 0, i64 %indvars.iv56
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = icmp eq i32 %73, 1
  br i1 %74, label %75, label %.lr.ph45.1

75:                                               ; preds = %.lr.ph45
  %76 = add nsw i32 %71, 1
  store i32 %76, ptr @ans, align 4, !tbaa !5
  br label %.lr.ph45.1

.lr.ph45.1:                                       ; preds = %.lr.ph45, %75
  %77 = phi i32 [ %71, %.lr.ph45 ], [ %76, %75 ]
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
  %78 = getelementptr inbounds [6666 x i32], ptr @d, i64 0, i64 %indvars.iv.next57
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = icmp eq i32 %79, 1
  br i1 %80, label %81, label %83

81:                                               ; preds = %.lr.ph45.1
  %82 = add nsw i32 %77, 1
  store i32 %82, ptr @ans, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %81, %.lr.ph45.1
  %84 = phi i32 [ %77, %.lr.ph45.1 ], [ %82, %81 ]
  %indvars.iv.next57.1 = add nuw nsw i64 %indvars.iv56, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge46.loopexit.unr-lcssa, label %.lr.ph45, !llvm.loop !17

._crit_edge50:                                    ; preds = %._crit_edge46, %0
  ret i32 0
}

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

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

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

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTS4Edge", !6, i64 0, !6, i64 4}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


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