; LLVM IR from duc0/ContestNeko :: CPPProjects (MinCostMaxFlowSSP)

; 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.CostNetwork = type { i64, %"class.std::vector", i32, i32, %"class.std::vector.0", %"class.std::vector.0", i64, %"class.std::vector.0", i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::vector<long long>, std::allocator<std::vector<long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<long long>, std::allocator<std::vector<long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<long long>, std::allocator<std::vector<long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<long long>, std::allocator<std::vector<long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.SSPath = type { %"class.std::vector.5", %"class.std::vector.10", %"class.std::vector.15", %"class.std::vector.10", i8, i64 }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = 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::vector.15" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = 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 }

@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #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 i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %class.CostNetwork, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %class.SSPath, align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %19 = load ptr, ptr @stdin, align 8, !tbaa !5
  %20 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %19)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6)
  call void @llvm.lifetime.start.p0(i64 128, ptr %7) #7
  %22 = load i32, ptr %2, align 4, !tbaa !9
  call void @_ZN11CostNetworkIxxEC2Ei(ptr noundef nonnull align 8 dereferenceable(128) %7, i32 noundef %22)
  %23 = load i32, ptr %5, align 4, !tbaa !9
  %24 = sub nsw i32 %23, 1
  invoke void @_ZN11CostNetworkIxxE9setSourceEi(ptr noundef nonnull align 8 dereferenceable(128) %7, i32 noundef %24)
          to label %25 unwind label %52

25:                                               ; preds = %0
  %26 = load i32, ptr %6, align 4, !tbaa !9
  %27 = sub nsw i32 %26, 1
  invoke void @_ZN11CostNetworkIxxE7setSinkEi(ptr noundef nonnull align 8 dereferenceable(128) %7, i32 noundef %27)
          to label %28 unwind label %52

28:                                               ; preds = %25
  br label %29

29:                                               ; preds = %51, %28
  %30 = load i32, ptr %3, align 4, !tbaa !9
  %31 = add nsw i32 %30, -1
  store i32 %31, ptr %3, align 4, !tbaa !9
  %32 = icmp ne i32 %30, 0
  br i1 %32, label %33, label %60

33:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %34 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.5, ptr noundef %10, ptr noundef %11, ptr noundef %12, ptr noundef %13)
          to label %35 unwind label %56

35:                                               ; preds = %33
  %36 = load i32, ptr %10, align 4, !tbaa !9
  %37 = sub nsw i32 %36, 1
  %38 = load i32, ptr %11, align 4, !tbaa !9
  %39 = sub nsw i32 %38, 1
  %40 = load i32, ptr %13, align 4, !tbaa !9
  %41 = load i32, ptr %12, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  invoke void @_ZN11CostNetworkIxxE7addEdgeEiiix(ptr noundef nonnull align 8 dereferenceable(128) %7, i32 noundef %37, i32 noundef %39, i32 noundef %40, i64 noundef %42)
          to label %43 unwind label %56

43:                                               ; preds = %35
  %44 = load i32, ptr %11, align 4, !tbaa !9
  %45 = sub nsw i32 %44, 1
  %46 = load i32, ptr %10, align 4, !tbaa !9
  %47 = sub nsw i32 %46, 1
  %48 = load i32, ptr %13, align 4, !tbaa !9
  %49 = load i32, ptr %12, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  invoke void @_ZN11CostNetworkIxxE7addEdgeEiiix(ptr noundef nonnull align 8 dereferenceable(128) %7, i32 noundef %45, i32 noundef %47, i32 noundef %48, i64 noundef %50)
          to label %51 unwind label %56

51:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %29, !llvm.loop !11

52:                                               ; preds = %25, %0
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %8, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %9, align 4
  br label %157

56:                                               ; preds = %43, %35, %33
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %8, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %157

60:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 128, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %61 = load i32, ptr %4, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  store i64 %62, ptr %15, align 8, !tbaa !13
  invoke void @_ZN6SSPathIxxEC2ER11CostNetworkIxxERKx(ptr noundef nonnull align 8 dereferenceable(128) %14, ptr noundef nonnull align 8 dereferenceable(128) %7, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %63 unwind label %74

63:                                               ; preds = %60
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  %64 = invoke noundef i64 @_ZNK11CostNetworkIxxE7getFlowEv(ptr noundef nonnull align 8 dereferenceable(128) %7)
          to label %65 unwind label %78

65:                                               ; preds = %63
  %66 = load i32, ptr %4, align 4, !tbaa !9
  %67 = sext i32 %66 to i64
  %68 = icmp slt i64 %64, %67
  br i1 %68, label %69, label %82

69:                                               ; preds = %65
  %70 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
          to label %71 unwind label %78

71:                                               ; preds = %69
  %72 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %70, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %73 unwind label %78

73:                                               ; preds = %71
  br label %153

74:                                               ; preds = %60
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %8, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %156

78:                                               ; preds = %150, %148, %86, %84, %82, %71, %69, %63
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %8, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %9, align 4
  br label %155

82:                                               ; preds = %65
  %83 = invoke noundef i64 @_ZNK11CostNetworkIxxE7getCostEv(ptr noundef nonnull align 8 dereferenceable(128) %7)
          to label %84 unwind label %78

84:                                               ; preds = %82
  %85 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %83)
          to label %86 unwind label %78

86:                                               ; preds = %84
  %87 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %85, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %88 unwind label %78

88:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %89

89:                                               ; preds = %144, %88
  %90 = load i32, ptr %16, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = invoke noundef i64 @_ZNK11CostNetworkIxxE7getSizeEv(ptr noundef nonnull align 8 dereferenceable(128) %7)
          to label %93 unwind label %96

93:                                               ; preds = %89
  %94 = icmp ult i64 %91, %92
  br i1 %94, label %100, label %95

95:                                               ; preds = %93
  store i32 4, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %148

96:                                               ; preds = %89
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %8, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %9, align 4
  br label %147

100:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %101

101:                                              ; preds = %140, %100
  %102 = load i32, ptr %18, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = invoke noundef i64 @_ZNK11CostNetworkIxxE7getSizeEv(ptr noundef nonnull align 8 dereferenceable(128) %7)
          to label %105 unwind label %108

105:                                              ; preds = %101
  %106 = icmp ult i64 %103, %104
  br i1 %106, label %112, label %107

107:                                              ; preds = %105
  store i32 7, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %143

108:                                              ; preds = %136, %134, %130, %128, %124, %122, %118, %112, %101
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %8, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %147

112:                                              ; preds = %105
  %113 = load i32, ptr %16, align 4, !tbaa !9
  %114 = load i32, ptr %18, align 4, !tbaa !9
  %115 = invoke noundef i64 @_ZNK11CostNetworkIxxE7getFlowEii(ptr noundef nonnull align 8 dereferenceable(128) %7, i32 noundef %113, i32 noundef %114)
          to label %116 unwind label %108

116:                                              ; preds = %112
  %117 = icmp sgt i64 %115, 0
  br i1 %117, label %118, label %139

118:                                              ; preds = %116
  %119 = load i32, ptr %16, align 4, !tbaa !9
  %120 = add nsw i32 %119, 1
  %121 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %120)
          to label %122 unwind label %108

122:                                              ; preds = %118
  %123 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %121, ptr noundef @.str.6)
          to label %124 unwind label %108

124:                                              ; preds = %122
  %125 = load i32, ptr %18, align 4, !tbaa !9
  %126 = add nsw i32 %125, 1
  %127 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %123, i32 noundef %126)
          to label %128 unwind label %108

128:                                              ; preds = %124
  %129 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %127, ptr noundef @.str.6)
          to label %130 unwind label %108

130:                                              ; preds = %128
  %131 = load i32, ptr %16, align 4, !tbaa !9
  %132 = load i32, ptr %18, align 4, !tbaa !9
  %133 = invoke noundef i64 @_ZNK11CostNetworkIxxE7getFlowEii(ptr noundef nonnull align 8 dereferenceable(128) %7, i32 noundef %131, i32 noundef %132)
          to label %134 unwind label %108

134:                                              ; preds = %130
  %135 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %129, i64 noundef %133)
          to label %136 unwind label %108

