; LLVM IR from eyangch/competitive-programming :: USACOcontests/silver/2013.02 (tractor)

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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<edge, std::allocator<edge>>::_Vector_impl" }
%"struct.std::_Vector_base<edge, std::allocator<edge>>::_Vector_impl" = type { %"struct.std::_Vector_base<edge, std::allocator<edge>>::_Vector_impl_data" }
%"struct.std::_Vector_base<edge, std::allocator<edge>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.edge = type { i32, %"struct.std::pair", %"struct.std::pair" }
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%class.anon = type { i8 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::vector", align 8
  %10 = alloca %struct.edge, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %struct.edge, align 4
  %16 = alloca i32, align 4
  %17 = alloca %struct.edge, align 4
  %18 = alloca i32, align 4
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca %class.anon, align 1
  %22 = alloca [500 x [500 x %"struct.std::pair"]], align 16
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca %"struct.std::pair", align 4
  %26 = alloca [500 x [500 x i32]], align 16
  %27 = alloca i32, align 4
  %28 = alloca ptr, align 8
  %29 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %30 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %31 = alloca %struct.edge, align 4
  %32 = alloca i32, align 4
  %33 = alloca %"struct.std::pair", align 4
  %34 = alloca %"struct.std::pair", align 4
  %35 = alloca %"struct.std::pair", align 4
  %36 = alloca %"struct.std::pair", align 4
  %37 = alloca %"struct.std::pair", align 4
  %38 = alloca %"struct.std::pair", align 4
  %39 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %40 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %41 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %42 = getelementptr i8, ptr %41, i64 -24
  %43 = load i64, ptr %42, align 8
  %44 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %43
  %45 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %44, ptr noundef null)
  %46 = load ptr, ptr @stdin, align 8, !tbaa !8
  %47 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %46)
  %48 = load ptr, ptr @stdout, align 8, !tbaa !8
  %49 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %48)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #10
  %50 = 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)
  %51 = load i32, ptr %2, align 4, !tbaa !11
  %52 = zext i32 %51 to i64
  %53 = load i32, ptr %2, align 4, !tbaa !11
  %54 = zext i32 %53 to i64
  %55 = call ptr @llvm.stacksave.p0()
  store ptr %55, ptr %3, align 8
  %56 = mul nuw i64 %52, %54
  %57 = alloca i32, i64 %56, align 16
  store i64 %52, ptr %4, align 8
  store i64 %54, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #10
  store i32 0, ptr %6, align 4, !tbaa !11
  br label %58

58:                                               ; preds = %82, %0
  %59 = load i32, ptr %6, align 4, !tbaa !11
  %60 = load i32, ptr %2, align 4, !tbaa !11
  %61 = icmp slt i32 %59, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #10
  br label %85

63:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #10
  store i32 0, ptr %8, align 4, !tbaa !11
  br label %64

64:                                               ; preds = %78, %63
  %65 = load i32, ptr %8, align 4, !tbaa !11
  %66 = load i32, ptr %2, align 4, !tbaa !11
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %64
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #10
  br label %81

69:                                               ; preds = %64
  %70 = load i32, ptr %6, align 4, !tbaa !11
  %71 = sext i32 %70 to i64
  %72 = mul nsw i64 %71, %54
  %73 = getelementptr inbounds i32, ptr %57, i64 %72
  %74 = load i32, ptr %8, align 4, !tbaa !11
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds i32, ptr %73, i64 %75
  %77 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %76)
  br label %78

78:                                               ; preds = %69
  %79 = load i32, ptr %8, align 4, !tbaa !11
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %8, align 4, !tbaa !11
  br label %64, !llvm.loop !13

81:                                               ; preds = %68
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %6, align 4, !tbaa !11
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %6, align 4, !tbaa !11
  br label %58, !llvm.loop !15

85:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #10
  call void @_ZNSt6vectorI4edgeSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #10
  call void @llvm.lifetime.start.p0(i64 20, ptr %10) #10
  invoke void @_ZN4edgeC2Ev(ptr noundef nonnull align 4 dereferenceable(20) %10)
          to label %86 unwind label %92

86:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #10
  store i32 0, ptr %13, align 4, !tbaa !11
  br label %87

87:                                               ; preds = %194, %86
  %88 = load i32, ptr %13, align 4, !tbaa !11
  %89 = load i32, ptr %2, align 4, !tbaa !11
  %90 = icmp slt i32 %88, %89
  br i1 %90, label %96, label %91

91:                                               ; preds = %87
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #10
  br label %197

92:                                               ; preds = %197, %85
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %11, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %12, align 4
  br label %339

96:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #10
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %97

97:                                               ; preds = %189, %96
  %98 = load i32, ptr %14, align 4, !tbaa !11
  %99 = load i32, ptr %2, align 4, !tbaa !11
  %100 = icmp slt i32 %98, %99
  br i1 %100, label %102, label %101

101:                                              ; preds = %97
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #10
  br label %193

102:                                              ; preds = %97
  %103 = load i32, ptr %13, align 4, !tbaa !11
  %104 = icmp sgt i32 %103, 0
  br i1 %104, label %105, label %147

105:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 20, ptr %15) #10
  %106 = getelementptr inbounds %struct.edge, ptr %15, i32 0, i32 0
  %107 = load i32, ptr %13, align 4, !tbaa !11
  %108 = sext i32 %107 to i64
  %109 = mul nsw i64 %108, %54
  %110 = getelementptr inbounds i32, ptr %57, i64 %109
  %111 = load i32, ptr %14, align 4, !tbaa !11
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds i32, ptr %110, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !11
  %115 = load i32, ptr %13, align 4, !tbaa !11
  %116 = sub nsw i32 %115, 1
  %117 = sext i32 %116 to i64
  %118 = mul nsw i64 %117, %54
  %119 = getelementptr inbounds i32, ptr %57, i64 %118
  %120 = load i32, ptr %14, align 4, !tbaa !11
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds i32, ptr %119, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !11
  %124 = sub nsw i32 %114, %123
  %125 = call i32 @llvm.abs.i32(i32 %124, i1 true)
  store i32 %125, ptr %106, align 4, !tbaa !16
  %126 = getelementptr inbounds %struct.edge, ptr %15, i32 0, i32 1
  invoke void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %126, ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %127 unwind label %134

127:                                              ; preds = %105
  %128 = getelementptr inbounds %struct.edge, ptr %15, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #10
  %129 = load i32, ptr %13, align 4, !tbaa !11
  %130 = sub nsw i32 %129, 1
  store i32 %130, ptr %16, align 4, !tbaa !11
  invoke void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %128, ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %131 unwind label %138

131:                                              ; preds = %127
  %132 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZN4edgeaSEOS_(ptr noundef nonnull align 4 dereferenceable(20) %10, ptr noundef nonnull align 4 dereferenceable(20) %15) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #10
  call void @llvm.lifetime.end.p0(i64 20, ptr %15) #10
  invoke void @_ZNSt6vectorI4edgeSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(20) %10)
          to label %133 unwind label %143

133:                                              ; preds = %131
  br label %147

134:                                              ; preds = %105
  %135 = landingpad { ptr, i32 }
          cleanup
  %136 = extractvalue { ptr, i32 } %135, 0
  store ptr %136, ptr %11, align 8
  %137 = extractvalue { ptr, i32 } %135, 1
  store i32 %137, ptr %12, align 4
  br label %142

138:                                              ; preds = %127
  %139 = landingpad { ptr, i32 }
          cleanup
  %140 = extractvalue { ptr, i32 } %139, 0
  store ptr %140, ptr %11, align 8
  %141 = extractvalue { ptr, i32 } %139, 1
  store i32 %141, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #10
  br label %142

142:                                              ; preds = %138, %134
  call void @llvm.lifetime.end.p0(i64 20, ptr %15) #10
  br label %192

143:                                              ; preds = %176, %131
  %144 = landingpad { ptr, i32 }
          cleanup
  %145 = extractvalue { ptr, i32 } %144, 0
  store ptr %145, ptr %11, align 8
  %146 = extractvalue { ptr, i32 } %144, 1
  store i32 %146, ptr %12, align 4
  br label %192

147:                                              ; preds = %133, %102
  %148 = load i32, ptr %14, align 4, !tbaa !11
  %149 = icmp sgt i32 %148, 0
  br i1 %149, label %150, label %188

150:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 20, ptr %17) #10
  %151 = getelementptr inbounds %struct.edge, ptr %17, i32 0, i32 0
  %152 = load i32, ptr %13, align 4, !tbaa !11
  %153 = sext i32 %152 to i64
  %154 = mul nsw i64 %153, %54
  %155 = getelementptr inbounds i32, ptr %57, i64 %154
  %156 = load i32, ptr %14, align 4, !tbaa !11
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds i32, ptr %155, i64 %157
  %159 = load i32, ptr %158, align 4, !tbaa !11
  %160 = load i32, ptr %13, align 4, !tbaa !11
  %161 = sext i32 %160 to i64
  %162 = mul nsw i64 %161, %54
  %163 = getelementptr inbounds i32, ptr %57, i64 %162
  %164 = load i32, ptr %14, align 4, !tbaa !11
  %165 = sub nsw i32 %164, 1
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds i32, ptr %163, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !11
  %169 = sub nsw i32 %159, %168
  %170 = call i32 @llvm.abs.i32(i32 %169, i1 true)
  store i32 %170, ptr %151, align 4, !tbaa !16
  %171 = getelementptr inbounds %struct.edge, ptr %17, i32 0, i32 1
  invoke void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %171, ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %172 unwind label %179

172:                                              ; preds = %150
  %173 = getelementptr inbounds %struct.edge, ptr %17, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #10
  %174 = load i32, ptr %14, align 4, !tbaa !11
  %175 = sub nsw i32 %174, 1
  store i32 %175, ptr %18, align 4, !tbaa !11
  invoke void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %173, ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %18)
          to label %176 unwind label %183

176:                                              ; preds = %172
  %177 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZN4edgeaSEOS_(ptr noundef nonnull align 4 dereferenceable(20) %10, ptr noundef nonnull align 4 dereferenceable(20) %17) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #10
  call void @llvm.lifetime.end.p0(i64 20, ptr %17) #10
  invoke void @_ZNSt6vectorI4edgeSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(20) %10)
          to label %178 unwind label %143

178:                                              ; preds = %176
  br label %188

179:                                              ; preds = %150
  %180 = landingpad { ptr, i32 }
          cleanup
  %181 = extractvalue { ptr, i32 } %180, 0
  store ptr %181, ptr %11, align 8
  %182 = extractvalue { ptr, i32 } %180, 1
  store i32 %182, ptr %12, align 4
  br label %187

183:                                              ; preds = %172
  %184 = landingpad { ptr, i32 }
          cleanup
  %185 = extractvalue { ptr, i32 } %184, 0
  store ptr %185, ptr %11, align 8
  %186 = extractvalue { ptr, i32 } %184, 1
  store i32 %186, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #10
  br label %187

