; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Company Contests/SnapDeal Hackathon/Problem C (C)

; 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::__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] }
%"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 }
%"struct.std::pair" = type { i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@s = external dso_local global [20 x i32], align 16
@q = external dso_local global [20 x i32], align 16
@_Z2opB5cxx11 = external dso_local global [20 x %"class.std::__cxx11::basic_string"], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.3 = external hidden unnamed_addr constant [7 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 i32, align 4
  %7 = alloca ptr, align 8
  %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
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %"struct.std::pair", 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
  %22 = alloca %"struct.std::pair", align 4
  store i32 0, ptr %1, align 4
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %34, %0
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = load i32, ptr @n, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %29, label %28

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

29:                                               ; preds = %24
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [20 x i32], ptr @s, i64 0, i64 %31
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %32)
  br label %34

34:                                               ; preds = %29
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %2, align 4, !tbaa !5
  br label %24, !llvm.loop !9

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

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

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

43:                                               ; preds = %38
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [20 x i32], ptr @q, i64 0, i64 %45
  %47 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %46)
  br label %48

48:                                               ; preds = %43
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %3, align 4, !tbaa !5
  br label %38, !llvm.loop !11

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

52:                                               ; preds = %62, %51
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = load i32, ptr @n, align 4, !tbaa !5
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %57, label %56

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

57:                                               ; preds = %52
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [20 x %"class.std::__cxx11::basic_string"], ptr @_Z2opB5cxx11, i64 0, i64 %59
  %61 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %60)
  br label %62

62:                                               ; preds = %57
  %63 = load i32, ptr %4, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %4, align 4, !tbaa !5
  br label %52, !llvm.loop !12

65:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  %66 = load i32, ptr @n, align 4, !tbaa !5
  %67 = load i32, ptr @m, align 4, !tbaa !5
  %68 = add nsw i32 %66, %67
  store i32 %68, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  %69 = load i32, ptr %5, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %71 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 3632) #9
  %72 = load i32, ptr @n, align 4, !tbaa !5
  %73 = load i32, ptr @m, align 4, !tbaa !5
  %74 = add nsw i32 %72, %73
  %75 = add nsw i32 %74, 2
  invoke void @_ZN14minCostMaxFlowC2Ei(ptr noundef nonnull align 8 dereferenceable(3632) %71, i32 noundef %75)
          to label %76 unwind label %82

76:                                               ; preds = %65
  store ptr %71, ptr %7, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %90, %76
  %78 = load i32, ptr %10, align 4, !tbaa !5
  %79 = load i32, ptr @n, align 4, !tbaa !5
  %80 = icmp slt i32 %78, %79
  br i1 %80, label %86, label %81

81:                                               ; preds = %77
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %93

82:                                               ; preds = %65
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %8, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %9, align 4
  call void @_ZdlPvm(ptr noundef %71, i64 noundef 3632) #10
  br label %259

86:                                               ; preds = %77
  %87 = load ptr, ptr %7, align 8, !tbaa !13
  %88 = load i32, ptr %5, align 4, !tbaa !5
  %89 = load i32, ptr %10, align 4, !tbaa !5
  call void @_ZN14minCostMaxFlow7addEdgeEiiii(ptr noundef nonnull align 8 dereferenceable(3632) %87, i32 noundef %88, i32 noundef %89, i32 noundef 1, i32 noundef 0)
  br label %90

90:                                               ; preds = %86
  %91 = load i32, ptr %10, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %10, align 4, !tbaa !5
  br label %77, !llvm.loop !15

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

94:                                               ; preds = %105, %93
  %95 = load i32, ptr %11, align 4, !tbaa !5
  %96 = load i32, ptr @m, align 4, !tbaa !5
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %99, label %98

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

99:                                               ; preds = %94
  %100 = load ptr, ptr %7, align 8, !tbaa !13
  %101 = load i32, ptr @n, align 4, !tbaa !5
  %102 = load i32, ptr %11, align 4, !tbaa !5
  %103 = add nsw i32 %101, %102
  %104 = load i32, ptr %6, align 4, !tbaa !5
  call void @_ZN14minCostMaxFlow7addEdgeEiiii(ptr noundef nonnull align 8 dereferenceable(3632) %100, i32 noundef %103, i32 noundef %104, i32 noundef 1, i32 noundef 0)
  br label %105