136:                                              ; preds = %134
  %137 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %135, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %138 unwind label %108

138:                                              ; preds = %136
  br label %139

139:                                              ; preds = %138, %116
  br label %140

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

143:                                              ; preds = %107
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %16, align 4, !tbaa !9
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %16, align 4, !tbaa !9
  br label %89, !llvm.loop !16

147:                                              ; preds = %108, %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %155

148:                                              ; preds = %95
  %149 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.7)
          to label %150 unwind label %78

150:                                              ; preds = %148
  %151 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %149, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %152 unwind label %78

152:                                              ; preds = %150
  br label %153

153:                                              ; preds = %152, %73
  store i32 0, ptr %1, align 4
  store i32 1, ptr %17, align 4
  call void @_ZN6SSPathIxxED2Ev(ptr noundef nonnull align 8 dereferenceable(128) %14) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr %14) #7
  call void @_ZN11CostNetworkIxxED2Ev(ptr noundef nonnull align 8 dereferenceable(128) %7) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %154 = load i32, ptr %1, align 4
  ret i32 %154

155:                                              ; preds = %147, %78
  call void @_ZN6SSPathIxxED2Ev(ptr noundef nonnull align 8 dereferenceable(128) %14) #7
  br label %156

156:                                              ; preds = %155, %74
  call void @llvm.lifetime.end.p0(i64 128, ptr %14) #7
  br label %157

157:                                              ; preds = %156, %56, %52
  call void @_ZN11CostNetworkIxxED2Ev(ptr noundef nonnull align 8 dereferenceable(128) %7) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %158

158:                                              ; preds = %157
  %159 = load ptr, ptr %8, align 8
  %160 = load i32, ptr %9, align 4
  %161 = insertvalue { ptr, i32 } poison, ptr %159, 0
  %162 = insertvalue { ptr, i32 } %161, i32 %160, 1
  resume { ptr, i32 } %162
}

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6SSPathIxxEC2ER11CostNetworkIxxERKx(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

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

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

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

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

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

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

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 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 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


; 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.CostNetwork = type { i64, %"class.std::vector", i32, i32, %"class.std::vector.0", %"class.std::vector.0", i64, %"class.std::vector.0", i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::vector<long long>, std::allocator<std::vector<long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<long long>, std::allocator<std::vector<long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<long long>, std::allocator<std::vector<long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<long long>, std::allocator<std::vector<long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.SSPath = type { %"class.std::vector.5", %"class.std::vector.10", %"class.std::vector.15", %"class.std::vector.10", i8, i64 }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = 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::vector.15" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = 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 }

@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #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 i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %class.CostNetwork, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %class.SSPath, align 8
  %12 = alloca i64, align 8
  %13 = load ptr, ptr @stdin, align 8, !tbaa !5
  %14 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %13)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5)
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %6) #8
  %16 = load i32, ptr %1, align 4, !tbaa !9
  call void @_ZN11CostNetworkIxxEC2Ei(ptr noundef nonnull align 8 dereferenceable(128) %6, i32 noundef %16)
  %17 = load i32, ptr %4, align 4, !tbaa !9
  %18 = add nsw i32 %17, -1
  call void @_ZN11CostNetworkIxxE9setSourceEi(ptr noundef nonnull align 8 dereferenceable(128) %6, i32 noundef %18)
  %19 = load i32, ptr %5, align 4, !tbaa !9
  %20 = add nsw i32 %19, -1
  call void @_ZN11CostNetworkIxxE7setSinkEi(ptr noundef nonnull align 8 dereferenceable(128) %6, i32 noundef %20)
  %21 = load i32, ptr %2, align 4, !tbaa !9
  %22 = add nsw i32 %21, -1
  store i32 %22, ptr %2, align 4, !tbaa !9
  %.not22 = icmp eq i32 %21, 0
  br i1 %.not22, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0, %39
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #8
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10)
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = add nsw i32 %24, -1
  %26 = load i32, ptr %8, align 4, !tbaa !9
  %27 = add nsw i32 %26, -1
  %28 = load i32, ptr %10, align 4, !tbaa !9
  %29 = load i32, ptr %9, align 4, !tbaa !9
  %30 = sext i32 %29 to i64
  invoke void @_ZN11CostNetworkIxxE7addEdgeEiiix(ptr noundef nonnull align 8 dereferenceable(128) %6, i32 noundef %25, i32 noundef %27, i32 noundef %28, i64 noundef %30)
          to label %31 unwind label %42