187:                                              ; preds = %183, %179
  call void @llvm.lifetime.end.p0(i64 20, ptr %17) #10
  br label %192

188:                                              ; preds = %178, %147
  br label %189

189:                                              ; preds = %188
  %190 = load i32, ptr %14, align 4, !tbaa !11
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr %14, align 4, !tbaa !11
  br label %97, !llvm.loop !19

192:                                              ; preds = %187, %143, %142
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #10
  br label %339

193:                                              ; preds = %101
  br label %194

194:                                              ; preds = %193
  %195 = load i32, ptr %13, align 4, !tbaa !11
  %196 = add nsw i32 %195, 1
  store i32 %196, ptr %13, align 4, !tbaa !11
  br label %87, !llvm.loop !20

197:                                              ; preds = %91
  %198 = call ptr @_ZNSt6vectorI4edgeSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #10
  %199 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %198, ptr %199, align 8
  %200 = call ptr @_ZNSt6vectorI4edgeSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #10
  %201 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %200, ptr %201, align 8
  %202 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  %203 = load ptr, ptr %202, align 8
  %204 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  %205 = load ptr, ptr %204, align 8
  invoke void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP4edgeSt6vectorIS2_SaIS2_EEEEZ4mainE3$_0EvT_S9_T0_"(ptr %203, ptr %205)
          to label %206 unwind label %92

206:                                              ; preds = %197
  call void @llvm.lifetime.start.p0(i64 2000000, ptr %22) #10
  %207 = getelementptr inbounds [500 x [500 x %"struct.std::pair"]], ptr %22, i32 0, i32 0, i32 0
  %208 = getelementptr inbounds %"struct.std::pair", ptr %207, i64 250000
  br label %209

209:                                              ; preds = %211, %206
  %210 = phi ptr [ %207, %206 ], [ %212, %211 ]
  invoke void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %210)
          to label %211 unwind label %220

211:                                              ; preds = %209
  %212 = getelementptr inbounds %"struct.std::pair", ptr %210, i64 1
  %213 = icmp eq ptr %212, %208
  br i1 %213, label %214, label %209

214:                                              ; preds = %211
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #10
  store i32 0, ptr %23, align 4, !tbaa !11
  br label %215

215:                                              ; preds = %247, %214
  %216 = load i32, ptr %23, align 4, !tbaa !11
  %217 = load i32, ptr %2, align 4, !tbaa !11
  %218 = icmp slt i32 %216, %217
  br i1 %218, label %224, label %219

219:                                              ; preds = %215
  store i32 14, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #10
  br label %250

220:                                              ; preds = %209
  %221 = landingpad { ptr, i32 }
          cleanup
  %222 = extractvalue { ptr, i32 } %221, 0
  store ptr %222, ptr %11, align 8
  %223 = extractvalue { ptr, i32 } %221, 1
  store i32 %223, ptr %12, align 4
  br label %338

224:                                              ; preds = %215
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #10
  store i32 0, ptr %24, align 4, !tbaa !11
  br label %225

225:                                              ; preds = %239, %224
  %226 = load i32, ptr %24, align 4, !tbaa !11
  %227 = load i32, ptr %2, align 4, !tbaa !11
  %228 = icmp slt i32 %226, %227
  br i1 %228, label %230, label %229

229:                                              ; preds = %225
  store i32 17, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #10
  br label %246

230:                                              ; preds = %225
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #10
  invoke void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %25, ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %24)
          to label %231 unwind label %242

231:                                              ; preds = %230
  %232 = load i32, ptr %23, align 4, !tbaa !11
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds [500 x [500 x %"struct.std::pair"]], ptr %22, i64 0, i64 %233
  %235 = load i32, ptr %24, align 4, !tbaa !11
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [500 x %"struct.std::pair"], ptr %234, i64 0, i64 %236
  %238 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %237, ptr noundef nonnull align 4 dereferenceable(8) %25) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #10
  br label %239

239:                                              ; preds = %231
  %240 = load i32, ptr %24, align 4, !tbaa !11
  %241 = add nsw i32 %240, 1
  store i32 %241, ptr %24, align 4, !tbaa !11
  br label %225, !llvm.loop !21

242:                                              ; preds = %230
  %243 = landingpad { ptr, i32 }
          cleanup
  %244 = extractvalue { ptr, i32 } %243, 0
  store ptr %244, ptr %11, align 8
  %245 = extractvalue { ptr, i32 } %243, 1
  store i32 %245, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #10
  br label %338

246:                                              ; preds = %229
  br label %247

247:                                              ; preds = %246
  %248 = load i32, ptr %23, align 4, !tbaa !11
  %249 = add nsw i32 %248, 1
  store i32 %249, ptr %23, align 4, !tbaa !11
  br label %215, !llvm.loop !22

250:                                              ; preds = %219
  call void @llvm.lifetime.start.p0(i64 1000000, ptr %26) #10
  %251 = getelementptr inbounds [500 x [500 x i32]], ptr %26, i64 0, i64 0
  %252 = getelementptr inbounds [500 x i32], ptr %251, i64 0, i64 0
  %253 = load i32, ptr %2, align 4, !tbaa !11
  %254 = sub nsw i32 %253, 1
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [500 x [500 x i32]], ptr %26, i64 0, i64 %255
  %257 = getelementptr inbounds [500 x i32], ptr %256, i64 0, i64 0
  %258 = load i32, ptr %2, align 4, !tbaa !11
  %259 = sext i32 %258 to i64
  %260 = getelementptr inbounds i32, ptr %257, i64 %259
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #10
  store i32 1, ptr %27, align 4, !tbaa !11
  invoke void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef %252, ptr noundef %260, ptr noundef nonnull align 4 dereferenceable(4) %27)
          to label %261 unwind label %271