105:                                              ; preds = %99
  %106 = load i32, ptr %11, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %11, align 4, !tbaa !5
  br label %94, !llvm.loop !16

108:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %150, %108
  %110 = load i32, ptr %12, align 4, !tbaa !5
  %111 = load i32, ptr @n, align 4, !tbaa !5
  %112 = icmp slt i32 %110, %111
  br i1 %112, label %114, label %113

113:                                              ; preds = %109
  store i32 17, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %153

114:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %146, %114
  %116 = load i32, ptr %14, align 4, !tbaa !5
  %117 = load i32, ptr @m, align 4, !tbaa !5
  %118 = icmp slt i32 %116, %117
  br i1 %118, label %120, label %119

119:                                              ; preds = %115
  store i32 20, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %149

120:                                              ; preds = %115
  %121 = load i32, ptr %12, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [20 x %"class.std::__cxx11::basic_string"], ptr @_Z2opB5cxx11, i64 0, i64 %122
  %124 = load i32, ptr %14, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %123, i64 noundef %125)
  %127 = load i8, ptr %126, align 1, !tbaa !17
  %128 = sext i8 %127 to i32
  %129 = icmp eq i32 %128, 89
  br i1 %129, label %130, label %145

130:                                              ; preds = %120
  %131 = load ptr, ptr %7, align 8, !tbaa !13
  %132 = load i32, ptr %12, align 4, !tbaa !5
  %133 = load i32, ptr @n, align 4, !tbaa !5
  %134 = load i32, ptr %14, align 4, !tbaa !5
  %135 = add nsw i32 %133, %134
  %136 = load i32, ptr %12, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [20 x i32], ptr @s, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = load i32, ptr %14, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [20 x i32], ptr @q, i64 0, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !5
  %144 = mul nsw i32 %139, %143
  call void @_ZN14minCostMaxFlow7addEdgeEiiii(ptr noundef nonnull align 8 dereferenceable(3632) %131, i32 noundef %132, i32 noundef %135, i32 noundef 1, i32 noundef %144)
  br label %145

145:                                              ; preds = %130, %120
  br label %146

146:                                              ; preds = %145
  %147 = load i32, ptr %14, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %14, align 4, !tbaa !5
  br label %115, !llvm.loop !18

149:                                              ; preds = %119
  br label %150

150:                                              ; preds = %149
  %151 = load i32, ptr %12, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %12, align 4, !tbaa !5
  br label %109, !llvm.loop !19

153:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %154 = load ptr, ptr %7, align 8, !tbaa !13
  %155 = load i32, ptr %5, align 4, !tbaa !5
  %156 = load i32, ptr %6, align 4, !tbaa !5
  %157 = call i64 @_ZN14minCostMaxFlow4mcmfEii(ptr noundef nonnull align 8 dereferenceable(3632) %154, i32 noundef %155, i32 noundef %156)
  store i64 %157, ptr %16, align 4
  %158 = getelementptr inbounds %"struct.std::pair", ptr %16, i32 0, i32 1
  %159 = load i32, ptr %158, align 4, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  store i32 %159, ptr %15, align 4, !tbaa !5
  %160 = load ptr, ptr %7, align 8, !tbaa !13
  %161 = icmp eq ptr %160, null
  br i1 %161, label %163, label %162

162:                                              ; preds = %153
  call void @_ZN14minCostMaxFlowD2Ev(ptr noundef nonnull align 8 dereferenceable(3632) %160) #8
  call void @_ZdlPvm(ptr noundef %160, i64 noundef 3632) #10
  br label %163

163:                                              ; preds = %162, %153
  %164 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 3632) #9
  %165 = load i32, ptr @n, align 4, !tbaa !5
  %166 = load i32, ptr @m, align 4, !tbaa !5
  %167 = add nsw i32 %165, %166
  %168 = add nsw i32 %167, 2
  invoke void @_ZN14minCostMaxFlowC2Ei(ptr noundef nonnull align 8 dereferenceable(3632) %164, i32 noundef %168)
          to label %169 unwind label %175

