; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Codeagon 2017/Problem E/E2.ll (Z5solvev)

; 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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }

@mf = external dso_local global ptr, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::vector", align 8
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::pair", align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair", align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr %1) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %2) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %22 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %23 unwind label %31

23:                                               ; preds = %0
  %24 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %25 unwind label %31

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

26:                                               ; preds = %43, %25
  %27 = load i32, ptr %7, align 4, !tbaa !5
  %28 = load i32, ptr %3, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %35, label %30

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

31:                                               ; preds = %23, %0
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %5, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %6, align 4
  br label %251

35:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %36 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %37 unwind label %46

37:                                               ; preds = %35
  %38 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %36, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %39 unwind label %46

39:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %40 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %41 unwind label %50

41:                                               ; preds = %39
  store i64 %40, ptr %10, align 4
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 4 dereferenceable(8) %10)
          to label %42 unwind label %50

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

43:                                               ; preds = %42
  %44 = load i32, ptr %7, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %7, align 4, !tbaa !5
  br label %26, !llvm.loop !9

46:                                               ; preds = %37, %35
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %5, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %6, align 4
  br label %54

50:                                               ; preds = %41, %39
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %5, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %54

54:                                               ; preds = %50, %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %251

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

56:                                               ; preds = %69, %55
  %57 = load i32, ptr %11, align 4, !tbaa !5
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = icmp slt i32 %57, %58
  br i1 %59, label %61, label %60

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

61:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %62 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %63 unwind label %72

63:                                               ; preds = %61
  %64 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %62, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %65 unwind label %72

65:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %66 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %67 unwind label %76

67:                                               ; preds = %65
  store i64 %66, ptr %14, align 4
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 4 dereferenceable(8) %14)
          to label %68 unwind label %76

68:                                               ; preds = %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %69

69:                                               ; preds = %68
  %70 = load i32, ptr %11, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %11, align 4, !tbaa !5
  br label %56, !llvm.loop !11

72:                                               ; preds = %63, %61
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %5, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %6, align 4
  br label %80

76:                                               ; preds = %67, %65
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %5, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %80

80:                                               ; preds = %76, %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %251

81:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %82 = load i32, ptr %3, align 4, !tbaa !5
  %83 = load i32, ptr %4, align 4, !tbaa !5
  %84 = add nsw i32 %82, %83
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %86 = load i32, ptr %15, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %16, align 4, !tbaa !5
  %88 = load ptr, ptr @mf, align 8, !tbaa !12
  %89 = load i32, ptr %3, align 4, !tbaa !5
  %90 = load i32, ptr %4, align 4, !tbaa !5
  %91 = add nsw i32 %89, %90
  %92 = add nsw i32 %91, 2
  invoke void @_ZN7maxFlow5resetEi(ptr noundef nonnull align 8 dereferenceable(67232) %88, i32 noundef %92)
          to label %93 unwind label %99

93:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 1, ptr %17, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %108, %93
  %95 = load i32, ptr %17, align 4, !tbaa !5
  %96 = load i32, ptr %3, align 4, !tbaa !5
  %97 = icmp sle i32 %95, %96
  br i1 %97, label %103, label %98

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

99:                                               ; preds = %247, %245, %240, %81
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %5, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %6, align 4
  br label %250

103:                                              ; preds = %94
  %104 = load ptr, ptr @mf, align 8, !tbaa !12
  %105 = load i32, ptr %15, align 4, !tbaa !5
  %106 = load i32, ptr %17, align 4, !tbaa !5
  invoke void @_ZN7maxFlow7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(67232) %104, i32 noundef %105, i32 noundef %106, i32 noundef 1)
          to label %107 unwind label %111

107:                                              ; preds = %103
  br label %108

108:                                              ; preds = %107
  %109 = load i32, ptr %17, align 4, !tbaa !5
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %17, align 4, !tbaa !5
  br label %94, !llvm.loop !14

111:                                              ; preds = %103
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %5, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %250

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

116:                                              ; preds = %128, %115
  %117 = load i32, ptr %18, align 4, !tbaa !5
  %118 = load i32, ptr %4, align 4, !tbaa !5
  %119 = icmp sle i32 %117, %118
  br i1 %119, label %121, label %120

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

