; LLVM IR from tangjz/acm-icpc :: hdu (5263)

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

%class.MinCost_MaxFlow = type { [6000 x %"struct.MinCost_MaxFlow::Edge"], i32, i32, i32, i32, [60 x i32], [60 x i32], [60 x i32], [60 x i32], [60 x i32], [60 x i32], i32, i32 }
%"struct.MinCost_MaxFlow::Edge" = type { i32, i32, i32, i32, i32, i32 }

@tt = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@deg = external dso_local global [60 x i32], align 16
@u = external dso_local global [3000 x i32], align 16
@v = external dso_local global [3000 x i32], align 16
@str = external dso_local global [60 x [21 x i8]], align 16
@NetWork = external dso_local global %class.MinCost_MaxFlow, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca [21 x i8], align 16
  %6 = alloca [21 x i8], align 16
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @tt)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %163, %0
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = load i32, ptr @tt, align 4, !tbaa !5
  %16 = icmp sle i32 %14, %15
  br i1 %16, label %18, label %17

17:                                               ; preds = %13
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %166

18:                                               ; preds = %13
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %19)
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @n, ptr noundef @m, ptr noundef @q)
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 16 @deg, i8 0, i64 240, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %137, %18
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = load i32, ptr @m, align 4, !tbaa !5
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %22
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %140

27:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 21, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 21, ptr %6) #7
  %28 = getelementptr inbounds [21 x i8], ptr %5, i64 0, i64 0
  %29 = getelementptr inbounds [21 x i8], ptr %6, i64 0, i64 0
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %28, ptr noundef %29)
  %31 = load i32, ptr %4, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [3000 x i32], ptr @v, i64 0, i64 %32
  store i32 -1, ptr %33, align 4, !tbaa !5
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [3000 x i32], ptr @u, i64 0, i64 %35
  store i32 -1, ptr %36, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %56, %27
  %38 = load i32, ptr %7, align 4, !tbaa !5
  %39 = load i32, ptr @tot, align 4, !tbaa !5
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  store i32 8, ptr %3, align 4
  br label %59

42:                                               ; preds = %37
  %43 = load i32, ptr %7, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [60 x [21 x i8]], ptr @str, i64 0, i64 %44
  %46 = getelementptr inbounds [21 x i8], ptr %45, i64 0, i64 0
  %47 = getelementptr inbounds [21 x i8], ptr %5, i64 0, i64 0
  %48 = call i32 @strcmp(ptr noundef %46, ptr noundef %47) #8
  %49 = icmp eq i32 %48, 0
  br i1 %49, label %50, label %55

50:                                               ; preds = %42
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [3000 x i32], ptr @u, i64 0, i64 %53
  store i32 %51, ptr %54, align 4, !tbaa !5
  store i32 8, ptr %3, align 4
  br label %59

55:                                               ; preds = %42
  br label %56

56:                                               ; preds = %55
  %57 = load i32, ptr %7, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %7, align 4, !tbaa !5
  br label %37, !llvm.loop !9

59:                                               ; preds = %50, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %60

60:                                               ; preds = %59
  %61 = load i32, ptr %4, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [3000 x i32], ptr @u, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = icmp eq i32 %64, -1
  br i1 %65, label %66, label %78

66:                                               ; preds = %60
  %67 = load i32, ptr @tot, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [60 x [21 x i8]], ptr @str, i64 0, i64 %68
  %70 = getelementptr inbounds [21 x i8], ptr %69, i64 0, i64 0
  %71 = getelementptr inbounds [21 x i8], ptr %5, i64 0, i64 0
  %72 = call ptr @strcpy(ptr noundef %70, ptr noundef %71) #7
  %73 = load i32, ptr @tot, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr @tot, align 4, !tbaa !5
  %75 = load i32, ptr %4, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [3000 x i32], ptr @u, i64 0, i64 %76
  store i32 %73, ptr %77, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %66, %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %98, %78
  %80 = load i32, ptr %8, align 4, !tbaa !5
  %81 = load i32, ptr @tot, align 4, !tbaa !5
  %82 = icmp slt i32 %80, %81
  br i1 %82, label %84, label %83

83:                                               ; preds = %79
  store i32 11, ptr %3, align 4
  br label %101