169:                                              ; preds = %163
  store ptr %164, ptr %7, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %170

170:                                              ; preds = %183, %169
  %171 = load i32, ptr %17, align 4, !tbaa !5
  %172 = load i32, ptr @n, align 4, !tbaa !5
  %173 = icmp slt i32 %171, %172
  br i1 %173, label %179, label %174

174:                                              ; preds = %170
  store i32 23, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %186

175:                                              ; preds = %163
  %176 = landingpad { ptr, i32 }
          cleanup
  %177 = extractvalue { ptr, i32 } %176, 0
  store ptr %177, ptr %8, align 8
  %178 = extractvalue { ptr, i32 } %176, 1
  store i32 %178, ptr %9, align 4
  call void @_ZdlPvm(ptr noundef %164, i64 noundef 3632) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %259

179:                                              ; preds = %170
  %180 = load ptr, ptr %7, align 8, !tbaa !13
  %181 = load i32, ptr %5, align 4, !tbaa !5
  %182 = load i32, ptr %17, align 4, !tbaa !5
  call void @_ZN14minCostMaxFlow7addEdgeEiiii(ptr noundef nonnull align 8 dereferenceable(3632) %180, i32 noundef %181, i32 noundef %182, i32 noundef 1, i32 noundef 0)
  br label %183

183:                                              ; preds = %179
  %184 = load i32, ptr %17, align 4, !tbaa !5
  %185 = add nsw i32 %184, 1
  store i32 %185, ptr %17, align 4, !tbaa !5
  br label %170, !llvm.loop !22

186:                                              ; preds = %174
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %187

187:                                              ; preds = %198, %186
  %188 = load i32, ptr %18, align 4, !tbaa !5
  %189 = load i32, ptr @m, align 4, !tbaa !5
  %190 = icmp slt i32 %188, %189
  br i1 %190, label %192, label %191

191:                                              ; preds = %187
  store i32 26, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %201

192:                                              ; preds = %187
  %193 = load ptr, ptr %7, align 8, !tbaa !13
  %194 = load i32, ptr @n, align 4, !tbaa !5
  %195 = load i32, ptr %18, align 4, !tbaa !5
  %196 = add nsw i32 %194, %195
  %197 = load i32, ptr %6, align 4, !tbaa !5
  call void @_ZN14minCostMaxFlow7addEdgeEiiii(ptr noundef nonnull align 8 dereferenceable(3632) %193, i32 noundef %196, i32 noundef %197, i32 noundef 1, i32 noundef 0)
  br label %198

198:                                              ; preds = %192
  %199 = load i32, ptr %18, align 4, !tbaa !5
  %200 = add nsw i32 %199, 1
  store i32 %200, ptr %18, align 4, !tbaa !5
  br label %187, !llvm.loop !23

201:                                              ; preds = %191
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %202

202:                                              ; preds = %244, %201
  %203 = load i32, ptr %19, align 4, !tbaa !5
  %204 = load i32, ptr @n, align 4, !tbaa !5
  %205 = icmp slt i32 %203, %204
  br i1 %205, label %207, label %206

206:                                              ; preds = %202
  store i32 29, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %247

207:                                              ; preds = %202
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %208

208:                                              ; preds = %240, %207
  %209 = load i32, ptr %20, align 4, !tbaa !5
  %210 = load i32, ptr @m, align 4, !tbaa !5
  %211 = icmp slt i32 %209, %210
  br i1 %211, label %213, label %212

212:                                              ; preds = %208
  store i32 32, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  br label %243

213:                                              ; preds = %208
  %214 = load i32, ptr %19, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [20 x %"class.std::__cxx11::basic_string"], ptr @_Z2opB5cxx11, i64 0, i64 %215
  %217 = load i32, ptr %20, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %216, i64 noundef %218)
  %220 = load i8, ptr %219, align 1, !tbaa !17
  %221 = sext i8 %220 to i32
  %222 = icmp eq i32 %221, 89
  br i1 %222, label %223, label %239

