; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/304 Division 2/Problem E (E)

; 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.maxFlow = type { i32, [1000 x i32], [1000 x i32], %"class.std::vector", [1000 x %"class.std::vector.0"], [300 x [300 x i32]] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<maxFlow::Edge, std::allocator<maxFlow::Edge>>::_Vector_impl" }
%"struct.std::_Vector_base<maxFlow::Edge, std::allocator<maxFlow::Edge>>::_Vector_impl" = type { %"struct.std::_Vector_base<maxFlow::Edge, std::allocator<maxFlow::Edge>>::_Vector_impl_data" }
%"struct.std::_Vector_base<maxFlow::Edge, std::allocator<maxFlow::Edge>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global [101 x i32], align 16
@b = external dso_local global [101 x i32], align 16
@tot = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %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 %struct.maxFlow, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %14

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

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

19:                                               ; preds = %14
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %21
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %22)
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = load i32, ptr @tot, align 4, !tbaa !5
  %29 = add nsw i32 %28, %27
  store i32 %29, ptr @tot, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %19
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %2, align 4, !tbaa !5
  br label %14, !llvm.loop !9

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

34:                                               ; preds = %50, %33
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = load i32, ptr @n, align 4, !tbaa !5
  %37 = icmp sle i32 %35, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %53

39:                                               ; preds = %34
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %41
  %43 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %42)
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = load i32, ptr @tot, align 4, !tbaa !5
  %49 = sub nsw i32 %48, %47
  store i32 %49, ptr @tot, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %39
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %3, align 4, !tbaa !5
  br label %34, !llvm.loop !11

53:                                               ; preds = %38
  %54 = load i32, ptr @tot, align 4, !tbaa !5
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %58

56:                                               ; preds = %53
  %57 = call i32 @puts(ptr noundef @.str.2)
  store i32 0, ptr %1, align 4
  br label %158

58:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %59 = load i32, ptr @n, align 4, !tbaa !5
  %60 = load i32, ptr @n, align 4, !tbaa !5
  %61 = add nsw i32 %59, %60
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %63 = load i32, ptr @n, align 4, !tbaa !5
  %64 = load i32, ptr @n, align 4, !tbaa !5
  %65 = add nsw i32 %63, %64
  %66 = add nsw i32 %65, 2
  store i32 %66, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 392032, ptr %6) #6
  %67 = load i32, ptr @n, align 4, !tbaa !5
  %68 = load i32, ptr @n, align 4, !tbaa !5
  %69 = add nsw i32 %67, %68
  %70 = add nsw i32 %69, 2
  call void @_ZN7maxFlowC2Ei(ptr noundef nonnull align 8 dereferenceable(392032) %6, i32 noundef %70)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %104, %58
  %72 = load i32, ptr %7, align 4, !tbaa !5
  %73 = load i32, ptr @n, align 4, !tbaa !5
  %74 = icmp sle i32 %72, %73
  br i1 %74, label %76, label %75

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

76:                                               ; preds = %71
  %77 = load i32, ptr %4, align 4, !tbaa !5
  %78 = load i32, ptr %7, align 4, !tbaa !5
  %79 = load i32, ptr %7, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  invoke void @_ZN7maxFlow7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(392032) %6, i32 noundef %77, i32 noundef %78, i32 noundef %82)
          to label %83 unwind label %107

83:                                               ; preds = %76
  %84 = load i32, ptr @n, align 4, !tbaa !5
  %85 = load i32, ptr %7, align 4, !tbaa !5
  %86 = add nsw i32 %84, %85
  %87 = load i32, ptr %5, align 4, !tbaa !5
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  invoke void @_ZN7maxFlow7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(392032) %6, i32 noundef %86, i32 noundef %87, i32 noundef %91)
          to label %92 unwind label %107

92:                                               ; preds = %83
  %93 = load i32, ptr %7, align 4, !tbaa !5
  %94 = load i32, ptr @n, align 4, !tbaa !5
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = add nsw i32 %94, %95
  invoke void @_ZN7maxFlow7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(392032) %6, i32 noundef %93, i32 noundef %96, i32 noundef 100)
          to label %97 unwind label %107

97:                                               ; preds = %92
  %98 = load i32, ptr %7, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = load i32, ptr @tot, align 4, !tbaa !5
  %103 = add nsw i32 %102, %101
  store i32 %103, ptr @tot, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %97
  %105 = load i32, ptr %7, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %7, align 4, !tbaa !5
  br label %71, !llvm.loop !12

107:                                              ; preds = %92, %83, %76
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %8, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %157

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

112:                                              ; preds = %130, %111
  %113 = load i32, ptr %10, align 4, !tbaa !5
  %114 = load i32, ptr @m, align 4, !tbaa !5
  %115 = icmp sle i32 %113, %114
  br i1 %115, label %117, label %116

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

117:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %118 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %11, ptr noundef %12)
          to label %119 unwind label %133

119:                                              ; preds = %117
  %120 = load i32, ptr %11, align 4, !tbaa !5
  %121 = load i32, ptr %12, align 4, !tbaa !5
  %122 = load i32, ptr @n, align 4, !tbaa !5
  %123 = add nsw i32 %121, %122
  invoke void @_ZN7maxFlow7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(392032) %6, i32 noundef %120, i32 noundef %123, i32 noundef 100)
          to label %124 unwind label %133

124:                                              ; preds = %119
  %125 = load i32, ptr %12, align 4, !tbaa !5
  %126 = load i32, ptr %11, align 4, !tbaa !5
  %127 = load i32, ptr @n, align 4, !tbaa !5
  %128 = add nsw i32 %126, %127
  invoke void @_ZN7maxFlow7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(392032) %6, i32 noundef %125, i32 noundef %128, i32 noundef 100)
          to label %129 unwind label %133

129:                                              ; preds = %124
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %130

130:                                              ; preds = %129
  %131 = load i32, ptr %10, align 4, !tbaa !5
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %10, align 4, !tbaa !5
  br label %112, !llvm.loop !13

133:                                              ; preds = %124, %119, %117
  %134 = landingpad { ptr, i32 }
          cleanup
  %135 = extractvalue { ptr, i32 } %134, 0
  store ptr %135, ptr %8, align 8
  %136 = extractvalue { ptr, i32 } %134, 1
  store i32 %136, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %157

137:                                              ; preds = %116
  %138 = load i32, ptr %4, align 4, !tbaa !5
  %139 = load i32, ptr %5, align 4, !tbaa !5
  %140 = invoke noundef i32 @_ZN7maxFlow7maxflowEii(ptr noundef nonnull align 8 dereferenceable(392032) %6, i32 noundef %138, i32 noundef %139)
          to label %141 unwind label %147

141:                                              ; preds = %137
  %142 = load i32, ptr @tot, align 4, !tbaa !5
  %143 = icmp ne i32 %140, %142
  br i1 %143, label %144, label %151

144:                                              ; preds = %141
  %145 = invoke i32 @puts(ptr noundef @.str.2)
          to label %146 unwind label %147

146:                                              ; preds = %144
  br label %156

147:                                              ; preds = %153, %151, %144, %137
  %148 = landingpad { ptr, i32 }
          cleanup
  %149 = extractvalue { ptr, i32 } %148, 0
  store ptr %149, ptr %8, align 8
  %150 = extractvalue { ptr, i32 } %148, 1
  store i32 %150, ptr %9, align 4
  br label %157

151:                                              ; preds = %141
  %152 = invoke i32 @puts(ptr noundef @.str.3)
          to label %153 unwind label %147

153:                                              ; preds = %151
  %154 = load i32, ptr @n, align 4, !tbaa !5
  invoke void @_ZN7maxFlow5printEi(ptr noundef nonnull align 8 dereferenceable(392032) %6, i32 noundef %154)
          to label %155 unwind label %147

155:                                              ; preds = %153
  br label %156

156:                                              ; preds = %155, %146
  store i32 0, ptr %1, align 4
  call void @_ZN7maxFlowD2Ev(ptr noundef nonnull align 8 dereferenceable(392032) %6) #6
  call void @llvm.lifetime.end.p0(i64 392032, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %158

157:                                              ; preds = %147, %133, %107
  call void @_ZN7maxFlowD2Ev(ptr noundef nonnull align 8 dereferenceable(392032) %6) #6
  call void @llvm.lifetime.end.p0(i64 392032, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %160

158:                                              ; preds = %156, %56
  %159 = load i32, ptr %1, align 4
  ret i32 %159

160:                                              ; preds = %157
  %161 = load ptr, ptr %8, align 8
  %162 = load i32, ptr %9, align 4
  %163 = insertvalue { ptr, i32 } poison, ptr %161, 0
  %164 = insertvalue { ptr, i32 } %163, i32 %162, 1
  resume { ptr, i32 } %164
}

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

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

declare i32 @puts(ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7maxFlowC2Ei(ptr noundef nonnull align 8 dereferenceable(392032), i32 noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7maxFlow7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(392032), i32 noundef, i32 noundef, i32 noundef) #4 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7maxFlow7maxflowEii(ptr noundef nonnull align 8 dereferenceable(392032), i32 noundef, i32 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7maxFlow5printEi(ptr noundef nonnull align 8 dereferenceable(392032), i32 noundef) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7maxFlowD2Ev(ptr noundef nonnull align 8 dereferenceable(392032)) unnamed_addr #5 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 = { 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 #4 = { 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 #5 = { 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 #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 = distinct !{!13, !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"

%struct.maxFlow = type { i32, [1000 x i32], [1000 x i32], %"class.std::vector", [1000 x %"class.std::vector.0"], [300 x [300 x i32]] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<maxFlow::Edge, std::allocator<maxFlow::Edge>>::_Vector_impl" }
%"struct.std::_Vector_base<maxFlow::Edge, std::allocator<maxFlow::Edge>>::_Vector_impl" = type { %"struct.std::_Vector_base<maxFlow::Edge, std::allocator<maxFlow::Edge>>::_Vector_impl_data" }
%"struct.std::_Vector_base<maxFlow::Edge, std::allocator<maxFlow::Edge>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global [101 x i32], align 16
@b = external dso_local global [101 x i32], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = 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 personality ptr @__gxx_personality_v0 {
  %1 = alloca %struct.maxFlow, align 8
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %.not39 = icmp slt i32 %5, 1
  br i1 %.not39, label %.preheader38.._crit_edge_crit_edge, label %.lr.ph

.preheader38:                                     ; preds = %.lr.ph
  %.not3241 = icmp slt i32 %12, 1
  br i1 %.not3241, label %.preheader38.._crit_edge_crit_edge, label %.lr.ph43

.preheader38.._crit_edge_crit_edge:               ; preds = %0, %.preheader38
  %6 = phi i32 [ %12, %.preheader38 ], [ %5, %0 ]
  %.pre = load i32, ptr @tot, align 4, !tbaa !5
  br label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %7 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %indvars.iv
  %8 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %7)
  %9 = load i32, ptr %7, align 4, !tbaa !5
  %10 = load i32, ptr @tot, align 4, !tbaa !5
  %11 = add nsw i32 %10, %9
  store i32 %11, ptr @tot, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %.not.not = icmp slt i64 %indvars.iv, %13
  br i1 %.not.not, label %.lr.ph, label %.preheader38, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph43, %.preheader38.._crit_edge_crit_edge
  %14 = phi i32 [ %.pre, %.preheader38.._crit_edge_crit_edge ], [ %19, %.lr.ph43 ]
  %.lcssa = phi i32 [ %6, %.preheader38.._crit_edge_crit_edge ], [ %20, %.lr.ph43 ]
  %.not33 = icmp eq i32 %14, 0
  br i1 %.not33, label %24, label %22

.lr.ph43:                                         ; preds = %.preheader38, %.lr.ph43
  %indvars.iv54 = phi i64 [ %indvars.iv.next55, %.lr.ph43 ], [ 1, %.preheader38 ]
  %15 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %indvars.iv54
  %16 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %15)
  %17 = load i32, ptr %15, align 4, !tbaa !5
  %18 = load i32, ptr @tot, align 4, !tbaa !5
  %19 = sub nsw i32 %18, %17
  store i32 %19, ptr @tot, align 4, !tbaa !5
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %.not32.not = icmp slt i64 %indvars.iv54, %21
  br i1 %.not32.not, label %.lr.ph43, label %._crit_edge, !llvm.loop !11

22:                                               ; preds = %._crit_edge
  %23 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %76

24:                                               ; preds = %._crit_edge
  %25 = shl nsw i32 %.lcssa, 1
  %26 = or disjoint i32 %25, 1
  %27 = add nsw i32 %25, 2
  call void @llvm.lifetime.start.p0(i64 392032, ptr nonnull %1) #6
  call void @_ZN7maxFlowC2Ei(ptr noundef nonnull align 8 dereferenceable(392032) %1, i32 noundef %27)
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %.not3444 = icmp slt i32 %28, 1
  br i1 %.not3444, label %.preheader, label %.lr.ph47

.preheader:                                       ; preds = %41, %24
  %29 = load i32, ptr @m, align 4, !tbaa !5
  %.not3548 = icmp slt i32 %29, 1
  br i1 %.not3548, label %._crit_edge51, label %.lr.ph50

.lr.ph47:                                         ; preds = %24, %41
  %indvars.iv57 = phi i64 [ %indvars.iv.next58, %41 ], [ 1, %24 ]
  %30 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %indvars.iv57
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = trunc nuw nsw i64 %indvars.iv57 to i32
  invoke void @_ZN7maxFlow7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(392032) %1, i32 noundef %26, i32 noundef %32, i32 noundef %31)
          to label %33 unwind label %47

33:                                               ; preds = %.lr.ph47
  %34 = load i32, ptr @n, align 4, !tbaa !5
  %35 = add nsw i32 %34, %32
  %36 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %indvars.iv57
  %37 = load i32, ptr %36, align 4, !tbaa !5
  invoke void @_ZN7maxFlow7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(392032) %1, i32 noundef %35, i32 noundef %27, i32 noundef %37)
          to label %38 unwind label %47

38:                                               ; preds = %33
  %39 = load i32, ptr @n, align 4, !tbaa !5
  %40 = add nsw i32 %39, %32
  invoke void @_ZN7maxFlow7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(392032) %1, i32 noundef %32, i32 noundef %40, i32 noundef 100)
          to label %41 unwind label %47

41:                                               ; preds = %38
  %42 = load i32, ptr %30, align 4, !tbaa !5
  %43 = load i32, ptr @tot, align 4, !tbaa !5
  %44 = add nsw i32 %43, %42
  store i32 %44, ptr @tot, align 4, !tbaa !5
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %45 = load i32, ptr @n, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %.not34.not = icmp slt i64 %indvars.iv57, %46
  br i1 %.not34.not, label %.lr.ph47, label %.preheader, !llvm.loop !12

47:                                               ; preds = %38, %33, %.lr.ph47
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %75

._crit_edge51:                                    ; preds = %60, %.preheader
  %49 = invoke noundef i32 @_ZN7maxFlow7maxflowEii(ptr noundef nonnull align 8 dereferenceable(392032) %1, i32 noundef %26, i32 noundef %27)
          to label %65 unwind label %69

.lr.ph50:                                         ; preds = %.preheader, %60
  %.049 = phi i32 [ %61, %60 ], [ 1, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %50 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = load i32, ptr %3, align 4, !tbaa !5
  %53 = load i32, ptr @n, align 4, !tbaa !5
  %54 = add nsw i32 %53, %52
  invoke void @_ZN7maxFlow7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(392032) %1, i32 noundef %51, i32 noundef %54, i32 noundef 100)
          to label %55 unwind label %63

55:                                               ; preds = %.lr.ph50
  %56 = load i32, ptr %3, align 4, !tbaa !5
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = load i32, ptr @n, align 4, !tbaa !5
  %59 = add nsw i32 %58, %57
  invoke void @_ZN7maxFlow7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(392032) %1, i32 noundef %56, i32 noundef %59, i32 noundef 100)
          to label %60 unwind label %63

60:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  %61 = add nuw nsw i32 %.049, 1
  %62 = load i32, ptr @m, align 4, !tbaa !5
  %.not35.not = icmp slt i32 %.049, %62
  br i1 %.not35.not, label %.lr.ph50, label %._crit_edge51, !llvm.loop !13

63:                                               ; preds = %55, %.lr.ph50
  %64 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  br label %75

65:                                               ; preds = %._crit_edge51
  %66 = load i32, ptr @tot, align 4, !tbaa !5
  %.not36 = icmp eq i32 %49, %66
  br i1 %.not36, label %71, label %67

67:                                               ; preds = %65
  %68 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %74

69:                                               ; preds = %71, %._crit_edge51
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %75

71:                                               ; preds = %65
  %72 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  %73 = load i32, ptr @n, align 4, !tbaa !5
  invoke void @_ZN7maxFlow5printEi(ptr noundef nonnull align 8 dereferenceable(392032) %1, i32 noundef %73)
          to label %74 unwind label %69

74:                                               ; preds = %71, %67
  call void @_ZN7maxFlowD2Ev(ptr noundef nonnull align 8 dereferenceable(392032) %1) #6
  call void @llvm.lifetime.end.p0(i64 392032, ptr nonnull %1) #6
  br label %76

75:                                               ; preds = %69, %63, %47
  %.pn = phi { ptr, i32 } [ %48, %47 ], [ %64, %63 ], [ %70, %69 ]
  call void @_ZN7maxFlowD2Ev(ptr noundef nonnull align 8 dereferenceable(392032) %1) #6
  call void @llvm.lifetime.end.p0(i64 392032, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn

76:                                               ; preds = %74, %22
  ret i32 0
}

; 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7maxFlowC2Ei(ptr noundef nonnull align 8 dereferenceable(392032), i32 noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7maxFlow7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(392032), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7maxFlow7maxflowEii(ptr noundef nonnull align 8 dereferenceable(392032), i32 noundef, i32 noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7maxFlow5printEi(ptr noundef nonnull align 8 dereferenceable(392032), i32 noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7maxFlowD2Ev(ptr noundef nonnull align 8 dereferenceable(392032)) unnamed_addr #5 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 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 #4 = { 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 #5 = { 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 #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 = distinct !{!13, !10}


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