84:                                               ; preds = %79
  %85 = load i32, ptr %8, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [60 x [21 x i8]], ptr @str, i64 0, i64 %86
  %88 = getelementptr inbounds [21 x i8], ptr %87, i64 0, i64 0
  %89 = getelementptr inbounds [21 x i8], ptr %6, i64 0, i64 0
  %90 = call i32 @strcmp(ptr noundef %88, ptr noundef %89) #8
  %91 = icmp eq i32 %90, 0
  br i1 %91, label %92, label %97

92:                                               ; preds = %84
  %93 = load i32, ptr %8, align 4, !tbaa !5
  %94 = load i32, ptr %4, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [3000 x i32], ptr @v, i64 0, i64 %95
  store i32 %93, ptr %96, align 4, !tbaa !5
  store i32 11, ptr %3, align 4
  br label %101

97:                                               ; preds = %84
  br label %98

98:                                               ; preds = %97
  %99 = load i32, ptr %8, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %8, align 4, !tbaa !5
  br label %79, !llvm.loop !11

101:                                              ; preds = %92, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %102

102:                                              ; preds = %101
  %103 = load i32, ptr %4, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [3000 x i32], ptr @v, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = icmp eq i32 %106, -1
  br i1 %107, label %108, label %120

108:                                              ; preds = %102
  %109 = load i32, ptr @tot, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [60 x [21 x i8]], ptr @str, i64 0, i64 %110
  %112 = getelementptr inbounds [21 x i8], ptr %111, i64 0, i64 0
  %113 = getelementptr inbounds [21 x i8], ptr %6, i64 0, i64 0
  %114 = call ptr @strcpy(ptr noundef %112, ptr noundef %113) #7
  %115 = load i32, ptr @tot, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr @tot, align 4, !tbaa !5
  %117 = load i32, ptr %4, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [3000 x i32], ptr @v, i64 0, i64 %118
  store i32 %115, ptr %119, align 4, !tbaa !5
  br label %120

120:                                              ; preds = %108, %102
  %121 = load i32, ptr %4, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [3000 x i32], ptr @u, i64 0, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [60 x i32], ptr @deg, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %126, align 4, !tbaa !5
  %129 = load i32, ptr %4, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [3000 x i32], ptr @v, i64 0, i64 %130
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [60 x i32], ptr @deg, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = add nsw i32 %135, -1
  store i32 %136, ptr %134, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 21, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 21, ptr %5) #7
  br label %137

137:                                              ; preds = %120
  %138 = load i32, ptr %4, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %4, align 4, !tbaa !5
  br label %22, !llvm.loop !12

140:                                              ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %141 = load i32, ptr @n, align 4, !tbaa !5
  %142 = sub nsw i32 %141, 1
  store i32 %142, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  br label %143

143:                                              ; preds = %159, %140
  %144 = load i32, ptr %9, align 4, !tbaa !5
  %145 = load i32, ptr %10, align 4, !tbaa !5
  %146 = icmp slt i32 %144, %145
  br i1 %146, label %147, label %160

147:                                              ; preds = %143
  %148 = load i32, ptr %9, align 4, !tbaa !5
  %149 = load i32, ptr %10, align 4, !tbaa !5
  %150 = add nsw i32 %148, %149
  %151 = ashr i32 %150, 1
  store i32 %151, ptr %11, align 4, !tbaa !5
  %152 = load i32, ptr %11, align 4, !tbaa !5
  %153 = call noundef zeroext i1 @_ZN15MinCost_MaxFlow5checkEi(ptr noundef nonnull align 4 dereferenceable(145464) @NetWork, i32 noundef %152)
  br i1 %153, label %154, label %156

154:                                              ; preds = %147
  %155 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %155, ptr %10, align 4, !tbaa !5
  br label %159

156:                                              ; preds = %147
  %157 = load i32, ptr %11, align 4, !tbaa !5
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %9, align 4, !tbaa !5
  br label %159

159:                                              ; preds = %156, %154
  br label %143, !llvm.loop !13

160:                                              ; preds = %143
  %161 = load i32, ptr %9, align 4, !tbaa !5
  %162 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %161)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %163

