; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/190 Division 1/Problem B/B2.ll (Z3allv)

; 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.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"struct.std::pair" = type { i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global %"class.std::vector", align 8
@c = external dso_local global %"class.std::vector", align 8
@_Z3howB5cxx11 = external dso_local global [101 x %"class.std::__cxx11::basic_string"], align 16
@.str = 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: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #1

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZN14minCostMaxFlow4mcmfEiib(ptr noundef nonnull align 8 dereferenceable(16032), i32 noundef, i32 noundef, i1 noundef zeroext) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z3allv() #4 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %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
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::pair", align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %13 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 16032) #7
  %14 = load i32, ptr @m, align 4, !tbaa !5
  %15 = load i32, ptr @m, align 4, !tbaa !5
  %16 = add nsw i32 %14, %15
  %17 = add nsw i32 %16, 2
  invoke void @_ZN14minCostMaxFlowC2Ei(ptr noundef nonnull align 8 dereferenceable(16032) %13, i32 noundef %17)
          to label %18 unwind label %24

18:                                               ; preds = %0
  store ptr %13, ptr %2, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 1, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %33, %18
  %20 = load i32, ptr %7, align 4, !tbaa !5
  %21 = load i32, ptr @m, align 4, !tbaa !5
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %28, label %23

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

24:                                               ; preds = %0
  %25 = landingpad { ptr, i32 }
          cleanup
  %26 = extractvalue { ptr, i32 } %25, 0
  store ptr %26, ptr %3, align 8
  %27 = extractvalue { ptr, i32 } %25, 1
  store i32 %27, ptr %4, align 4
  call void @_ZdlPvm(ptr noundef %13, i64 noundef 16032) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  br label %159

28:                                               ; preds = %19
  %29 = load ptr, ptr %2, align 8, !tbaa !9
  %30 = load i32, ptr %5, align 4, !tbaa !5
  %31 = load i32, ptr %7, align 4, !tbaa !5
  %32 = add nsw i32 %31, 2
  call void @_ZN14minCostMaxFlow7addEdgeEiiii(ptr noundef nonnull align 8 dereferenceable(16032) %29, i32 noundef %30, i32 noundef %32, i32 noundef 1, i32 noundef 0)
  br label %33

33:                                               ; preds = %28
  %34 = load i32, ptr %7, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %7, align 4, !tbaa !5
  br label %19, !llvm.loop !11

36:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %49, %36
  %38 = load i32, ptr %8, align 4, !tbaa !5
  %39 = load i32, ptr @m, align 4, !tbaa !5
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %42, label %41

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

42:                                               ; preds = %37
  %43 = load ptr, ptr %2, align 8, !tbaa !9
  %44 = load i32, ptr @m, align 4, !tbaa !5
  %45 = add nsw i32 %44, 2
  %46 = load i32, ptr %8, align 4, !tbaa !5
  %47 = add nsw i32 %45, %46
  %48 = load i32, ptr %6, align 4, !tbaa !5
  call void @_ZN14minCostMaxFlow7addEdgeEiiii(ptr noundef nonnull align 8 dereferenceable(16032) %43, i32 noundef %47, i32 noundef %48, i32 noundef 1, i32 noundef 0)
  br label %49

49:                                               ; preds = %42
  %50 = load i32, ptr %8, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %8, align 4, !tbaa !5
  br label %37, !llvm.loop !13

52:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %140, %52
  %54 = load i32, ptr %9, align 4, !tbaa !5
  %55 = load i32, ptr @m, align 4, !tbaa !5
  %56 = icmp slt i32 %54, %55
  br i1 %56, label %58, label %57

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

58:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %136, %58
  %60 = load i32, ptr %11, align 4, !tbaa !5
  %61 = load i32, ptr @m, align 4, !tbaa !5
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %64, label %63

63:                                               ; preds = %59
  store i32 11, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %139

64:                                               ; preds = %59
  %65 = load i32, ptr %9, align 4, !tbaa !5
  %66 = load i32, ptr @n, align 4, !tbaa !5
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %68, label %122

68:                                               ; preds = %64
  %69 = load i32, ptr %9, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [101 x %"class.std::__cxx11::basic_string"], ptr @_Z3howB5cxx11, i64 0, i64 %70
  %72 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %71, ptr noundef @.str)
  br i1 %72, label %73, label %102

73:                                               ; preds = %68
  %74 = load i32, ptr %11, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @c, i64 noundef %75) #6
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = load i32, ptr %9, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @a, i64 noundef %79) #6
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = icmp sge i32 %77, %81
  br i1 %82, label %83, label %101