121:                                              ; preds = %116
  %122 = load ptr, ptr @mf, align 8, !tbaa !12
  %123 = load i32, ptr %3, align 4, !tbaa !5
  %124 = load i32, ptr %18, align 4, !tbaa !5
  %125 = add nsw i32 %123, %124
  %126 = load i32, ptr %16, align 4, !tbaa !5
  invoke void @_ZN7maxFlow7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(67232) %122, i32 noundef %125, i32 noundef %126, i32 noundef 1)
          to label %127 unwind label %131

127:                                              ; preds = %121
  br label %128

128:                                              ; preds = %127
  %129 = load i32, ptr %18, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %18, align 4, !tbaa !5
  br label %116, !llvm.loop !15

131:                                              ; preds = %121
  %132 = landingpad { ptr, i32 }
          cleanup
  %133 = extractvalue { ptr, i32 } %132, 0
  store ptr %133, ptr %5, align 8
  %134 = extractvalue { ptr, i32 } %132, 1
  store i32 %134, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %250

135:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 1, ptr %19, align 4, !tbaa !5
  br label %136

136:                                              ; preds = %237, %135
  %137 = load i32, ptr %19, align 4, !tbaa !5
  %138 = load i32, ptr %3, align 4, !tbaa !5
  %139 = icmp sle i32 %137, %138
  br i1 %139, label %141, label %140

140:                                              ; preds = %136
  store i32 14, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %240

141:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  store i32 1, ptr %21, align 4, !tbaa !5
  br label %142

142:                                              ; preds = %233, %141
  %143 = load i32, ptr %21, align 4, !tbaa !5
  %144 = load i32, ptr %4, align 4, !tbaa !5
  %145 = icmp sle i32 %143, %144
  br i1 %145, label %147, label %146

146:                                              ; preds = %142
  store i32 17, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %236

147:                                              ; preds = %142
  %148 = load i32, ptr %19, align 4, !tbaa !5
  %149 = sub nsw i32 %148, 1
  %150 = sext i32 %149 to i64
  %151 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %150) #6
  %152 = getelementptr inbounds %"struct.std::pair", ptr %151, i32 0, i32 0
  %153 = load i32, ptr %152, align 4, !tbaa !16
  %154 = load i32, ptr %21, align 4, !tbaa !5
  %155 = sub nsw i32 %154, 1
  %156 = sext i32 %155 to i64
  %157 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %156) #6
  %158 = getelementptr inbounds %"struct.std::pair", ptr %157, i32 0, i32 0
  %159 = load i32, ptr %158, align 4, !tbaa !16
  %160 = icmp eq i32 %153, %159
  br i1 %160, label %161, label %172

161:                                              ; preds = %147
  %162 = load ptr, ptr @mf, align 8, !tbaa !12
  %163 = load i32, ptr %19, align 4, !tbaa !5
  %164 = load i32, ptr %3, align 4, !tbaa !5
  %165 = load i32, ptr %21, align 4, !tbaa !5
  %166 = add nsw i32 %164, %165
  invoke void @_ZN7maxFlow7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(67232) %162, i32 noundef %163, i32 noundef %166, i32 noundef 1)
          to label %167 unwind label %168

167:                                              ; preds = %161
  br label %232

168:                                              ; preds = %223, %186, %161
  %169 = landingpad { ptr, i32 }
          cleanup
  %170 = extractvalue { ptr, i32 } %169, 0
  store ptr %170, ptr %5, align 8
  %171 = extractvalue { ptr, i32 } %169, 1
  store i32 %171, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %250

172:                                              ; preds = %147
  %173 = load i32, ptr %19, align 4, !tbaa !5
  %174 = sub nsw i32 %173, 1
  %175 = sext i32 %174 to i64
  %176 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %175) #6
  %177 = getelementptr inbounds %"struct.std::pair", ptr %176, i32 0, i32 1
  %178 = load i32, ptr %177, align 4, !tbaa !18
  %179 = load i32, ptr %21, align 4, !tbaa !5
  %180 = sub nsw i32 %179, 1
  %181 = sext i32 %180 to i64
  %182 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %181) #6
  %183 = getelementptr inbounds %"struct.std::pair", ptr %182, i32 0, i32 1
  %184 = load i32, ptr %183, align 4, !tbaa !18
  %185 = icmp eq i32 %178, %184
  br i1 %185, label %186, label %193