31:                                               ; preds = %.lr.ph
  %32 = load i32, ptr %8, align 4, !tbaa !9
  %33 = add nsw i32 %32, -1
  %34 = load i32, ptr %7, align 4, !tbaa !9
  %35 = add nsw i32 %34, -1
  %36 = load i32, ptr %10, align 4, !tbaa !9
  %37 = load i32, ptr %9, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  invoke void @_ZN11CostNetworkIxxE7addEdgeEiiix(ptr noundef nonnull align 8 dereferenceable(128) %6, i32 noundef %33, i32 noundef %35, i32 noundef %36, i64 noundef %38)
          to label %39 unwind label %42

39:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  %40 = load i32, ptr %2, align 4, !tbaa !9
  %41 = add nsw i32 %40, -1
  store i32 %41, ptr %2, align 4, !tbaa !9
  %.not = icmp eq i32 %40, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !11

42:                                               ; preds = %31, %.lr.ph
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  br label %98

._crit_edge:                                      ; preds = %39, %0
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %11) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #8
  %44 = load i32, ptr %3, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  store i64 %45, ptr %12, align 8, !tbaa !13
  invoke void @_ZN6SSPathIxxEC2ER11CostNetworkIxxERKx(ptr noundef nonnull align 8 dereferenceable(128) %11, ptr noundef nonnull align 8 dereferenceable(128) %6, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %46 unwind label %53

46:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #8
  %47 = call noundef i64 @_ZNK11CostNetworkIxxE7getFlowEv(ptr noundef nonnull align 8 dereferenceable(128) %6)
  %48 = load i32, ptr %3, align 4, !tbaa !9
  %49 = sext i32 %48 to i64
  %50 = icmp slt i64 %47, %49
  br i1 %50, label %51, label %57

51:                                               ; preds = %46
  %52 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
          to label %.invoke unwind label %55

53:                                               ; preds = %._crit_edge
  %54 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #8
  br label %97

55:                                               ; preds = %.invoke, %._crit_edge27, %60, %57, %51
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %96

57:                                               ; preds = %46
  %58 = call noundef i64 @_ZNK11CostNetworkIxxE7getCostEv(ptr noundef nonnull align 8 dereferenceable(128) %6)
  %59 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %58)
          to label %60 unwind label %55

60:                                               ; preds = %57
  %61 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %59, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %.preheader21 unwind label %55

.preheader21:                                     ; preds = %60
  %62 = call noundef i64 @_ZNK11CostNetworkIxxE7getSizeEv(ptr noundef nonnull align 8 dereferenceable(128) %6)
  %.not28 = icmp eq i64 %62, 0
  br i1 %.not28, label %._crit_edge27, label %.preheader

.preheader:                                       ; preds = %.preheader21, %._crit_edge25
  %indvars.iv31 = phi i64 [ %.pre, %._crit_edge25 ], [ 0, %.preheader21 ]
  %63 = call noundef i64 @_ZNK11CostNetworkIxxE7getSizeEv(ptr noundef nonnull align 8 dereferenceable(128) %6)
  %.not29 = icmp eq i64 %63, 0
  %.pre = add nuw nsw i64 %indvars.iv31, 1
  br i1 %.not29, label %._crit_edge25, label %.lr.ph24

.lr.ph24:                                         ; preds = %.preheader
  %64 = trunc nuw nsw i64 %indvars.iv31 to i32
  %65 = trunc nuw i64 %.pre to i32
  br label %71

._crit_edge27:                                    ; preds = %._crit_edge25, %.preheader21
  %66 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.7)
          to label %.invoke unwind label %55

._crit_edge25:                                    ; preds = %90, %.preheader
  %67 = call noundef i64 @_ZNK11CostNetworkIxxE7getSizeEv(ptr noundef nonnull align 8 dereferenceable(128) %6)
  %68 = icmp ugt i64 %67, %.pre
  br i1 %68, label %.preheader, label %._crit_edge27, !llvm.loop !15

