; LLVM IR from tangjz/acm-icpc :: codeforces/complete (757F)

; 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<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"struct.std::pair" = type <{ i64, i32, [4 x i8] }>
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@S = external dso_local global i32, align 4
@deg = external dso_local global [200001 x i32], align 16
@que = external dso_local global [200001 x i32], align 16
@L = external dso_local global i32, align 4
@R = external dso_local global i32, align 4
@dep = external dso_local global [200001 x i32], align 16
@fa = external dso_local global [19 x [200001 x i32]], align 16
@sz = external dso_local global [200001 x i32], align 16
@ctr = external dso_local global [200001 x i32], align 16
@dis = external dso_local global [200001 x i64], align 16
@e = external dso_local global [200001 x %"class.std::vector"], align 16
@Q = external dso_local global %"class.std::priority_queue", align 8
@vis = external dso_local global [200001 x i8], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3lcaii(i32 noundef, i32 noundef) #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca i64, align 8
  %7 = alloca { i64, i32 }, align 8
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca i64, align 8
  %10 = alloca { i64, i32 }, align 8
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca { i64, i32 }, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i64, align 8
  %21 = alloca %"struct.std::pair", align 8
  %22 = alloca { i64, i32 }, align 8
  %23 = alloca i32, align 4
  %24 = alloca %"class.std::vector", align 8
  %25 = alloca ptr, align 8
  %26 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %27 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca ptr, align 8
  %33 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %34 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %35 = alloca ptr, align 8
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca i32, align 4
  %40 = alloca ptr, align 8
  %41 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %42 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %43 = alloca ptr, align 8
  %44 = alloca i32, align 4
  %45 = alloca i32, align 4
  %46 = alloca i32, align 4
  %47 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %48 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m, ptr noundef @S)
  br label %49

49:                                               ; preds = %53, %0
  %50 = load i32, ptr @m, align 4, !tbaa !5
  %51 = add nsw i32 %50, -1
  store i32 %51, ptr @m, align 4, !tbaa !5
  %52 = icmp ne i32 %50, 0
  br i1 %52, label %53, label %67

53:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  %54 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3, ptr noundef %4)
  %55 = load i32, ptr %2, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @e, i64 0, i64 %56
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  store i64 %59, ptr %6, align 8, !tbaa !9
  %60 = call { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store { i64, i32 } %60, ptr %7, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %5, ptr align 8 %7, i64 12, i1 false)
  call void @_ZNSt6vectorISt4pairIxiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %57, ptr noundef nonnull align 8 dereferenceable(12) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #8
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @e, i64 0, i64 %62
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %64 = load i32, ptr %4, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  store i64 %65, ptr %9, align 8, !tbaa !9
  %66 = call { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store { i64, i32 } %66, ptr %10, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %8, ptr align 8 %10, i64 12, i1 false)
  call void @_ZNSt6vectorISt4pairIxiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %63, ptr noundef nonnull align 8 dereferenceable(12) %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %49, !llvm.loop !11

67:                                               ; preds = %49
  %68 = load i32, ptr @n, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = mul i64 %69, 8
  call void @llvm.memset.p0.i64(ptr align 8 getelementptr inbounds (i64, ptr @dis, i64 1), i8 63, i64 %70, i1 false)
  %71 = load i32, ptr @S, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [200001 x i64], ptr @dis, i64 0, i64 %72
  store i64 0, ptr %73, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #8
  %74 = load i32, ptr @S, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [200001 x i64], ptr @dis, i64 0, i64 %75
  %77 = call { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %76, ptr noundef nonnull align 4 dereferenceable(4) @S)
  store { i64, i32 } %77, ptr %12, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %12, i64 12, i1 false)
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 8 dereferenceable(12) %11)
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #8
  br label %78

78:                                               ; preds = %141, %139, %67
  %79 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %80 = xor i1 %79, true
  br i1 %80, label %81, label %142

81:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %82 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %83 = getelementptr inbounds %"struct.std::pair", ptr %82, i32 0, i32 1
  %84 = load i32, ptr %83, align 8, !tbaa !13
  store i32 %84, ptr %13, align 4, !tbaa !5
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %85 = load i32, ptr %13, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [200001 x i8], ptr @vis, i64 0, i64 %86
  %88 = load i8, ptr %87, align 1, !tbaa !15, !range !17, !noundef !18
  %89 = trunc i8 %88 to i1
  br i1 %89, label %90, label %91

90:                                               ; preds = %81
  store i32 4, ptr %14, align 4
  br label %139, !llvm.loop !19

91:                                               ; preds = %81
  %92 = load i32, ptr %13, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [200001 x i8], ptr @vis, i64 0, i64 %93
  store i8 1, ptr %94, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %95 = load i32, ptr %13, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @e, i64 0, i64 %96
  store ptr %97, ptr %15, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %98 = load ptr, ptr %15, align 8, !tbaa !20
  %99 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %98) #8
  %100 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %99, ptr %100, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %101 = load ptr, ptr %15, align 8, !tbaa !20
  %102 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %101) #8
  %103 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %102, ptr %103, align 8
  br label %104

104:                                              ; preds = %136, %91
  %105 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #8
  br i1 %105, label %107, label %106

106:                                              ; preds = %104
  store i32 6, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  br label %138

107:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %108 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIxiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #8
  store ptr %108, ptr %18, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %109 = load ptr, ptr %18, align 8, !tbaa !20
  %110 = getelementptr inbounds %"struct.std::pair", ptr %109, i32 0, i32 1
  %111 = load i32, ptr %110, align 8, !tbaa !13
  store i32 %111, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %112 = load i32, ptr %13, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [200001 x i64], ptr @dis, i64 0, i64 %113
  %115 = load i64, ptr %114, align 8, !tbaa !9
  %116 = load ptr, ptr %18, align 8, !tbaa !20
  %117 = getelementptr inbounds %"struct.std::pair", ptr %116, i32 0, i32 0
  %118 = load i64, ptr %117, align 8, !tbaa !22
  %119 = add nsw i64 %115, %118
  store i64 %119, ptr %20, align 8, !tbaa !9
  %120 = load i32, ptr %19, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [200001 x i64], ptr @dis, i64 0, i64 %121
  %123 = load i64, ptr %122, align 8, !tbaa !9
  %124 = load i64, ptr %20, align 8, !tbaa !9
  %125 = icmp sgt i64 %123, %124
  br i1 %125, label %126, label %135

126:                                              ; preds = %107
  %127 = load i64, ptr %20, align 8, !tbaa !9
  %128 = load i32, ptr %19, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [200001 x i64], ptr @dis, i64 0, i64 %129
  store i64 %127, ptr %130, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #8
  %131 = load i32, ptr %19, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [200001 x i64], ptr @dis, i64 0, i64 %132
  %134 = call { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %133, ptr noundef nonnull align 4 dereferenceable(4) %19)
  store { i64, i32 } %134, ptr %22, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %22, i64 12, i1 false)
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 8 dereferenceable(12) %21)
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #8
  br label %135

135:                                              ; preds = %126, %107
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %136

136:                                              ; preds = %135
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIxiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #8
  br label %104

138:                                              ; preds = %106
  store i32 0, ptr %14, align 4
  br label %139

139:                                              ; preds = %138, %90
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  %140 = load i32, ptr %14, align 4
  switch i32 %140, label %410 [
    i32 0, label %141
    i32 4, label %78
  ]

141:                                              ; preds = %139
  br label %78, !llvm.loop !19

142:                                              ; preds = %78
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  store i32 1, ptr %23, align 4, !tbaa !5
  br label %143

143:                                              ; preds = %206, %142
  %144 = load i32, ptr %23, align 4, !tbaa !5
  %145 = load i32, ptr @n, align 4, !tbaa !5
  %146 = icmp sle i32 %144, %145
  br i1 %146, label %148, label %147

147:                                              ; preds = %143
  store i32 8, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %209

148:                                              ; preds = %143
  %149 = load i32, ptr %23, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [200001 x i64], ptr @dis, i64 0, i64 %150
  %152 = load i64, ptr %151, align 8, !tbaa !9
  %153 = icmp ne i64 %152, 4557430888798830399
  br i1 %153, label %154, label %205

154:                                              ; preds = %148
  call void @llvm.lifetime.start.p0(i64 24, ptr %24) #8
  call void @_ZNSt6vectorISt4pairIxiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %155 = load i32, ptr %23, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @e, i64 0, i64 %156
  store ptr %157, ptr %25, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %158 = load ptr, ptr %25, align 8, !tbaa !20
  %159 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %158) #8
  %160 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %26, i32 0, i32 0
  store ptr %159, ptr %160, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  %161 = load ptr, ptr %25, align 8, !tbaa !20
  %162 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %161) #8
  %163 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %27, i32 0, i32 0
  store ptr %162, ptr %163, align 8
  br label %164

164:                                              ; preds = %199, %154
  %165 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 8 dereferenceable(8) %27) #8
  br i1 %165, label %167, label %166

166:                                              ; preds = %164
  store i32 11, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  br label %201

167:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #8
  %168 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIxiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %26) #8
  store ptr %168, ptr %28, align 8, !tbaa !20
  %169 = load ptr, ptr %28, align 8, !tbaa !20
  %170 = getelementptr inbounds %"struct.std::pair", ptr %169, i32 0, i32 1
  %171 = load i32, ptr %170, align 8, !tbaa !13
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [200001 x i64], ptr @dis, i64 0, i64 %172
  %174 = load i64, ptr %173, align 8, !tbaa !9
  %175 = load i32, ptr %23, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [200001 x i64], ptr @dis, i64 0, i64 %176
  %178 = load i64, ptr %177, align 8, !tbaa !9
  %179 = load ptr, ptr %28, align 8, !tbaa !20
  %180 = getelementptr inbounds %"struct.std::pair", ptr %179, i32 0, i32 0
  %181 = load i64, ptr %180, align 8, !tbaa !22
  %182 = add nsw i64 %178, %181
  %183 = icmp eq i64 %174, %182
  br i1 %183, label %184, label %198

184:                                              ; preds = %167
  %185 = load ptr, ptr %28, align 8, !tbaa !20
  invoke void @_ZNSt6vectorISt4pairIxiESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef nonnull align 8 dereferenceable(12) %185)
          to label %186 unwind label %194

186:                                              ; preds = %184
  %187 = load ptr, ptr %28, align 8, !tbaa !20
  %188 = getelementptr inbounds %"struct.std::pair", ptr %187, i32 0, i32 1
  %189 = load i32, ptr %188, align 8, !tbaa !13
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [200001 x i32], ptr @deg, i64 0, i64 %190
  %192 = load i32, ptr %191, align 4, !tbaa !5
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %191, align 4, !tbaa !5
  br label %198

194:                                              ; preds = %184
  %195 = landingpad { ptr, i32 }
          cleanup
  %196 = extractvalue { ptr, i32 } %195, 0
  store ptr %196, ptr %29, align 8
  %197 = extractvalue { ptr, i32 } %195, 1
  store i32 %197, ptr %30, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  call void @_ZNSt6vectorISt4pairIxiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %405

198:                                              ; preds = %186, %167
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  br label %199

199:                                              ; preds = %198
  %200 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIxiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %26) #8
  br label %164

201:                                              ; preds = %166
  %202 = load i32, ptr %23, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @e, i64 0, i64 %203
  call void @_ZNSt6vectorISt4pairIxiESaIS1_EE4swapERS3_(ptr noundef nonnull align 8 dereferenceable(24) %204, ptr noundef nonnull align 8 dereferenceable(24) %24) #8
  call void @_ZNSt6vectorISt4pairIxiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #8
  br label %205

205:                                              ; preds = %201, %148
  br label %206

206:                                              ; preds = %205
  %207 = load i32, ptr %23, align 4, !tbaa !5
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr %23, align 4, !tbaa !5
  br label %143, !llvm.loop !23

209:                                              ; preds = %147
  %210 = load i32, ptr @n, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = mul i64 %211, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 getelementptr inbounds (i32, ptr @ctr, i64 1), ptr align 4 getelementptr inbounds (i32, ptr @deg, i64 1), i64 %212, i1 false)
  store i32 0, ptr @R, align 4, !tbaa !5
  store i32 0, ptr @L, align 4, !tbaa !5
  %213 = load i32, ptr @S, align 4, !tbaa !5
  %214 = load i32, ptr @R, align 4, !tbaa !5
  %215 = add nsw i32 %214, 1
  store i32 %215, ptr @R, align 4, !tbaa !5
  %216 = sext i32 %214 to i64
  %217 = getelementptr inbounds [200001 x i32], ptr @que, i64 0, i64 %216
  store i32 %213, ptr %217, align 4, !tbaa !5
  br label %218

218:                                              ; preds = %260, %209
  %219 = load i32, ptr @L, align 4, !tbaa !5
  %220 = load i32, ptr @R, align 4, !tbaa !5
  %221 = icmp slt i32 %219, %220
  br i1 %221, label %222, label %261

222:                                              ; preds = %218
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #8
  %223 = load i32, ptr @L, align 4, !tbaa !5
  %224 = add nsw i32 %223, 1
  store i32 %224, ptr @L, align 4, !tbaa !5
  %225 = sext i32 %223 to i64
  %226 = getelementptr inbounds [200001 x i32], ptr @que, i64 0, i64 %225
  %227 = load i32, ptr %226, align 4, !tbaa !5
  store i32 %227, ptr %31, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #8
  %228 = load i32, ptr %31, align 4, !tbaa !5
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @e, i64 0, i64 %229
  store ptr %230, ptr %32, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #8
  %231 = load ptr, ptr %32, align 8, !tbaa !20
  %232 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %231) #8
  %233 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %33, i32 0, i32 0
  store ptr %232, ptr %233, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #8
  %234 = load ptr, ptr %32, align 8, !tbaa !20
  %235 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %234) #8
  %236 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %34, i32 0, i32 0
  store ptr %235, ptr %236, align 8
  br label %237

237:                                              ; preds = %258, %222
  %238 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef nonnull align 8 dereferenceable(8) %34) #8
  br i1 %238, label %240, label %239

239:                                              ; preds = %237
  store i32 15, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  br label %260

240:                                              ; preds = %237
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #8
  %241 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIxiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %33) #8
  store ptr %241, ptr %35, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #8
  %242 = load ptr, ptr %35, align 8, !tbaa !20
  %243 = getelementptr inbounds %"struct.std::pair", ptr %242, i32 0, i32 1
  %244 = load i32, ptr %243, align 8, !tbaa !13
  store i32 %244, ptr %36, align 4, !tbaa !5
  %245 = load i32, ptr %36, align 4, !tbaa !5
  %246 = sext i32 %245 to i64
  %247 = getelementptr inbounds [200001 x i32], ptr @ctr, i64 0, i64 %246
  %248 = load i32, ptr %247, align 4, !tbaa !5
  %249 = add nsw i32 %248, -1
  store i32 %249, ptr %247, align 4, !tbaa !5
  %250 = icmp ne i32 %249, 0
  br i1 %250, label %257, label %251

251:                                              ; preds = %240
  %252 = load i32, ptr %36, align 4, !tbaa !5
  %253 = load i32, ptr @R, align 4, !tbaa !5
  %254 = add nsw i32 %253, 1
  store i32 %254, ptr @R, align 4, !tbaa !5
  %255 = sext i32 %253 to i64
  %256 = getelementptr inbounds [200001 x i32], ptr @que, i64 0, i64 %255
  store i32 %252, ptr %256, align 4, !tbaa !5
  br label %257

257:                                              ; preds = %251, %240
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #8
  br label %258

258:                                              ; preds = %257
  %259 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIxiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %33) #8
  br label %237

260:                                              ; preds = %239
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #8
  br label %218, !llvm.loop !24

261:                                              ; preds = %218
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #8
  store i32 0, ptr %37, align 4, !tbaa !5
  br label %262

262:                                              ; preds = %354, %261
  %263 = load i32, ptr %37, align 4, !tbaa !5
  %264 = load i32, ptr @R, align 4, !tbaa !5
  %265 = icmp slt i32 %263, %264
  br i1 %265, label %267, label %266

266:                                              ; preds = %262
  store i32 17, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #8
  br label %357

267:                                              ; preds = %262
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #8
  %268 = load i32, ptr %37, align 4, !tbaa !5
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [200001 x i32], ptr @que, i64 0, i64 %269
  %271 = load i32, ptr %270, align 4, !tbaa !5
  store i32 %271, ptr %38, align 4, !tbaa !5
  %272 = load i32, ptr %38, align 4, !tbaa !5
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds [200001 x i32], ptr @fa, i64 0, i64 %273
  %275 = load i32, ptr %274, align 4, !tbaa !5
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds [200001 x i32], ptr @dep, i64 0, i64 %276
  %278 = load i32, ptr %277, align 4, !tbaa !5
  %279 = add nsw i32 %278, 1
  %280 = load i32, ptr %38, align 4, !tbaa !5
  %281 = sext i32 %280 to i64
  %282 = getelementptr inbounds [200001 x i32], ptr @dep, i64 0, i64 %281
  store i32 %279, ptr %282, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #8
  store i32 1, ptr %39, align 4, !tbaa !5
  br label %283

283:                                              ; preds = %309, %267
  %284 = load i32, ptr %39, align 4, !tbaa !5
  %285 = icmp slt i32 %284, 19
  br i1 %285, label %287, label %286

286:                                              ; preds = %283
  store i32 20, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #8
  br label %312

287:                                              ; preds = %283
  %288 = load i32, ptr %39, align 4, !tbaa !5
  %289 = sub nsw i32 %288, 1
  %290 = sext i32 %289 to i64
  %291 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 %290
  %292 = load i32, ptr %39, align 4, !tbaa !5
  %293 = sub nsw i32 %292, 1
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 %294
  %296 = load i32, ptr %38, align 4, !tbaa !5
  %297 = sext i32 %296 to i64
  %298 = getelementptr inbounds [200001 x i32], ptr %295, i64 0, i64 %297
  %299 = load i32, ptr %298, align 4, !tbaa !5
  %300 = sext i32 %299 to i64
  %301 = getelementptr inbounds [200001 x i32], ptr %291, i64 0, i64 %300
  %302 = load i32, ptr %301, align 4, !tbaa !5
  %303 = load i32, ptr %39, align 4, !tbaa !5
  %304 = sext i32 %303 to i64
  %305 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 %304
  %306 = load i32, ptr %38, align 4, !tbaa !5
  %307 = sext i32 %306 to i64
  %308 = getelementptr inbounds [200001 x i32], ptr %305, i64 0, i64 %307
  store i32 %302, ptr %308, align 4, !tbaa !5
  br label %309

309:                                              ; preds = %287
  %310 = load i32, ptr %39, align 4, !tbaa !5
  %311 = add nsw i32 %310, 1
  store i32 %311, ptr %39, align 4, !tbaa !5
  br label %283, !llvm.loop !25

312:                                              ; preds = %286
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #8
  %313 = load i32, ptr %38, align 4, !tbaa !5
  %314 = sext i32 %313 to i64
  %315 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @e, i64 0, i64 %314
  store ptr %315, ptr %40, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #8
  %316 = load ptr, ptr %40, align 8, !tbaa !20
  %317 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %316) #8
  %318 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %41, i32 0, i32 0
  store ptr %317, ptr %318, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #8
  %319 = load ptr, ptr %40, align 8, !tbaa !20
  %320 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %319) #8
  %321 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %42, i32 0, i32 0
  store ptr %320, ptr %321, align 8
  br label %322

322:                                              ; preds = %351, %312
  %323 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %41, ptr noundef nonnull align 8 dereferenceable(8) %42) #8
  br i1 %323, label %325, label %324

324:                                              ; preds = %322
  store i32 23, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #8
  br label %353

325:                                              ; preds = %322
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #8
  %326 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIxiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %41) #8
  store ptr %326, ptr %43, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #8
  %327 = load ptr, ptr %43, align 8, !tbaa !20
  %328 = getelementptr inbounds %"struct.std::pair", ptr %327, i32 0, i32 1
  %329 = load i32, ptr %328, align 8, !tbaa !13
  store i32 %329, ptr %44, align 4, !tbaa !5
  %330 = load i32, ptr %44, align 4, !tbaa !5
  %331 = sext i32 %330 to i64
  %332 = getelementptr inbounds [200001 x i32], ptr @fa, i64 0, i64 %331
  %333 = load i32, ptr %332, align 4, !tbaa !5
  %334 = icmp ne i32 %333, 0
  br i1 %334, label %340, label %335

335:                                              ; preds = %325
  %336 = load i32, ptr %38, align 4, !tbaa !5
  %337 = load i32, ptr %44, align 4, !tbaa !5
  %338 = sext i32 %337 to i64
  %339 = getelementptr inbounds [200001 x i32], ptr @fa, i64 0, i64 %338
  store i32 %336, ptr %339, align 4, !tbaa !5
  br label %350

340:                                              ; preds = %325
  %341 = load i32, ptr %38, align 4, !tbaa !5
  %342 = load i32, ptr %44, align 4, !tbaa !5
  %343 = sext i32 %342 to i64
  %344 = getelementptr inbounds [200001 x i32], ptr @fa, i64 0, i64 %343
  %345 = load i32, ptr %344, align 4, !tbaa !5
  %346 = call noundef i32 @_Z3lcaii(i32 noundef %341, i32 noundef %345)
  %347 = load i32, ptr %44, align 4, !tbaa !5
  %348 = sext i32 %347 to i64
  %349 = getelementptr inbounds [200001 x i32], ptr @fa, i64 0, i64 %348
  store i32 %346, ptr %349, align 4, !tbaa !5
  br label %350

350:                                              ; preds = %340, %335
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #8
  br label %351

351:                                              ; preds = %350
  %352 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIxiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %41) #8
  br label %322

353:                                              ; preds = %324
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #8
  br label %354

354:                                              ; preds = %353
  %355 = load i32, ptr %37, align 4, !tbaa !5
  %356 = add nsw i32 %355, 1
  store i32 %356, ptr %37, align 4, !tbaa !5
  br label %262, !llvm.loop !26

357:                                              ; preds = %266
  call void @llvm.lifetime.start.p0(i64 4, ptr %45) #8
  store i32 0, ptr %45, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %46) #8
  %358 = load i32, ptr @R, align 4, !tbaa !5
  %359 = sub nsw i32 %358, 1
  store i32 %359, ptr %46, align 4, !tbaa !5
  br label %360

360:                                              ; preds = %398, %357
  %361 = load i32, ptr %46, align 4, !tbaa !5
  %362 = icmp sgt i32 %361, 0
  br i1 %362, label %364, label %363

363:                                              ; preds = %360
  store i32 25, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #8
  br label %401

364:                                              ; preds = %360
  call void @llvm.lifetime.start.p0(i64 4, ptr %47) #8
  %365 = load i32, ptr %46, align 4, !tbaa !5
  %366 = sext i32 %365 to i64
  %367 = getelementptr inbounds [200001 x i32], ptr @que, i64 0, i64 %366
  %368 = load i32, ptr %367, align 4, !tbaa !5
  store i32 %368, ptr %47, align 4, !tbaa !5
  %369 = load i32, ptr %47, align 4, !tbaa !5
  %370 = sext i32 %369 to i64
  %371 = getelementptr inbounds [200001 x i32], ptr @sz, i64 0, i64 %370
  %372 = load i32, ptr %371, align 4, !tbaa !5
  %373 = add nsw i32 %372, 1
  store i32 %373, ptr %371, align 4, !tbaa !5
  %374 = load i32, ptr %47, align 4, !tbaa !5
  %375 = sext i32 %374 to i64
  %376 = getelementptr inbounds [200001 x i32], ptr @sz, i64 0, i64 %375
  %377 = load i32, ptr %376, align 4, !tbaa !5
  %378 = load i32, ptr %47, align 4, !tbaa !5
  %379 = sext i32 %378 to i64
  %380 = getelementptr inbounds [200001 x i32], ptr @fa, i64 0, i64 %379
  %381 = load i32, ptr %380, align 4, !tbaa !5
  %382 = sext i32 %381 to i64
  %383 = getelementptr inbounds [200001 x i32], ptr @sz, i64 0, i64 %382
  %384 = load i32, ptr %383, align 4, !tbaa !5
  %385 = add nsw i32 %384, %377
  store i32 %385, ptr %383, align 4, !tbaa !5
  %386 = load i32, ptr %45, align 4, !tbaa !5
  %387 = load i32, ptr %47, align 4, !tbaa !5
  %388 = sext i32 %387 to i64
  %389 = getelementptr inbounds [200001 x i32], ptr @sz, i64 0, i64 %388
  %390 = load i32, ptr %389, align 4, !tbaa !5
  %391 = icmp slt i32 %386, %390
  br i1 %391, label %392, label %397

392:                                              ; preds = %364
  %393 = load i32, ptr %47, align 4, !tbaa !5
  %394 = sext i32 %393 to i64
  %395 = getelementptr inbounds [200001 x i32], ptr @sz, i64 0, i64 %394
  %396 = load i32, ptr %395, align 4, !tbaa !5
  store i32 %396, ptr %45, align 4, !tbaa !5
  br label %397

397:                                              ; preds = %392, %364
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #8
  br label %398

398:                                              ; preds = %397
  %399 = load i32, ptr %46, align 4, !tbaa !5
  %400 = add nsw i32 %399, -1
  store i32 %400, ptr %46, align 4, !tbaa !5
  br label %360, !llvm.loop !27

401:                                              ; preds = %363
  %402 = load i32, ptr %45, align 4, !tbaa !5
  %403 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %402)
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #8
  %404 = load i32, ptr %1, align 4
  ret i32 %404

405:                                              ; preds = %194
  %406 = load ptr, ptr %29, align 8
  %407 = load i32, ptr %30, align 4
  %408 = insertvalue { ptr, i32 } poison, ptr %406, 0
  %409 = insertvalue { ptr, i32 } %408, i32 %407, 1
  resume { ptr, i32 } %409

410:                                              ; preds = %139
  unreachable
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #4

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(12)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25)) #0 align 2

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

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

declare i32 @printf(ptr noundef, ...) #3

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

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

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"struct.std::pair" = type <{ i64, i32, [4 x i8] }>
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@S = external dso_local global i32, align 4
@deg = external dso_local local_unnamed_addr global [200001 x i32], align 16
@que = external dso_local local_unnamed_addr global [200001 x i32], align 16
@L = external dso_local local_unnamed_addr global i32, align 4
@R = external dso_local local_unnamed_addr global i32, align 4
@dep = external dso_local local_unnamed_addr global [200001 x i32], align 16
@fa = external dso_local local_unnamed_addr global [19 x [200001 x i32]], align 16
@sz = external dso_local local_unnamed_addr global [200001 x i32], align 16
@ctr = external dso_local local_unnamed_addr global [200001 x i32], align 16
@dis = external dso_local global [200001 x i64], align 16
@e = external dso_local global [200001 x %"class.std::vector"], align 16
@Q = external dso_local global %"class.std::priority_queue", align 8
@vis = external dso_local local_unnamed_addr global [200001 x i8], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3lcaii(i32 noundef, i32 noundef) 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca i64, align 8
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca i64, align 8
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::pair", align 8
  %13 = alloca %"class.std::vector", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @S)
  %21 = load i32, ptr @m, align 4, !tbaa !5
  %22 = add nsw i32 %21, -1
  store i32 %22, ptr @m, align 4, !tbaa !5
  %.not92 = icmp eq i32 %21, 0
  br i1 %.not92, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0
  %.sroa.272.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  %.sroa.268.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 8
  br label %23

23:                                               ; preds = %.lr.ph, %23
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #9
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %25 = load i32, ptr %1, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @e, i64 0, i64 %26
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #9
  %28 = load i32, ptr %3, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  store i64 %29, ptr %5, align 8, !tbaa !9
  %30 = call { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %.fca.0.extract69 = extractvalue { i64, i32 } %30, 0
  %.fca.1.extract70 = extractvalue { i64, i32 } %30, 1
  store i64 %.fca.0.extract69, ptr %4, align 8
  store i32 %.fca.1.extract70, ptr %.sroa.272.0..sroa_idx, align 8
  call void @_ZNSt6vectorISt4pairIxiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %27, ptr noundef nonnull align 8 dereferenceable(12) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #9
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @e, i64 0, i64 %32
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #9
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  store i64 %35, ptr %7, align 8, !tbaa !9
  %36 = call { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %.fca.0.extract65 = extractvalue { i64, i32 } %36, 0
  %.fca.1.extract66 = extractvalue { i64, i32 } %36, 1
  store i64 %.fca.0.extract65, ptr %6, align 8
  store i32 %.fca.1.extract66, ptr %.sroa.268.0..sroa_idx, align 8
  call void @_ZNSt6vectorISt4pairIxiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %33, ptr noundef nonnull align 8 dereferenceable(12) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  %37 = load i32, ptr @m, align 4, !tbaa !5
  %38 = add nsw i32 %37, -1
  store i32 %38, ptr @m, align 4, !tbaa !5
  %.not = icmp eq i32 %37, 0
  br i1 %.not, label %._crit_edge, label %23, !llvm.loop !11

._crit_edge:                                      ; preds = %23, %0
  %39 = load i32, ptr @n, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = shl nsw i64 %40, 3
  call void @llvm.memset.p0.i64(ptr nonnull align 8 getelementptr inbounds (i8, ptr @dis, i64 8), i8 63, i64 %41, i1 false)
  %42 = load i32, ptr @S, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [200001 x i64], ptr @dis, i64 0, i64 %43
  store i64 0, ptr %44, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #9
  %45 = call { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %44, ptr noundef nonnull align 4 dereferenceable(4) @S)
  %.fca.0.extract61 = extractvalue { i64, i32 } %45, 0
  %.fca.1.extract62 = extractvalue { i64, i32 } %45, 1
  store i64 %.fca.0.extract61, ptr %8, align 8
  %.sroa.264.0..sroa_idx = getelementptr inbounds i8, ptr %8, i64 8
  store i32 %.fca.1.extract62, ptr %.sroa.264.0..sroa_idx, align 8
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 8 dereferenceable(12) %8)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #9
  %46 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %46, label %.preheader89, label %.lr.ph97

.lr.ph97:                                         ; preds = %._crit_edge
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %12, i64 8
  br label %48

.preheader89:                                     ; preds = %78, %._crit_edge
  %47 = load i32, ptr @n, align 4, !tbaa !5
  %.not84101 = icmp slt i32 %47, 1
  br i1 %.not84101, label %.preheader89.._crit_edge104_crit_edge, label %.lr.ph103

.preheader89.._crit_edge104_crit_edge:            ; preds = %.preheader89
  %.pre134 = sext i32 %47 to i64
  br label %.lr.ph109.preheader

48:                                               ; preds = %.lr.ph97, %78
  %49 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %50 = getelementptr inbounds i8, ptr %49, i64 8
  %51 = load i32, ptr %50, align 8, !tbaa !13
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [200001 x i8], ptr @vis, i64 0, i64 %52
  %54 = load i8, ptr %53, align 1, !tbaa !15, !range !17, !noundef !18
  %55 = trunc nuw i8 %54 to i1
  br i1 %55, label %78, label %56, !llvm.loop !19

56:                                               ; preds = %48
  store i8 1, ptr %53, align 1, !tbaa !15
  %57 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @e, i64 0, i64 %52
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #9
  %58 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %57) #9
  store ptr %58, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #9
  %59 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %57) #9
  store ptr %59, ptr %10, align 8
  %60 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #9
  br i1 %60, label %.lr.ph94, label %._crit_edge95

.lr.ph94:                                         ; preds = %56
  %61 = getelementptr inbounds [200001 x i64], ptr @dis, i64 0, i64 %52
  br label %62

._crit_edge95:                                    ; preds = %75, %56
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  br label %78

62:                                               ; preds = %.lr.ph94, %75
  %63 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIxiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #9
  %64 = getelementptr inbounds i8, ptr %63, i64 8
  %65 = load i32, ptr %64, align 8, !tbaa !13
  store i32 %65, ptr %11, align 4, !tbaa !5
  %66 = load i64, ptr %61, align 8, !tbaa !9
  %67 = load i64, ptr %63, align 8, !tbaa !20
  %68 = add nsw i64 %67, %66
  %69 = sext i32 %65 to i64
  %70 = getelementptr inbounds [200001 x i64], ptr @dis, i64 0, i64 %69
  %71 = load i64, ptr %70, align 8, !tbaa !9
  %72 = icmp sgt i64 %71, %68
  br i1 %72, label %73, label %75

73:                                               ; preds = %62
  store i64 %68, ptr %70, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #9
  %74 = call { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %70, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %.fca.0.extract = extractvalue { i64, i32 } %74, 0
  %.fca.1.extract = extractvalue { i64, i32 } %74, 1
  store i64 %.fca.0.extract, ptr %12, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 8 dereferenceable(12) %12)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #9
  br label %75

75:                                               ; preds = %73, %62
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #9
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIxiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #9
  %77 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #9
  br i1 %77, label %62, label %._crit_edge95

78:                                               ; preds = %48, %._crit_edge95
  %79 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %79, label %.preheader89, label %48

.lr.ph109.preheader:                              ; preds = %112, %.preheader89.._crit_edge104_crit_edge
  %.pre-phi = phi i64 [ %.pre134, %.preheader89.._crit_edge104_crit_edge ], [ %114, %112 ]
  %80 = shl nsw i64 %.pre-phi, 2
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @ctr, i64 4), ptr nonnull align 4 getelementptr inbounds (i8, ptr @deg, i64 4), i64 %80, i1 false)
  store i32 0, ptr @L, align 4, !tbaa !5
  %81 = load i32, ptr @S, align 4, !tbaa !5
  store i32 1, ptr @R, align 4, !tbaa !5
  store i32 %81, ptr @que, align 16, !tbaa !5
  br label %.lr.ph109

.lr.ph103:                                        ; preds = %.preheader89, %112
  %82 = phi i32 [ %113, %112 ], [ %47, %.preheader89 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %112 ], [ 1, %.preheader89 ]
  %83 = getelementptr inbounds [200001 x i64], ptr @dis, i64 0, i64 %indvars.iv
  %84 = load i64, ptr %83, align 8, !tbaa !9
  %.not87 = icmp eq i64 %84, 4557430888798830399
  br i1 %.not87, label %112, label %85

85:                                               ; preds = %.lr.ph103
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #9
  call void @_ZNSt6vectorISt4pairIxiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #9
  %86 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @e, i64 0, i64 %indvars.iv
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #9
  %87 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %86) #9
  store ptr %87, ptr %14, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #9
  %88 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %86) #9
  store ptr %88, ptr %15, align 8
  %89 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #9
  br i1 %89, label %.lr.ph99, label %._crit_edge100

._crit_edge100:                                   ; preds = %109, %85
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #9
  call void @_ZNSt6vectorISt4pairIxiESaIS1_EE4swapERS3_(ptr noundef nonnull align 8 dereferenceable(24) %86, ptr noundef nonnull align 8 dereferenceable(24) %13) #9
  call void @_ZNSt6vectorISt4pairIxiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #9
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %112

.lr.ph99:                                         ; preds = %85, %109
  %90 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIxiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #9
  %91 = getelementptr inbounds i8, ptr %90, i64 8
  %92 = load i32, ptr %91, align 8, !tbaa !13
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [200001 x i64], ptr @dis, i64 0, i64 %93
  %95 = load i64, ptr %94, align 8, !tbaa !9
  %96 = load i64, ptr %83, align 8, !tbaa !9
  %97 = load i64, ptr %90, align 8, !tbaa !20
  %98 = add nsw i64 %97, %96
  %99 = icmp eq i64 %95, %98
  br i1 %99, label %100, label %109

100:                                              ; preds = %.lr.ph99
  invoke void @_ZNSt6vectorISt4pairIxiESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(12) %90)
          to label %101 unwind label %107

101:                                              ; preds = %100
  %102 = load i32, ptr %91, align 8, !tbaa !13
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [200001 x i32], ptr @deg, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %104, align 4, !tbaa !5
  br label %109

107:                                              ; preds = %100
  %108 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #9
  call void @_ZNSt6vectorISt4pairIxiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #9
  resume { ptr, i32 } %108

109:                                              ; preds = %101, %.lr.ph99
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIxiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #9
  %111 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #9
  br i1 %111, label %.lr.ph99, label %._crit_edge100

112:                                              ; preds = %.lr.ph103, %._crit_edge100
  %113 = phi i32 [ %82, %.lr.ph103 ], [ %.pre, %._crit_edge100 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %114 = sext i32 %113 to i64
  %.not84.not = icmp slt i64 %indvars.iv, %114
  br i1 %.not84.not, label %.lr.ph103, label %.lr.ph109.preheader, !llvm.loop !21

.preheader88:                                     ; preds = %._crit_edge107
  %115 = icmp sgt i32 %127, 0
  br i1 %115, label %.lr.ph115, label %._crit_edge120

.lr.ph109:                                        ; preds = %.lr.ph109.preheader, %._crit_edge107
  %116 = phi i32 [ %126, %._crit_edge107 ], [ 0, %.lr.ph109.preheader ]
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr @L, align 4, !tbaa !5
  %118 = sext i32 %116 to i64
  %119 = getelementptr inbounds [200001 x i32], ptr @que, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @e, i64 0, i64 %121
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #9
  %123 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %122) #9
  store ptr %123, ptr %16, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #9
  %124 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %122) #9
  store ptr %124, ptr %17, align 8
  %125 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #9
  br i1 %125, label %.lr.ph106, label %._crit_edge107

._crit_edge107:                                   ; preds = %141, %.lr.ph109
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #9
  %126 = load i32, ptr @L, align 4, !tbaa !5
  %127 = load i32, ptr @R, align 4, !tbaa !5
  %128 = icmp slt i32 %126, %127
  br i1 %128, label %.lr.ph109, label %.preheader88, !llvm.loop !22

.lr.ph106:                                        ; preds = %.lr.ph109, %141
  %129 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIxiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #9
  %130 = getelementptr inbounds i8, ptr %129, i64 8
  %131 = load i32, ptr %130, align 8, !tbaa !13
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [200001 x i32], ptr @ctr, i64 0, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = add nsw i32 %134, -1
  store i32 %135, ptr %133, align 4, !tbaa !5
  %.not86 = icmp eq i32 %135, 0
  br i1 %.not86, label %136, label %141

136:                                              ; preds = %.lr.ph106
  %137 = load i32, ptr @R, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr @R, align 4, !tbaa !5
  %139 = sext i32 %137 to i64
  %140 = getelementptr inbounds [200001 x i32], ptr @que, i64 0, i64 %139
  store i32 %131, ptr %140, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %136, %.lr.ph106
  %142 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIxiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #9
  %143 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #9
  br i1 %143, label %.lr.ph106, label %._crit_edge107

.preheader:                                       ; preds = %._crit_edge113
  %144 = icmp sgt i32 %231, 1
  br i1 %144, label %.lr.ph119.preheader, label %._crit_edge120

.lr.ph119.preheader:                              ; preds = %.preheader
  %145 = zext nneg i32 %231 to i64
  br label %.lr.ph119

.lr.ph115:                                        ; preds = %.preheader88, %._crit_edge113
  %indvars.iv128 = phi i64 [ %indvars.iv.next129, %._crit_edge113 ], [ 0, %.preheader88 ]
  %146 = getelementptr inbounds [200001 x i32], ptr @que, i64 0, i64 %indvars.iv128
  %147 = load i32, ptr %146, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [200001 x i32], ptr @fa, i64 0, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [200001 x i32], ptr @dep, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = add nsw i32 %153, 1
  %155 = getelementptr inbounds [200001 x i32], ptr @dep, i64 0, i64 %148
  store i32 %154, ptr %155, align 4, !tbaa !5
  %156 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 0, i64 %151
  %157 = load i32, ptr %156, align 4, !tbaa !5
  %158 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 1, i64 %148
  store i32 %157, ptr %158, align 4, !tbaa !5
  %159 = sext i32 %157 to i64
  %160 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 1, i64 %159
  %161 = load i32, ptr %160, align 4, !tbaa !5
  %162 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 2, i64 %148
  store i32 %161, ptr %162, align 4, !tbaa !5
  %163 = sext i32 %161 to i64
  %164 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 2, i64 %163
  %165 = load i32, ptr %164, align 4, !tbaa !5
  %166 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 3, i64 %148
  store i32 %165, ptr %166, align 4, !tbaa !5
  %167 = sext i32 %165 to i64
  %168 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 3, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !5
  %170 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 4, i64 %148
  store i32 %169, ptr %170, align 4, !tbaa !5
  %171 = sext i32 %169 to i64
  %172 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 4, i64 %171
  %173 = load i32, ptr %172, align 4, !tbaa !5
  %174 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 5, i64 %148
  store i32 %173, ptr %174, align 4, !tbaa !5
  %175 = sext i32 %173 to i64
  %176 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 5, i64 %175
  %177 = load i32, ptr %176, align 4, !tbaa !5
  %178 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 6, i64 %148
  store i32 %177, ptr %178, align 4, !tbaa !5
  %179 = sext i32 %177 to i64
  %180 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 6, i64 %179
  %181 = load i32, ptr %180, align 4, !tbaa !5
  %182 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 7, i64 %148
  store i32 %181, ptr %182, align 4, !tbaa !5
  %183 = sext i32 %181 to i64
  %184 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 7, i64 %183
  %185 = load i32, ptr %184, align 4, !tbaa !5
  %186 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 8, i64 %148
  store i32 %185, ptr %186, align 4, !tbaa !5
  %187 = sext i32 %185 to i64
  %188 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 8, i64 %187
  %189 = load i32, ptr %188, align 4, !tbaa !5
  %190 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 9, i64 %148
  store i32 %189, ptr %190, align 4, !tbaa !5
  %191 = sext i32 %189 to i64
  %192 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 9, i64 %191
  %193 = load i32, ptr %192, align 4, !tbaa !5
  %194 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 10, i64 %148
  store i32 %193, ptr %194, align 4, !tbaa !5
  %195 = sext i32 %193 to i64
  %196 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 10, i64 %195
  %197 = load i32, ptr %196, align 4, !tbaa !5
  %198 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 11, i64 %148
  store i32 %197, ptr %198, align 4, !tbaa !5
  %199 = sext i32 %197 to i64
  %200 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 11, i64 %199
  %201 = load i32, ptr %200, align 4, !tbaa !5
  %202 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 12, i64 %148
  store i32 %201, ptr %202, align 4, !tbaa !5
  %203 = sext i32 %201 to i64
  %204 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 12, i64 %203
  %205 = load i32, ptr %204, align 4, !tbaa !5
  %206 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 13, i64 %148
  store i32 %205, ptr %206, align 4, !tbaa !5
  %207 = sext i32 %205 to i64
  %208 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 13, i64 %207
  %209 = load i32, ptr %208, align 4, !tbaa !5
  %210 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 14, i64 %148
  store i32 %209, ptr %210, align 4, !tbaa !5
  %211 = sext i32 %209 to i64
  %212 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 14, i64 %211
  %213 = load i32, ptr %212, align 4, !tbaa !5
  %214 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 15, i64 %148
  store i32 %213, ptr %214, align 4, !tbaa !5
  %215 = sext i32 %213 to i64
  %216 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 15, i64 %215
  %217 = load i32, ptr %216, align 4, !tbaa !5
  %218 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 16, i64 %148
  store i32 %217, ptr %218, align 4, !tbaa !5
  %219 = sext i32 %217 to i64
  %220 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 16, i64 %219
  %221 = load i32, ptr %220, align 4, !tbaa !5
  %222 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 17, i64 %148
  store i32 %221, ptr %222, align 4, !tbaa !5
  %223 = sext i32 %221 to i64
  %224 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 17, i64 %223
  %225 = load i32, ptr %224, align 4, !tbaa !5
  %226 = getelementptr inbounds [19 x [200001 x i32]], ptr @fa, i64 0, i64 18, i64 %148
  store i32 %225, ptr %226, align 4, !tbaa !5
  %227 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @e, i64 0, i64 %148
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #9
  %228 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %227) #9
  store ptr %228, ptr %18, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #9
  %229 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %227) #9
  store ptr %229, ptr %19, align 8
  %230 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #9
  br i1 %230, label %.lr.ph112, label %._crit_edge113

._crit_edge113:                                   ; preds = %242, %.lr.ph115
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #9
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %231 = load i32, ptr @R, align 4, !tbaa !5
  %232 = sext i32 %231 to i64
  %233 = icmp slt i64 %indvars.iv.next129, %232
  br i1 %233, label %.lr.ph115, label %.preheader, !llvm.loop !23

.lr.ph112:                                        ; preds = %.lr.ph115, %242
  %234 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIxiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #9
  %235 = getelementptr inbounds i8, ptr %234, i64 8
  %236 = load i32, ptr %235, align 8, !tbaa !13
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [200001 x i32], ptr @fa, i64 0, i64 %237
  %239 = load i32, ptr %238, align 4, !tbaa !5
  %.not85 = icmp eq i32 %239, 0
  br i1 %.not85, label %242, label %240

240:                                              ; preds = %.lr.ph112
  %241 = call noundef i32 @_Z3lcaii(i32 noundef %147, i32 noundef %239)
  br label %242

242:                                              ; preds = %.lr.ph112, %240
  %storemerge = phi i32 [ %241, %240 ], [ %147, %.lr.ph112 ]
  store i32 %storemerge, ptr %238, align 4, !tbaa !5
  %243 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIxiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #9
  %244 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #9
  br i1 %244, label %.lr.ph112, label %._crit_edge113

._crit_edge120:                                   ; preds = %.lr.ph119, %.preheader88, %.preheader
  %.074.lcssa = phi i32 [ 0, %.preheader ], [ 0, %.preheader88 ], [ %spec.select, %.lr.ph119 ]
  %245 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.074.lcssa)
  ret i32 0

.lr.ph119:                                        ; preds = %.lr.ph119.preheader, %.lr.ph119
  %indvars.iv131 = phi i64 [ %145, %.lr.ph119.preheader ], [ %indvars.iv.next132, %.lr.ph119 ]
  %.074117 = phi i32 [ 0, %.lr.ph119.preheader ], [ %spec.select, %.lr.ph119 ]
  %indvars.iv.next132 = add nsw i64 %indvars.iv131, -1
  %246 = getelementptr inbounds [200001 x i32], ptr @que, i64 0, i64 %indvars.iv.next132
  %247 = load i32, ptr %246, align 4, !tbaa !5
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [200001 x i32], ptr @sz, i64 0, i64 %248
  %250 = load i32, ptr %249, align 4, !tbaa !5
  %251 = add nsw i32 %250, 1
  store i32 %251, ptr %249, align 4, !tbaa !5
  %252 = getelementptr inbounds [200001 x i32], ptr @fa, i64 0, i64 %248
  %253 = load i32, ptr %252, align 4, !tbaa !5
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds [200001 x i32], ptr @sz, i64 0, i64 %254
  %256 = load i32, ptr %255, align 4, !tbaa !5
  %257 = add nsw i32 %256, %251
  store i32 %257, ptr %255, align 4, !tbaa !5
  %258 = load i32, ptr %249, align 4, !tbaa !5
  %spec.select = call i32 @llvm.smax.i32(i32 %.074117, i32 %258)
  %259 = icmp ugt i64 %indvars.iv131, 2
  br i1 %259, label %.lr.ph119, label %._crit_edge120, !llvm.loop !24
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

; Function Attrs: mustprogress 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) #5

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #0 align 2

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

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

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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


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