186:                                              ; preds = %172
  %187 = load ptr, ptr @mf, align 8, !tbaa !12
  %188 = load i32, ptr %19, align 4, !tbaa !5
  %189 = load i32, ptr %3, align 4, !tbaa !5
  %190 = load i32, ptr %21, align 4, !tbaa !5
  %191 = add nsw i32 %189, %190
  invoke void @_ZN7maxFlow7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(67232) %187, i32 noundef %188, i32 noundef %191, i32 noundef 1)
          to label %192 unwind label %168

192:                                              ; preds = %186
  br label %231

193:                                              ; preds = %172
  %194 = load i32, ptr %19, align 4, !tbaa !5
  %195 = sub nsw i32 %194, 1
  %196 = sext i32 %195 to i64
  %197 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %196) #6
  %198 = getelementptr inbounds %"struct.std::pair", ptr %197, i32 0, i32 0
  %199 = load i32, ptr %198, align 4, !tbaa !16
  %200 = load i32, ptr %21, align 4, !tbaa !5
  %201 = sub nsw i32 %200, 1
  %202 = sext i32 %201 to i64
  %203 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %202) #6
  %204 = getelementptr inbounds %"struct.std::pair", ptr %203, i32 0, i32 0
  %205 = load i32, ptr %204, align 4, !tbaa !16
  %206 = sub nsw i32 %199, %205
  %207 = call i32 @llvm.abs.i32(i32 %206, i1 true)
  %208 = load i32, ptr %19, align 4, !tbaa !5
  %209 = sub nsw i32 %208, 1
  %210 = sext i32 %209 to i64
  %211 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %210) #6
  %212 = getelementptr inbounds %"struct.std::pair", ptr %211, i32 0, i32 1
  %213 = load i32, ptr %212, align 4, !tbaa !18
  %214 = load i32, ptr %21, align 4, !tbaa !5
  %215 = sub nsw i32 %214, 1
  %216 = sext i32 %215 to i64
  %217 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %216) #6
  %218 = getelementptr inbounds %"struct.std::pair", ptr %217, i32 0, i32 1
  %219 = load i32, ptr %218, align 4, !tbaa !18
  %220 = sub nsw i32 %213, %219
  %221 = call i32 @llvm.abs.i32(i32 %220, i1 true)
  %222 = icmp eq i32 %207, %221
  br i1 %222, label %223, label %230

223:                                              ; preds = %193
  %224 = load ptr, ptr @mf, align 8, !tbaa !12
  %225 = load i32, ptr %19, align 4, !tbaa !5
  %226 = load i32, ptr %3, align 4, !tbaa !5
  %227 = load i32, ptr %21, align 4, !tbaa !5
  %228 = add nsw i32 %226, %227
  invoke void @_ZN7maxFlow7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(67232) %224, i32 noundef %225, i32 noundef %228, i32 noundef 1)
          to label %229 unwind label %168

229:                                              ; preds = %223
  br label %230

230:                                              ; preds = %229, %193
  br label %231

231:                                              ; preds = %230, %192
  br label %232

232:                                              ; preds = %231, %167
  br label %233

233:                                              ; preds = %232
  %234 = load i32, ptr %21, align 4, !tbaa !5
  %235 = add nsw i32 %234, 1
  store i32 %235, ptr %21, align 4, !tbaa !5
  br label %142, !llvm.loop !19

236:                                              ; preds = %146
  br label %237

237:                                              ; preds = %236
  %238 = load i32, ptr %19, align 4, !tbaa !5
  %239 = add nsw i32 %238, 1
  store i32 %239, ptr %19, align 4, !tbaa !5
  br label %136, !llvm.loop !20

240:                                              ; preds = %140
  %241 = load ptr, ptr @mf, align 8, !tbaa !12
  %242 = load i32, ptr %15, align 4, !tbaa !5
  %243 = load i32, ptr %16, align 4, !tbaa !5
  %244 = invoke noundef i32 @_ZN7maxFlow7maxflowEii(ptr noundef nonnull align 8 dereferenceable(67232) %241, i32 noundef %242, i32 noundef %243)
          to label %245 unwind label %99

