; LLVM IR from kazunetakahashi/atcoder :: 2019/0921_AGC038 (F)

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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%class.Permutation = type { i32, %"class.std::vector", %"class.std::vector" }
%class.Dinic = type { i32, %"class.std::vector.0", %"class.std::vector.5", %"class.std::vector.10" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::vector<Dinic::edge>, std::allocator<std::vector<Dinic::edge>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<Dinic::edge>, std::allocator<std::vector<Dinic::edge>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<Dinic::edge>, std::allocator<std::vector<Dinic::edge>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<Dinic::edge>, std::allocator<std::vector<Dinic::edge>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

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

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

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

22:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #7
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #7
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %24, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %25 unwind label %35

25:                                               ; preds = %22
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %45, %25
  %27 = load i32, ptr %9, align 4, !tbaa !5
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %39, label %30

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

31:                                               ; preds = %0
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %5, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %6, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #7
  br label %195

35:                                               ; preds = %22
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %5, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %6, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #7
  br label %194

39:                                               ; preds = %26
  %40 = load i32, ptr %9, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %41) #7
  %43 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %42)
          to label %44 unwind label %48

44:                                               ; preds = %39
  br label %45

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

48:                                               ; preds = %39
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %5, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %193

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

53:                                               ; preds = %64, %52
  %54 = load i32, ptr %10, align 4, !tbaa !5
  %55 = load i32, ptr %2, align 4, !tbaa !5
  %56 = icmp slt i32 %54, %55
  br i1 %56, label %58, label %57

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

58:                                               ; preds = %53
  %59 = load i32, ptr %10, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %60) #7
  %62 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %61)
          to label %63 unwind label %67

63:                                               ; preds = %58
  br label %64

64:                                               ; preds = %63
  %65 = load i32, ptr %10, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %10, align 4, !tbaa !5
  br label %53, !llvm.loop !11

67:                                               ; preds = %58
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %5, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %193

71:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 56, ptr %11) #7
  %72 = load i32, ptr %2, align 4, !tbaa !5
  invoke void @_ZN11PermutationC2EiRKSt6vectorIiSaIiEE(ptr noundef nonnull align 8 dereferenceable(56) %11, i32 noundef %72, ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %73 unwind label %87

73:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 56, ptr %12) #7
  %74 = load i32, ptr %2, align 4, !tbaa !5
  invoke void @_ZN11PermutationC2EiRKSt6vectorIiSaIiEE(ptr noundef nonnull align 8 dereferenceable(56) %12, i32 noundef %74, ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %75 unwind label %91

75:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 2, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 1, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr %16) #7
  %76 = load i32, ptr %2, align 4, !tbaa !5
  %77 = mul nsw i32 2, %76
  %78 = add nsw i32 2, %77
  invoke void @_ZN5DinicC2Ei(ptr noundef nonnull align 8 dereferenceable(80) %16, i32 noundef %78)
          to label %79 unwind label %95

79:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %80 = load i32, ptr %2, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  store i64 %81, ptr %17, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %171, %79
  %83 = load i32, ptr %18, align 4, !tbaa !5
  %84 = load i32, ptr %2, align 4, !tbaa !5
  %85 = icmp slt i32 %83, %84
  br i1 %85, label %99, label %86

86:                                               ; preds = %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %174

87:                                               ; preds = %71
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %5, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %6, align 4
  br label %192

91:                                               ; preds = %73
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %5, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %6, align 4
  br label %191

95:                                               ; preds = %75
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %5, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %6, align 4
  br label %190

99:                                               ; preds = %82
  %100 = load i32, ptr %18, align 4, !tbaa !5
  %101 = invoke noundef zeroext i1 @_ZN11Permutation8isolatedEi(ptr noundef nonnull align 8 dereferenceable(56) %11, i32 noundef %100)
          to label %102 unwind label %110

102:                                              ; preds = %99
  br i1 %101, label %103, label %114

103:                                              ; preds = %102
  %104 = load i32, ptr %18, align 4, !tbaa !5
  %105 = invoke noundef zeroext i1 @_ZN11Permutation8isolatedEi(ptr noundef nonnull align 8 dereferenceable(56) %12, i32 noundef %104)
          to label %106 unwind label %110

106:                                              ; preds = %103
  br i1 %105, label %107, label %114

107:                                              ; preds = %106
  %108 = load i64, ptr %17, align 8, !tbaa !12
  %109 = add nsw i64 %108, -1
  store i64 %109, ptr %17, align 8, !tbaa !12
  br label %170

