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

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

%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%struct.maxFlow = type { i32, [1000 x i32], [1000 x i32], %"class.std::vector", [1000 x %"class.std::vector.3"] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<maxFlow::Edge, std::allocator<maxFlow::Edge>>::_Vector_impl" }
%"struct.std::_Vector_base<maxFlow::Edge, std::allocator<maxFlow::Edge>>::_Vector_impl" = type { %"struct.std::_Vector_base<maxFlow::Edge, std::allocator<maxFlow::Edge>>::_Vector_impl_data" }
%"struct.std::_Vector_base<maxFlow::Edge, std::allocator<maxFlow::Edge>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global [101 x i32], align 16
@res = external dso_local global i32, align 4
@primes = external dso_local global %"class.std::set", align 8
@gp = external dso_local global [101 x [101 x i32]], 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
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %14 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %15 = alloca %struct.maxFlow, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  store i32 0, ptr %1, align 4
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %85, %0
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %32 = icmp sle i32 %30, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %88

34:                                               ; preds = %29
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %36
  %38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %37)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !5
  store i32 %42, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 2, ptr %5, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %72, %34
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = load i32, ptr %5, align 4, !tbaa !5
  %46 = mul nsw i32 %44, %45
  %47 = load i32, ptr %4, align 4, !tbaa !5
  %48 = icmp sle i32 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %43
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %75

50:                                               ; preds = %43
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = load i32, ptr %5, align 4, !tbaa !5
  %53 = srem i32 %51, %52
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %55, label %71

55:                                               ; preds = %50
  %56 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @primes, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %57 = getelementptr inbounds { ptr, i8 }, ptr %6, i32 0, i32 0
  %58 = extractvalue { ptr, i8 } %56, 0
  store ptr %58, ptr %57, align 8
  %59 = getelementptr inbounds { ptr, i8 }, ptr %6, i32 0, i32 1
  %60 = extractvalue { ptr, i8 } %56, 1
  store i8 %60, ptr %59, align 8
  br label %61

61:                                               ; preds = %66, %55
  %62 = load i32, ptr %4, align 4, !tbaa !5
  %63 = load i32, ptr %5, align 4, !tbaa !5
  %64 = srem i32 %62, %63
  %65 = icmp eq i32 %64, 0
  br i1 %65, label %66, label %70

66:                                               ; preds = %61
  %67 = load i32, ptr %5, align 4, !tbaa !5
  %68 = load i32, ptr %4, align 4, !tbaa !5
  %69 = sdiv i32 %68, %67
  store i32 %69, ptr %4, align 4, !tbaa !5
  br label %61, !llvm.loop !9

70:                                               ; preds = %61
  br label %71

71:                                               ; preds = %70, %50
  br label %72

72:                                               ; preds = %71
  %73 = load i32, ptr %5, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %5, align 4, !tbaa !5
  br label %43, !llvm.loop !11

75:                                               ; preds = %49
  %76 = load i32, ptr %4, align 4, !tbaa !5
  %77 = icmp sgt i32 %76, 1
  br i1 %77, label %78, label %84

78:                                               ; preds = %75
  %79 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @primes, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %80 = getelementptr inbounds { ptr, i8 }, ptr %7, i32 0, i32 0
  %81 = extractvalue { ptr, i8 } %79, 0
  store ptr %81, ptr %80, align 8
  %82 = getelementptr inbounds { ptr, i8 }, ptr %7, i32 0, i32 1
  %83 = extractvalue { ptr, i8 } %79, 1
  store i8 %83, ptr %82, align 8
  br label %84

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

85:                                               ; preds = %84
  %86 = load i32, ptr %2, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %2, align 4, !tbaa !5
  br label %29, !llvm.loop !12

88:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %89 = load i32, ptr @n, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %91 = load i32, ptr @n, align 4, !tbaa !5
  %92 = add nsw i32 %91, 2
  store i32 %92, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %93

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

97:                                               ; preds = %93
  store i32 10, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %115

98:                                               ; preds = %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %99 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %11, ptr noundef %12)
  %100 = load i32, ptr %12, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [101 x [101 x i32]], ptr @gp, i64 0, i64 %101
  %103 = load i32, ptr %11, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [101 x i32], ptr %102, i64 0, i64 %104
  store i32 1, ptr %105, align 4, !tbaa !5
  %106 = load i32, ptr %11, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [101 x [101 x i32]], ptr @gp, i64 0, i64 %107
  %109 = load i32, ptr %12, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [101 x i32], ptr %108, i64 0, i64 %110
  store i32 1, ptr %111, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %112