245:                                              ; preds = %240
  %246 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %244)
          to label %247 unwind label %99

247:                                              ; preds = %245
  %248 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %246, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %249 unwind label %99

249:                                              ; preds = %247
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %1) #6
  ret void

250:                                              ; preds = %168, %131, %111, %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %251

251:                                              ; preds = %250, %80, %54, %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %1) #6
  br label %252

252:                                              ; preds = %251
  %253 = load ptr, ptr %5, align 8
  %254 = load i32, ptr %6, align 4
  %255 = insertvalue { ptr, i32 } poison, ptr %253, 0
  %256 = insertvalue { ptr, i32 } %255, i32 %254, 1
  resume { ptr, i32 } %256
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #0

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

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 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 = { "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 nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = !{!17, !6, i64 0}
!17 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!18 = !{!17, !6, i64 4}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !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.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }

@mf = external dso_local local_unnamed_addr global ptr, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::vector", align 8
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::pair", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %11 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %12 unwind label %19

12:                                               ; preds = %0
  %13 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %.preheader57 unwind label %19

.preheader57:                                     ; preds = %12
  %14 = load i32, ptr %3, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph, label %.preheader56

.preheader56:                                     ; preds = %27, %.preheader57
  %16 = phi i32 [ %14, %.preheader57 ], [ %29, %27 ]
  %17 = load i32, ptr %4, align 4, !tbaa !5
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph62, label %._crit_edge

19:                                               ; preds = %12, %0
  %20 = landingpad { ptr, i32 }
          cleanup
  br label %131

.lr.ph:                                           ; preds = %.preheader57, %27
  %.04360 = phi i32 [ %28, %27 ], [ 0, %.preheader57 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %21 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %22 unwind label %31

22:                                               ; preds = %.lr.ph
  %23 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %24 unwind label %31

24:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %25 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %26 unwind label %33

26:                                               ; preds = %24
  store i64 %25, ptr %7, align 8
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 4 dereferenceable(8) %7)
          to label %27 unwind label %33

27:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  %28 = add nuw nsw i32 %.04360, 1
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %.lr.ph, label %.preheader56, !llvm.loop !9

31:                                               ; preds = %22, %.lr.ph
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %35

33:                                               ; preds = %26, %24
  %34 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %35