223:                                              ; preds = %213
  %224 = load ptr, ptr %7, align 8, !tbaa !13
  %225 = load i32, ptr %19, align 4, !tbaa !5
  %226 = load i32, ptr @n, align 4, !tbaa !5
  %227 = load i32, ptr %20, align 4, !tbaa !5
  %228 = add nsw i32 %226, %227
  %229 = load i32, ptr %19, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [20 x i32], ptr @s, i64 0, i64 %230
  %232 = load i32, ptr %231, align 4, !tbaa !5
  %233 = sub nsw i32 0, %232
  %234 = load i32, ptr %20, align 4, !tbaa !5
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds [20 x i32], ptr @q, i64 0, i64 %235
  %237 = load i32, ptr %236, align 4, !tbaa !5
  %238 = mul nsw i32 %233, %237
  call void @_ZN14minCostMaxFlow7addEdgeEiiii(ptr noundef nonnull align 8 dereferenceable(3632) %224, i32 noundef %225, i32 noundef %228, i32 noundef 1, i32 noundef %238)
  br label %239

239:                                              ; preds = %223, %213
  br label %240

240:                                              ; preds = %239
  %241 = load i32, ptr %20, align 4, !tbaa !5
  %242 = add nsw i32 %241, 1
  store i32 %242, ptr %20, align 4, !tbaa !5
  br label %208, !llvm.loop !24

243:                                              ; preds = %212
  br label %244

244:                                              ; preds = %243
  %245 = load i32, ptr %19, align 4, !tbaa !5
  %246 = add nsw i32 %245, 1
  store i32 %246, ptr %19, align 4, !tbaa !5
  br label %202, !llvm.loop !25

247:                                              ; preds = %206
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %248 = load ptr, ptr %7, align 8, !tbaa !13
  %249 = load i32, ptr %5, align 4, !tbaa !5
  %250 = load i32, ptr %6, align 4, !tbaa !5
  %251 = call i64 @_ZN14minCostMaxFlow4mcmfEii(ptr noundef nonnull align 8 dereferenceable(3632) %248, i32 noundef %249, i32 noundef %250)
  store i64 %251, ptr %22, align 4
  %252 = getelementptr inbounds %"struct.std::pair", ptr %22, i32 0, i32 1
  %253 = load i32, ptr %252, align 4, !tbaa !20
  %254 = sub nsw i32 0, %253
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  store i32 %254, ptr %21, align 4, !tbaa !5
  %255 = load i32, ptr %15, align 4, !tbaa !5
  %256 = load i32, ptr %21, align 4, !tbaa !5
  %257 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %255, i32 noundef %256)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  %258 = load i32, ptr %1, align 4
  ret i32 %258

259:                                              ; preds = %175, %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  br label %260

260:                                              ; preds = %259
  %261 = load ptr, ptr %8, align 8
  %262 = load i32, ptr %9, align 4
  %263 = insertvalue { ptr, i32 } poison, ptr %261, 0
  %264 = insertvalue { ptr, i32 } %263, i32 %262, 1
  resume { ptr, i32 } %264
}

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 noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #1

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZN14minCostMaxFlow4mcmfEii(ptr noundef nonnull align 8 dereferenceable(3632), i32 noundef, i32 noundef) #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN14minCostMaxFlowD2Ev(ptr noundef nonnull align 8 dereferenceable(3632)) unnamed_addr #7 align 2

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

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 = { 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 #4 = { 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 #5 = { 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 #6 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = !{!21, !6, i64 4}
!21 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !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::__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] }
%"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 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@s = external dso_local global [20 x i32], align 16
@q = external dso_local global [20 x i32], align 16
@_Z2opB5cxx11 = external dso_local global [20 x %"class.std::__cxx11::basic_string"], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.3 = external hidden unnamed_addr constant [7 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 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 0
  br i1 %3, label %.lr.ph, label %.preheader80

.preheader80:                                     ; preds = %.lr.ph, %0
  %4 = phi i32 [ %2, %0 ], [ %9, %.lr.ph ]
  %5 = load i32, ptr @m, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph83, label %.preheader79

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

.preheader79.loopexit:                            ; preds = %.lr.ph83
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %.preheader79

.preheader79:                                     ; preds = %.preheader79.loopexit, %.preheader80
  %12 = phi i32 [ %17, %.preheader79.loopexit ], [ %5, %.preheader80 ]
  %13 = phi i32 [ %.pre, %.preheader79.loopexit ], [ %4, %.preheader80 ]
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph85, label %._crit_edge

.lr.ph83:                                         ; preds = %.preheader80, %.lr.ph83
  %indvars.iv110 = phi i64 [ %indvars.iv.next111, %.lr.ph83 ], [ 0, %.preheader80 ]
  %15 = getelementptr inbounds [20 x i32], ptr @q, i64 0, i64 %indvars.iv110
  %16 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %15)
  %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1
  %17 = load i32, ptr @m, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = icmp slt i64 %indvars.iv.next111, %18
  br i1 %19, label %.lr.ph83, label %.preheader79.loopexit, !llvm.loop !11

._crit_edge.loopexit:                             ; preds = %.lr.ph85
  %.pre128 = load i32, ptr @m, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader79
  %20 = phi i32 [ %12, %.preheader79 ], [ %.pre128, %._crit_edge.loopexit ]
  %.lcssa = phi i32 [ %13, %.preheader79 ], [ %29, %._crit_edge.loopexit ]
  %21 = add nsw i32 %20, %.lcssa
  %22 = add nsw i32 %21, 1
  %23 = tail call noalias noundef nonnull dereferenceable(3632) ptr @_Znwm(i64 noundef 3632) #8
  %24 = add nsw i32 %21, 2
  tail call void @_ZN14minCostMaxFlowC2Ei(ptr noundef nonnull align 8 dereferenceable(3632) %23, i32 noundef %24)
  %25 = load i32, ptr @n, align 4, !tbaa !5
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %.lr.ph88, label %.preheader78

.lr.ph85:                                         ; preds = %.preheader79, %.lr.ph85
  %indvars.iv113 = phi i64 [ %indvars.iv.next114, %.lr.ph85 ], [ 0, %.preheader79 ]
  %27 = getelementptr inbounds [20 x %"class.std::__cxx11::basic_string"], ptr @_Z2opB5cxx11, i64 0, i64 %indvars.iv113
  %28 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %27)
  %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1
  %29 = load i32, ptr @n, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = icmp slt i64 %indvars.iv.next114, %30
  br i1 %31, label %.lr.ph85, label %._crit_edge.loopexit, !llvm.loop !12

.preheader78:                                     ; preds = %.lr.ph88, %._crit_edge
  %32 = phi i32 [ %25, %._crit_edge ], [ %36, %.lr.ph88 ]
  %33 = load i32, ptr @m, align 4, !tbaa !5
  %34 = icmp sgt i32 %33, 0
  br i1 %34, label %.lr.ph90, label %.preheader77

.lr.ph88:                                         ; preds = %._crit_edge, %.lr.ph88
  %.06986 = phi i32 [ %35, %.lr.ph88 ], [ 0, %._crit_edge ]
  tail call void @_ZN14minCostMaxFlow7addEdgeEiiii(ptr noundef nonnull align 8 dereferenceable(3632) %23, i32 noundef %21, i32 noundef %.06986, i32 noundef 1, i32 noundef 0)
  %35 = add nuw nsw i32 %.06986, 1
  %36 = load i32, ptr @n, align 4, !tbaa !5
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %.lr.ph88, label %.preheader78, !llvm.loop !13

.preheader77.loopexit:                            ; preds = %.lr.ph90
  %.pre129 = load i32, ptr @n, align 4, !tbaa !5
  br label %.preheader77