112:                                              ; preds = %98
  %113 = load i32, ptr %10, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %10, align 4, !tbaa !5
  br label %93, !llvm.loop !13

115:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %116 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @primes) #6
  %117 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %13, i32 0, i32 0
  store ptr %116, ptr %117, align 8
  br label %118

118:                                              ; preds = %267, %115
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %119 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @primes) #6
  %120 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %14, i32 0, i32 0
  store ptr %119, ptr %120, align 8
  %121 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br i1 %121, label %123, label %122

122:                                              ; preds = %118
  store i32 13, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %275

123:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 32032, ptr %15) #6
  %124 = load i32, ptr @n, align 4, !tbaa !5
  %125 = add nsw i32 %124, 2
  call void @_ZN7maxFlowC2Ei(ptr noundef nonnull align 8 dereferenceable(32032) %15, i32 noundef %125)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %126 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  %127 = load i32, ptr %126, align 4, !tbaa !5
  store i32 %127, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 1, ptr %17, align 4, !tbaa !5
  br label %128

128:                                              ; preds = %168, %123
  %129 = load i32, ptr %17, align 4, !tbaa !5
  %130 = load i32, ptr @n, align 4, !tbaa !5
  %131 = icmp sle i32 %129, %130
  br i1 %131, label %133, label %132

132:                                              ; preds = %128
  store i32 16, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %171

133:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %134 = load i32, ptr %17, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  store i32 %137, ptr %19, align 4, !tbaa !5
  br label %138

138:                                              ; preds = %143, %133
  %139 = load i32, ptr %19, align 4, !tbaa !5
  %140 = load i32, ptr %16, align 4, !tbaa !5
  %141 = srem i32 %139, %140
  %142 = icmp eq i32 %141, 0
  br i1 %142, label %143, label %149

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

149:                                              ; preds = %138
  %150 = load i32, ptr %17, align 4, !tbaa !5
  %151 = srem i32 %150, 2
  %152 = icmp eq i32 %151, 1
  br i1 %152, label %153, label %162

153:                                              ; preds = %149
  %154 = load i32, ptr %8, align 4, !tbaa !5
  %155 = load i32, ptr %17, align 4, !tbaa !5
  %156 = load i32, ptr %18, align 4, !tbaa !5
  invoke void @_ZN7maxFlow7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(32032) %15, i32 noundef %154, i32 noundef %155, i32 noundef %156)
          to label %157 unwind label %158

157:                                              ; preds = %153
  br label %167

158:                                              ; preds = %162, %153
  %159 = landingpad { ptr, i32 }
          cleanup
  %160 = extractvalue { ptr, i32 } %159, 0
  store ptr %160, ptr %20, align 8
  %161 = extractvalue { ptr, i32 } %159, 1
  store i32 %161, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %274

162:                                              ; preds = %149
  %163 = load i32, ptr %17, align 4, !tbaa !5
  %164 = load i32, ptr %9, align 4, !tbaa !5
  %165 = load i32, ptr %18, align 4, !tbaa !5
  invoke void @_ZN7maxFlow7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(32032) %15, i32 noundef %163, i32 noundef %164, i32 noundef %165)
          to label %166 unwind label %158

166:                                              ; preds = %162
  br label %167

167:                                              ; preds = %166, %157
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %168

168:                                              ; preds = %167
  %169 = load i32, ptr %17, align 4, !tbaa !5
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr %17, align 4, !tbaa !5
  br label %128, !llvm.loop !15

171:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  store i32 1, ptr %22, align 4, !tbaa !5
  br label %172

172:                                              ; preds = %257, %171
  %173 = load i32, ptr %22, align 4, !tbaa !5
  %174 = load i32, ptr @n, align 4, !tbaa !5
  %175 = icmp sle i32 %173, %174
  br i1 %175, label %177, label %176

176:                                              ; preds = %172
  store i32 21, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  br label %260

177:                                              ; preds = %172
  %178 = load i32, ptr %22, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %179
  %181 = load i32, ptr %180, align 4, !tbaa !5
  %182 = load i32, ptr %16, align 4, !tbaa !5
  %183 = srem i32 %181, %182
  %184 = icmp ne i32 %183, 0
  br i1 %184, label %185, label %186

185:                                              ; preds = %177
  br label %257