35:                                               ; preds = %33, %31
  %.pn51 = phi { ptr, i32 } [ %34, %33 ], [ %32, %31 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  br label %131

._crit_edge.loopexit:                             ; preds = %48
  %.pre = load i32, ptr %3, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader56
  %36 = phi i32 [ %16, %.preheader56 ], [ %.pre, %._crit_edge.loopexit ]
  %.lcssa = phi i32 [ %17, %.preheader56 ], [ %50, %._crit_edge.loopexit ]
  %37 = add nsw i32 %36, %.lcssa
  %38 = add nsw i32 %37, 1
  %39 = add nsw i32 %37, 2
  %40 = load ptr, ptr @mf, align 8, !tbaa !11
  call void @_ZN7maxFlow5resetEi(ptr noundef nonnull align 8 dereferenceable(67232) %40, i32 noundef %39)
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %.not63 = icmp slt i32 %41, 1
  br i1 %.not63, label %.preheader55, label %.lr.ph66

.lr.ph62:                                         ; preds = %.preheader56, %48
  %.04261 = phi i32 [ %49, %48 ], [ 0, %.preheader56 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #6
  %42 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %43 unwind label %52

43:                                               ; preds = %.lr.ph62
  %44 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %42, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %45 unwind label %52

45:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %46 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %47 unwind label %54

47:                                               ; preds = %45
  store i64 %46, ptr %10, align 8
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 4 dereferenceable(8) %10)
          to label %48 unwind label %54

48:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  %49 = add nuw nsw i32 %.04261, 1
  %50 = load i32, ptr %4, align 4, !tbaa !5
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %.lr.ph62, label %._crit_edge.loopexit, !llvm.loop !13

52:                                               ; preds = %43, %.lr.ph62
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %56

54:                                               ; preds = %47, %45
  %55 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  br label %56

56:                                               ; preds = %54, %52
  %.pn49 = phi { ptr, i32 } [ %55, %54 ], [ %53, %52 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  br label %131

.preheader55:                                     ; preds = %62, %._crit_edge
  %57 = phi i32 [ %41, %._crit_edge ], [ %64, %62 ]
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %.not4567 = icmp slt i32 %58, 1
  br i1 %.not4567, label %.preheader54, label %.lr.ph69

59:                                               ; preds = %128, %126, %._crit_edge76
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %131

.lr.ph66:                                         ; preds = %._crit_edge, %62
  %.03664 = phi i32 [ %63, %62 ], [ 1, %._crit_edge ]
  %61 = load ptr, ptr @mf, align 8, !tbaa !11
  invoke void @_ZN7maxFlow7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(67232) %61, i32 noundef %38, i32 noundef %.03664, i32 noundef 1)
          to label %62 unwind label %65

62:                                               ; preds = %.lr.ph66
  %63 = add nuw nsw i32 %.03664, 1
  %64 = load i32, ptr %3, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.03664, %64
  br i1 %.not.not, label %.lr.ph66, label %.preheader55, !llvm.loop !14

65:                                               ; preds = %.lr.ph66
  %66 = landingpad { ptr, i32 }
          cleanup
  br label %131

.preheader54.loopexit:                            ; preds = %73
  %.pre83 = load i32, ptr %3, align 4, !tbaa !5
  br label %.preheader54

.preheader54:                                     ; preds = %.preheader54.loopexit, %.preheader55
  %67 = phi i32 [ %75, %.preheader54.loopexit ], [ %58, %.preheader55 ]
  %68 = phi i32 [ %.pre83, %.preheader54.loopexit ], [ %57, %.preheader55 ]
  %.not4674 = icmp slt i32 %68, 1
  %69 = icmp slt i32 %67, 1
  %or.cond = or i1 %.not4674, %69
  br i1 %or.cond, label %._crit_edge76, label %.preheader

.lr.ph69:                                         ; preds = %.preheader55, %73
  %.03568 = phi i32 [ %74, %73 ], [ 1, %.preheader55 ]
  %70 = load ptr, ptr @mf, align 8, !tbaa !11
  %71 = load i32, ptr %3, align 4, !tbaa !5
  %72 = add nsw i32 %71, %.03568
  invoke void @_ZN7maxFlow7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(67232) %70, i32 noundef %72, i32 noundef %39, i32 noundef 1)
          to label %73 unwind label %76

73:                                               ; preds = %.lr.ph69
  %74 = add nuw nsw i32 %.03568, 1
  %75 = load i32, ptr %4, align 4, !tbaa !5
  %.not45.not = icmp slt i32 %.03568, %75
  br i1 %.not45.not, label %.lr.ph69, label %.preheader54.loopexit, !llvm.loop !15

76:                                               ; preds = %.lr.ph69
  %77 = landingpad { ptr, i32 }
          cleanup
  br label %131

.preheader:                                       ; preds = %.preheader54, %._crit_edge73
  %78 = phi i32 [ %84, %._crit_edge73 ], [ %68, %.preheader54 ]
  %79 = phi i32 [ %85, %._crit_edge73 ], [ %67, %.preheader54 ]
  %indvars.iv80 = phi i64 [ %indvars.iv.next81, %._crit_edge73 ], [ 1, %.preheader54 ]
  %.not4770 = icmp slt i32 %79, 1
  br i1 %.not4770, label %._crit_edge73, label %.lr.ph72

.lr.ph72:                                         ; preds = %.preheader
  %80 = add nsw i64 %indvars.iv80, -1
  %81 = trunc i64 %indvars.iv80 to i32
  br label %87

._crit_edge76:                                    ; preds = %._crit_edge73, %.preheader54
  %82 = load ptr, ptr @mf, align 8, !tbaa !11
  %83 = invoke noundef i32 @_ZN7maxFlow7maxflowEii(ptr noundef nonnull align 8 dereferenceable(67232) %82, i32 noundef %38, i32 noundef %39)
          to label %126 unwind label %59