.preheader77:                                     ; preds = %.preheader77.loopexit, %.preheader78
  %38 = phi i32 [ %45, %.preheader77.loopexit ], [ %33, %.preheader78 ]
  %39 = phi i32 [ %.pre129, %.preheader77.loopexit ], [ %32, %.preheader78 ]
  %40 = icmp sgt i32 %39, 0
  %41 = icmp sgt i32 %38, 0
  %or.cond = and i1 %40, %41
  br i1 %or.cond, label %.preheader76, label %._crit_edge95

.lr.ph90:                                         ; preds = %.preheader78, %.lr.ph90
  %.07289 = phi i32 [ %44, %.lr.ph90 ], [ 0, %.preheader78 ]
  %42 = load i32, ptr @n, align 4, !tbaa !5
  %43 = add nsw i32 %42, %.07289
  tail call void @_ZN14minCostMaxFlow7addEdgeEiiii(ptr noundef nonnull align 8 dereferenceable(3632) %23, i32 noundef %43, i32 noundef %22, i32 noundef 1, i32 noundef 0)
  %44 = add nuw nsw i32 %.07289, 1
  %45 = load i32, ptr @m, align 4, !tbaa !5
  %46 = icmp slt i32 %44, %45
  br i1 %46, label %.lr.ph90, label %.preheader77.loopexit, !llvm.loop !14

.preheader76:                                     ; preds = %.preheader77, %._crit_edge93
  %47 = phi i32 [ %61, %._crit_edge93 ], [ %39, %.preheader77 ]
  %48 = phi i32 [ %62, %._crit_edge93 ], [ %38, %.preheader77 ]
  %indvars.iv119 = phi i64 [ %indvars.iv.next120, %._crit_edge93 ], [ 0, %.preheader77 ]
  %49 = icmp sgt i32 %48, 0
  br i1 %49, label %.lr.ph92, label %._crit_edge93

.lr.ph92:                                         ; preds = %.preheader76
  %50 = getelementptr inbounds [20 x %"class.std::__cxx11::basic_string"], ptr @_Z2opB5cxx11, i64 0, i64 %indvars.iv119
  %51 = getelementptr inbounds [20 x i32], ptr @s, i64 0, i64 %indvars.iv119
  %52 = trunc nuw nsw i64 %indvars.iv119 to i32
  br label %65

._crit_edge95:                                    ; preds = %._crit_edge93, %.preheader77
  %53 = tail call i64 @_ZN14minCostMaxFlow4mcmfEii(ptr noundef nonnull align 8 dereferenceable(3632) %23, i32 noundef %21, i32 noundef %22)
  tail call void @_ZN14minCostMaxFlowD2Ev(ptr noundef nonnull align 8 dereferenceable(3632) %23) #9
  tail call void @_ZdlPvm(ptr noundef nonnull %23, i64 noundef 3632) #10
  %54 = tail call noalias noundef nonnull dereferenceable(3632) ptr @_Znwm(i64 noundef 3632) #8
  %55 = load i32, ptr @n, align 4, !tbaa !5
  %56 = load i32, ptr @m, align 4, !tbaa !5
  %57 = add i32 %55, 2
  %58 = add i32 %57, %56
  tail call void @_ZN14minCostMaxFlowC2Ei(ptr noundef nonnull align 8 dereferenceable(3632) %54, i32 noundef %58)
  %59 = load i32, ptr @n, align 4, !tbaa !5
  %60 = icmp sgt i32 %59, 0
  br i1 %60, label %.lr.ph98, label %.preheader75

._crit_edge93.loopexit:                           ; preds = %77
  %.pre130 = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge93

._crit_edge93:                                    ; preds = %._crit_edge93.loopexit, %.preheader76
  %61 = phi i32 [ %.pre130, %._crit_edge93.loopexit ], [ %47, %.preheader76 ]
  %62 = phi i32 [ %78, %._crit_edge93.loopexit ], [ %48, %.preheader76 ]
  %indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 1
  %63 = sext i32 %61 to i64
  %64 = icmp slt i64 %indvars.iv.next120, %63
  br i1 %64, label %.preheader76, label %._crit_edge95, !llvm.loop !15

65:                                               ; preds = %.lr.ph92, %77
  %indvars.iv116 = phi i64 [ 0, %.lr.ph92 ], [ %indvars.iv.next117, %77 ]
  %66 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %50, i64 noundef %indvars.iv116)
  %67 = load i8, ptr %66, align 1, !tbaa !17
  %68 = icmp eq i8 %67, 89
  br i1 %68, label %69, label %77

69:                                               ; preds = %65
  %70 = load i32, ptr @n, align 4, !tbaa !5
  %71 = trunc nuw nsw i64 %indvars.iv116 to i32
  %72 = add nsw i32 %70, %71
  %73 = load i32, ptr %51, align 4, !tbaa !5
  %74 = getelementptr inbounds [20 x i32], ptr @q, i64 0, i64 %indvars.iv116
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = mul nsw i32 %75, %73
  tail call void @_ZN14minCostMaxFlow7addEdgeEiiii(ptr noundef nonnull align 8 dereferenceable(3632) %23, i32 noundef %52, i32 noundef %72, i32 noundef 1, i32 noundef %76)
  br label %77

77:                                               ; preds = %65, %69
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
  %78 = load i32, ptr @m, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = icmp slt i64 %indvars.iv.next117, %79
  br i1 %80, label %65, label %._crit_edge93.loopexit, !llvm.loop !18

.preheader75:                                     ; preds = %.lr.ph98, %._crit_edge95
  %81 = phi i32 [ %59, %._crit_edge95 ], [ %85, %.lr.ph98 ]
  %82 = load i32, ptr @m, align 4, !tbaa !5
  %83 = icmp sgt i32 %82, 0
  br i1 %83, label %.lr.ph100, label %.preheader74

.lr.ph98:                                         ; preds = %._crit_edge95, %.lr.ph98
  %.06796 = phi i32 [ %84, %.lr.ph98 ], [ 0, %._crit_edge95 ]
  tail call void @_ZN14minCostMaxFlow7addEdgeEiiii(ptr noundef nonnull align 8 dereferenceable(3632) %54, i32 noundef %21, i32 noundef %.06796, i32 noundef 1, i32 noundef 0)
  %84 = add nuw nsw i32 %.06796, 1
  %85 = load i32, ptr @n, align 4, !tbaa !5
  %86 = icmp slt i32 %84, %85
  br i1 %86, label %.lr.ph98, label %.preheader75, !llvm.loop !19

.preheader74.loopexit:                            ; preds = %.lr.ph100
  %.pre131 = load i32, ptr @n, align 4, !tbaa !5
  br label %.preheader74

.preheader74:                                     ; preds = %.preheader74.loopexit, %.preheader75
  %87 = phi i32 [ %94, %.preheader74.loopexit ], [ %82, %.preheader75 ]
  %88 = phi i32 [ %.pre131, %.preheader74.loopexit ], [ %81, %.preheader75 ]
  %89 = icmp sgt i32 %88, 0
  %90 = icmp sgt i32 %87, 0
  %or.cond142 = and i1 %89, %90
  br i1 %or.cond142, label %.preheader, label %._crit_edge105

.lr.ph100:                                        ; preds = %.preheader75, %.lr.ph100
  %.06699 = phi i32 [ %93, %.lr.ph100 ], [ 0, %.preheader75 ]
  %91 = load i32, ptr @n, align 4, !tbaa !5
  %92 = add nsw i32 %91, %.06699
  tail call void @_ZN14minCostMaxFlow7addEdgeEiiii(ptr noundef nonnull align 8 dereferenceable(3632) %54, i32 noundef %92, i32 noundef %22, i32 noundef 1, i32 noundef 0)
  %93 = add nuw nsw i32 %.06699, 1
  %94 = load i32, ptr @m, align 4, !tbaa !5
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %.lr.ph100, label %.preheader74.loopexit, !llvm.loop !20

.preheader:                                       ; preds = %.preheader74, %._crit_edge103
  %96 = phi i32 [ %105, %._crit_edge103 ], [ %88, %.preheader74 ]
  %97 = phi i32 [ %106, %._crit_edge103 ], [ %87, %.preheader74 ]
  %indvars.iv125 = phi i64 [ %indvars.iv.next126, %._crit_edge103 ], [ 0, %.preheader74 ]
  %98 = icmp sgt i32 %97, 0
  br i1 %98, label %.lr.ph102, label %._crit_edge103

.lr.ph102:                                        ; preds = %.preheader
  %99 = getelementptr inbounds [20 x %"class.std::__cxx11::basic_string"], ptr @_Z2opB5cxx11, i64 0, i64 %indvars.iv125
  %100 = getelementptr inbounds [20 x i32], ptr @s, i64 0, i64 %indvars.iv125
  %101 = trunc nuw nsw i64 %indvars.iv125 to i32
  br label %109

._crit_edge105:                                   ; preds = %._crit_edge103, %.preheader74
  %.sroa.318.0.extract.shift = lshr i64 %53, 32
  %.sroa.318.0.extract.trunc = trunc nuw i64 %.sroa.318.0.extract.shift to i32
  %102 = tail call i64 @_ZN14minCostMaxFlow4mcmfEii(ptr noundef nonnull align 8 dereferenceable(3632) %54, i32 noundef %21, i32 noundef %22)
  %.sroa.3.0.extract.shift = lshr i64 %102, 32
  %.sroa.3.0.extract.trunc = trunc nuw i64 %.sroa.3.0.extract.shift to i32
  %103 = sub nsw i32 0, %.sroa.3.0.extract.trunc
  %104 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %.sroa.318.0.extract.trunc, i32 noundef %103)
  ret i32 0

._crit_edge103.loopexit:                          ; preds = %122
  %.pre132 = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge103

._crit_edge103:                                   ; preds = %._crit_edge103.loopexit, %.preheader
  %105 = phi i32 [ %.pre132, %._crit_edge103.loopexit ], [ %96, %.preheader ]
  %106 = phi i32 [ %123, %._crit_edge103.loopexit ], [ %97, %.preheader ]
  %indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 1
  %107 = sext i32 %105 to i64
  %108 = icmp slt i64 %indvars.iv.next126, %107
  br i1 %108, label %.preheader, label %._crit_edge105, !llvm.loop !21

109:                                              ; preds = %.lr.ph102, %122
  %indvars.iv122 = phi i64 [ 0, %.lr.ph102 ], [ %indvars.iv.next123, %122 ]
  %110 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %99, i64 noundef %indvars.iv122)
  %111 = load i8, ptr %110, align 1, !tbaa !17
  %112 = icmp eq i8 %111, 89
  br i1 %112, label %113, label %122

113:                                              ; preds = %109
  %114 = load i32, ptr @n, align 4, !tbaa !5
  %115 = trunc nuw nsw i64 %indvars.iv122 to i32
  %116 = add nsw i32 %114, %115
  %117 = load i32, ptr %100, align 4, !tbaa !5
  %118 = getelementptr inbounds [20 x i32], ptr @q, i64 0, i64 %indvars.iv122
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = mul i32 %117, %119
  %121 = sub i32 0, %120
  tail call void @_ZN14minCostMaxFlow7addEdgeEiiii(ptr noundef nonnull align 8 dereferenceable(3632) %54, i32 noundef %101, i32 noundef %116, i32 noundef 1, i32 noundef %121)
  br label %122

122:                                              ; preds = %109, %113
  %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
  %123 = load i32, ptr @m, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = icmp slt i64 %indvars.iv.next123, %124
  br i1 %125, label %109, label %._crit_edge103.loopexit, !llvm.loop !22
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZN14minCostMaxFlow4mcmfEii(ptr noundef nonnull align 8 dereferenceable(3632), i32 noundef, i32 noundef) local_unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN14minCostMaxFlowD2Ev(ptr noundef nonnull align 8 dereferenceable(3632)) unnamed_addr #7 align 2

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

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 = { "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 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 #4 = { 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 #5 = { 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 #6 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { builtin allocsize(0) }
attributes #9 = { nounwind }
attributes #10 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !16}
!16 = !{!"llvm.loop.unswitch.partial.disable"}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10, !16}
!22 = distinct !{!22, !10}


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