110:                                              ; preds = %164, %158, %155, %150, %147, %143, %139, %136, %133, %130, %126, %121, %118, %114, %103, %99
  %111 = landingpad { ptr, i32 }
          cleanup
  %112 = extractvalue { ptr, i32 } %111, 0
  store ptr %112, ptr %5, align 8
  %113 = extractvalue { ptr, i32 } %111, 1
  store i32 %113, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %189

114:                                              ; preds = %106, %102
  %115 = load i32, ptr %18, align 4, !tbaa !5
  %116 = invoke noundef zeroext i1 @_ZN11Permutation8isolatedEi(ptr noundef nonnull align 8 dereferenceable(56) %11, i32 noundef %115)
          to label %117 unwind label %110

117:                                              ; preds = %114
  br i1 %116, label %118, label %126

118:                                              ; preds = %117
  %119 = load i32, ptr %18, align 4, !tbaa !5
  %120 = invoke noundef i32 @_ZN11Permutation8composedEi(ptr noundef nonnull align 8 dereferenceable(56) %12, i32 noundef %119)
          to label %121 unwind label %110

121:                                              ; preds = %118
  %122 = load i32, ptr %2, align 4, !tbaa !5
  %123 = add nsw i32 %120, %122
  %124 = add nsw i32 %123, 2
  invoke void @_ZN5Dinic8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(80) %16, i32 noundef 0, i32 noundef %124, i64 noundef 1)
          to label %125 unwind label %110

125:                                              ; preds = %121
  br label %169

126:                                              ; preds = %117
  %127 = load i32, ptr %18, align 4, !tbaa !5
  %128 = invoke noundef zeroext i1 @_ZN11Permutation8isolatedEi(ptr noundef nonnull align 8 dereferenceable(56) %12, i32 noundef %127)
          to label %129 unwind label %110

129:                                              ; preds = %126
  br i1 %128, label %130, label %136

130:                                              ; preds = %129
  %131 = load i32, ptr %18, align 4, !tbaa !5
  %132 = invoke noundef i32 @_ZN11Permutation8composedEi(ptr noundef nonnull align 8 dereferenceable(56) %11, i32 noundef %131)
          to label %133 unwind label %110

133:                                              ; preds = %130
  %134 = add nsw i32 %132, 2
  invoke void @_ZN5Dinic8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(80) %16, i32 noundef %134, i32 noundef 1, i64 noundef 1)
          to label %135 unwind label %110

135:                                              ; preds = %133
  br label %168

136:                                              ; preds = %129
  %137 = load i32, ptr %18, align 4, !tbaa !5
  %138 = invoke noundef i32 @_ZN11Permutation8composedEi(ptr noundef nonnull align 8 dereferenceable(56) %11, i32 noundef %137)
          to label %139 unwind label %110

139:                                              ; preds = %136
  %140 = add nsw i32 %138, 2
  %141 = load i32, ptr %18, align 4, !tbaa !5
  %142 = invoke noundef i32 @_ZN11Permutation8composedEi(ptr noundef nonnull align 8 dereferenceable(56) %12, i32 noundef %141)
          to label %143 unwind label %110

143:                                              ; preds = %139
  %144 = load i32, ptr %2, align 4, !tbaa !5
  %145 = add nsw i32 %142, %144
  %146 = add nsw i32 %145, 2
  invoke void @_ZN5Dinic8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(80) %16, i32 noundef %140, i32 noundef %146, i64 noundef 1)
          to label %147 unwind label %110

147:                                              ; preds = %143
  %148 = load i32, ptr %18, align 4, !tbaa !5
  %149 = invoke noundef i32 @_ZN11Permutation3perEi(ptr noundef nonnull align 8 dereferenceable(56) %11, i32 noundef %148)
          to label %150 unwind label %110

150:                                              ; preds = %147
  %151 = load i32, ptr %18, align 4, !tbaa !5
  %152 = invoke noundef i32 @_ZN11Permutation3perEi(ptr noundef nonnull align 8 dereferenceable(56) %12, i32 noundef %151)
          to label %153 unwind label %110

153:                                              ; preds = %150
  %154 = icmp eq i32 %149, %152
  br i1 %154, label %155, label %167

155:                                              ; preds = %153
  %156 = load i32, ptr %18, align 4, !tbaa !5
  %157 = invoke noundef i32 @_ZN11Permutation8composedEi(ptr noundef nonnull align 8 dereferenceable(56) %12, i32 noundef %156)
          to label %158 unwind label %110