163:                                              ; preds = %160
  %164 = load i32, ptr %2, align 4, !tbaa !5
  %165 = add nsw i32 %164, 1
  store i32 %165, ptr %2, align 4, !tbaa !5
  br label %13, !llvm.loop !14

166:                                              ; preds = %17
  ret i32 0
}

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

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

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

; 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: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #4

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

; Function Attrs: nounwind
declare ptr @strcpy(ptr noundef, ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN15MinCost_MaxFlow5checkEi(ptr noundef nonnull align 4 dereferenceable(145464), i32 noundef) #6 align 2

attributes #0 = { 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 #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind willreturn memory(read) "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 "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 = { 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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }

!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 = distinct !{!13, !10}
!14 = distinct !{!14, !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"

%class.MinCost_MaxFlow = type { [6000 x %"struct.MinCost_MaxFlow::Edge"], i32, i32, i32, i32, [60 x i32], [60 x i32], [60 x i32], [60 x i32], [60 x i32], [60 x i32], i32, i32 }
%"struct.MinCost_MaxFlow::Edge" = type { i32, i32, i32, i32, i32, i32 }

@tt = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@deg = external dso_local local_unnamed_addr global [60 x i32], align 16
@u = external dso_local local_unnamed_addr global [3000 x i32], align 16
@v = external dso_local local_unnamed_addr global [3000 x i32], align 16
@str = external dso_local global [60 x [21 x i8]], align 16
@NetWork = external dso_local global %class.MinCost_MaxFlow, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca [21 x i8], align 16
  %2 = alloca [21 x i8], align 16
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @tt)
  %4 = load i32, ptr @tt, align 4, !tbaa !5
  %.not60 = icmp slt i32 %4, 1
  br i1 %.not60, label %._crit_edge64, label %.lr.ph63

._crit_edge64:                                    ; preds = %._crit_edge59, %0
  ret i32 0

.lr.ph63:                                         ; preds = %0, %._crit_edge59
  %.061 = phi i32 [ %56, %._crit_edge59 ], [ 1, %0 ]
  %5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.061)
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @q)
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(240) @deg, i8 0, i64 240, i1 false)
  %7 = load i32, ptr @m, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph53, label %._crit_edge54

._crit_edge54:                                    ; preds = %38, %.lr.ph63
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 1
  br i1 %10, label %.lr.ph58.preheader, label %._crit_edge59

.lr.ph58.preheader:                               ; preds = %._crit_edge54
  %11 = add nsw i32 %9, -1
  br label %.lr.ph58

.lr.ph53:                                         ; preds = %.lr.ph63, %38
  %indvars.iv73 = phi i64 [ %indvars.iv.next74, %38 ], [ 0, %.lr.ph63 ]
  call void @llvm.lifetime.start.p0(i64 21, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 21, ptr nonnull %2) #7
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %13 = getelementptr inbounds [3000 x i32], ptr @v, i64 0, i64 %indvars.iv73
  %14 = getelementptr inbounds [3000 x i32], ptr @u, i64 0, i64 %indvars.iv73
  %15 = load i32, ptr @tot, align 4, !tbaa !5
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.lr.ph53
  %wide.trip.count = zext nneg i32 %15 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %21
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %21 ]
  %17 = getelementptr inbounds [60 x [21 x i8]], ptr @str, i64 0, i64 %indvars.iv
  %18 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %17, ptr noundef nonnull dereferenceable(1) %1) #8
  %19 = icmp eq i32 %18, 0
  br i1 %19, label %.thread, label %21

.thread:                                          ; preds = %.lr.ph
  %20 = trunc nuw nsw i64 %indvars.iv to i32
  br label %26

21:                                               ; preds = %.lr.ph
  %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 %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %21, %.lr.ph53
  %22 = sext i32 %15 to i64
  %23 = getelementptr inbounds [60 x [21 x i8]], ptr @str, i64 0, i64 %22
  %24 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %23, ptr noundef nonnull dereferenceable(1) %1) #7
  %25 = add nsw i32 %15, 1
  store i32 %25, ptr @tot, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %.thread, %._crit_edge
  %storemerge = phi i32 [ %15, %._crit_edge ], [ %20, %.thread ]
  %27 = phi i32 [ %25, %._crit_edge ], [ %15, %.thread ]
  store i32 %storemerge, ptr %14, align 4, !tbaa !5
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %.lr.ph48.preheader, label %._crit_edge49

.lr.ph48.preheader:                               ; preds = %26
  %wide.trip.count71 = zext nneg i32 %27 to i64
  br label %.lr.ph48

.lr.ph48:                                         ; preds = %.lr.ph48.preheader, %33
  %indvars.iv68 = phi i64 [ 0, %.lr.ph48.preheader ], [ %indvars.iv.next69, %33 ]
  %29 = getelementptr inbounds [60 x [21 x i8]], ptr @str, i64 0, i64 %indvars.iv68
  %30 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %29, ptr noundef nonnull dereferenceable(1) %2) #8
  %31 = icmp eq i32 %30, 0
  br i1 %31, label %.thread39, label %33

.thread39:                                        ; preds = %.lr.ph48
  %32 = trunc nuw nsw i64 %indvars.iv68 to i32
  br label %38

33:                                               ; preds = %.lr.ph48
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %exitcond72.not = icmp eq i64 %indvars.iv.next69, %wide.trip.count71
  br i1 %exitcond72.not, label %._crit_edge49, label %.lr.ph48, !llvm.loop !11

._crit_edge49:                                    ; preds = %33, %26
  %34 = sext i32 %27 to i64
  %35 = getelementptr inbounds [60 x [21 x i8]], ptr @str, i64 0, i64 %34
  %36 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %35, ptr noundef nonnull dereferenceable(1) %2) #7
  %37 = add nsw i32 %27, 1
  store i32 %37, ptr @tot, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %.thread39, %._crit_edge49
  %storemerge76 = phi i32 [ %27, %._crit_edge49 ], [ %32, %.thread39 ]
  store i32 %storemerge76, ptr %13, align 4, !tbaa !5
  %39 = sext i32 %storemerge to i64
  %40 = getelementptr inbounds [60 x i32], ptr @deg, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %40, align 4, !tbaa !5
  %43 = sext i32 %storemerge76 to i64
  %44 = getelementptr inbounds [60 x i32], ptr @deg, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = add nsw i32 %45, -1
  store i32 %46, ptr %44, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 21, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 21, ptr nonnull %1) #7
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %47 = load i32, ptr @m, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = icmp slt i64 %indvars.iv.next74, %48
  br i1 %49, label %.lr.ph53, label %._crit_edge54, !llvm.loop !12

.lr.ph58:                                         ; preds = %.lr.ph58.preheader, %.lr.ph58
  %.03156 = phi i32 [ %.1, %.lr.ph58 ], [ %11, %.lr.ph58.preheader ]
  %.03255 = phi i32 [ %.133, %.lr.ph58 ], [ 0, %.lr.ph58.preheader ]
  %50 = add nuw nsw i32 %.03156, %.03255
  %51 = lshr i32 %50, 1
  %52 = call noundef zeroext i1 @_ZN15MinCost_MaxFlow5checkEi(ptr noundef nonnull align 4 dereferenceable(145464) @NetWork, i32 noundef %51)
  %53 = add nuw nsw i32 %51, 1
  %.133 = select i1 %52, i32 %.03255, i32 %53
  %.1 = select i1 %52, i32 %51, i32 %.03156
  %54 = icmp slt i32 %.133, %.1
  br i1 %54, label %.lr.ph58, label %._crit_edge59, !llvm.loop !13

._crit_edge59:                                    ; preds = %.lr.ph58, %._crit_edge54
  %.032.lcssa = phi i32 [ 0, %._crit_edge54 ], [ %.133, %.lr.ph58 ]
  %55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %.032.lcssa)
  %56 = add nuw nsw i32 %.061, 1
  %57 = load i32, ptr @tt, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.061, %57
  br i1 %.not.not, label %.lr.ph63, label %._crit_edge64, !llvm.loop !14
}

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

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

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

; 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: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #4

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN15MinCost_MaxFlow5checkEi(ptr noundef nonnull align 4 dereferenceable(145464), i32 noundef) local_unnamed_addr #6 align 2

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

!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 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


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