261:                                              ; preds = %250
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #10
  store ptr %9, ptr %28, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #10
  %262 = load ptr, ptr %28, align 8, !tbaa !8
  %263 = call ptr @_ZNSt6vectorI4edgeSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %262) #10
  %264 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %29, i32 0, i32 0
  store ptr %263, ptr %264, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #10
  %265 = load ptr, ptr %28, align 8, !tbaa !8
  %266 = call ptr @_ZNSt6vectorI4edgeSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %265) #10
  %267 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %30, i32 0, i32 0
  store ptr %266, ptr %267, align 8
  br label %268

268:                                              ; preds = %327, %261
  %269 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4edgeSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef nonnull align 8 dereferenceable(8) %30) #10
  br i1 %269, label %275, label %270

270:                                              ; preds = %268
  store i32 20, ptr %7, align 4
  br label %331

271:                                              ; preds = %250
  %272 = landingpad { ptr, i32 }
          cleanup
  %273 = extractvalue { ptr, i32 } %272, 0
  store ptr %273, ptr %11, align 8
  %274 = extractvalue { ptr, i32 } %272, 1
  store i32 %274, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #10
  br label %337

275:                                              ; preds = %268
  call void @llvm.lifetime.start.p0(i64 20, ptr %31) #10
  %276 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4edgeSt6vectorIS1_SaIS1_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #10
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %31, ptr align 4 %276, i64 20, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #10
  %277 = getelementptr inbounds %struct.edge, ptr %31, i32 0, i32 0
  %278 = load i32, ptr %277, align 4, !tbaa !16
  store i32 %278, ptr %32, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #10
  %279 = getelementptr inbounds %struct.edge, ptr %31, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %33, ptr align 4 %279, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #10
  %280 = getelementptr inbounds %struct.edge, ptr %31, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %34, ptr align 4 %280, i64 8, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %35, ptr align 4 %33, i64 8, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %36, ptr align 4 %34, i64 8, i1 false)
  %281 = load i64, ptr %35, align 4
  %282 = load i64, ptr %36, align 4
  invoke void @_Z2unSt4pairIiiES0_RA500_A500_S0_RA500_A500_i(i64 %281, i64 %282, ptr noundef nonnull align 4 dereferenceable(2000000) %22, ptr noundef nonnull align 4 dereferenceable(1000000) %26)
          to label %283 unwind label %308

283:                                              ; preds = %275
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #10
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %38, ptr align 4 %33, i64 8, i1 false)
  %284 = load i64, ptr %38, align 4
  %285 = invoke i64 @_Z4findSt4pairIiiERA500_A500_S0_(i64 %284, ptr noundef nonnull align 4 dereferenceable(2000000) %22)
          to label %286 unwind label %312

286:                                              ; preds = %283
  store i64 %285, ptr %37, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #10
  %287 = getelementptr inbounds %"struct.std::pair", ptr %37, i32 0, i32 0
  %288 = load i32, ptr %287, align 4, !tbaa !23
  %289 = sext i32 %288 to i64
  %290 = getelementptr inbounds [500 x [500 x i32]], ptr %26, i64 0, i64 %289
  %291 = getelementptr inbounds %"struct.std::pair", ptr %37, i32 0, i32 1
  %292 = load i32, ptr %291, align 4, !tbaa !24
  %293 = sext i32 %292 to i64
  %294 = getelementptr inbounds [500 x i32], ptr %290, i64 0, i64 %293
  %295 = load i32, ptr %294, align 4, !tbaa !11
  store i32 %295, ptr %39, align 4, !tbaa !11
  %296 = load i32, ptr %39, align 4, !tbaa !11
  %297 = mul nsw i32 %296, 2
  %298 = load i32, ptr %2, align 4, !tbaa !11
  %299 = load i32, ptr %2, align 4, !tbaa !11
  %300 = mul nsw i32 %298, %299
  %301 = icmp sge i32 %297, %300
  br i1 %301, label %302, label %320

302:                                              ; preds = %286
  %303 = load i32, ptr %32, align 4, !tbaa !11
  %304 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %303)
          to label %305 unwind label %316

305:                                              ; preds = %302
  %306 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %304, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %307 unwind label %316

307:                                              ; preds = %305
  store i32 0, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %321

308:                                              ; preds = %275
  %309 = landingpad { ptr, i32 }
          cleanup
  %310 = extractvalue { ptr, i32 } %309, 0
  store ptr %310, ptr %11, align 8
  %311 = extractvalue { ptr, i32 } %309, 1
  store i32 %311, ptr %12, align 4
  br label %330

312:                                              ; preds = %283
  %313 = landingpad { ptr, i32 }
          cleanup
  %314 = extractvalue { ptr, i32 } %313, 0
  store ptr %314, ptr %11, align 8
  %315 = extractvalue { ptr, i32 } %313, 1
  store i32 %315, ptr %12, align 4
  br label %329

316:                                              ; preds = %305, %302
  %317 = landingpad { ptr, i32 }
          cleanup
  %318 = extractvalue { ptr, i32 } %317, 0
  store ptr %318, ptr %11, align 8
  %319 = extractvalue { ptr, i32 } %317, 1
  store i32 %319, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #10
  br label %329