186:                                              ; preds = %177
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %187 = load i32, ptr %22, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %188
  %190 = load i32, ptr %189, align 4, !tbaa !5
  store i32 %190, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  store i32 0, ptr %24, align 4, !tbaa !5
  br label %191

191:                                              ; preds = %196, %186
  %192 = load i32, ptr %23, align 4, !tbaa !5
  %193 = load i32, ptr %16, align 4, !tbaa !5
  %194 = srem i32 %192, %193
  %195 = icmp eq i32 %194, 0
  br i1 %195, label %196, label %202

196:                                              ; preds = %191
  %197 = load i32, ptr %24, align 4, !tbaa !5
  %198 = add nsw i32 %197, 1
  store i32 %198, ptr %24, align 4, !tbaa !5
  %199 = load i32, ptr %16, align 4, !tbaa !5
  %200 = load i32, ptr %23, align 4, !tbaa !5
  %201 = sdiv i32 %200, %199
  store i32 %201, ptr %23, align 4, !tbaa !5
  br label %191, !llvm.loop !16

202:                                              ; preds = %191
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  store i32 2, ptr %25, align 4, !tbaa !5
  br label %203

203:                                              ; preds = %249, %202
  %204 = load i32, ptr %25, align 4, !tbaa !5
  %205 = load i32, ptr @n, align 4, !tbaa !5
  %206 = icmp sle i32 %204, %205
  br i1 %206, label %208, label %207

207:                                              ; preds = %203
  store i32 26, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  br label %256

208:                                              ; preds = %203
  %209 = load i32, ptr %25, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %210
  %212 = load i32, ptr %211, align 4, !tbaa !5
  %213 = load i32, ptr %16, align 4, !tbaa !5
  %214 = srem i32 %212, %213
  %215 = icmp ne i32 %214, 0
  br i1 %215, label %225, label %216

216:                                              ; preds = %208
  %217 = load i32, ptr %22, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [101 x [101 x i32]], ptr @gp, i64 0, i64 %218
  %220 = load i32, ptr %25, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [101 x i32], ptr %219, i64 0, i64 %221
  %223 = load i32, ptr %222, align 4, !tbaa !5
  %224 = icmp ne i32 %223, 0
  br i1 %224, label %226, label %225

225:                                              ; preds = %216, %208
  br label %249

226:                                              ; preds = %216
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  store i32 0, ptr %26, align 4, !tbaa !5
  %227 = load i32, ptr %25, align 4, !tbaa !5
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %228
  %230 = load i32, ptr %229, align 4, !tbaa !5
  store i32 %230, ptr %23, align 4, !tbaa !5
  br label %231

231:                                              ; preds = %236, %226
  %232 = load i32, ptr %23, align 4, !tbaa !5
  %233 = load i32, ptr %16, align 4, !tbaa !5
  %234 = srem i32 %232, %233
  %235 = icmp eq i32 %234, 0
  br i1 %235, label %236, label %242

236:                                              ; preds = %231
  %237 = load i32, ptr %26, align 4, !tbaa !5
  %238 = add nsw i32 %237, 1
  store i32 %238, ptr %26, align 4, !tbaa !5
  %239 = load i32, ptr %16, align 4, !tbaa !5
  %240 = load i32, ptr %23, align 4, !tbaa !5
  %241 = sdiv i32 %240, %239
  store i32 %241, ptr %23, align 4, !tbaa !5
  br label %231, !llvm.loop !17

242:                                              ; preds = %231
  %243 = load i32, ptr %22, align 4, !tbaa !5
  %244 = load i32, ptr %25, align 4, !tbaa !5
  %245 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %26, ptr noundef nonnull align 4 dereferenceable(4) %24)
          to label %246 unwind label %252

246:                                              ; preds = %242
  %247 = load i32, ptr %245, align 4, !tbaa !5
  invoke void @_ZN7maxFlow7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(32032) %15, i32 noundef %243, i32 noundef %244, i32 noundef %247)
          to label %248 unwind label %252

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

249:                                              ; preds = %248, %225
  %250 = load i32, ptr %25, align 4, !tbaa !5
  %251 = add nsw i32 %250, 2
  store i32 %251, ptr %25, align 4, !tbaa !5
  br label %203, !llvm.loop !18

252:                                              ; preds = %246, %242
  %253 = landingpad { ptr, i32 }
          cleanup
  %254 = extractvalue { ptr, i32 } %253, 0
  store ptr %254, ptr %20, align 8
  %255 = extractvalue { ptr, i32 } %253, 1
  store i32 %255, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  br label %274