158:                                              ; preds = %155
  %159 = load i32, ptr %2, align 4, !tbaa !5
  %160 = add nsw i32 %157, %159
  %161 = add nsw i32 %160, 2
  %162 = load i32, ptr %18, align 4, !tbaa !5
  %163 = invoke noundef i32 @_ZN11Permutation8composedEi(ptr noundef nonnull align 8 dereferenceable(56) %11, i32 noundef %162)
          to label %164 unwind label %110

164:                                              ; preds = %158
  %165 = add nsw i32 %163, 2
  invoke void @_ZN5Dinic8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(80) %16, i32 noundef %161, i32 noundef %165, i64 noundef 1)
          to label %166 unwind label %110

166:                                              ; preds = %164
  br label %167

167:                                              ; preds = %166, %153
  br label %168

168:                                              ; preds = %167, %135
  br label %169

169:                                              ; preds = %168, %125
  br label %170

170:                                              ; preds = %169, %107
  br label %171

171:                                              ; preds = %170
  %172 = load i32, ptr %18, align 4, !tbaa !5
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %18, align 4, !tbaa !5
  br label %82, !llvm.loop !14

174:                                              ; preds = %86
  %175 = invoke noundef i64 @_ZN5Dinic8max_flowEii(ptr noundef nonnull align 8 dereferenceable(80) %16, i32 noundef 0, i32 noundef 1)
          to label %176 unwind label %185

176:                                              ; preds = %174
  %177 = load i64, ptr %17, align 8, !tbaa !12
  %178 = sub nsw i64 %177, %175
  store i64 %178, ptr %17, align 8, !tbaa !12
  %179 = load i64, ptr %17, align 8, !tbaa !12
  %180 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %179)
          to label %181 unwind label %185

181:                                              ; preds = %176
  %182 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %180, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %183 unwind label %185

183:                                              ; preds = %181
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @_ZN5DinicD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %16) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @_ZN11PermutationD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %12) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr %12) #7
  call void @_ZN11PermutationD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %11) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr %11) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %184 = load i32, ptr %1, align 4
  ret i32 %184

185:                                              ; preds = %181, %176, %174
  %186 = landingpad { ptr, i32 }
          cleanup
  %187 = extractvalue { ptr, i32 } %186, 0
  store ptr %187, ptr %5, align 8
  %188 = extractvalue { ptr, i32 } %186, 1
  store i32 %188, ptr %6, align 4
  br label %189

189:                                              ; preds = %185, %110
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @_ZN5DinicD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %16) #7
  br label %190

190:                                              ; preds = %189, %95
  call void @llvm.lifetime.end.p0(i64 80, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @_ZN11PermutationD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %12) #7
  br label %191

191:                                              ; preds = %190, %91
  call void @llvm.lifetime.end.p0(i64 56, ptr %12) #7
  call void @_ZN11PermutationD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %11) #7
  br label %192

192:                                              ; preds = %191, %87
  call void @llvm.lifetime.end.p0(i64 56, ptr %11) #7
  br label %193

193:                                              ; preds = %192, %67, %48
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  br label %194

194:                                              ; preds = %193, %35
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  br label %195

195:                                              ; preds = %194, %31
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %196

196:                                              ; preds = %195
  %197 = load ptr, ptr %5, align 8
  %198 = load i32, ptr %6, align 4
  %199 = insertvalue { ptr, i32 } poison, ptr %197, 0
  %200 = insertvalue { ptr, i32 } %199, i32 %198, 1
  resume { ptr, i32 } %200
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11PermutationC2EiRKSt6vectorIiSaIiEE(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN11Permutation8isolatedEi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #5 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN11Permutation8composedEi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN11Permutation3perEi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #5 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5DinicD2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN11PermutationD2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #6 align 2

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

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

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%class.Permutation = type { i32, %"class.std::vector", %"class.std::vector" }
%class.Dinic = type { i32, %"class.std::vector.0", %"class.std::vector.5", %"class.std::vector.10" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::vector<Dinic::edge>, std::allocator<std::vector<Dinic::edge>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<Dinic::edge>, std::allocator<std::vector<Dinic::edge>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<Dinic::edge>, std::allocator<std::vector<Dinic::edge>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<Dinic::edge>, std::allocator<std::vector<Dinic::edge>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %"class.std::allocator", align 1
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca %class.Permutation, align 8
  %7 = alloca %class.Permutation, align 8
  %8 = alloca %class.Dinic, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #7
  %10 = load i32, ptr %1, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #7
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %11, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %12 unwind label %19

12:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #7
  %13 = load i32, ptr %1, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #7
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %14, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %15 unwind label %21

15:                                               ; preds = %12
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

.preheader:                                       ; preds = %25
  %18 = icmp sgt i32 %26, 0
  br i1 %18, label %.lr.ph49, label %._crit_edge

19:                                               ; preds = %0
  %20 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #7
  br label %110

21:                                               ; preds = %12
  %22 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  br label %109

.lr.ph:                                           ; preds = %15, %25
  %indvars.iv = phi i64 [ %indvars.iv.next, %25 ], [ 0, %15 ]
  %23 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #7
  %24 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %23)
          to label %25 unwind label %29

25:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %26 = load i32, ptr %1, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = icmp slt i64 %indvars.iv.next, %27
  br i1 %28, label %.lr.ph, label %.preheader, !llvm.loop !9

29:                                               ; preds = %.lr.ph
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %108

._crit_edge:                                      ; preds = %33, %15, %.preheader
  %.lcssa = phi i32 [ %26, %.preheader ], [ %16, %15 ], [ %34, %33 ]
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %6) #7
  invoke void @_ZN11PermutationC2EiRKSt6vectorIiSaIiEE(ptr noundef nonnull align 8 dereferenceable(56) %6, i32 noundef %.lcssa, ptr noundef nonnull align 8 dereferenceable(24) %2)
          to label %39 unwind label %50