320:                                              ; preds = %286
  store i32 0, ptr %7, align 4
  br label %321

321:                                              ; preds = %320, %307
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #10
  %322 = load i32, ptr %7, align 4
  switch i32 %322, label %324 [
    i32 0, label %323
  ]

323:                                              ; preds = %321
  store i32 0, ptr %7, align 4
  br label %324

324:                                              ; preds = %323, %321
  call void @llvm.lifetime.end.p0(i64 20, ptr %31) #10
  %325 = load i32, ptr %7, align 4
  switch i32 %325, label %331 [
    i32 0, label %326
  ]

326:                                              ; preds = %324
  br label %327

327:                                              ; preds = %326
  %328 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP4edgeSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #10
  br label %268

329:                                              ; preds = %316, %312
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #10
  br label %330

330:                                              ; preds = %329, %308
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #10
  call void @llvm.lifetime.end.p0(i64 20, ptr %31) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #10
  br label %337

331:                                              ; preds = %324, %270
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #10
  %332 = load i32, ptr %7, align 4
  switch i32 %332, label %334 [
    i32 20, label %333
  ]

333:                                              ; preds = %331
  store i32 0, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %334

334:                                              ; preds = %333, %331
  call void @llvm.lifetime.end.p0(i64 1000000, ptr %26) #10
  call void @llvm.lifetime.end.p0(i64 2000000, ptr %22) #10
  call void @llvm.lifetime.end.p0(i64 20, ptr %10) #10
  call void @_ZNSt6vectorI4edgeSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #10
  %335 = load ptr, ptr %3, align 8
  call void @llvm.stackrestore.p0(ptr %335)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #10
  %336 = load i32, ptr %1, align 4
  ret i32 %336

337:                                              ; preds = %330, %271
  call void @llvm.lifetime.end.p0(i64 1000000, ptr %26) #10
  br label %338

338:                                              ; preds = %337, %242, %220
  call void @llvm.lifetime.end.p0(i64 2000000, ptr %22) #10
  br label %339

339:                                              ; preds = %338, %192, %92
  call void @llvm.lifetime.end.p0(i64 20, ptr %10) #10
  call void @_ZNSt6vectorI4edgeSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #10
  br label %340

340:                                              ; preds = %339
  %341 = load ptr, ptr %11, align 8
  %342 = load i32, ptr %12, align 4
  %343 = insertvalue { ptr, i32 } poison, ptr %341, 0
  %344 = insertvalue { ptr, i32 } %343, i32 %342, 1
  resume { ptr, i32 } %344
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #5

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

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #5

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #6

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4edgeC2Ev(ptr noundef nonnull align 4 dereferenceable(20)) unnamed_addr #7 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(20) ptr @_ZN4edgeaSEOS_(ptr noundef nonnull align 4 dereferenceable(20), ptr noundef nonnull align 4 dereferenceable(20)) #9 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP4edgeSt6vectorIS2_SaIS2_EEEEZ4mainE3$_0EvT_S9_T0_"(ptr, ptr) #7

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #7

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

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #6

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #5 = { "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 = { nocallback nofree nosync nounwind willreturn }
attributes #7 = { 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 #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { 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 #10 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{!17, !12, i64 0}
!17 = !{!"_ZTS4edge", !12, i64 0, !18, i64 4, !18, i64 12}
!18 = !{!"_ZTSSt4pairIiiE", !12, i64 0, !12, i64 4}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14}
!23 = !{!18, !12, i64 0}
!24 = !{!18, !12, i64 4}


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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<edge, std::allocator<edge>>::_Vector_impl" }
%"struct.std::_Vector_base<edge, std::allocator<edge>>::_Vector_impl" = type { %"struct.std::_Vector_base<edge, std::allocator<edge>>::_Vector_impl_data" }
%"struct.std::_Vector_base<edge, std::allocator<edge>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.edge = type { i32, %"struct.std::pair", %"struct.std::pair" }
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %struct.edge, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %struct.edge, align 4
  %7 = alloca i32, align 4
  %8 = alloca %struct.edge, align 4
  %9 = alloca i32, align 4
  %10 = alloca [500 x [500 x %"struct.std::pair"]], align 16
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::pair", align 4
  %14 = alloca [500 x [500 x i32]], align 16
  %15 = alloca i32, align 4
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %19 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %20 = getelementptr i8, ptr %19, i64 -24
  %21 = load i64, ptr %20, align 8
  %22 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %21
  %23 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %22, ptr noundef null)
  %24 = load ptr, ptr @stdin, align 8, !tbaa !8
  %25 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %24)
  %26 = load ptr, ptr @stdout, align 8, !tbaa !8
  %27 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %26)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #9
  %28 = 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)
  %29 = load i32, ptr %1, align 4, !tbaa !11
  %30 = zext i32 %29 to i64
  %31 = call ptr @llvm.stacksave.p0()
  %32 = mul nuw i64 %30, %30
  %33 = alloca i32, i64 %32, align 16
  %34 = load i32, ptr %1, align 4, !tbaa !11
  %35 = icmp sgt i32 %34, 0
  br i1 %35, label %.preheader, label %._crit_edge56

.preheader:                                       ; preds = %0, %._crit_edge
  %36 = phi i32 [ %40, %._crit_edge ], [ %34, %0 ]
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %._crit_edge ], [ 0, %0 ]
  %37 = icmp sgt i32 %36, 0
  br i1 %37, label %.lr.ph, label %.preheader.._crit_edge_crit_edge

.preheader.._crit_edge_crit_edge:                 ; preds = %.preheader
  %.pre92 = sext i32 %36 to i64
  br label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %38 = mul nuw nsw i64 %indvars.iv83, %30
  %39 = getelementptr inbounds i32, ptr %33, i64 %38
  br label %42

._crit_edge56:                                    ; preds = %._crit_edge, %0
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #9
  call void @_ZNSt6vectorI4edgeSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #9
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %3) #9
  invoke void @_ZN4edgeC2Ev(ptr noundef nonnull align 4 dereferenceable(20) %3)
          to label %48 unwind label %57

._crit_edge:                                      ; preds = %42, %.preheader.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre92, %.preheader.._crit_edge_crit_edge ], [ %46, %42 ]
  %40 = phi i32 [ %36, %.preheader.._crit_edge_crit_edge ], [ %45, %42 ]
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %41 = icmp slt i64 %indvars.iv.next84, %.pre-phi
  br i1 %41, label %.preheader, label %._crit_edge56, !llvm.loop !13

42:                                               ; preds = %.lr.ph, %42
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %42 ]
  %43 = getelementptr inbounds i32, ptr %39, i64 %indvars.iv
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %43)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %45 = load i32, ptr %1, align 4, !tbaa !11
  %46 = sext i32 %45 to i64
  %47 = icmp slt i64 %indvars.iv.next, %46
  br i1 %47, label %42, label %._crit_edge, !llvm.loop !16

48:                                               ; preds = %._crit_edge56
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  store i32 0, ptr %4, align 4, !tbaa !11
  %49 = load i32, ptr %1, align 4, !tbaa !11
  %50 = icmp sgt i32 %49, 0
  br i1 %50, label %.lr.ph62.split.preheader, label %._crit_edge63

.lr.ph62.split.preheader:                         ; preds = %48
  %51 = getelementptr inbounds i8, ptr %6, i64 4
  %52 = getelementptr inbounds i8, ptr %6, i64 12
  %53 = getelementptr inbounds i8, ptr %8, i64 4
  %54 = getelementptr inbounds i8, ptr %8, i64 12
  br label %.lr.ph62.split

._crit_edge63:                                    ; preds = %._crit_edge60, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  %55 = call ptr @_ZNSt6vectorI4edgeSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #9
  %56 = call ptr @_ZNSt6vectorI4edgeSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #9
  invoke void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP4edgeSt6vectorIS2_SaIS2_EEEEZ4mainE3$_0EvT_S9_T0_"(ptr %55, ptr %56)
          to label %111 unwind label %57

57:                                               ; preds = %._crit_edge63, %._crit_edge56
  %58 = landingpad { ptr, i32 }
          cleanup
  br label %172

.lr.ph62.split:                                   ; preds = %.lr.ph62.split.preheader, %._crit_edge60
  %59 = phi i32 [ %49, %.lr.ph62.split.preheader ], [ %62, %._crit_edge60 ]
  %60 = phi i32 [ 0, %.lr.ph62.split.preheader ], [ %64, %._crit_edge60 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #9
  store i32 0, ptr %5, align 4, !tbaa !11
  %61 = icmp sgt i32 %59, 0
  br i1 %61, label %.lr.ph59, label %._crit_edge60

._crit_edge60.loopexit:                           ; preds = %106
  %.pre90 = load i32, ptr %4, align 4, !tbaa !11
  br label %._crit_edge60

._crit_edge60:                                    ; preds = %._crit_edge60.loopexit, %.lr.ph62.split
  %62 = phi i32 [ %109, %._crit_edge60.loopexit ], [ %59, %.lr.ph62.split ]
  %63 = phi i32 [ %.pre90, %._crit_edge60.loopexit ], [ %60, %.lr.ph62.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %4, align 4, !tbaa !11
  %65 = icmp slt i32 %64, %62
  br i1 %65, label %.lr.ph62.split, label %._crit_edge63, !llvm.loop !17

.lr.ph59:                                         ; preds = %.lr.ph62.split, %106
  %storemerge4757 = phi i32 [ %108, %106 ], [ 0, %.lr.ph62.split ]
  %66 = load i32, ptr %4, align 4, !tbaa !11
  %67 = icmp sgt i32 %66, 0
  br i1 %67, label %68, label %88

68:                                               ; preds = %.lr.ph59
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %6) #9
  %69 = zext nneg i32 %66 to i64
  %70 = mul nuw nsw i64 %69, %30
  %71 = getelementptr inbounds i32, ptr %33, i64 %70
  %72 = sext i32 %storemerge4757 to i64
  %73 = getelementptr inbounds i32, ptr %71, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !11
  %75 = add nsw i32 %66, -1
  %76 = zext nneg i32 %75 to i64
  %77 = mul nuw nsw i64 %76, %30
  %78 = getelementptr inbounds i32, ptr %33, i64 %77
  %79 = getelementptr inbounds i32, ptr %78, i64 %72
  %80 = load i32, ptr %79, align 4, !tbaa !11
  %81 = sub nsw i32 %74, %80
  %82 = call i32 @llvm.abs.i32(i32 %81, i1 true)
  store i32 %82, ptr %6, align 4, !tbaa !18
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %51, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #9
  %83 = load i32, ptr %4, align 4, !tbaa !11
  %84 = add nsw i32 %83, -1
  store i32 %84, ptr %7, align 4, !tbaa !11
  call void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %52, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %85 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZN4edgeaSEOS_(ptr noundef nonnull align 4 dereferenceable(20) %3, ptr noundef nonnull align 4 dereferenceable(20) %6) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %6) #9
  invoke void @_ZNSt6vectorI4edgeSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 4 dereferenceable(20) %3)
          to label %._crit_edge87 unwind label %86

._crit_edge87:                                    ; preds = %68
  %.pre = load i32, ptr %5, align 4, !tbaa !11
  br label %88

86:                                               ; preds = %91, %68
  %87 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  br label %172

88:                                               ; preds = %._crit_edge87, %.lr.ph59
  %89 = phi i32 [ %.pre, %._crit_edge87 ], [ %storemerge4757, %.lr.ph59 ]
  %90 = icmp sgt i32 %89, 0
  br i1 %90, label %91, label %106

91:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %8) #9
  %92 = load i32, ptr %4, align 4, !tbaa !11
  %93 = sext i32 %92 to i64
  %94 = mul nsw i64 %93, %30
  %95 = getelementptr inbounds i32, ptr %33, i64 %94
  %96 = zext nneg i32 %89 to i64
  %97 = getelementptr inbounds i32, ptr %95, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !11
  %99 = getelementptr i8, ptr %97, i64 -4
  %100 = load i32, ptr %99, align 4, !tbaa !11
  %101 = sub nsw i32 %98, %100
  %102 = call i32 @llvm.abs.i32(i32 %101, i1 true)
  store i32 %102, ptr %8, align 4, !tbaa !18
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %53, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #9
  %103 = load i32, ptr %5, align 4, !tbaa !11
  %104 = add nsw i32 %103, -1
  store i32 %104, ptr %9, align 4, !tbaa !11
  call void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %54, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %105 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZN4edgeaSEOS_(ptr noundef nonnull align 4 dereferenceable(20) %3, ptr noundef nonnull align 4 dereferenceable(20) %8) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %8) #9
  invoke void @_ZNSt6vectorI4edgeSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 4 dereferenceable(20) %3)
          to label %._crit_edge88 unwind label %86

._crit_edge88:                                    ; preds = %91
  %.pre89 = load i32, ptr %5, align 4, !tbaa !11
  br label %106

106:                                              ; preds = %._crit_edge88, %88
  %107 = phi i32 [ %.pre89, %._crit_edge88 ], [ %89, %88 ]
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %5, align 4, !tbaa !11
  %109 = load i32, ptr %1, align 4, !tbaa !11
  %110 = icmp slt i32 %108, %109
  br i1 %110, label %.lr.ph59, label %._crit_edge60.loopexit, !llvm.loop !21

111:                                              ; preds = %._crit_edge63
  call void @llvm.lifetime.start.p0(i64 2000000, ptr nonnull %10) #9
  br label %112

112:                                              ; preds = %112, %111
  %.idx = phi i64 [ 0, %111 ], [ %.add, %112 ]
  %.ptr = getelementptr inbounds i8, ptr %10, i64 %.idx
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %.ptr)
  %.add = add nuw nsw i64 %.idx, 8
  %113 = icmp eq i64 %.add, 2000000
  br i1 %113, label %114, label %112

114:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #9
  store i32 0, ptr %11, align 4, !tbaa !11
  %115 = load i32, ptr %1, align 4, !tbaa !11
  %116 = icmp sgt i32 %115, 0
  br i1 %116, label %.lr.ph69.split, label %._crit_edge70

._crit_edge70:                                    ; preds = %._crit_edge67, %114
  %.lcssa = phi i32 [ %115, %114 ], [ %125, %._crit_edge67 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #9
  call void @llvm.lifetime.start.p0(i64 1000000, ptr nonnull %14) #9
  %117 = add nsw i32 %.lcssa, -1
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [500 x [500 x i32]], ptr %14, i64 0, i64 %118
  %120 = sext i32 %.lcssa to i64
  %121 = getelementptr inbounds i32, ptr %119, i64 %120
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #9
  store i32 1, ptr %15, align 4, !tbaa !11
  invoke void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull %14, ptr noundef nonnull %121, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %139 unwind label %143

.lr.ph69.split:                                   ; preds = %114, %._crit_edge67
  %122 = phi i32 [ %125, %._crit_edge67 ], [ %115, %114 ]
  %123 = phi i32 [ %127, %._crit_edge67 ], [ 0, %114 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #9
  store i32 0, ptr %12, align 4, !tbaa !11
  %124 = icmp sgt i32 %122, 0
  br i1 %124, label %.lr.ph66, label %._crit_edge67

._crit_edge67.loopexit:                           ; preds = %.lr.ph66
  %.pre91 = load i32, ptr %11, align 4, !tbaa !11
  br label %._crit_edge67

._crit_edge67:                                    ; preds = %._crit_edge67.loopexit, %.lr.ph69.split
  %125 = phi i32 [ %137, %._crit_edge67.loopexit ], [ %122, %.lr.ph69.split ]
  %126 = phi i32 [ %.pre91, %._crit_edge67.loopexit ], [ %123, %.lr.ph69.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #9
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %11, align 4, !tbaa !11
  %128 = icmp slt i32 %127, %125
  br i1 %128, label %.lr.ph69.split, label %._crit_edge70, !llvm.loop !22

.lr.ph66:                                         ; preds = %.lr.ph69.split, %.lr.ph66
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #9
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %129 = load i32, ptr %11, align 4, !tbaa !11
  %130 = sext i32 %129 to i64
  %131 = load i32, ptr %12, align 4, !tbaa !11
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [500 x [500 x %"struct.std::pair"]], ptr %10, i64 0, i64 %130, i64 %132
  %134 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %133, ptr noundef nonnull align 4 dereferenceable(8) %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #9
  %135 = load i32, ptr %12, align 4, !tbaa !11
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %12, align 4, !tbaa !11
  %137 = load i32, ptr %1, align 4, !tbaa !11
  %138 = icmp slt i32 %136, %137
  br i1 %138, label %.lr.ph66, label %._crit_edge67.loopexit, !llvm.loop !23

139:                                              ; preds = %._crit_edge70
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #9
  %140 = call ptr @_ZNSt6vectorI4edgeSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #9
  store ptr %140, ptr %16, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #9
  %141 = call ptr @_ZNSt6vectorI4edgeSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #9
  store ptr %141, ptr %17, align 8
  %142 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4edgeSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #9
  br i1 %142, label %.lr.ph74, label %.critedge51

143:                                              ; preds = %._crit_edge70
  %144 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #9
  br label %171

.lr.ph74:                                         ; preds = %139, %.critedge
  %145 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4edgeSt6vectorIS1_SaIS1_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #9
  %.sroa.010.0.copyload = load i32, ptr %145, align 4
  %.sroa.511.0..sroa_idx = getelementptr inbounds i8, ptr %145, i64 4
  %.sroa.511.0.copyload = load i64, ptr %.sroa.511.0..sroa_idx, align 4
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %145, i64 12
  %.sroa.6.0.copyload = load i64, ptr %.sroa.6.0..sroa_idx, align 4
  invoke void @_Z2unSt4pairIiiES0_RA500_A500_S0_RA500_A500_i(i64 %.sroa.511.0.copyload, i64 %.sroa.6.0.copyload, ptr noundef nonnull align 4 dereferenceable(2000000) %10, ptr noundef nonnull align 4 dereferenceable(1000000) %14)
          to label %146 unwind label %160

146:                                              ; preds = %.lr.ph74
  %147 = invoke i64 @_Z4findSt4pairIiiERA500_A500_S0_(i64 %.sroa.511.0.copyload, ptr noundef nonnull align 4 dereferenceable(2000000) %10)
          to label %148 unwind label %162

148:                                              ; preds = %146
  %sext = shl i64 %147, 32
  %149 = ashr exact i64 %sext, 32
  %150 = ashr i64 %147, 32
  %151 = getelementptr inbounds [500 x [500 x i32]], ptr %14, i64 0, i64 %149, i64 %150
  %152 = load i32, ptr %151, align 4, !tbaa !11
  %153 = shl nsw i32 %152, 1
  %154 = load i32, ptr %1, align 4, !tbaa !11
  %155 = mul nsw i32 %154, %154
  %.not = icmp slt i32 %153, %155
  br i1 %.not, label %.critedge, label %156

156:                                              ; preds = %148
  %157 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.sroa.010.0.copyload)
          to label %158 unwind label %164

158:                                              ; preds = %156
  %159 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %157, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %169 unwind label %164

160:                                              ; preds = %.lr.ph74
  %161 = landingpad { ptr, i32 }
          cleanup
  br label %168

162:                                              ; preds = %146
  %163 = landingpad { ptr, i32 }
          cleanup
  br label %168

164:                                              ; preds = %158, %156
  %165 = landingpad { ptr, i32 }
          cleanup
  br label %168

.critedge:                                        ; preds = %148
  %166 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP4edgeSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #9
  %167 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4edgeSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #9
  br i1 %167, label %.lr.ph74, label %.critedge51

168:                                              ; preds = %162, %164, %160
  %.pn.pn = phi { ptr, i32 } [ %161, %160 ], [ %165, %164 ], [ %163, %162 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #9
  br label %171

169:                                              ; preds = %158
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #9
  br label %170

.critedge51:                                      ; preds = %.critedge, %139
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #9
  br label %170

170:                                              ; preds = %169, %.critedge51
  call void @llvm.lifetime.end.p0(i64 1000000, ptr nonnull %14) #9
  call void @llvm.lifetime.end.p0(i64 2000000, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %3) #9
  call void @_ZNSt6vectorI4edgeSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #9
  call void @llvm.stackrestore.p0(ptr %31)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  ret i32 0

171:                                              ; preds = %168, %143
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %168 ], [ %144, %143 ]
  call void @llvm.lifetime.end.p0(i64 1000000, ptr nonnull %14) #9
  call void @llvm.lifetime.end.p0(i64 2000000, ptr nonnull %10) #9
  br label %172

172:                                              ; preds = %171, %86, %57
  %.pn48 = phi { ptr, i32 } [ %87, %86 ], [ %.pn.pn.pn, %171 ], [ %58, %57 ]
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %3) #9
  call void @_ZNSt6vectorI4edgeSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  resume { ptr, i32 } %.pn48
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #4

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

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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 nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4edgeC2Ev(ptr noundef nonnull align 4 dereferenceable(20)) unnamed_addr #6 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP4edgeSt6vectorIS2_SaIS2_EEEEZ4mainE3$_0EvT_S9_T0_"(ptr, ptr) local_unnamed_addr #6

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #6

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

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

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

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #5

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #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 nocallback nofree nosync nounwind willreturn }
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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { 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 #9 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14, !15}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.unswitch.partial.disable"}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14, !15}
!18 = !{!19, !12, i64 0}
!19 = !{!"_ZTS4edge", !12, i64 0, !20, i64 4, !20, i64 12}
!20 = !{!"_ZTSSt4pairIiiE", !12, i64 0, !12, i64 4}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14, !15}
!23 = distinct !{!23, !14}


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