256:                                              ; preds = %207
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %257

257:                                              ; preds = %256, %185
  %258 = load i32, ptr %22, align 4, !tbaa !5
  %259 = add nsw i32 %258, 2
  store i32 %259, ptr %22, align 4, !tbaa !5
  br label %172, !llvm.loop !19

260:                                              ; preds = %176
  %261 = load i32, ptr %8, align 4, !tbaa !5
  %262 = load i32, ptr %9, align 4, !tbaa !5
  %263 = invoke noundef i32 @_ZN7maxFlow7maxflowEii(ptr noundef nonnull align 8 dereferenceable(32032) %15, i32 noundef %261, i32 noundef %262)
          to label %264 unwind label %270

264:                                              ; preds = %260
  %265 = load i32, ptr @res, align 4, !tbaa !5
  %266 = add nsw i32 %265, %263
  store i32 %266, ptr @res, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @_ZN7maxFlowD2Ev(ptr noundef nonnull align 8 dereferenceable(32032) %15) #6
  call void @llvm.lifetime.end.p0(i64 32032, ptr %15) #6
  br label %267

267:                                              ; preds = %264
  %268 = call ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEi(ptr noundef nonnull align 8 dereferenceable(8) %13, i32 noundef 0) #6
  %269 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %27, i32 0, i32 0
  store ptr %268, ptr %269, align 8
  br label %118, !llvm.loop !20

270:                                              ; preds = %260
  %271 = landingpad { ptr, i32 }
          cleanup
  %272 = extractvalue { ptr, i32 } %271, 0
  store ptr %272, ptr %20, align 8
  %273 = extractvalue { ptr, i32 } %271, 1
  store i32 %273, ptr %21, align 4
  br label %274

274:                                              ; preds = %270, %252, %158
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @_ZN7maxFlowD2Ev(ptr noundef nonnull align 8 dereferenceable(32032) %15) #6
  call void @llvm.lifetime.end.p0(i64 32032, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #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 %279

275:                                              ; preds = %122
  %276 = load i32, ptr @res, align 4, !tbaa !5
  %277 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %276)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  %278 = load i32, ptr %1, align 4
  ret i32 %278

279:                                              ; preds = %274
  %280 = load ptr, ptr %20, align 8
  %281 = load i32, ptr %21, align 4
  %282 = insertvalue { ptr, i32 } poison, ptr %280, 0
  %283 = insertvalue { ptr, i32 } %282, i32 %281, 1
  resume { ptr, i32 } %283
}

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: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) #4 align 2

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7maxFlowD2Ev(ptr noundef nonnull align 8 dereferenceable(32032)) unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #4 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 = { 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 #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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%struct.maxFlow = type { i32, [1000 x i32], [1000 x i32], %"class.std::vector", [1000 x %"class.std::vector.3"] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<maxFlow::Edge, std::allocator<maxFlow::Edge>>::_Vector_impl" }
%"struct.std::_Vector_base<maxFlow::Edge, std::allocator<maxFlow::Edge>>::_Vector_impl" = type { %"struct.std::_Vector_base<maxFlow::Edge, std::allocator<maxFlow::Edge>>::_Vector_impl_data" }
%"struct.std::_Vector_base<maxFlow::Edge, std::allocator<maxFlow::Edge>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global [101 x i32], align 16
@res = external dso_local local_unnamed_addr global i32, align 4
@primes = external dso_local global %"class.std::set", align 8
@gp = external dso_local local_unnamed_addr global [101 x [101 x i32]], 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
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %6 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %7 = alloca %struct.maxFlow, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %.not76 = icmp slt i32 %11, 1
  br i1 %.not76, label %._crit_edge80, label %.lr.ph79

._crit_edge80:                                    ; preds = %36, %0
  %.lcssa71 = phi i32 [ %11, %0 ], [ %37, %36 ]
  %12 = add nsw i32 %.lcssa71, 1
  %13 = add nsw i32 %.lcssa71, 2
  %14 = load i32, ptr @m, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph84, label %._crit_edge85