69:                                               ; preds = %88, %85, %83, %79, %77, %75
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %96

71:                                               ; preds = %.lr.ph24, %90
  %indvars.iv = phi i64 [ 0, %.lr.ph24 ], [ %indvars.iv.next.pre-phi, %90 ]
  %72 = trunc nuw nsw i64 %indvars.iv to i32
  %73 = call noundef i64 @_ZNK11CostNetworkIxxE7getFlowEii(ptr noundef nonnull align 8 dereferenceable(128) %6, i32 noundef %64, i32 noundef %72)
  %74 = icmp sgt i64 %73, 0
  br i1 %74, label %75, label %._crit_edge34

._crit_edge34:                                    ; preds = %71
  %.pre35 = add nuw nsw i64 %indvars.iv, 1
  br label %90

75:                                               ; preds = %71
  %76 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %65)
          to label %77 unwind label %69

77:                                               ; preds = %75
  %78 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %76, ptr noundef nonnull @.str.6)
          to label %79 unwind label %69

79:                                               ; preds = %77
  %80 = add nuw nsw i64 %indvars.iv, 1
  %81 = trunc nuw i64 %80 to i32
  %82 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %78, i32 noundef %81)
          to label %83 unwind label %69

83:                                               ; preds = %79
  %84 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %82, ptr noundef nonnull @.str.6)
          to label %85 unwind label %69

85:                                               ; preds = %83
  %86 = call noundef i64 @_ZNK11CostNetworkIxxE7getFlowEii(ptr noundef nonnull align 8 dereferenceable(128) %6, i32 noundef %64, i32 noundef %72)
  %87 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %84, i64 noundef %86)
          to label %88 unwind label %69

88:                                               ; preds = %85
  %89 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %87, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %90 unwind label %69

90:                                               ; preds = %._crit_edge34, %88
  %indvars.iv.next.pre-phi = phi i64 [ %.pre35, %._crit_edge34 ], [ %80, %88 ]
  %91 = call noundef i64 @_ZNK11CostNetworkIxxE7getSizeEv(ptr noundef nonnull align 8 dereferenceable(128) %6)
  %92 = icmp ugt i64 %91, %indvars.iv.next.pre-phi
  br i1 %92, label %71, label %._crit_edge25, !llvm.loop !16

.invoke:                                          ; preds = %51, %._crit_edge27
  %93 = phi ptr [ %66, %._crit_edge27 ], [ %52, %51 ]
  %94 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %93, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %95 unwind label %55

95:                                               ; preds = %.invoke
  call void @_ZN6SSPathIxxED2Ev(ptr noundef nonnull align 8 dereferenceable(128) %11) #8
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %11) #8
  call void @_ZN11CostNetworkIxxED2Ev(ptr noundef nonnull align 8 dereferenceable(128) %6) #8
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  ret i32 0

96:                                               ; preds = %69, %55
  %.pn = phi { ptr, i32 } [ %56, %55 ], [ %70, %69 ]
  call void @_ZN6SSPathIxxED2Ev(ptr noundef nonnull align 8 dereferenceable(128) %11) #8
  br label %97

97:                                               ; preds = %96, %53
  %.pn.pn = phi { ptr, i32 } [ %.pn, %96 ], [ %54, %53 ]
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %11) #8
  br label %98

98:                                               ; preds = %97, %42
  %.pn19 = phi { ptr, i32 } [ %43, %42 ], [ %.pn.pn, %97 ]
  call void @_ZN11CostNetworkIxxED2Ev(ptr noundef nonnull align 8 dereferenceable(128) %6) #8
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  resume { ptr, i32 } %.pn19
}

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6SSPathIxxEC2ER11CostNetworkIxxERKx(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK11CostNetworkIxxE7getFlowEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #5 align 2

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

; 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 #4 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)) #6

; 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 #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK11CostNetworkIxxE7getCostEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK11CostNetworkIxxE7getSizeEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #5 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #6

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

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

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

!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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


; Effective O3 passes: GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass