; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2008-09 (lfence)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.graph = type { [62500 x %"class.std::vector"], %struct.Topo, [62500 x i32] }
%struct.Topo = type { i32, [62500 x i32], %"class.std::vector.3", [62500 x %"class.std::vector.3"] }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.11" = type { ptr }
%class.anon = type { i32 }
%class.anon.12 = type { i32 }
%"struct.std::pair" = type { i32, i32 }

@N = external dso_local global i32, align 4
@v = external dso_local global %"class.std::vector", align 8
@nex = external dso_local global [250 x %"class.std::vector.3"], align 16
@pre = external dso_local global [250 x %"class.std::vector.3"], align 16
@G = external dso_local global [2 x %struct.graph], align 16
@.str.13 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2io5setIOENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef) #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z2cwSt4pairIiiES0_S0_(i64, i64, i64) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3getii(i32 noundef, i32 noundef) #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 %"class.std::__cxx11::basic_string", align 8
  %3 = alloca %"class.std::allocator", align 1
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.__gnu_cxx::__normal_iterator.11", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator.11", align 8
  %15 = alloca %class.anon, align 4
  %16 = alloca %"class.__gnu_cxx::__normal_iterator.11", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator.11", align 8
  %18 = alloca %class.anon.12, align 4
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator.11", align 8
  %22 = alloca %"class.__gnu_cxx::__normal_iterator.11", align 8
  %23 = alloca ptr, align 8
  %24 = alloca %"struct.std::pair", align 4
  %25 = alloca %"struct.std::pair", align 4
  %26 = alloca %"struct.std::pair", align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca %"class.std::vector.3", align 8
  %30 = alloca %"class.std::vector.3", align 8
  %31 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef @.str.13, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %32 unwind label %50

32:                                               ; preds = %0
  invoke void @_ZN2io5setIOENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %2)
          to label %33 unwind label %54

33:                                               ; preds = %32
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #7
  call void @_ZN2io2reIiEEvRT_(ptr noundef nonnull align 4 dereferenceable(4) @N)
  %34 = load i32, ptr @N, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %35)
  call void @_ZN2io2reISt4pairIiiEEEvRSt6vectorIT_SaIS4_EE(ptr noundef nonnull align 8 dereferenceable(24) @v)
  %36 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #7
  %37 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %6, i32 0, i32 0
  store ptr %36, ptr %37, align 8
  %38 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #7
  %39 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %38, ptr %39, align 8
  %40 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %6, i32 0, i32 0
  %41 = load ptr, ptr %40, align 8
  %42 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  %43 = load ptr, ptr %42, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %41, ptr %43)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %79, %33
  %45 = load i32, ptr %8, align 4, !tbaa !5
  %46 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #7
  %47 = trunc i64 %46 to i32
  %48 = icmp slt i32 %45, %47
  br i1 %48, label %59, label %49

49:                                               ; preds = %44
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %82

50:                                               ; preds = %0
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %4, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %5, align 4
  br label %58

54:                                               ; preds = %32
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %4, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %5, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  br label %58

58:                                               ; preds = %54, %50
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #7
  br label %318

59:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %60 = load i32, ptr %8, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %10, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %75, %59
  %63 = load i32, ptr %10, align 4, !tbaa !5
  %64 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #7
  %65 = trunc i64 %64 to i32
  %66 = icmp slt i32 %63, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %62
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %78

68:                                               ; preds = %62
  %69 = load i32, ptr %8, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [250 x %"class.std::vector.3"], ptr @nex, i64 0, i64 %70
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %71, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %72 = load i32, ptr %10, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [250 x %"class.std::vector.3"], ptr @pre, i64 0, i64 %73
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %74, ptr noundef nonnull align 4 dereferenceable(4) %8)
  br label %75

75:                                               ; preds = %68
  %76 = load i32, ptr %10, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %10, align 4, !tbaa !5
  br label %62, !llvm.loop !9

78:                                               ; preds = %67
  br label %79

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

82:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %271, %82
  %84 = load i32, ptr %11, align 4, !tbaa !5
  %85 = load i32, ptr @N, align 4, !tbaa !5
  %86 = icmp slt i32 %84, %85
  br i1 %86, label %88, label %87

87:                                               ; preds = %83
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %274

88:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !5
  %89 = load i32, ptr %11, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [250 x %"class.std::vector.3"], ptr @nex, i64 0, i64 %90
  %92 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %91) #7
  %93 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.11", ptr %13, i32 0, i32 0
  store ptr %92, ptr %93, align 8
  %94 = load i32, ptr %11, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [250 x %"class.std::vector.3"], ptr @nex, i64 0, i64 %95
  %97 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %96) #7
  %98 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.11", ptr %14, i32 0, i32 0
  store ptr %97, ptr %98, align 8
  %99 = getelementptr inbounds %class.anon, ptr %15, i32 0, i32 0
  %100 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %100, ptr %99, align 4, !tbaa !12
  %101 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.11", ptr %13, i32 0, i32 0
  %102 = load ptr, ptr %101, align 8
  %103 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.11", ptr %14, i32 0, i32 0
  %104 = load ptr, ptr %103, align 8
  %105 = getelementptr inbounds %class.anon, ptr %15, i32 0, i32 0
  %106 = load i32, ptr %105, align 4
  call void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEZ4mainE3$_0EvT_S8_T0_"(ptr %102, ptr %104, i32 %106)
  %107 = load i32, ptr %11, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [250 x %"class.std::vector.3"], ptr @pre, i64 0, i64 %108
  %110 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %109) #7
  %111 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.11", ptr %16, i32 0, i32 0
  store ptr %110, ptr %111, align 8
  %112 = load i32, ptr %11, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [250 x %"class.std::vector.3"], ptr @pre, i64 0, i64 %113
  %115 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %114) #7
  %116 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.11", ptr %17, i32 0, i32 0
  store ptr %115, ptr %116, align 8
  %117 = getelementptr inbounds %class.anon.12, ptr %18, i32 0, i32 0
  %118 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %118, ptr %117, align 4, !tbaa !14
  %119 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.11", ptr %16, i32 0, i32 0
  %120 = load ptr, ptr %119, align 8
  %121 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.11", ptr %17, i32 0, i32 0
  %122 = load ptr, ptr %121, align 8
  %123 = getelementptr inbounds %class.anon.12, ptr %18, i32 0, i32 0
  %124 = load i32, ptr %123, align 4
  call void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEZ4mainE3$_1EvT_S8_T0_"(ptr %120, ptr %122, i32 %124)
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %125

125:                                              ; preds = %174, %88
  %126 = load i32, ptr %19, align 4, !tbaa !5
  %127 = load i32, ptr %11, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [250 x %"class.std::vector.3"], ptr @nex, i64 0, i64 %128
  %130 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %129) #7
  %131 = trunc i64 %130 to i32
  %132 = sub nsw i32 %131, 1
  %133 = icmp slt i32 %126, %132
  br i1 %133, label %135, label %134

134:                                              ; preds = %125
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %177

135:                                              ; preds = %125
  %136 = load i32, ptr %11, align 4, !tbaa !5
  %137 = load i32, ptr %11, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [250 x %"class.std::vector.3"], ptr @nex, i64 0, i64 %138
  %140 = load i32, ptr %19, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %139, i64 noundef %141) #7
  %143 = load i32, ptr %142, align 4, !tbaa !5
  %144 = call noundef i32 @_Z3getii(i32 noundef %136, i32 noundef %143)
  %145 = load i32, ptr %11, align 4, !tbaa !5
  %146 = load i32, ptr %11, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [250 x %"class.std::vector.3"], ptr @nex, i64 0, i64 %147
  %149 = load i32, ptr %19, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  %151 = sext i32 %150 to i64
  %152 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %148, i64 noundef %151) #7
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = call noundef i32 @_Z3getii(i32 noundef %145, i32 noundef %153)
  call void @_ZN5graph7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(3500032) @G, i32 noundef %144, i32 noundef %154, i32 noundef 0)
  %155 = load i32, ptr %11, align 4, !tbaa !5
  %156 = load i32, ptr %11, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [250 x %"class.std::vector.3"], ptr @nex, i64 0, i64 %157
  %159 = load i32, ptr %19, align 4, !tbaa !5
  %160 = add nsw i32 %159, 1
  %161 = sext i32 %160 to i64
  %162 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %158, i64 noundef %161) #7
  %163 = load i32, ptr %162, align 4, !tbaa !5
  %164 = call noundef i32 @_Z3getii(i32 noundef %155, i32 noundef %163)
  %165 = load i32, ptr %11, align 4, !tbaa !5
  %166 = load i32, ptr %11, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [250 x %"class.std::vector.3"], ptr @nex, i64 0, i64 %167
  %169 = load i32, ptr %19, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %168, i64 noundef %170) #7
  %172 = load i32, ptr %171, align 4, !tbaa !5
  %173 = call noundef i32 @_Z3getii(i32 noundef %165, i32 noundef %172)
  call void @_ZN5graph7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(3500032) getelementptr inbounds ([2 x %struct.graph], ptr @G, i64 0, i64 1), i32 noundef %164, i32 noundef %173, i32 noundef 0)
  br label %174

174:                                              ; preds = %135
  %175 = load i32, ptr %19, align 4, !tbaa !5
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %19, align 4, !tbaa !5
  br label %125, !llvm.loop !16

177:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %178 = load i32, ptr %11, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [250 x %"class.std::vector.3"], ptr @pre, i64 0, i64 %179
  store ptr %180, ptr %20, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %181 = load ptr, ptr %20, align 8, !tbaa !17
  %182 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %181) #7
  %183 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.11", ptr %21, i32 0, i32 0
  store ptr %182, ptr %183, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %184 = load ptr, ptr %20, align 8, !tbaa !17
  %185 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %184) #7
  %186 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.11", ptr %22, i32 0, i32 0
  store ptr %185, ptr %186, align 8
  br label %187

187:                                              ; preds = %268, %177
  %188 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %22) #7
  br i1 %188, label %190, label %189

189:                                              ; preds = %187
  store i32 14, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %270

190:                                              ; preds = %187
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %191 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #7
  store ptr %191, ptr %23, align 8, !tbaa !17
  br label %192

192:                                              ; preds = %224, %190
  %193 = load i32, ptr %12, align 4, !tbaa !5
  %194 = load i32, ptr %11, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [250 x %"class.std::vector.3"], ptr @nex, i64 0, i64 %195
  %197 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %196) #7
  %198 = trunc i64 %197 to i32
  %199 = icmp slt i32 %193, %198
  br i1 %199, label %200, label %222

200:                                              ; preds = %192
  %201 = load ptr, ptr %23, align 8, !tbaa !17
  %202 = load i32, ptr %201, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %203) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 4 %204, i64 8, i1 false)
  %205 = load i32, ptr %11, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %206) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 4 %207, i64 8, i1 false)
  %208 = load i32, ptr %11, align 4, !tbaa !5
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [250 x %"class.std::vector.3"], ptr @nex, i64 0, i64 %209
  %211 = load i32, ptr %12, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  %213 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %210, i64 noundef %212) #7
  %214 = load i32, ptr %213, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %215) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 4 %216, i64 8, i1 false)
  %217 = load i64, ptr %24, align 4
  %218 = load i64, ptr %25, align 4
  %219 = load i64, ptr %26, align 4
  %220 = call noundef zeroext i1 @_Z2cwSt4pairIiiES0_S0_(i64 %217, i64 %218, i64 %219)
  %221 = xor i1 %220, true
  br label %222

222:                                              ; preds = %200, %192
  %223 = phi i1 [ false, %192 ], [ %221, %200 ]
  br i1 %223, label %224, label %227

224:                                              ; preds = %222
  %225 = load i32, ptr %12, align 4, !tbaa !5
  %226 = add nsw i32 %225, 1
  store i32 %226, ptr %12, align 4, !tbaa !5
  br label %192, !llvm.loop !19

227:                                              ; preds = %222
  %228 = load i32, ptr %12, align 4, !tbaa !5
  %229 = load i32, ptr %11, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [250 x %"class.std::vector.3"], ptr @nex, i64 0, i64 %230
  %232 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %231) #7
  %233 = trunc i64 %232 to i32
  %234 = icmp slt i32 %228, %233
  br i1 %234, label %235, label %249

235:                                              ; preds = %227
  %236 = load ptr, ptr %23, align 8, !tbaa !17
  %237 = load i32, ptr %236, align 4, !tbaa !5
  %238 = load i32, ptr %11, align 4, !tbaa !5
  %239 = call noundef i32 @_Z3getii(i32 noundef %237, i32 noundef %238)
  %240 = load i32, ptr %11, align 4, !tbaa !5
  %241 = load i32, ptr %11, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [250 x %"class.std::vector.3"], ptr @nex, i64 0, i64 %242
  %244 = load i32, ptr %12, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %243, i64 noundef %245) #7
  %247 = load i32, ptr %246, align 4, !tbaa !5
  %248 = call noundef i32 @_Z3getii(i32 noundef %240, i32 noundef %247)
  call void @_ZN5graph7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(3500032) @G, i32 noundef %239, i32 noundef %248, i32 noundef 1)
  br label %249

249:                                              ; preds = %235, %227
  %250 = load i32, ptr %12, align 4, !tbaa !5
  %251 = icmp sgt i32 %250, 0
  br i1 %251, label %252, label %267

252:                                              ; preds = %249
  %253 = load ptr, ptr %23, align 8, !tbaa !17
  %254 = load i32, ptr %253, align 4, !tbaa !5
  %255 = load i32, ptr %11, align 4, !tbaa !5
  %256 = call noundef i32 @_Z3getii(i32 noundef %254, i32 noundef %255)
  %257 = load i32, ptr %11, align 4, !tbaa !5
  %258 = load i32, ptr %11, align 4, !tbaa !5
  %259 = sext i32 %258 to i64
  %260 = getelementptr inbounds [250 x %"class.std::vector.3"], ptr @nex, i64 0, i64 %259
  %261 = load i32, ptr %12, align 4, !tbaa !5
  %262 = sub nsw i32 %261, 1
  %263 = sext i32 %262 to i64
  %264 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %260, i64 noundef %263) #7
  %265 = load i32, ptr %264, align 4, !tbaa !5
  %266 = call noundef i32 @_Z3getii(i32 noundef %257, i32 noundef %265)
  call void @_ZN5graph7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(3500032) getelementptr inbounds ([2 x %struct.graph], ptr @G, i64 0, i64 1), i32 noundef %256, i32 noundef %266, i32 noundef 1)
  br label %267

267:                                              ; preds = %252, %249
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %268

268:                                              ; preds = %267
  %269 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #7
  br label %187

270:                                              ; preds = %189
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %271

271:                                              ; preds = %270
  %272 = load i32, ptr %11, align 4, !tbaa !5
  %273 = add nsw i32 %272, 1
  store i32 %273, ptr %11, align 4, !tbaa !5
  br label %83, !llvm.loop !20

274:                                              ; preds = %87
  call void @_ZN5graph3genEv(ptr noundef nonnull align 8 dereferenceable(3500032) @G)
  call void @_ZN5graph3genEv(ptr noundef nonnull align 8 dereferenceable(3500032) getelementptr inbounds ([2 x %struct.graph], ptr @G, i64 0, i64 1))
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  store i32 0, ptr %27, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  store i32 0, ptr %28, align 4, !tbaa !5
  br label %275

275:                                              ; preds = %312, %274
  %276 = load i32, ptr %28, align 4, !tbaa !5
  %277 = load i32, ptr @N, align 4, !tbaa !5
  %278 = icmp slt i32 %276, %277
  br i1 %278, label %280, label %279

279:                                              ; preds = %275
  store i32 18, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  br label %316

280:                                              ; preds = %275
  call void @llvm.lifetime.start.p0(i64 24, ptr %29) #7
  %281 = load i32, ptr %28, align 4, !tbaa !5
  call void @_ZN5graph7genDistEi(ptr dead_on_unwind writable sret(%"class.std::vector.3") align 8 %29, ptr noundef nonnull align 8 dereferenceable(3500032) @G, i32 noundef %281)
  call void @llvm.lifetime.start.p0(i64 24, ptr %30) #7
  %282 = load i32, ptr %28, align 4, !tbaa !5
  invoke void @_ZN5graph7genDistEi(ptr dead_on_unwind writable sret(%"class.std::vector.3") align 8 %30, ptr noundef nonnull align 8 dereferenceable(3500032) getelementptr inbounds ([2 x %struct.graph], ptr @G, i64 0, i64 1), i32 noundef %282)
          to label %283 unwind label %289

283:                                              ; preds = %280
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  store i32 0, ptr %31, align 4, !tbaa !5
  br label %284

284:                                              ; preds = %304, %283
  %285 = load i32, ptr %31, align 4, !tbaa !5
  %286 = load i32, ptr @N, align 4, !tbaa !5
  %287 = icmp slt i32 %285, %286
  br i1 %287, label %293, label %288

288:                                              ; preds = %284
  store i32 21, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  br label %311

289:                                              ; preds = %280
  %290 = landingpad { ptr, i32 }
          cleanup
  %291 = extractvalue { ptr, i32 } %290, 0
  store ptr %291, ptr %4, align 8
  %292 = extractvalue { ptr, i32 } %290, 1
  store i32 %292, ptr %5, align 4
  br label %315

293:                                              ; preds = %284
  %294 = load i32, ptr %31, align 4, !tbaa !5
  %295 = sext i32 %294 to i64
  %296 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %29, i64 noundef %295) #7
  %297 = load i32, ptr %296, align 4, !tbaa !5
  %298 = load i32, ptr %31, align 4, !tbaa !5
  %299 = sext i32 %298 to i64
  %300 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef %299) #7
  %301 = load i32, ptr %300, align 4, !tbaa !5
  %302 = add nsw i32 %297, %301
  invoke void @_Z5ckmaxIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4) %27, i32 noundef %302)
          to label %303 unwind label %307

303:                                              ; preds = %293
  br label %304

304:                                              ; preds = %303
  %305 = load i32, ptr %31, align 4, !tbaa !5
  %306 = add nsw i32 %305, 1
  store i32 %306, ptr %31, align 4, !tbaa !5
  br label %284, !llvm.loop !21

307:                                              ; preds = %293
  %308 = landingpad { ptr, i32 }
          cleanup
  %309 = extractvalue { ptr, i32 } %308, 0
  store ptr %309, ptr %4, align 8
  %310 = extractvalue { ptr, i32 } %308, 1
  store i32 %310, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %30) #7
  br label %315

311:                                              ; preds = %288
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %30) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %30) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %29) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %29) #7
  br label %312

312:                                              ; preds = %311
  %313 = load i32, ptr %28, align 4, !tbaa !5
  %314 = add nsw i32 %313, 1
  store i32 %314, ptr %28, align 4, !tbaa !5
  br label %275, !llvm.loop !22

315:                                              ; preds = %307, %289
  call void @llvm.lifetime.end.p0(i64 24, ptr %30) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %29) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  br label %318

316:                                              ; preds = %279
  call void @_ZN2io2prIiEEvRKT_(ptr noundef nonnull align 4 dereferenceable(4) %27)
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  %317 = load i32, ptr %1, align 4
  ret i32 %317

318:                                              ; preds = %315, %58
  %319 = load ptr, ptr %4, align 8
  %320 = load i32, ptr %5, align 4
  %321 = insertvalue { ptr, i32 } poison, ptr %319, 0
  %322 = insertvalue { ptr, i32 } %321, i32 %320, 1
  resume { ptr, i32 } %322
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2io2reIiEEvRT_(ptr noundef nonnull align 4 dereferenceable(4)) #0

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2io2reISt4pairIiiEEEvRSt6vectorIT_SaIS4_EE(ptr noundef nonnull align 8 dereferenceable(24)) #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr, ptr) #5

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEZ4mainE3$_0EvT_S8_T0_"(ptr, ptr, i32) #5

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEZ4mainE3$_1EvT_S8_T0_"(ptr, ptr, i32) #5

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5graph3genEv(ptr noundef nonnull align 8 dereferenceable(3500032)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5graph7genDistEi(ptr dead_on_unwind noalias writable sret(%"class.std::vector.3") align 8, ptr noundef nonnull align 8 dereferenceable(3500032), i32 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5ckmaxIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2io2prIiEEvRKT_(ptr noundef nonnull align 4 dereferenceable(4)) #0

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

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.graph = type { [62500 x %"class.std::vector"], %struct.Topo, [62500 x i32] }
%struct.Topo = type { i32, [62500 x i32], %"class.std::vector.3", [62500 x %"class.std::vector.3"] }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }
%"class.__gnu_cxx::__normal_iterator.11" = type { ptr }

@N = external dso_local global i32, align 4
@v = external dso_local global %"class.std::vector", align 8
@nex = external dso_local global [250 x %"class.std::vector.3"], align 16
@pre = external dso_local global [250 x %"class.std::vector.3"], align 16
@G = external dso_local global [2 x %struct.graph], align 16
@.str.13 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2io5setIOENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef) local_unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z2cwSt4pairIiiES0_S0_(i64, i64, i64) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3getii(i32 noundef, i32 noundef) 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 %"class.std::__cxx11::basic_string", align 8
  %2 = alloca %"class.std::allocator", align 1
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.__gnu_cxx::__normal_iterator.11", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator.11", align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::vector.3", align 8
  %9 = alloca %"class.std::vector.3", align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull @.str.13, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %10 unwind label %21

10:                                               ; preds = %0
  invoke void @_ZN2io5setIOENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull %1)
          to label %11 unwind label %23

11:                                               ; preds = %10
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #6
  call void @_ZN2io2reIiEEvRT_(ptr noundef nonnull align 4 dereferenceable(4) @N)
  %12 = load i32, ptr @N, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %13)
  call void @_ZN2io2reISt4pairIiiEEEvRSt6vectorIT_SaIS4_EE(ptr noundef nonnull align 8 dereferenceable(24) @v)
  %14 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #6
  %15 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #6
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %14, ptr %15)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  %16 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #6
  %17 = trunc i64 %16 to i32
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph83, label %._crit_edge84

._crit_edge84:                                    ; preds = %._crit_edge, %11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %19 = load i32, ptr @N, align 4, !tbaa !5
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.lr.ph100, label %._crit_edge101

21:                                               ; preds = %0
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %25

23:                                               ; preds = %10
  %24 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  br label %25

25:                                               ; preds = %23, %21
  %.pn = phi { ptr, i32 } [ %24, %23 ], [ %22, %21 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #6
  br label %137

.lr.ph83:                                         ; preds = %11, %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %storemerge79.in80 = load i32, ptr %3, align 4, !tbaa !5
  %storemerge7981 = add nsw i32 %storemerge79.in80, 1
  store i32 %storemerge7981, ptr %4, align 4, !tbaa !5
  %26 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #6
  %27 = trunc i64 %26 to i32
  %28 = icmp slt i32 %storemerge7981, %27
  br i1 %28, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph83
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr %3, align 4, !tbaa !5
  %31 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #6
  %32 = trunc i64 %31 to i32
  %33 = icmp slt i32 %30, %32
  br i1 %33, label %.lr.ph83, label %._crit_edge84, !llvm.loop !9

.lr.ph:                                           ; preds = %.lr.ph83, %.lr.ph
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [250 x %"class.std::vector.3"], ptr @nex, i64 0, i64 %35
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %36, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [250 x %"class.std::vector.3"], ptr @pre, i64 0, i64 %38
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %39, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %storemerge79.in = load i32, ptr %4, align 4, !tbaa !5
  %storemerge79 = add nsw i32 %storemerge79.in, 1
  store i32 %storemerge79, ptr %4, align 4, !tbaa !5
  %40 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #6
  %41 = trunc i64 %40 to i32
  %42 = icmp slt i32 %storemerge79, %41
  br i1 %42, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge101:                                   ; preds = %._crit_edge97, %._crit_edge84
  call void @_ZN5graph3genEv(ptr noundef nonnull align 8 dereferenceable(3500032) @G)
  call void @_ZN5graph3genEv(ptr noundef nonnull align 8 dereferenceable(3500032) getelementptr inbounds (i8, ptr @G, i64 3500032))
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  %43 = load i32, ptr @N, align 4, !tbaa !5
  %44 = icmp sgt i32 %43, 0
  br i1 %44, label %.lr.ph107, label %._crit_edge108

.lr.ph100:                                        ; preds = %._crit_edge84, %._crit_edge97
  %indvars.iv113 = phi i64 [ %indvars.iv.next114, %._crit_edge97 ], [ 0, %._crit_edge84 ]
  %45 = getelementptr inbounds [250 x %"class.std::vector.3"], ptr @nex, i64 0, i64 %indvars.iv113
  %46 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %45) #6
  %47 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %45) #6
  %48 = trunc nuw nsw i64 %indvars.iv113 to i32
  call void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEZ4mainE3$_0EvT_S8_T0_"(ptr %46, ptr %47, i32 %48)
  %49 = getelementptr inbounds [250 x %"class.std::vector.3"], ptr @pre, i64 0, i64 %indvars.iv113
  %50 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %49) #6
  %51 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %49) #6
  call void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEZ4mainE3$_1EvT_S8_T0_"(ptr %50, ptr %51, i32 %48)
  %52 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %45) #6
  %53 = trunc i64 %52 to i32
  %54 = icmp sgt i32 %53, 1
  br i1 %54, label %.lr.ph87, label %._crit_edge88

._crit_edge88:                                    ; preds = %.lr.ph87, %.lr.ph100
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %55 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %49) #6
  store ptr %55, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %56 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %49) #6
  store ptr %56, ptr %6, align 8
  %57 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  br i1 %57, label %.lr.ph96, label %._crit_edge97

.lr.ph87:                                         ; preds = %.lr.ph100, %.lr.ph87
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph87 ], [ 0, %.lr.ph100 ]
  %58 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %45, i64 noundef %indvars.iv) #6
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = call noundef i32 @_Z3getii(i32 noundef %48, i32 noundef %59)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %45, i64 noundef %indvars.iv.next) #6
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = call noundef i32 @_Z3getii(i32 noundef %48, i32 noundef %62)
  call void @_ZN5graph7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(3500032) @G, i32 noundef %60, i32 noundef %63, i32 noundef 0)
  %64 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %45, i64 noundef %indvars.iv.next) #6
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = call noundef i32 @_Z3getii(i32 noundef %48, i32 noundef %65)
  %67 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %45, i64 noundef %indvars.iv) #6
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = call noundef i32 @_Z3getii(i32 noundef %48, i32 noundef %68)
  call void @_ZN5graph7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(3500032) getelementptr inbounds (i8, ptr @G, i64 3500032), i32 noundef %66, i32 noundef %69, i32 noundef 0)
  %70 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %45) #6
  %71 = shl i64 %70, 32
  %sext = add i64 %71, -4294967296
  %72 = ashr exact i64 %sext, 32
  %73 = icmp slt i64 %indvars.iv.next, %72
  br i1 %73, label %.lr.ph87, label %._crit_edge88, !llvm.loop !12

._crit_edge97:                                    ; preds = %115, %._crit_edge88
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1
  %74 = load i32, ptr @N, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = icmp slt i64 %indvars.iv.next114, %75
  br i1 %76, label %.lr.ph100, label %._crit_edge101, !llvm.loop !13

.lr.ph96:                                         ; preds = %._crit_edge88, %115
  %.07294 = phi i32 [ %.173.lcssa, %115 ], [ 0, %._crit_edge88 ]
  %77 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  %78 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %45) #6
  %79 = trunc i64 %78 to i32
  %80 = icmp slt i32 %.07294, %79
  br i1 %80, label %.lr.ph91.preheader, label %.critedge

.lr.ph91.preheader:                               ; preds = %.lr.ph96
  %81 = sext i32 %.07294 to i64
  br label %.lr.ph91

.lr.ph91:                                         ; preds = %.lr.ph91.preheader, %91
  %indvars.iv110 = phi i64 [ %81, %.lr.ph91.preheader ], [ %indvars.iv.next111, %91 ]
  %82 = load i32, ptr %77, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %83) #6
  %.sroa.09.0.copyload = load i64, ptr %84, align 4
  %85 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %indvars.iv113) #6
  %.sroa.08.0.copyload = load i64, ptr %85, align 4
  %86 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %45, i64 noundef %indvars.iv110) #6
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %88) #6
  %.sroa.0.0.copyload = load i64, ptr %89, align 4
  %90 = call noundef zeroext i1 @_Z2cwSt4pairIiiES0_S0_(i64 %.sroa.09.0.copyload, i64 %.sroa.08.0.copyload, i64 %.sroa.0.0.copyload)
  br i1 %90, label %.critedge.loopexit, label %91

91:                                               ; preds = %.lr.ph91
  %indvars.iv.next111 = add nsw i64 %indvars.iv110, 1
  %92 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %45) #6
  %sext121 = shl i64 %92, 32
  %93 = ashr exact i64 %sext121, 32
  %94 = icmp slt i64 %indvars.iv.next111, %93
  br i1 %94, label %.lr.ph91, label %.critedge.loopexit, !llvm.loop !14

.critedge.loopexit:                               ; preds = %91, %.lr.ph91
  %.173.lcssa.ph.in = phi i64 [ %indvars.iv110, %.lr.ph91 ], [ %indvars.iv.next111, %91 ]
  %.173.lcssa.ph = trunc i64 %.173.lcssa.ph.in to i32
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %.lr.ph96
  %.173.lcssa = phi i32 [ %.07294, %.lr.ph96 ], [ %.173.lcssa.ph, %.critedge.loopexit ]
  %95 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %45) #6
  %96 = trunc i64 %95 to i32
  %97 = icmp slt i32 %.173.lcssa, %96
  br i1 %97, label %98, label %105

98:                                               ; preds = %.critedge
  %99 = load i32, ptr %77, align 4, !tbaa !5
  %100 = call noundef i32 @_Z3getii(i32 noundef %99, i32 noundef %48)
  %101 = sext i32 %.173.lcssa to i64
  %102 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %45, i64 noundef %101) #6
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = call noundef i32 @_Z3getii(i32 noundef %48, i32 noundef %103)
  call void @_ZN5graph7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(3500032) @G, i32 noundef %100, i32 noundef %104, i32 noundef 1)
  br label %105

105:                                              ; preds = %98, %.critedge
  %106 = icmp sgt i32 %.173.lcssa, 0
  br i1 %106, label %107, label %115

107:                                              ; preds = %105
  %108 = load i32, ptr %77, align 4, !tbaa !5
  %109 = call noundef i32 @_Z3getii(i32 noundef %108, i32 noundef %48)
  %110 = add nsw i32 %.173.lcssa, -1
  %111 = zext nneg i32 %110 to i64
  %112 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %45, i64 noundef %111) #6
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = call noundef i32 @_Z3getii(i32 noundef %48, i32 noundef %113)
  call void @_ZN5graph7addEdgeEiii(ptr noundef nonnull align 8 dereferenceable(3500032) getelementptr inbounds (i8, ptr @G, i64 3500032), i32 noundef %109, i32 noundef %114, i32 noundef 1)
  br label %115

115:                                              ; preds = %107, %105
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  %117 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  br i1 %117, label %.lr.ph96, label %._crit_edge97

._crit_edge108:                                   ; preds = %._crit_edge104, %._crit_edge101
  call void @_ZN2io2prIiEEvRKT_(ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  ret i32 0

.lr.ph107:                                        ; preds = %._crit_edge101, %._crit_edge104
  %.066105 = phi i32 [ %120, %._crit_edge104 ], [ 0, %._crit_edge101 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #6
  call void @_ZN5graph7genDistEi(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.3") align 8 %8, ptr noundef nonnull align 8 dereferenceable(3500032) @G, i32 noundef %.066105)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #6
  invoke void @_ZN5graph7genDistEi(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.3") align 8 %9, ptr noundef nonnull align 8 dereferenceable(3500032) getelementptr inbounds (i8, ptr @G, i64 3500032), i32 noundef %.066105)
          to label %.preheader unwind label %123

.preheader:                                       ; preds = %.lr.ph107
  %118 = load i32, ptr @N, align 4, !tbaa !5
  %119 = icmp sgt i32 %118, 0
  br i1 %119, label %.lr.ph103, label %._crit_edge104

._crit_edge104:                                   ; preds = %130, %.preheader
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  %120 = add nuw nsw i32 %.066105, 1
  %121 = load i32, ptr @N, align 4, !tbaa !5
  %122 = icmp slt i32 %120, %121
  br i1 %122, label %.lr.ph107, label %._crit_edge108, !llvm.loop !15

123:                                              ; preds = %.lr.ph107
  %124 = landingpad { ptr, i32 }
          cleanup
  br label %136

.lr.ph103:                                        ; preds = %.preheader, %130
  %indvars.iv117 = phi i64 [ %indvars.iv.next118, %130 ], [ 0, %.preheader ]
  %125 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %indvars.iv117) #6
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %indvars.iv117) #6
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = add nsw i32 %128, %126
  invoke void @_Z5ckmaxIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4) %7, i32 noundef %129)
          to label %130 unwind label %134

130:                                              ; preds = %.lr.ph103
  %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1
  %131 = load i32, ptr @N, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = icmp slt i64 %indvars.iv.next118, %132
  br i1 %133, label %.lr.ph103, label %._crit_edge104, !llvm.loop !16

134:                                              ; preds = %.lr.ph103
  %135 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  br label %136

136:                                              ; preds = %134, %123
  %.pn76 = phi { ptr, i32 } [ %135, %134 ], [ %124, %123 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  br label %137

137:                                              ; preds = %136, %25
  %.pn76.pn = phi { ptr, i32 } [ %.pn76, %136 ], [ %.pn, %25 ]
  resume { ptr, i32 } %.pn76.pn
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2io2reIiEEvRT_(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2io2reISt4pairIiiEEEvRSt6vectorIT_SaIS4_EE(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr, ptr) local_unnamed_addr #4

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEZ4mainE3$_0EvT_S8_T0_"(ptr, ptr, i32) local_unnamed_addr #4

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEZ4mainE3$_1EvT_S8_T0_"(ptr, ptr, i32) local_unnamed_addr #4

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5graph3genEv(ptr noundef nonnull align 8 dereferenceable(3500032)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5graph7genDistEi(ptr dead_on_unwind noalias writable sret(%"class.std::vector.3") align 8, ptr noundef nonnull align 8 dereferenceable(3500032), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5ckmaxIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2io2prIiEEvRKT_(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0

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

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

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

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


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