.lr.ph79:                                         ; preds = %0, %36
  %indvars.iv = phi i64 [ %indvars.iv.next, %36 ], [ 1, %0 ]
  %16 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %indvars.iv
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %16)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %18 = load i32, ptr %16, align 4, !tbaa !5
  store i32 %18, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  store i32 2, ptr %2, align 4, !tbaa !5
  %.not6973 = icmp slt i32 %18, 4
  br i1 %.not6973, label %._crit_edge, label %.lr.ph75

._crit_edge:                                      ; preds = %.loopexit, %.lr.ph79
  %.lcssa = phi i32 [ %18, %.lr.ph79 ], [ %.pr, %.loopexit ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  %19 = icmp sgt i32 %.lcssa, 1
  br i1 %19, label %34, label %36

.lr.ph75:                                         ; preds = %.lr.ph79, %.loopexit
  %.pr133 = phi i32 [ %.pr, %.loopexit ], [ %18, %.lr.ph79 ]
  %storemerge74 = phi i32 [ %32, %.loopexit ], [ 2, %.lr.ph79 ]
  %20 = srem i32 %.pr133, %storemerge74
  %21 = icmp eq i32 %20, 0
  br i1 %21, label %22, label %.loopexit

22:                                               ; preds = %.lr.ph75
  %23 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @primes, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %.promoted = load i32, ptr %1, align 4, !tbaa !5
  %25 = srem i32 %.promoted, %24
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %22, %.lr.ph
  %27 = phi i32 [ %28, %.lr.ph ], [ %.promoted, %22 ]
  %28 = sdiv i32 %27, %24
  %29 = srem i32 %28, %24
  %30 = icmp eq i32 %29, 0
  br i1 %30, label %.lr.ph, label %..loopexit_crit_edge, !llvm.loop !9

..loopexit_crit_edge:                             ; preds = %.lr.ph
  store i32 %28, ptr %1, align 4, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %22, %..loopexit_crit_edge, %.lr.ph75
  %.pr = phi i32 [ %.promoted, %22 ], [ %28, %..loopexit_crit_edge ], [ %.pr133, %.lr.ph75 ]
  %31 = phi i32 [ %24, %22 ], [ %24, %..loopexit_crit_edge ], [ %storemerge74, %.lr.ph75 ]
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %2, align 4, !tbaa !5
  %33 = mul nsw i32 %32, %32
  %.not69 = icmp sgt i32 %33, %.pr
  br i1 %.not69, label %._crit_edge, label %.lr.ph75, !llvm.loop !11

34:                                               ; preds = %._crit_edge
  %35 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @primes, ptr noundef nonnull align 4 dereferenceable(4) %1)
  br label %36

36:                                               ; preds = %34, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %37 = load i32, ptr @n, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %.not.not = icmp slt i64 %indvars.iv, %38
  br i1 %.not.not, label %.lr.ph79, label %._crit_edge80, !llvm.loop !12

._crit_edge85:                                    ; preds = %.lr.ph84, %._crit_edge80
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %39 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @primes) #6
  store ptr %39, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %40 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @primes) #6
  store ptr %40, ptr %6, align 8
  %41 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br i1 %41, label %.lr.ph116, label %._crit_edge117

.lr.ph84:                                         ; preds = %._crit_edge80, %.lr.ph84
  %.05882 = phi i32 [ %49, %.lr.ph84 ], [ 0, %._crit_edge80 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [101 x [101 x i32]], ptr @gp, i64 0, i64 %44, i64 %46
  store i32 1, ptr %47, align 4, !tbaa !5
  %48 = getelementptr inbounds [101 x [101 x i32]], ptr @gp, i64 0, i64 %46, i64 %44
  store i32 1, ptr %48, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %49 = add nuw nsw i32 %.05882, 1
  %50 = load i32, ptr @m, align 4, !tbaa !5
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %.lr.ph84, label %._crit_edge85, !llvm.loop !13

._crit_edge117:                                   ; preds = %115, %._crit_edge85
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %52 = load i32, ptr @res, align 4, !tbaa !5
  %53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %52)
  ret i32 0

.lr.ph116:                                        ; preds = %._crit_edge85, %115
  call void @llvm.lifetime.start.p0(i64 32032, ptr nonnull %7) #6
  %54 = load i32, ptr @n, align 4, !tbaa !5
  %55 = add nsw i32 %54, 2
  call void @_ZN7maxFlowC2Ei(ptr noundef nonnull align 8 dereferenceable(32032) %7, i32 noundef %55)
  %56 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = load i32, ptr @n, align 4, !tbaa !5
  %.not6192 = icmp slt i32 %58, 1
  br i1 %.not6192, label %._crit_edge114, label %.lr.ph95

.preheader70:                                     ; preds = %73
  %.not62111 = icmp slt i32 %74, 1
  br i1 %.not62111, label %._crit_edge114, label %.lr.ph113

.lr.ph95:                                         ; preds = %.lr.ph116, %73
  %indvars.iv124 = phi i64 [ %indvars.iv.next125, %73 ], [ 1, %.lr.ph116 ]
  %59 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %indvars.iv124
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = srem i32 %60, %57
  %62 = icmp eq i32 %61, 0
  br i1 %62, label %.lr.ph89, label %._crit_edge90

.lr.ph89:                                         ; preds = %.lr.ph95, %.lr.ph89
  %.05487 = phi i32 [ %64, %.lr.ph89 ], [ %60, %.lr.ph95 ]
  %.05586 = phi i32 [ %63, %.lr.ph89 ], [ 0, %.lr.ph95 ]
  %63 = add nuw nsw i32 %.05586, 1
  %64 = sdiv i32 %.05487, %57
  %65 = srem i32 %64, %57
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %.lr.ph89, label %._crit_edge90, !llvm.loop !14

._crit_edge90:                                    ; preds = %.lr.ph89, %.lr.ph95
  %.055.lcssa = phi i32 [ 0, %.lr.ph95 ], [ %63, %.lr.ph89 ]
  %67 = trunc nuw nsw i64 %indvars.iv124 to i32
  %68 = and i32 %67, 1
  %.not67 = icmp eq i32 %68, 0
  %69 = select i1 %.not67, i32 %67, i32 %12
  %70 = select i1 %.not67, i32 %13, i32 %67
  invoke void @_ZN7maxFlow7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(32032) %7, i32 noundef %69, i32 noundef %70, i32 noundef %.055.lcssa)
          to label %73 unwind label %71

71:                                               ; preds = %._crit_edge90
  %72 = landingpad { ptr, i32 }
          cleanup
  br label %123

73:                                               ; preds = %._crit_edge90
  %indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1
  %74 = load i32, ptr @n, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %.not61.not = icmp slt i64 %indvars.iv124, %75
  br i1 %.not61.not, label %.lr.ph95, label %.preheader70, !llvm.loop !15

._crit_edge114:                                   ; preds = %112, %.lr.ph116, %.preheader70
  %76 = invoke noundef i32 @_ZN7maxFlow7maxflowEii(ptr noundef nonnull align 8 dereferenceable(32032) %7, i32 noundef %12, i32 noundef %13)
          to label %115 unwind label %121

.lr.ph113:                                        ; preds = %.preheader70, %112
  %77 = phi i32 [ %113, %112 ], [ %74, %.preheader70 ]
  %indvars.iv130 = phi i64 [ %indvars.iv.next131, %112 ], [ 1, %.preheader70 ]
  %78 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %indvars.iv130
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = srem i32 %79, %57
  %.not63 = icmp eq i32 %80, 0
  br i1 %.not63, label %.lr.ph99.preheader, label %112

.lr.ph99.preheader:                               ; preds = %.lr.ph113
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  br label %.lr.ph99

.preheader:                                       ; preds = %.lr.ph99
  store i32 %83, ptr %8, align 4, !tbaa !5
  %.not64107 = icmp slt i32 %77, 2
  br i1 %.not64107, label %._crit_edge110, label %.lr.ph109.preheader

.lr.ph109.preheader:                              ; preds = %.preheader
  %81 = trunc nuw nsw i64 %indvars.iv130 to i32
  br label %.lr.ph109

.lr.ph99:                                         ; preds = %.lr.ph99.preheader, %.lr.ph99
  %.05097 = phi i32 [ %84, %.lr.ph99 ], [ %79, %.lr.ph99.preheader ]
  %82 = phi i32 [ %83, %.lr.ph99 ], [ 0, %.lr.ph99.preheader ]
  %83 = add nuw nsw i32 %82, 1
  %84 = sdiv i32 %.05097, %57
  %85 = srem i32 %84, %57
  %86 = icmp eq i32 %85, 0
  br i1 %86, label %.lr.ph99, label %.preheader, !llvm.loop !16