83:                                               ; preds = %73
  %84 = load ptr, ptr %2, align 8, !tbaa !9
  %85 = load i32, ptr %9, align 4, !tbaa !5
  %86 = add nsw i32 %85, 2
  %87 = load i32, ptr @m, align 4, !tbaa !5
  %88 = add nsw i32 %87, 2
  %89 = load i32, ptr %11, align 4, !tbaa !5
  %90 = add nsw i32 %88, %89
  %91 = load i32, ptr %11, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @c, i64 noundef %92) #6
  %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 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @a, i64 noundef %96) #6
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = sub nsw i32 %94, %98
  %100 = sub nsw i32 0, %99
  call void @_ZN14minCostMaxFlow7addEdgeEiiii(ptr noundef nonnull align 8 dereferenceable(16032) %84, i32 noundef %86, i32 noundef %90, i32 noundef 1, i32 noundef %100)
  br label %101

101:                                              ; preds = %83, %73
  br label %121

102:                                              ; preds = %68
  %103 = load i32, ptr %11, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @c, i64 noundef %104) #6
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = load i32, ptr %9, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @a, i64 noundef %108) #6
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = icmp sgt i32 %106, %110
  br i1 %111, label %112, label %120

112:                                              ; preds = %102
  %113 = load ptr, ptr %2, align 8, !tbaa !9
  %114 = load i32, ptr %9, align 4, !tbaa !5
  %115 = add nsw i32 %114, 2
  %116 = load i32, ptr @m, align 4, !tbaa !5
  %117 = add nsw i32 %116, 2
  %118 = load i32, ptr %11, align 4, !tbaa !5
  %119 = add nsw i32 %117, %118
  call void @_ZN14minCostMaxFlow7addEdgeEiiii(ptr noundef nonnull align 8 dereferenceable(16032) %113, i32 noundef %115, i32 noundef %119, i32 noundef 1, i32 noundef 0)
  br label %120

120:                                              ; preds = %112, %102
  br label %121

121:                                              ; preds = %120, %101
  br label %135

122:                                              ; preds = %64
  %123 = load ptr, ptr %2, align 8, !tbaa !9
  %124 = load i32, ptr %9, align 4, !tbaa !5
  %125 = add nsw i32 %124, 2
  %126 = load i32, ptr @m, align 4, !tbaa !5
  %127 = add nsw i32 %126, 2
  %128 = load i32, ptr %11, align 4, !tbaa !5
  %129 = add nsw i32 %127, %128
  %130 = load i32, ptr %11, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @c, i64 noundef %131) #6
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = sub nsw i32 0, %133
  call void @_ZN14minCostMaxFlow7addEdgeEiiii(ptr noundef nonnull align 8 dereferenceable(16032) %123, i32 noundef %125, i32 noundef %129, i32 noundef 1, i32 noundef %134)
  br label %135

135:                                              ; preds = %122, %121
  br label %136

136:                                              ; preds = %135
  %137 = load i32, ptr %11, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %11, align 4, !tbaa !5
  br label %59, !llvm.loop !14

139:                                              ; preds = %63
  br label %140

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

143:                                              ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %144 = load ptr, ptr %2, align 8, !tbaa !9
  %145 = load i32, ptr %5, align 4, !tbaa !5
  %146 = load i32, ptr %6, align 4, !tbaa !5
  %147 = call i64 @_ZN14minCostMaxFlow4mcmfEiib(ptr noundef nonnull align 8 dereferenceable(16032) %144, i32 noundef %145, i32 noundef %146, i1 noundef zeroext true)
  store i64 %147, ptr %12, align 4
  %148 = getelementptr inbounds %"struct.std::pair", ptr %12, i32 0, i32 0
  %149 = load i32, ptr %148, align 4, !tbaa !16
  %150 = load i32, ptr @m, align 4, !tbaa !5
  %151 = icmp eq i32 %149, %150
  br i1 %151, label %152, label %156

152:                                              ; preds = %143
  %153 = getelementptr inbounds %"struct.std::pair", ptr %12, i32 0, i32 1
  %154 = load i32, ptr %153, align 4, !tbaa !18
  %155 = sub nsw i32 0, %154
  store i32 %155, ptr %1, align 4
  store i32 1, ptr %10, align 4
  br label %157

156:                                              ; preds = %143
  store i32 0, ptr %1, align 4
  store i32 1, ptr %10, align 4
  br label %157

157:                                              ; preds = %156, %152
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %158 = load i32, ptr %1, align 4
  ret i32 %158

159:                                              ; preds = %24
  %160 = load ptr, ptr %3, align 8
  %161 = load i32, ptr %4, align 4
  %162 = insertvalue { ptr, i32 } poison, ptr %160, 0
  %163 = insertvalue { ptr, i32 } %162, i32 %161, 1
  resume { ptr, i32 } %163
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin allocsize(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 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 #3 = { nobuiltin 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 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 }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = !{!17, !6, i64 0}
!17 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!18 = !{!17, !6, i64 4}


; 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.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@n = external dso_local local_unnamed_addr global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@a = external dso_local global %"class.std::vector", align 8
@c = external dso_local global %"class.std::vector", align 8
@_Z3howB5cxx11 = external dso_local global [101 x %"class.std::__cxx11::basic_string"], align 16
@.str = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #0

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZN14minCostMaxFlow4mcmfEiib(ptr noundef nonnull align 8 dereferenceable(16032), i32 noundef, i32 noundef, i1 noundef zeroext) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 -2147483647, -2147483648) i32 @_Z3allv() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = tail call noalias noundef nonnull dereferenceable(16032) ptr @_Znwm(i64 noundef 16032) #4
  %2 = load i32, ptr @m, align 4, !tbaa !5
  %3 = shl nsw i32 %2, 1
  %4 = add nsw i32 %3, 2
  tail call void @_ZN14minCostMaxFlowC2Ei(ptr noundef nonnull align 8 dereferenceable(16032) %1, i32 noundef %4)
  %5 = load i32, ptr @m, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph, label %._crit_edge49

.preheader42:                                     ; preds = %.lr.ph
  %7 = icmp sgt i32 %10, 0
  br i1 %7, label %.lr.ph45, label %._crit_edge49

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.03543 = phi i32 [ %9, %.lr.ph ], [ 0, %0 ]
  %8 = add nuw nsw i32 %.03543, 2
  tail call void @_ZN14minCostMaxFlow7addEdgeEiiii(ptr noundef nonnull align 8 dereferenceable(16032) %1, i32 noundef 0, i32 noundef %8, i32 noundef 1, i32 noundef 0)
  %9 = add nuw nsw i32 %.03543, 1
  %10 = load i32, ptr @m, align 4, !tbaa !5
  %11 = icmp slt i32 %9, %10
  br i1 %11, label %.lr.ph, label %.preheader42, !llvm.loop !9

.preheader41:                                     ; preds = %.lr.ph45
  %12 = icmp sgt i32 %17, 0
  br i1 %12, label %.preheader, label %._crit_edge49

.lr.ph45:                                         ; preds = %.preheader42, %.lr.ph45
  %13 = phi i32 [ %17, %.lr.ph45 ], [ %10, %.preheader42 ]
  %.03844 = phi i32 [ %16, %.lr.ph45 ], [ 0, %.preheader42 ]
  %14 = add nuw i32 %.03844, 2
  %15 = add i32 %14, %13
  tail call void @_ZN14minCostMaxFlow7addEdgeEiiii(ptr noundef nonnull align 8 dereferenceable(16032) %1, i32 noundef %15, i32 noundef 1, i32 noundef 1, i32 noundef 0)
  %16 = add nuw nsw i32 %.03844, 1
  %17 = load i32, ptr @m, align 4, !tbaa !5
  %18 = icmp slt i32 %16, %17
  br i1 %18, label %.lr.ph45, label %.preheader41, !llvm.loop !11

.preheader:                                       ; preds = %.preheader41, %._crit_edge
  %19 = phi i32 [ %30, %._crit_edge ], [ %17, %.preheader41 ]
  %indvars.iv52 = phi i64 [ %indvars.iv.next53, %._crit_edge ], [ 0, %.preheader41 ]
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.lr.ph47, label %.preheader.._crit_edge_crit_edge

.preheader.._crit_edge_crit_edge:                 ; preds = %.preheader
  %.pre = sext i32 %19 to i64
  br label %._crit_edge

.lr.ph47:                                         ; preds = %.preheader
  %21 = add nuw nsw i64 %indvars.iv52, 2
  %22 = getelementptr inbounds [101 x %"class.std::__cxx11::basic_string"], ptr @_Z3howB5cxx11, i64 0, i64 %indvars.iv52
  %23 = trunc nuw i64 %21 to i32
  %24 = trunc nuw i64 %21 to i32
  %25 = trunc nuw i64 %21 to i32
  br label %32

._crit_edge49:                                    ; preds = %._crit_edge, %0, %.preheader42, %.preheader41
  %26 = tail call i64 @_ZN14minCostMaxFlow4mcmfEiib(ptr noundef nonnull align 8 dereferenceable(16032) %1, i32 noundef 0, i32 noundef 1, i1 noundef zeroext true)
  %.sroa.0.0.extract.trunc = trunc i64 %26 to i32
  %27 = load i32, ptr @m, align 4, !tbaa !5
  %28 = icmp eq i32 %27, %.sroa.0.0.extract.trunc
  %.sroa.4.0.extract.shift = lshr i64 %26, 32
  %.sroa.4.0.extract.trunc = trunc nuw i64 %.sroa.4.0.extract.shift to i32
  %29 = sub nsw i32 0, %.sroa.4.0.extract.trunc
  %.0 = select i1 %28, i32 %29, i32 0
  ret i32 %.0

._crit_edge:                                      ; preds = %67, %.preheader.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.preheader.._crit_edge_crit_edge ], [ %69, %67 ]
  %30 = phi i32 [ %19, %.preheader.._crit_edge_crit_edge ], [ %68, %67 ]
  %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
  %31 = icmp slt i64 %indvars.iv.next53, %.pre-phi
  br i1 %31, label %.preheader, label %._crit_edge49, !llvm.loop !12

32:                                               ; preds = %.lr.ph47, %67
  %indvars.iv = phi i64 [ 0, %.lr.ph47 ], [ %indvars.iv.next, %67 ]
  %33 = phi i32 [ %19, %.lr.ph47 ], [ %68, %67 ]
  %34 = load i32, ptr @n, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = icmp slt i64 %indvars.iv52, %35
  br i1 %36, label %37, label %60

37:                                               ; preds = %32
  %38 = tail call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %22, ptr noundef nonnull @.str)
  %39 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @c, i64 noundef %indvars.iv) #5
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @a, i64 noundef %indvars.iv52) #5
  %42 = load i32, ptr %41, align 4, !tbaa !5
  br i1 %38, label %43, label %53

43:                                               ; preds = %37
  %.not = icmp slt i32 %40, %42
  br i1 %.not, label %67, label %44

44:                                               ; preds = %43
  %45 = load i32, ptr @m, align 4, !tbaa !5
  %46 = trunc i64 %indvars.iv to i32
  %47 = add i32 %46, 2
  %48 = add i32 %47, %45
  %49 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @c, i64 noundef %indvars.iv) #5
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @a, i64 noundef %indvars.iv52) #5
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %.neg = sub nsw i32 %52, %50
  tail call void @_ZN14minCostMaxFlow7addEdgeEiiii(ptr noundef nonnull align 8 dereferenceable(16032) %1, i32 noundef %25, i32 noundef %48, i32 noundef 1, i32 noundef %.neg)
  br label %67

53:                                               ; preds = %37
  %54 = icmp sgt i32 %40, %42
  br i1 %54, label %55, label %67

55:                                               ; preds = %53
  %56 = load i32, ptr @m, align 4, !tbaa !5
  %57 = trunc i64 %indvars.iv to i32
  %58 = add i32 %57, 2
  %59 = add i32 %58, %56
  tail call void @_ZN14minCostMaxFlow7addEdgeEiiii(ptr noundef nonnull align 8 dereferenceable(16032) %1, i32 noundef %24, i32 noundef %59, i32 noundef 1, i32 noundef 0)
  br label %67

60:                                               ; preds = %32
  %61 = trunc i64 %indvars.iv to i32
  %62 = add i32 %61, 2
  %63 = add i32 %62, %33
  %64 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @c, i64 noundef %indvars.iv) #5
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = sub nsw i32 0, %65
  tail call void @_ZN14minCostMaxFlow7addEdgeEiiii(ptr noundef nonnull align 8 dereferenceable(16032) %1, i32 noundef %23, i32 noundef %63, i32 noundef 1, i32 noundef %66)
  br label %67

67:                                               ; preds = %60, %53, %55, %43, %44
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %68 = load i32, ptr @m, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = icmp slt i64 %indvars.iv.next, %69
  br i1 %70, label %32, label %._crit_edge, !llvm.loop !14
}

attributes #0 = { nobuiltin allocsize(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 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 #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress 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 = { builtin allocsize(0) }
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}
!13 = !{!"llvm.loop.unswitch.partial.disable"}
!14 = distinct !{!14, !10}


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