._crit_edge73.loopexit:                           ; preds = %123
  %.pre84 = load i32, ptr %3, align 4, !tbaa !5
  br label %._crit_edge73

._crit_edge73:                                    ; preds = %._crit_edge73.loopexit, %.preheader
  %84 = phi i32 [ %.pre84, %._crit_edge73.loopexit ], [ %78, %.preheader ]
  %85 = phi i32 [ %124, %._crit_edge73.loopexit ], [ %79, %.preheader ]
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %86 = sext i32 %84 to i64
  %.not46.not = icmp slt i64 %indvars.iv80, %86
  br i1 %.not46.not, label %.preheader, label %._crit_edge76, !llvm.loop !16

87:                                               ; preds = %.lr.ph72, %123
  %indvars.iv = phi i64 [ 1, %.lr.ph72 ], [ %indvars.iv.next, %123 ]
  %88 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %80) #6
  %89 = load i32, ptr %88, align 4, !tbaa !18
  %90 = add nsw i64 %indvars.iv, -1
  %91 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %90) #6
  %92 = load i32, ptr %91, align 4, !tbaa !18
  %93 = icmp eq i32 %89, %92
  br i1 %93, label %.invoke, label %96

94:                                               ; preds = %.invoke
  %95 = landingpad { ptr, i32 }
          cleanup
  br label %131

96:                                               ; preds = %87
  %97 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %80) #6
  %98 = getelementptr inbounds i8, ptr %97, i64 4
  %99 = load i32, ptr %98, align 4, !tbaa !20
  %100 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %90) #6
  %101 = getelementptr inbounds i8, ptr %100, i64 4
  %102 = load i32, ptr %101, align 4, !tbaa !20
  %103 = icmp eq i32 %99, %102
  br i1 %103, label %.invoke, label %104

104:                                              ; preds = %96
  %105 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %80) #6
  %106 = load i32, ptr %105, align 4, !tbaa !18
  %107 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %90) #6
  %108 = load i32, ptr %107, align 4, !tbaa !18
  %109 = sub nsw i32 %106, %108
  %110 = call i32 @llvm.abs.i32(i32 %109, i1 true)
  %111 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %80) #6
  %112 = getelementptr inbounds i8, ptr %111, i64 4
  %113 = load i32, ptr %112, align 4, !tbaa !20
  %114 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %90) #6
  %115 = getelementptr inbounds i8, ptr %114, i64 4
  %116 = load i32, ptr %115, align 4, !tbaa !20
  %117 = sub nsw i32 %113, %116
  %118 = call i32 @llvm.abs.i32(i32 %117, i1 true)
  %119 = icmp eq i32 %110, %118
  br i1 %119, label %.invoke, label %123

.invoke:                                          ; preds = %104, %96, %87
  %120 = load ptr, ptr @mf, align 8, !tbaa !11
  %.sink = load i32, ptr %3, align 4, !tbaa !5
  %121 = trunc nuw nsw i64 %indvars.iv to i32
  %122 = add nsw i32 %.sink, %121
  invoke void @_ZN7maxFlow7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(67232) %120, i32 noundef %81, i32 noundef %122, i32 noundef 1)
          to label %123 unwind label %94

123:                                              ; preds = %.invoke, %104
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %124 = load i32, ptr %4, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %.not47.not = icmp slt i64 %indvars.iv, %125
  br i1 %.not47.not, label %87, label %._crit_edge73.loopexit, !llvm.loop !21

126:                                              ; preds = %._crit_edge76
  %127 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %83)
          to label %128 unwind label %59

128:                                              ; preds = %126
  %129 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %127, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %130 unwind label %59

130:                                              ; preds = %128
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #6
  ret void

131:                                              ; preds = %59, %65, %76, %94, %56, %35, %19
  %.pn51.pn = phi { ptr, i32 } [ %.pn51, %35 ], [ %.pn49, %56 ], [ %20, %19 ], [ %66, %65 ], [ %77, %76 ], [ %95, %94 ], [ %60, %59 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn51.pn
}

; 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 nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0

; 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 nounwind uwtable
declare dso_local void @_ZN7maxFlow5resetEi(ptr noundef nonnull align 8 dereferenceable(67232), i32 noundef) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

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 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 = { "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 nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

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


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