._crit_edge110:                                   ; preds = %106, %.preheader
  %87 = phi i32 [ %77, %.preheader ], [ %107, %106 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  br label %112

.lr.ph109:                                        ; preds = %.lr.ph109.preheader, %106
  %88 = phi i32 [ %77, %.lr.ph109.preheader ], [ %107, %106 ]
  %89 = phi i32 [ %77, %.lr.ph109.preheader ], [ %108, %106 ]
  %indvars.iv127 = phi i64 [ 2, %.lr.ph109.preheader ], [ %indvars.iv.next128, %106 ]
  %90 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %indvars.iv127
  %91 = load i32, ptr %90, align 8, !tbaa !5
  %92 = srem i32 %91, %57
  %.not65 = icmp eq i32 %92, 0
  br i1 %.not65, label %93, label %106

93:                                               ; preds = %.lr.ph109
  %94 = getelementptr inbounds [101 x [101 x i32]], ptr @gp, i64 0, i64 %indvars.iv130, i64 %indvars.iv127
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %.not66 = icmp eq i32 %95, 0
  br i1 %.not66, label %106, label %.lr.ph104.preheader

.lr.ph104.preheader:                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #6
  br label %.lr.ph104

.lr.ph104:                                        ; preds = %.lr.ph104.preheader, %.lr.ph104
  %.1102 = phi i32 [ %98, %.lr.ph104 ], [ %91, %.lr.ph104.preheader ]
  %96 = phi i32 [ %97, %.lr.ph104 ], [ 0, %.lr.ph104.preheader ]
  %97 = add nuw nsw i32 %96, 1
  %98 = sdiv i32 %.1102, %57
  %99 = srem i32 %98, %57
  %100 = icmp eq i32 %99, 0
  br i1 %100, label %.lr.ph104, label %101, !llvm.loop !17

101:                                              ; preds = %.lr.ph104
  store i32 %97, ptr %9, align 4, !tbaa !5
  %102 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = trunc nuw nsw i64 %indvars.iv127 to i32
  invoke void @_ZN7maxFlow7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(32032) %7, i32 noundef %81, i32 noundef %104, i32 noundef %103)
          to label %105 unwind label %110

105:                                              ; preds = %101
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %106

106:                                              ; preds = %.lr.ph109, %93, %105
  %107 = phi i32 [ %88, %.lr.ph109 ], [ %88, %93 ], [ %.pre, %105 ]
  %108 = phi i32 [ %89, %.lr.ph109 ], [ %89, %93 ], [ %.pre, %105 ]
  %indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 2
  %109 = trunc nuw i64 %indvars.iv.next128 to i32
  %.not64 = icmp slt i32 %108, %109
  br i1 %.not64, label %._crit_edge110, label %.lr.ph109, !llvm.loop !18

110:                                              ; preds = %101
  %111 = landingpad { ptr, i32 }
          cleanup
  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 %123

112:                                              ; preds = %.lr.ph113, %._crit_edge110
  %113 = phi i32 [ %77, %.lr.ph113 ], [ %87, %._crit_edge110 ]
  %indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 2
  %114 = trunc nuw i64 %indvars.iv.next131 to i32
  %.not62 = icmp slt i32 %113, %114
  br i1 %.not62, label %._crit_edge114, label %.lr.ph113, !llvm.loop !19

115:                                              ; preds = %._crit_edge114
  %116 = load i32, ptr @res, align 4, !tbaa !5
  %117 = add nsw i32 %116, %76
  store i32 %117, ptr @res, align 4, !tbaa !5
  call void @_ZN7maxFlowD2Ev(ptr noundef nonnull align 8 dereferenceable(32032) %7) #6
  call void @llvm.lifetime.end.p0(i64 32032, ptr nonnull %7) #6
  %118 = call ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEi(ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef 0) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %119 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @primes) #6
  store ptr %119, ptr %6, align 8
  %120 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br i1 %120, label %.lr.ph116, label %._crit_edge117, !llvm.loop !20

121:                                              ; preds = %._crit_edge114
  %122 = landingpad { ptr, i32 }
          cleanup
  br label %123

123:                                              ; preds = %121, %110, %71
  %.pn = phi { ptr, i32 } [ %72, %71 ], [ %111, %110 ], [ %122, %121 ]
  call void @_ZN7maxFlowD2Ev(ptr noundef nonnull align 8 dereferenceable(32032) %7) #6
  call void @llvm.lifetime.end.p0(i64 32032, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  resume { ptr, i32 } %.pn
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #4 align 2

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7maxFlowD2Ev(ptr noundef nonnull align 8 dereferenceable(32032)) unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #4 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

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


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