.lr.ph49:                                         ; preds = %.preheader, %33
  %indvars.iv59 = phi i64 [ %indvars.iv.next60, %33 ], [ 0, %.preheader ]
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv59) #7
  %32 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %31)
          to label %33 unwind label %37

33:                                               ; preds = %.lr.ph49
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %34 = load i32, ptr %1, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = icmp slt i64 %indvars.iv.next60, %35
  br i1 %36, label %.lr.ph49, label %._crit_edge, !llvm.loop !11

37:                                               ; preds = %.lr.ph49
  %38 = landingpad { ptr, i32 }
          cleanup
  br label %108

39:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %7) #7
  %40 = load i32, ptr %1, align 4, !tbaa !5
  invoke void @_ZN11PermutationC2EiRKSt6vectorIiSaIiEE(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %40, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %41 unwind label %52

41:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %8) #7
  %42 = load i32, ptr %1, align 4, !tbaa !5
  %43 = shl nsw i32 %42, 1
  %44 = add nsw i32 %43, 2
  invoke void @_ZN5DinicC2Ei(ptr noundef nonnull align 8 dereferenceable(80) %8, i32 noundef %44)
          to label %45 unwind label %54

45:                                               ; preds = %41
  %46 = load i32, ptr %1, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = icmp sgt i32 %46, 0
  br i1 %48, label %.lr.ph54, label %._crit_edge55

._crit_edge55:                                    ; preds = %92, %45
  %.025.lcssa = phi i64 [ %47, %45 ], [ %.1, %92 ]
  %49 = invoke noundef i64 @_ZN5Dinic8max_flowEii(ptr noundef nonnull align 8 dereferenceable(80) %8, i32 noundef 0, i32 noundef 1)
          to label %96 unwind label %102

50:                                               ; preds = %._crit_edge
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %107

52:                                               ; preds = %39
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %106

54:                                               ; preds = %41
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %105

.lr.ph54:                                         ; preds = %45, %92
  %.051 = phi i32 [ %93, %92 ], [ 0, %45 ]
  %.02550 = phi i64 [ %.1, %92 ], [ %47, %45 ]
  %56 = call noundef zeroext i1 @_ZN11Permutation8isolatedEi(ptr noundef nonnull align 8 dereferenceable(56) %6, i32 noundef %.051)
  br i1 %56, label %57, label %63

57:                                               ; preds = %.lr.ph54
  %58 = call noundef zeroext i1 @_ZN11Permutation8isolatedEi(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %.051)
  br i1 %58, label %59, label %63

59:                                               ; preds = %57
  %60 = add nsw i64 %.02550, -1
  br label %92

61:                                               ; preds = %.invoke, %74
  %62 = landingpad { ptr, i32 }
          cleanup
  br label %104

63:                                               ; preds = %57, %.lr.ph54
  %64 = call noundef zeroext i1 @_ZN11Permutation8isolatedEi(ptr noundef nonnull align 8 dereferenceable(56) %6, i32 noundef %.051)
  br i1 %64, label %65, label %70

65:                                               ; preds = %63
  %66 = call noundef i32 @_ZN11Permutation8composedEi(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %.051)
  %67 = load i32, ptr %1, align 4, !tbaa !5
  %68 = add i32 %66, 2
  %69 = add i32 %68, %67
  br label %.invoke

70:                                               ; preds = %63
  %71 = call noundef zeroext i1 @_ZN11Permutation8isolatedEi(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %.051)
  %72 = call noundef i32 @_ZN11Permutation8composedEi(ptr noundef nonnull align 8 dereferenceable(56) %6, i32 noundef %.051)
  %73 = add nsw i32 %72, 2
  br i1 %71, label %.invoke, label %74

74:                                               ; preds = %70
  %75 = call noundef i32 @_ZN11Permutation8composedEi(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %.051)
  %76 = load i32, ptr %1, align 4, !tbaa !5
  %77 = add i32 %75, 2
  %78 = add i32 %77, %76
  invoke void @_ZN5Dinic8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(80) %8, i32 noundef %73, i32 noundef %78, i64 noundef 1)
          to label %79 unwind label %61

79:                                               ; preds = %74
  %80 = call noundef i32 @_ZN11Permutation3perEi(ptr noundef nonnull align 8 dereferenceable(56) %6, i32 noundef %.051)
  %81 = call noundef i32 @_ZN11Permutation3perEi(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %.051)
  %82 = icmp eq i32 %80, %81
  br i1 %82, label %83, label %92

83:                                               ; preds = %79
  %84 = call noundef i32 @_ZN11Permutation8composedEi(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %.051)
  %85 = load i32, ptr %1, align 4, !tbaa !5
  %86 = add i32 %84, 2
  %87 = add i32 %86, %85
  %88 = call noundef i32 @_ZN11Permutation8composedEi(ptr noundef nonnull align 8 dereferenceable(56) %6, i32 noundef %.051)
  %89 = add nsw i32 %88, 2
  br label %.invoke

.invoke:                                          ; preds = %70, %65, %83
  %90 = phi i32 [ %87, %83 ], [ 0, %65 ], [ %73, %70 ]
  %91 = phi i32 [ %89, %83 ], [ %69, %65 ], [ 1, %70 ]
  invoke void @_ZN5Dinic8add_edgeEiix(ptr noundef nonnull align 8 dereferenceable(80) %8, i32 noundef %90, i32 noundef %91, i64 noundef 1)
          to label %92 unwind label %61

92:                                               ; preds = %.invoke, %59, %79
  %.1 = phi i64 [ %60, %59 ], [ %.02550, %79 ], [ %.02550, %.invoke ]
  %93 = add nuw nsw i32 %.051, 1
  %94 = load i32, ptr %1, align 4, !tbaa !5
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %.lr.ph54, label %._crit_edge55, !llvm.loop !12

96:                                               ; preds = %._crit_edge55
  %97 = sub nsw i64 %.025.lcssa, %49
  %98 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %97)
          to label %99 unwind label %102

99:                                               ; preds = %96
  %100 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %98, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %101 unwind label %102

101:                                              ; preds = %99
  call void @_ZN5DinicD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %8) #7
  call void @_ZN11PermutationD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %7) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %7) #7
  call void @_ZN11PermutationD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %6) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %6) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

102:                                              ; preds = %99, %96, %._crit_edge55
  %103 = landingpad { ptr, i32 }
          cleanup
  br label %104

104:                                              ; preds = %102, %61
  %.pn = phi { ptr, i32 } [ %62, %61 ], [ %103, %102 ]
  call void @_ZN5DinicD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #7
  br label %105

105:                                              ; preds = %104, %54
  %.pn.pn = phi { ptr, i32 } [ %.pn, %104 ], [ %55, %54 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %8) #7
  call void @_ZN11PermutationD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %7) #7
  br label %106

106:                                              ; preds = %105, %52
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %105 ], [ %53, %52 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %7) #7
  call void @_ZN11PermutationD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %6) #7
  br label %107

107:                                              ; preds = %106, %50
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %106 ], [ %51, %50 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %6) #7
  br label %108

108:                                              ; preds = %107, %37, %29
  %.pn41 = phi { ptr, i32 } [ %30, %29 ], [ %38, %37 ], [ %.pn.pn.pn.pn, %107 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  br label %109

109:                                              ; preds = %108, %21
  %.pn41.pn = phi { ptr, i32 } [ %.pn41, %108 ], [ %22, %21 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  br label %110

110:                                              ; preds = %109, %19
  %.pn41.pn.pn = phi { ptr, i32 } [ %.pn41.pn, %109 ], [ %20, %19 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn41.pn.pn
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11PermutationC2EiRKSt6vectorIiSaIiEE(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN11Permutation8isolatedEi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) local_unnamed_addr #5 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN11Permutation8composedEi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN11Permutation3perEi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) local_unnamed_addr #5 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5DinicD2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN11PermutationD2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #6 align 2

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

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


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