; LLVM IR from ShahjalalShohag/code-library :: Graph Theory (Minimum Diameter Spanning Tree)

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

@d = external dso_local global [505 x [505 x i64]], align 16
@W = external dso_local global [200010 x i64], align 16
@g = external dso_local global [505 x %"class.std::vector"], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@U = external dso_local global [200010 x i32], align 16
@V = external dso_local global [200010 x i32], align 16
@id = external dso_local global [505 x i32], align 16
@par = external dso_local global [505 x i32], align 16
@ed = external dso_local global i64, align 8
@far = external dso_local global i64, align 8
@global = external dso_local global i64, align 8
@dist = external dso_local global [505 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca %class.anon, align 8
  %14 = alloca ptr, align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i64, align 8
  %20 = alloca i32, align 4
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca %"class.std::priority_queue", align 8
  %28 = alloca i32, align 4
  %29 = alloca ptr, align 8
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca ptr, align 8
  %34 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %35 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i64, align 8
  %39 = alloca i64, align 8
  %40 = alloca i32, align 4
  %41 = alloca i32, align 4
  %42 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %43 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %43, ptr noundef nonnull align 4 dereferenceable(4) @m)
  call void @llvm.memset.p0.i64(ptr align 16 @d, i8 63, i64 2040200, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %64, %0
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = load i32, ptr @n, align 4, !tbaa !5
  %48 = icmp sle i32 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %67

50:                                               ; preds = %45
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %52
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [505 x i64], ptr %53, i64 0, i64 %55
  store i64 0, ptr %56, align 8, !tbaa !9
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = load i32, ptr %2, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [505 x i32], ptr @par, i64 0, i64 %59
  store i32 %57, ptr %60, align 4, !tbaa !5
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [505 x i32], ptr @id, i64 0, i64 %62
  store i32 %57, ptr %63, align 4, !tbaa !5
  br label %64

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

67:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %154, %67
  %69 = load i32, ptr %3, align 4, !tbaa !5
  %70 = load i32, ptr @m, align 4, !tbaa !5
  %71 = icmp sle i32 %69, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  br label %157

73:                                               ; preds = %68
  %74 = load i32, ptr %3, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds i32, ptr @U, i64 %75
  %77 = load i32, ptr %3, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds i32, ptr @V, i64 %78
  %80 = load i32, ptr %3, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds i64, ptr @W, i64 %81
  %83 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %76, ptr noundef %79, ptr noundef %82)
  %84 = load i32, ptr %3, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [200010 x i32], ptr @U, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = load i32, ptr %3, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [200010 x i32], ptr @V, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = icmp sgt i32 %87, %91
  br i1 %92, label %93, label %100

93:                                               ; preds = %73
  %94 = load i32, ptr %3, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [200010 x i32], ptr @U, i64 0, i64 %95
  %97 = load i32, ptr %3, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [200010 x i32], ptr @V, i64 0, i64 %98
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %96, ptr noundef nonnull align 4 dereferenceable(4) %99) #8
  br label %100

100:                                              ; preds = %93, %73
  %101 = load i32, ptr %3, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [200010 x i64], ptr @W, i64 0, i64 %102
  %104 = load i64, ptr %103, align 8, !tbaa !9
  %105 = shl i64 %104, 1
  store i64 %105, ptr %103, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  %106 = load i32, ptr %3, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [200010 x i32], ptr @U, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !5
  store i32 %109, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  %110 = load i32, ptr %3, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [200010 x i32], ptr @V, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  store i32 %113, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %114 = load i32, ptr %3, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [200010 x i64], ptr @W, i64 0, i64 %115
  %117 = load i64, ptr %116, align 8, !tbaa !9
  store i64 %117, ptr %6, align 8, !tbaa !9
  %118 = load i32, ptr %4, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %119
  %121 = load i32, ptr %5, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [505 x i64], ptr %120, i64 0, i64 %122
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %123, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %125 = load i64, ptr %124, align 8, !tbaa !9
  %126 = load i32, ptr %4, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %127
  %129 = load i32, ptr %5, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [505 x i64], ptr %128, i64 0, i64 %130
  store i64 %125, ptr %131, align 8, !tbaa !9
  %132 = load i32, ptr %5, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %133
  %135 = load i32, ptr %4, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [505 x i64], ptr %134, i64 0, i64 %136
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %137, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %139 = load i64, ptr %138, align 8, !tbaa !9
  %140 = load i32, ptr %5, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %141
  %143 = load i32, ptr %4, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [505 x i64], ptr %142, i64 0, i64 %144
  store i64 %139, ptr %145, align 8, !tbaa !9
  %146 = load i32, ptr %4, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [505 x %"class.std::vector"], ptr @g, i64 0, i64 %147
  %149 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE12emplace_backIJRiEEES3_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %148, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %150 = load i32, ptr %5, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [505 x %"class.std::vector"], ptr @g, i64 0, i64 %151
  %153 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE12emplace_backIJRiEEES3_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %152, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  br label %154

154:                                              ; preds = %100
  %155 = load i32, ptr %3, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %3, align 4, !tbaa !5
  br label %68, !llvm.loop !13

157:                                              ; preds = %72
  %158 = load i32, ptr @n, align 4, !tbaa !5
  %159 = icmp eq i32 %158, 1
  br i1 %159, label %160, label %163

160:                                              ; preds = %157
  %161 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %162 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %161, i8 noundef signext 10)
  store i32 0, ptr %1, align 4
  br label %639

163:                                              ; preds = %157
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %164

164:                                              ; preds = %219, %163
  %165 = load i32, ptr %7, align 4, !tbaa !5
  %166 = load i32, ptr @n, align 4, !tbaa !5
  %167 = icmp sle i32 %165, %166
  br i1 %167, label %169, label %168

168:                                              ; preds = %164
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %222

169:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %170

170:                                              ; preds = %215, %169
  %171 = load i32, ptr %9, align 4, !tbaa !5
  %172 = load i32, ptr @n, align 4, !tbaa !5
  %173 = icmp sle i32 %171, %172
  br i1 %173, label %175, label %174

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

175:                                              ; preds = %170
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %176

176:                                              ; preds = %211, %175
  %177 = load i32, ptr %10, align 4, !tbaa !5
  %178 = load i32, ptr @n, align 4, !tbaa !5
  %179 = icmp sle i32 %177, %178
  br i1 %179, label %181, label %180

180:                                              ; preds = %176
  store i32 14, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %214

181:                                              ; preds = %176
  %182 = load i32, ptr %9, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %183
  %185 = load i32, ptr %10, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [505 x i64], ptr %184, i64 0, i64 %186
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %188 = load i32, ptr %9, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %189
  %191 = load i32, ptr %7, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [505 x i64], ptr %190, i64 0, i64 %192
  %194 = load i64, ptr %193, align 8, !tbaa !9
  %195 = load i32, ptr %7, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %196
  %198 = load i32, ptr %10, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [505 x i64], ptr %197, i64 0, i64 %199
  %201 = load i64, ptr %200, align 8, !tbaa !9
  %202 = add nsw i64 %194, %201
  store i64 %202, ptr %11, align 8, !tbaa !9
  %203 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %187, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %204 = load i64, ptr %203, align 8, !tbaa !9
  %205 = load i32, ptr %9, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %206
  %208 = load i32, ptr %10, align 4, !tbaa !5
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [505 x i64], ptr %207, i64 0, i64 %209
  store i64 %204, ptr %210, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %211

211:                                              ; preds = %181
  %212 = load i32, ptr %10, align 4, !tbaa !5
  %213 = add nsw i32 %212, 1
  store i32 %213, ptr %10, align 4, !tbaa !5
  br label %176, !llvm.loop !14

214:                                              ; preds = %180
  br label %215

215:                                              ; preds = %214
  %216 = load i32, ptr %9, align 4, !tbaa !5
  %217 = add nsw i32 %216, 1
  store i32 %217, ptr %9, align 4, !tbaa !5
  br label %170, !llvm.loop !15

218:                                              ; preds = %174
  br label %219

219:                                              ; preds = %218
  %220 = load i32, ptr %7, align 4, !tbaa !5
  %221 = add nsw i32 %220, 1
  store i32 %221, ptr %7, align 4, !tbaa !5
  br label %164, !llvm.loop !16

222:                                              ; preds = %168
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %223

223:                                              ; preds = %394, %222
  %224 = load i32, ptr %12, align 4, !tbaa !5
  %225 = load i32, ptr @n, align 4, !tbaa !5
  %226 = icmp sle i32 %224, %225
  br i1 %226, label %228, label %227

227:                                              ; preds = %223
  store i32 17, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %397

228:                                              ; preds = %223
  %229 = load i32, ptr @n, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds i32, ptr @id, i64 %230
  %232 = getelementptr inbounds i32, ptr %231, i64 1
  %233 = getelementptr inbounds %class.anon, ptr %13, i32 0, i32 0
  store ptr %12, ptr %233, align 8, !tbaa !17
  %234 = getelementptr inbounds %class.anon, ptr %13, i32 0, i32 0
  %235 = load ptr, ptr %234, align 8
  call void @"_ZSt4sortIPiZ4mainE3$_0EvT_S2_T0_"(ptr noundef getelementptr inbounds (i32, ptr @id, i64 1), ptr noundef %232, ptr %235)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %236 = load i32, ptr %12, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [505 x %"class.std::vector"], ptr @g, i64 0, i64 %237
  store ptr %238, ptr %14, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %239 = load ptr, ptr %14, align 8, !tbaa !17
  %240 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %239) #8
  %241 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %240, ptr %241, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %242 = load ptr, ptr %14, align 8, !tbaa !17
  %243 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %242) #8
  %244 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %243, ptr %244, align 8
  br label %245

245:                                              ; preds = %391, %228
  %246 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #8
  br i1 %246, label %248, label %247

247:                                              ; preds = %245
  store i32 20, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %393

248:                                              ; preds = %245
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %249 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #8
  %250 = load i32, ptr %249, align 4, !tbaa !5
  store i32 %250, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %251 = load i32, ptr %17, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [200010 x i32], ptr @U, i64 0, i64 %252
  %254 = load i32, ptr %253, align 4, !tbaa !5
  %255 = load i32, ptr %12, align 4, !tbaa !5
  %256 = xor i32 %254, %255
  %257 = load i32, ptr %17, align 4, !tbaa !5
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds [200010 x i32], ptr @V, i64 0, i64 %258
  %260 = load i32, ptr %259, align 4, !tbaa !5
  %261 = xor i32 %256, %260
  store i32 %261, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %262 = load i32, ptr %17, align 4, !tbaa !5
  %263 = sext i32 %262 to i64
  %264 = getelementptr inbounds [200010 x i64], ptr @W, i64 0, i64 %263
  %265 = load i64, ptr %264, align 8, !tbaa !9
  store i64 %265, ptr %19, align 8, !tbaa !9
  %266 = load i32, ptr %18, align 4, !tbaa !5
  %267 = load i32, ptr %12, align 4, !tbaa !5
  %268 = icmp slt i32 %266, %267
  br i1 %268, label %269, label %270

269:                                              ; preds = %248
  store i32 21, ptr %8, align 4
  br label %385

270:                                              ; preds = %248
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  %271 = load i32, ptr getelementptr inbounds ([505 x i32], ptr @id, i64 0, i64 1), align 4, !tbaa !5
  store i32 %271, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  store i64 0, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %272 = load i32, ptr %12, align 4, !tbaa !5
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %273
  %275 = load i32, ptr %20, align 4, !tbaa !5
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds [505 x i64], ptr %274, i64 0, i64 %276
  %278 = load i64, ptr %277, align 8, !tbaa !9
  store i64 %278, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  store i32 2, ptr %23, align 4, !tbaa !5
  br label %279

279:                                              ; preds = %353, %270
  %280 = load i32, ptr %23, align 4, !tbaa !5
  %281 = load i32, ptr @n, align 4, !tbaa !5
  %282 = icmp sle i32 %280, %281
  br i1 %282, label %284, label %283

283:                                              ; preds = %279
  store i32 22, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %356

284:                                              ; preds = %279
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  %285 = load i32, ptr %23, align 4, !tbaa !5
  %286 = sext i32 %285 to i64
  %287 = getelementptr inbounds [505 x i32], ptr @id, i64 0, i64 %286
  %288 = load i32, ptr %287, align 4, !tbaa !5
  store i32 %288, ptr %24, align 4, !tbaa !5
  %289 = load i32, ptr %18, align 4, !tbaa !5
  %290 = sext i32 %289 to i64
  %291 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %290
  %292 = load i32, ptr %24, align 4, !tbaa !5
  %293 = sext i32 %292 to i64
  %294 = getelementptr inbounds [505 x i64], ptr %291, i64 0, i64 %293
  %295 = load i64, ptr %294, align 8, !tbaa !9
  %296 = load i32, ptr %18, align 4, !tbaa !5
  %297 = sext i32 %296 to i64
  %298 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %297
  %299 = load i32, ptr %20, align 4, !tbaa !5
  %300 = sext i32 %299 to i64
  %301 = getelementptr inbounds [505 x i64], ptr %298, i64 0, i64 %300
  %302 = load i64, ptr %301, align 8, !tbaa !9
  %303 = icmp sle i64 %295, %302
  br i1 %303, label %304, label %305

304:                                              ; preds = %284
  store i32 24, ptr %8, align 4
  br label %350

305:                                              ; preds = %284
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %306 = load i64, ptr %19, align 8, !tbaa !9
  %307 = load i32, ptr %12, align 4, !tbaa !5
  %308 = sext i32 %307 to i64
  %309 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %308
  %310 = load i32, ptr %24, align 4, !tbaa !5
  %311 = sext i32 %310 to i64
  %312 = getelementptr inbounds [505 x i64], ptr %309, i64 0, i64 %311
  %313 = load i64, ptr %312, align 8, !tbaa !9
  %314 = sub nsw i64 %306, %313
  %315 = load i32, ptr %18, align 4, !tbaa !5
  %316 = sext i32 %315 to i64
  %317 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %316
  %318 = load i32, ptr %20, align 4, !tbaa !5
  %319 = sext i32 %318 to i64
  %320 = getelementptr inbounds [505 x i64], ptr %317, i64 0, i64 %319
  %321 = load i64, ptr %320, align 8, !tbaa !9
  %322 = add nsw i64 %314, %321
  %323 = sdiv i64 %322, 2
  store i64 %323, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %324 = load i64, ptr %19, align 8, !tbaa !9
  %325 = load i32, ptr %12, align 4, !tbaa !5
  %326 = sext i32 %325 to i64
  %327 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %326
  %328 = load i32, ptr %24, align 4, !tbaa !5
  %329 = sext i32 %328 to i64
  %330 = getelementptr inbounds [505 x i64], ptr %327, i64 0, i64 %329
  %331 = load i64, ptr %330, align 8, !tbaa !9
  %332 = add nsw i64 %324, %331
  %333 = load i32, ptr %18, align 4, !tbaa !5
  %334 = sext i32 %333 to i64
  %335 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %334
  %336 = load i32, ptr %20, align 4, !tbaa !5
  %337 = sext i32 %336 to i64
  %338 = getelementptr inbounds [505 x i64], ptr %335, i64 0, i64 %337
  %339 = load i64, ptr %338, align 8, !tbaa !9
  %340 = add nsw i64 %332, %339
  %341 = sdiv i64 %340, 2
  store i64 %341, ptr %26, align 8, !tbaa !9
  %342 = load i64, ptr %22, align 8, !tbaa !9
  %343 = load i64, ptr %26, align 8, !tbaa !9
  %344 = icmp sgt i64 %342, %343
  br i1 %344, label %345, label %348

345:                                              ; preds = %305
  %346 = load i64, ptr %26, align 8, !tbaa !9
  store i64 %346, ptr %22, align 8, !tbaa !9
  %347 = load i64, ptr %25, align 8, !tbaa !9
  store i64 %347, ptr %21, align 8, !tbaa !9
  br label %348

348:                                              ; preds = %345, %305
  %349 = load i32, ptr %24, align 4, !tbaa !5
  store i32 %349, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  store i32 0, ptr %8, align 4
  br label %350

350:                                              ; preds = %348, %304
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  %351 = load i32, ptr %8, align 4
  switch i32 %351, label %646 [
    i32 0, label %352
    i32 24, label %353
  ]

352:                                              ; preds = %350
  br label %353

353:                                              ; preds = %352, %350
  %354 = load i32, ptr %23, align 4, !tbaa !5
  %355 = add nsw i32 %354, 1
  store i32 %355, ptr %23, align 4, !tbaa !5
  br label %279, !llvm.loop !19

356:                                              ; preds = %283
  %357 = load i64, ptr %22, align 8, !tbaa !9
  %358 = load i32, ptr %18, align 4, !tbaa !5
  %359 = sext i32 %358 to i64
  %360 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %359
  %361 = load i32, ptr %20, align 4, !tbaa !5
  %362 = sext i32 %361 to i64
  %363 = getelementptr inbounds [505 x i64], ptr %360, i64 0, i64 %362
  %364 = load i64, ptr %363, align 8, !tbaa !9
  %365 = icmp sgt i64 %357, %364
  br i1 %365, label %366, label %375

366:                                              ; preds = %356
  %367 = load i32, ptr %18, align 4, !tbaa !5
  %368 = sext i32 %367 to i64
  %369 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %368
  %370 = load i32, ptr %20, align 4, !tbaa !5
  %371 = sext i32 %370 to i64
  %372 = getelementptr inbounds [505 x i64], ptr %369, i64 0, i64 %371
  %373 = load i64, ptr %372, align 8, !tbaa !9
  store i64 %373, ptr %22, align 8, !tbaa !9
  %374 = load i64, ptr %19, align 8, !tbaa !9
  store i64 %374, ptr %21, align 8, !tbaa !9
  br label %375

375:                                              ; preds = %366, %356
  %376 = load i64, ptr %22, align 8, !tbaa !9
  %377 = load i64, ptr @global, align 8, !tbaa !9
  %378 = icmp slt i64 %376, %377
  br i1 %378, label %379, label %384

379:                                              ; preds = %375
  %380 = load i64, ptr %22, align 8, !tbaa !9
  store i64 %380, ptr @global, align 8, !tbaa !9
  %381 = load i32, ptr %17, align 4, !tbaa !5
  %382 = sext i32 %381 to i64
  store i64 %382, ptr @ed, align 8, !tbaa !9
  %383 = load i64, ptr %21, align 8, !tbaa !9
  store i64 %383, ptr @far, align 8, !tbaa !9
  br label %384

384:                                              ; preds = %379, %375
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  store i32 0, ptr %8, align 4
  br label %385

385:                                              ; preds = %384, %269
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  %386 = load i32, ptr %8, align 4
  switch i32 %386, label %388 [
    i32 0, label %387
  ]

387:                                              ; preds = %385
  store i32 0, ptr %8, align 4
  br label %388

388:                                              ; preds = %387, %385
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  %389 = load i32, ptr %8, align 4
  switch i32 %389, label %646 [
    i32 0, label %390
    i32 21, label %391
  ]

390:                                              ; preds = %388
  br label %391

391:                                              ; preds = %390, %388
  %392 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #8
  br label %245

393:                                              ; preds = %247
  br label %394

394:                                              ; preds = %393
  %395 = load i32, ptr %12, align 4, !tbaa !5
  %396 = add nsw i32 %395, 1
  store i32 %396, ptr %12, align 4, !tbaa !5
  br label %223, !llvm.loop !20

397:                                              ; preds = %227
  %398 = load i64, ptr @global, align 8, !tbaa !9
  %399 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %398)
  %400 = load i32, ptr @n, align 4, !tbaa !5
  %401 = add nsw i32 %400, 1
  store i32 %401, ptr @n, align 4, !tbaa !5
  %402 = load i32, ptr @m, align 4, !tbaa !5
  %403 = add nsw i32 %402, 1
  store i32 %403, ptr @m, align 4, !tbaa !5
  %404 = load i64, ptr @ed, align 8, !tbaa !9
  %405 = getelementptr inbounds [200010 x i32], ptr @U, i64 0, i64 %404
  %406 = load i32, ptr %405, align 4, !tbaa !5
  %407 = load i32, ptr @m, align 4, !tbaa !5
  %408 = sext i32 %407 to i64
  %409 = getelementptr inbounds [200010 x i32], ptr @U, i64 0, i64 %408
  store i32 %406, ptr %409, align 4, !tbaa !5
  %410 = load i32, ptr @n, align 4, !tbaa !5
  %411 = load i32, ptr @m, align 4, !tbaa !5
  %412 = sext i32 %411 to i64
  %413 = getelementptr inbounds [200010 x i32], ptr @V, i64 0, i64 %412
  store i32 %410, ptr %413, align 4, !tbaa !5
  %414 = load i64, ptr @far, align 8, !tbaa !9
  %415 = load i32, ptr @m, align 4, !tbaa !5
  %416 = sext i32 %415 to i64
  %417 = getelementptr inbounds [200010 x i64], ptr @W, i64 0, i64 %416
  store i64 %414, ptr %417, align 8, !tbaa !9
  %418 = load i32, ptr @m, align 4, !tbaa !5
  %419 = sext i32 %418 to i64
  %420 = getelementptr inbounds [200010 x i32], ptr @U, i64 0, i64 %419
  %421 = load i32, ptr %420, align 4, !tbaa !5
  %422 = sext i32 %421 to i64
  %423 = getelementptr inbounds [505 x %"class.std::vector"], ptr @g, i64 0, i64 %422
  %424 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE12emplace_backIJRiEEES3_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %423, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %425 = load i32, ptr @m, align 4, !tbaa !5
  %426 = sext i32 %425 to i64
  %427 = getelementptr inbounds [200010 x i32], ptr @V, i64 0, i64 %426
  %428 = load i32, ptr %427, align 4, !tbaa !5
  %429 = sext i32 %428 to i64
  %430 = getelementptr inbounds [505 x %"class.std::vector"], ptr @g, i64 0, i64 %429
  %431 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE12emplace_backIJRiEEES3_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %430, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %432 = load i32, ptr @m, align 4, !tbaa !5
  %433 = add nsw i32 %432, 1
  store i32 %433, ptr @m, align 4, !tbaa !5
  %434 = load i64, ptr @ed, align 8, !tbaa !9
  %435 = getelementptr inbounds [200010 x i32], ptr @V, i64 0, i64 %434
  %436 = load i32, ptr %435, align 4, !tbaa !5
  %437 = load i32, ptr @m, align 4, !tbaa !5
  %438 = sext i32 %437 to i64
  %439 = getelementptr inbounds [200010 x i32], ptr @U, i64 0, i64 %438
  store i32 %436, ptr %439, align 4, !tbaa !5
  %440 = load i32, ptr @n, align 4, !tbaa !5
  %441 = load i32, ptr @m, align 4, !tbaa !5
  %442 = sext i32 %441 to i64
  %443 = getelementptr inbounds [200010 x i32], ptr @V, i64 0, i64 %442
  store i32 %440, ptr %443, align 4, !tbaa !5
  %444 = load i64, ptr @ed, align 8, !tbaa !9
  %445 = getelementptr inbounds [200010 x i64], ptr @W, i64 0, i64 %444
  %446 = load i64, ptr %445, align 8, !tbaa !9
  %447 = load i64, ptr @far, align 8, !tbaa !9
  %448 = sub nsw i64 %446, %447
  %449 = load i32, ptr @m, align 4, !tbaa !5
  %450 = sext i32 %449 to i64
  %451 = getelementptr inbounds [200010 x i64], ptr @W, i64 0, i64 %450
  store i64 %448, ptr %451, align 8, !tbaa !9
  %452 = load i32, ptr @m, align 4, !tbaa !5
  %453 = sext i32 %452 to i64
  %454 = getelementptr inbounds [200010 x i32], ptr @U, i64 0, i64 %453
  %455 = load i32, ptr %454, align 4, !tbaa !5
  %456 = sext i32 %455 to i64
  %457 = getelementptr inbounds [505 x %"class.std::vector"], ptr @g, i64 0, i64 %456
  %458 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE12emplace_backIJRiEEES3_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %457, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %459 = load i32, ptr @m, align 4, !tbaa !5
  %460 = sext i32 %459 to i64
  %461 = getelementptr inbounds [200010 x i32], ptr @V, i64 0, i64 %460
  %462 = load i32, ptr %461, align 4, !tbaa !5
  %463 = sext i32 %462 to i64
  %464 = getelementptr inbounds [505 x %"class.std::vector"], ptr @g, i64 0, i64 %463
  %465 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE12emplace_backIJRiEEES3_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %464, ptr noundef nonnull align 4 dereferenceable(4) @m)
  call void @llvm.lifetime.start.p0(i64 32, ptr %27) #8
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %27)
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #8
  store i32 0, ptr %28, align 4, !tbaa !5
  invoke void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE7emplaceIJiRiEEEvDpOT_(ptr noundef nonnull align 8 dereferenceable(25) %27, ptr noundef nonnull align 4 dereferenceable(4) %28, ptr noundef nonnull align 4 dereferenceable(4) @n)
          to label %466 unwind label %472

466:                                              ; preds = %397
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #8
  store i32 1, ptr %31, align 4, !tbaa !5
  br label %467

467:                                              ; preds = %480, %466
  %468 = load i32, ptr %31, align 4, !tbaa !5
  %469 = load i32, ptr @n, align 4, !tbaa !5
  %470 = icmp slt i32 %468, %469
  br i1 %470, label %476, label %471

471:                                              ; preds = %467
  store i32 25, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #8
  br label %483

472:                                              ; preds = %397
  %473 = landingpad { ptr, i32 }
          cleanup
  %474 = extractvalue { ptr, i32 } %473, 0
  store ptr %474, ptr %29, align 8
  %475 = extractvalue { ptr, i32 } %473, 1
  store i32 %475, ptr %30, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #8
  br label %638

476:                                              ; preds = %467
  %477 = load i32, ptr %31, align 4, !tbaa !5
  %478 = sext i32 %477 to i64
  %479 = getelementptr inbounds [505 x i64], ptr @dist, i64 0, i64 %478
  store i64 1000000000000000000, ptr %479, align 8, !tbaa !9
  br label %480

480:                                              ; preds = %476
  %481 = load i32, ptr %31, align 4, !tbaa !5
  %482 = add nsw i32 %481, 1
  store i32 %482, ptr %31, align 4, !tbaa !5
  br label %467, !llvm.loop !21

483:                                              ; preds = %471
  br label %484

484:                                              ; preds = %577, %483
  %485 = invoke noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %27)
          to label %486 unwind label %506

486:                                              ; preds = %484
  %487 = xor i1 %485, true
  br i1 %487, label %488, label %579

488:                                              ; preds = %486
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #8
  %489 = invoke noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %27)
          to label %490 unwind label %510

490:                                              ; preds = %488
  %491 = getelementptr inbounds %"struct.std::pair", ptr %489, i32 0, i32 1
  %492 = load i32, ptr %491, align 8, !tbaa !22
  store i32 %492, ptr %32, align 4, !tbaa !5
  invoke void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %27)
          to label %493 unwind label %510

493:                                              ; preds = %490
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #8
  %494 = load i32, ptr %32, align 4, !tbaa !5
  %495 = sext i32 %494 to i64
  %496 = getelementptr inbounds [505 x %"class.std::vector"], ptr @g, i64 0, i64 %495
  store ptr %496, ptr %33, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #8
  %497 = load ptr, ptr %33, align 8, !tbaa !17
  %498 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %497) #8
  %499 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %34, i32 0, i32 0
  store ptr %498, ptr %499, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #8
  %500 = load ptr, ptr %33, align 8, !tbaa !17
  %501 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %500) #8
  %502 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %35, i32 0, i32 0
  store ptr %501, ptr %502, align 8
  br label %503

503:                                              ; preds = %575, %493
  %504 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef nonnull align 8 dereferenceable(8) %35) #8
  br i1 %504, label %514, label %505

505:                                              ; preds = %503
  store i32 30, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #8
  br label %577

506:                                              ; preds = %592, %484
  %507 = landingpad { ptr, i32 }
          cleanup
  %508 = extractvalue { ptr, i32 } %507, 0
  store ptr %508, ptr %29, align 8
  %509 = extractvalue { ptr, i32 } %507, 1
  store i32 %509, ptr %30, align 4
  br label %638

510:                                              ; preds = %490, %488
  %511 = landingpad { ptr, i32 }
          cleanup
  %512 = extractvalue { ptr, i32 } %511, 0
  store ptr %512, ptr %29, align 8
  %513 = extractvalue { ptr, i32 } %511, 1
  store i32 %513, ptr %30, align 4
  br label %578

514:                                              ; preds = %503
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #8
  %515 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %34) #8
  %516 = load i32, ptr %515, align 4, !tbaa !5
  store i32 %516, ptr %36, align 4, !tbaa !5
  %517 = load i32, ptr %36, align 4, !tbaa !5
  %518 = sext i32 %517 to i64
  %519 = load i64, ptr @ed, align 8, !tbaa !9
  %520 = xor i64 %518, %519
  %521 = icmp ne i64 %520, 0
  br i1 %521, label %522, label %574

522:                                              ; preds = %514
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #8
  %523 = load i32, ptr %36, align 4, !tbaa !5
  %524 = sext i32 %523 to i64
  %525 = getelementptr inbounds [200010 x i32], ptr @U, i64 0, i64 %524
  %526 = load i32, ptr %525, align 4, !tbaa !5
  %527 = load i32, ptr %32, align 4, !tbaa !5
  %528 = xor i32 %526, %527
  %529 = load i32, ptr %36, align 4, !tbaa !5
  %530 = sext i32 %529 to i64
  %531 = getelementptr inbounds [200010 x i32], ptr @V, i64 0, i64 %530
  %532 = load i32, ptr %531, align 4, !tbaa !5
  %533 = xor i32 %528, %532
  store i32 %533, ptr %37, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #8
  %534 = load i32, ptr %36, align 4, !tbaa !5
  %535 = sext i32 %534 to i64
  %536 = getelementptr inbounds [200010 x i64], ptr @W, i64 0, i64 %535
  %537 = load i64, ptr %536, align 8, !tbaa !9
  store i64 %537, ptr %38, align 8, !tbaa !9
  %538 = load i32, ptr %37, align 4, !tbaa !5
  %539 = sext i32 %538 to i64
  %540 = getelementptr inbounds [505 x i64], ptr @dist, i64 0, i64 %539
  %541 = load i64, ptr %540, align 8, !tbaa !9
  %542 = load i32, ptr %32, align 4, !tbaa !5
  %543 = sext i32 %542 to i64
  %544 = getelementptr inbounds [505 x i64], ptr @dist, i64 0, i64 %543
  %545 = load i64, ptr %544, align 8, !tbaa !9
  %546 = load i64, ptr %38, align 8, !tbaa !9
  %547 = add nsw i64 %545, %546
  %548 = icmp sgt i64 %541, %547
  br i1 %548, label %549, label %573

549:                                              ; preds = %522
  %550 = load i32, ptr %32, align 4, !tbaa !5
  %551 = sext i32 %550 to i64
  %552 = getelementptr inbounds [505 x i64], ptr @dist, i64 0, i64 %551
  %553 = load i64, ptr %552, align 8, !tbaa !9
  %554 = load i64, ptr %38, align 8, !tbaa !9
  %555 = add nsw i64 %553, %554
  %556 = load i32, ptr %37, align 4, !tbaa !5
  %557 = sext i32 %556 to i64
  %558 = getelementptr inbounds [505 x i64], ptr @dist, i64 0, i64 %557
  store i64 %555, ptr %558, align 8, !tbaa !9
  %559 = load i32, ptr %32, align 4, !tbaa !5
  %560 = load i32, ptr %37, align 4, !tbaa !5
  %561 = sext i32 %560 to i64
  %562 = getelementptr inbounds [505 x i32], ptr @par, i64 0, i64 %561
  store i32 %559, ptr %562, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #8
  %563 = load i32, ptr %37, align 4, !tbaa !5
  %564 = sext i32 %563 to i64
  %565 = getelementptr inbounds [505 x i64], ptr @dist, i64 0, i64 %564
  %566 = load i64, ptr %565, align 8, !tbaa !9
  %567 = sub nsw i64 0, %566
  store i64 %567, ptr %39, align 8, !tbaa !9
  invoke void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE7emplaceIJxRiEEEvDpOT_(ptr noundef nonnull align 8 dereferenceable(25) %27, ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef nonnull align 4 dereferenceable(4) %37)
          to label %568 unwind label %569

568:                                              ; preds = %549
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #8
  br label %573

569:                                              ; preds = %549
  %570 = landingpad { ptr, i32 }
          cleanup
  %571 = extractvalue { ptr, i32 } %570, 0
  store ptr %571, ptr %29, align 8
  %572 = extractvalue { ptr, i32 } %570, 1
  store i32 %572, ptr %30, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #8
  br label %578

573:                                              ; preds = %568, %522
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #8
  br label %574

574:                                              ; preds = %573, %514
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  br label %575

575:                                              ; preds = %574
  %576 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %34) #8
  br label %503

577:                                              ; preds = %505
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #8
  br label %484, !llvm.loop !24

578:                                              ; preds = %569, %510
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #8
  br label %638

579:                                              ; preds = %486
  %580 = load i64, ptr @ed, align 8, !tbaa !9
  %581 = getelementptr inbounds [200010 x i32], ptr @U, i64 0, i64 %580
  %582 = load i32, ptr %581, align 4, !tbaa !5
  %583 = load i64, ptr @ed, align 8, !tbaa !9
  %584 = getelementptr inbounds [200010 x i32], ptr @V, i64 0, i64 %583
  %585 = load i32, ptr %584, align 4, !tbaa !5
  %586 = icmp sgt i32 %582, %585
  br i1 %586, label %587, label %592

587:                                              ; preds = %579
  %588 = load i64, ptr @ed, align 8, !tbaa !9
  %589 = getelementptr inbounds [200010 x i32], ptr @U, i64 0, i64 %588
  %590 = load i64, ptr @ed, align 8, !tbaa !9
  %591 = getelementptr inbounds [200010 x i32], ptr @V, i64 0, i64 %590
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %589, ptr noundef nonnull align 4 dereferenceable(4) %591) #8
  br label %592

592:                                              ; preds = %587, %579
  %593 = load i64, ptr @ed, align 8, !tbaa !9
  %594 = getelementptr inbounds [200010 x i32], ptr @U, i64 0, i64 %593
  %595 = load i32, ptr %594, align 4, !tbaa !5
  %596 = load i64, ptr @ed, align 8, !tbaa !9
  %597 = getelementptr inbounds [200010 x i32], ptr @V, i64 0, i64 %596
  %598 = load i32, ptr %597, align 4, !tbaa !5
  %599 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %595, i32 noundef %598)
          to label %600 unwind label %506

600:                                              ; preds = %592
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #8
  store i32 1, ptr %40, align 4, !tbaa !5
  br label %601

601:                                              ; preds = %634, %600
  %602 = load i32, ptr %40, align 4, !tbaa !5
  %603 = load i32, ptr @n, align 4, !tbaa !5
  %604 = icmp slt i32 %602, %603
  br i1 %604, label %606, label %605

605:                                              ; preds = %601
  store i32 32, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #8
  br label %637

606:                                              ; preds = %601
  %607 = load i32, ptr %40, align 4, !tbaa !5
  %608 = sext i32 %607 to i64
  %609 = getelementptr inbounds [505 x i32], ptr @par, i64 0, i64 %608
  %610 = load i32, ptr %609, align 4, !tbaa !5
  %611 = load i32, ptr @n, align 4, !tbaa !5
  %612 = xor i32 %610, %611
  %613 = icmp ne i32 %612, 0
  br i1 %613, label %614, label %633

614:                                              ; preds = %606
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #8
  %615 = load i32, ptr %40, align 4, !tbaa !5
  store i32 %615, ptr %41, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #8
  %616 = load i32, ptr %40, align 4, !tbaa !5
  %617 = sext i32 %616 to i64
  %618 = getelementptr inbounds [505 x i32], ptr @par, i64 0, i64 %617
  %619 = load i32, ptr %618, align 4, !tbaa !5
  store i32 %619, ptr %42, align 4, !tbaa !5
  %620 = load i32, ptr %41, align 4, !tbaa !5
  %621 = load i32, ptr %42, align 4, !tbaa !5
  %622 = icmp sgt i32 %620, %621
  br i1 %622, label %623, label %624

623:                                              ; preds = %614
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %41, ptr noundef nonnull align 4 dereferenceable(4) %42) #8
  br label %624

624:                                              ; preds = %623, %614
  %625 = load i32, ptr %41, align 4, !tbaa !5
  %626 = load i32, ptr %42, align 4, !tbaa !5
  %627 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %625, i32 noundef %626)
          to label %628 unwind label %629

628:                                              ; preds = %624
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #8
  br label %633

629:                                              ; preds = %624
  %630 = landingpad { ptr, i32 }
          cleanup
  %631 = extractvalue { ptr, i32 } %630, 0
  store ptr %631, ptr %29, align 8
  %632 = extractvalue { ptr, i32 } %630, 1
  store i32 %632, ptr %30, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #8
  br label %638

633:                                              ; preds = %628, %606
  br label %634

634:                                              ; preds = %633
  %635 = load i32, ptr %40, align 4, !tbaa !5
  %636 = add nsw i32 %635, 1
  store i32 %636, ptr %40, align 4, !tbaa !5
  br label %601, !llvm.loop !25

637:                                              ; preds = %605
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %27) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %27) #8
  br label %639

638:                                              ; preds = %629, %578, %506, %472
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %27) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %27) #8
  br label %641

639:                                              ; preds = %637, %160
  %640 = load i32, ptr %1, align 4
  ret i32 %640

641:                                              ; preds = %638
  %642 = load ptr, ptr %29, align 8
  %643 = load i32, ptr %30, align 4
  %644 = insertvalue { ptr, i32 } poison, ptr %642, 0
  %645 = insertvalue { ptr, i32 } %644, i32 %643, 1
  resume { ptr, i32 } %645

646:                                              ; preds = %388, %350
  unreachable
}

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPiZ4mainE3$_0EvT_S2_T0_"(ptr noundef, ptr noundef, ptr) #6

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #7 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)) #4

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

attributes #0 = { 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 #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress 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 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = !{!18, !18, i64 0}
!18 = !{!"any pointer", !7, i64 0}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = !{!23, !6, i64 8}
!23 = !{!"_ZTSSt4pairIxiE", !10, i64 0, !6, i64 8}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !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<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::priority_queue" = type <{ %"class.std::vector.0", [8 x i8] }>
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = 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 }

@d = external dso_local global [505 x [505 x i64]], align 16
@W = external dso_local global [200010 x i64], align 16
@g = external dso_local global [505 x %"class.std::vector"], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@U = external dso_local global [200010 x i32], align 16
@V = external dso_local global [200010 x i32], align 16
@id = external dso_local global [505 x i32], align 16
@par = external dso_local local_unnamed_addr global [505 x i32], align 16
@ed = external dso_local local_unnamed_addr global i64, align 8
@far = external dso_local local_unnamed_addr global i64, align 8
@global = external dso_local local_unnamed_addr global i64, align 8
@dist = external dso_local local_unnamed_addr global [505 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.std::priority_queue", align 8
  %8 = alloca i32, align 4
  %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 i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %16 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 4 dereferenceable(4) @m)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2040200) @d, i8 63, i64 2040200, i1 false)
  %17 = load i32, ptr @n, align 4, !tbaa !5
  %.not136 = icmp slt i32 %17, 1
  br i1 %.not136, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %0
  %18 = zext nneg i32 %17 to i64
  %xtraiter = and i64 %18, 1
  %19 = icmp eq i32 %17, 1
  br i1 %19, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %18, 2147483646
  br label %.lr.ph

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next.1, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge.loopexit.unr-lcssa
  %20 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %indvars.iv.unr, i64 %indvars.iv.unr
  store i64 0, ptr %20, align 8, !tbaa !9
  %21 = getelementptr inbounds [505 x i32], ptr @par, i64 0, i64 %indvars.iv.unr
  %22 = trunc nuw nsw i64 %indvars.iv.unr to i32
  store i32 %22, ptr %21, align 4, !tbaa !5
  %23 = getelementptr inbounds [505 x i32], ptr @id, i64 0, i64 %indvars.iv.unr
  store i32 %22, ptr %23, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.epil, %._crit_edge.loopexit.unr-lcssa, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #10
  store i32 1, ptr %1, align 4, !tbaa !5
  %24 = load i32, ptr @m, align 4, !tbaa !5
  %.not120138 = icmp slt i32 %24, 1
  br i1 %.not120138, label %._crit_edge142, label %.lr.ph141

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader.new ], [ %indvars.iv.next.1, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %25 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %indvars.iv, i64 %indvars.iv
  store i64 0, ptr %25, align 8, !tbaa !9
  %26 = getelementptr inbounds [505 x i32], ptr @par, i64 0, i64 %indvars.iv
  %27 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %27, ptr %26, align 4, !tbaa !5
  %28 = getelementptr inbounds [505 x i32], ptr @id, i64 0, i64 %indvars.iv
  store i32 %27, ptr %28, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %29 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %indvars.iv.next, i64 %indvars.iv.next
  store i64 0, ptr %29, align 8, !tbaa !9
  %30 = getelementptr inbounds [505 x i32], ptr @par, i64 0, i64 %indvars.iv.next
  %31 = trunc nuw nsw i64 %indvars.iv.next to i32
  store i32 %31, ptr %30, align 4, !tbaa !5
  %32 = getelementptr inbounds [505 x i32], ptr @id, i64 0, i64 %indvars.iv.next
  store i32 %31, ptr %32, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !11

._crit_edge142.loopexit:                          ; preds = %48
  %.pre211 = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge142

._crit_edge142:                                   ; preds = %._crit_edge142.loopexit, %._crit_edge
  %33 = phi i32 [ %.pre211, %._crit_edge142.loopexit ], [ %17, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #10
  %34 = icmp eq i32 %33, 1
  br i1 %34, label %69, label %.preheader135

.preheader135:                                    ; preds = %._crit_edge142
  %.not121150 = icmp slt i32 %33, 1
  br i1 %.not121150, label %._crit_edge152.thread, label %.preheader134

._crit_edge152.thread:                            ; preds = %.preheader135
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #10
  br label %._crit_edge169

.lr.ph141:                                        ; preds = %._crit_edge, %48
  %storemerge139 = phi i32 [ %67, %48 ], [ 1, %._crit_edge ]
  %35 = sext i32 %storemerge139 to i64
  %36 = getelementptr inbounds i32, ptr @U, i64 %35
  %37 = getelementptr inbounds i32, ptr @V, i64 %35
  %38 = getelementptr inbounds i64, ptr @W, i64 %35
  %39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %36, ptr noundef nonnull %37, ptr noundef nonnull %38)
  %40 = load i32, ptr %1, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [200010 x i32], ptr @U, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = getelementptr inbounds [200010 x i32], ptr @V, i64 0, i64 %41
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = icmp sgt i32 %43, %45
  br i1 %46, label %47, label %48

47:                                               ; preds = %.lr.ph141
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %42, ptr noundef nonnull align 4 dereferenceable(4) %44) #10
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  %.phi.trans.insert = sext i32 %.pre to i64
  %.phi.trans.insert207 = getelementptr inbounds [200010 x i32], ptr @U, i64 0, i64 %.phi.trans.insert
  %.pre208 = load i32, ptr %.phi.trans.insert207, align 4, !tbaa !5
  %.phi.trans.insert209 = getelementptr inbounds [200010 x i32], ptr @V, i64 0, i64 %.phi.trans.insert
  %.pre210 = load i32, ptr %.phi.trans.insert209, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %47, %.lr.ph141
  %.pre-phi221 = phi i64 [ %.phi.trans.insert, %47 ], [ %41, %.lr.ph141 ]
  %49 = phi i32 [ %.pre210, %47 ], [ %45, %.lr.ph141 ]
  %50 = phi i32 [ %.pre208, %47 ], [ %43, %.lr.ph141 ]
  %51 = getelementptr inbounds [200010 x i64], ptr @W, i64 0, i64 %.pre-phi221
  %52 = load i64, ptr %51, align 8, !tbaa !9
  %53 = shl i64 %52, 1
  store i64 %53, ptr %51, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #10
  store i64 %53, ptr %2, align 8, !tbaa !9
  %54 = sext i32 %50 to i64
  %55 = sext i32 %49 to i64
  %56 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %54, i64 %55
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %56, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %58 = load i64, ptr %57, align 8, !tbaa !9
  store i64 %58, ptr %56, align 8, !tbaa !9
  %59 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %55, i64 %54
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %59, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %61 = load i64, ptr %60, align 8, !tbaa !9
  store i64 %61, ptr %59, align 8, !tbaa !9
  %62 = getelementptr inbounds [505 x %"class.std::vector"], ptr @g, i64 0, i64 %54
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE12emplace_backIJRiEEES3_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %62, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %64 = getelementptr inbounds [505 x %"class.std::vector"], ptr @g, i64 0, i64 %55
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE12emplace_backIJRiEEES3_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %64, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #10
  %66 = load i32, ptr %1, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %1, align 4, !tbaa !5
  %68 = load i32, ptr @m, align 4, !tbaa !5
  %.not120.not = icmp slt i32 %66, %68
  br i1 %.not120.not, label %.lr.ph141, label %._crit_edge142.loopexit, !llvm.loop !13

69:                                               ; preds = %._crit_edge142
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %70, i8 noundef signext 10)
  br label %283

.preheader134:                                    ; preds = %.preheader135, %._crit_edge149
  %72 = phi i32 [ %76, %._crit_edge149 ], [ %33, %.preheader135 ]
  %indvars.iv191 = phi i64 [ %indvars.iv.next192, %._crit_edge149 ], [ 1, %.preheader135 ]
  %.not130147 = icmp slt i32 %72, 1
  br i1 %.not130147, label %._crit_edge149, label %.preheader133

._crit_edge152:                                   ; preds = %._crit_edge149
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #10
  store i32 1, ptr %4, align 4, !tbaa !5
  %.not123166 = icmp slt i32 %76, 1
  br i1 %.not123166, label %._crit_edge169, label %.lr.ph168

.preheader133:                                    ; preds = %.preheader134, %._crit_edge146
  %73 = phi i32 [ %78, %._crit_edge146 ], [ %72, %.preheader134 ]
  %74 = phi i32 [ %79, %._crit_edge146 ], [ %72, %.preheader134 ]
  %indvars.iv188 = phi i64 [ %indvars.iv.next189, %._crit_edge146 ], [ 1, %.preheader134 ]
  %.not131143 = icmp slt i32 %74, 1
  br i1 %.not131143, label %.preheader133.._crit_edge146_crit_edge, label %.lr.ph145

.preheader133.._crit_edge146_crit_edge:           ; preds = %.preheader133
  %.pre224 = sext i32 %74 to i64
  br label %._crit_edge146

.lr.ph145:                                        ; preds = %.preheader133
  %75 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %indvars.iv188, i64 %indvars.iv191
  br label %80

._crit_edge149:                                   ; preds = %._crit_edge146, %.preheader134
  %76 = phi i32 [ %72, %.preheader134 ], [ %78, %._crit_edge146 ]
  %indvars.iv.next192 = add nuw nsw i64 %indvars.iv191, 1
  %77 = sext i32 %76 to i64
  %.not121.not = icmp slt i64 %indvars.iv191, %77
  br i1 %.not121.not, label %.preheader134, label %._crit_edge152, !llvm.loop !14

._crit_edge146:                                   ; preds = %80, %.preheader133.._crit_edge146_crit_edge
  %.pre-phi225 = phi i64 [ %.pre224, %.preheader133.._crit_edge146_crit_edge ], [ %89, %80 ]
  %78 = phi i32 [ %73, %.preheader133.._crit_edge146_crit_edge ], [ %88, %80 ]
  %79 = phi i32 [ %74, %.preheader133.._crit_edge146_crit_edge ], [ %88, %80 ]
  %indvars.iv.next189 = add nuw nsw i64 %indvars.iv188, 1
  %.not130.not = icmp slt i64 %indvars.iv188, %.pre-phi225
  br i1 %.not130.not, label %.preheader133, label %._crit_edge149, !llvm.loop !16

80:                                               ; preds = %.lr.ph145, %80
  %indvars.iv185 = phi i64 [ 1, %.lr.ph145 ], [ %indvars.iv.next186, %80 ]
  %81 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %indvars.iv188, i64 %indvars.iv185
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #10
  %82 = load i64, ptr %75, align 8, !tbaa !9
  %83 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %indvars.iv191, i64 %indvars.iv185
  %84 = load i64, ptr %83, align 8, !tbaa !9
  %85 = add nsw i64 %84, %82
  store i64 %85, ptr %3, align 8, !tbaa !9
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %81, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %87 = load i64, ptr %86, align 8, !tbaa !9
  store i64 %87, ptr %81, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #10
  %indvars.iv.next186 = add nuw nsw i64 %indvars.iv185, 1
  %88 = load i32, ptr @n, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %.not131.not = icmp slt i64 %indvars.iv185, %89
  br i1 %.not131.not, label %80, label %._crit_edge146, !llvm.loop !17

._crit_edge169:                                   ; preds = %._crit_edge165, %._crit_edge152.thread, %._crit_edge152
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #10
  %90 = load i64, ptr @global, align 8, !tbaa !9
  %91 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %90)
  %92 = load i32, ptr @n, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr @n, align 4, !tbaa !5
  %94 = load i32, ptr @m, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr @m, align 4, !tbaa !5
  %96 = load i64, ptr @ed, align 8, !tbaa !9
  %97 = getelementptr inbounds [200010 x i32], ptr @U, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = sext i32 %95 to i64
  %100 = getelementptr inbounds [200010 x i32], ptr @U, i64 0, i64 %99
  store i32 %98, ptr %100, align 4, !tbaa !5
  %101 = getelementptr inbounds [200010 x i32], ptr @V, i64 0, i64 %99
  store i32 %93, ptr %101, align 4, !tbaa !5
  %102 = load i64, ptr @far, align 8, !tbaa !9
  %103 = getelementptr inbounds [200010 x i64], ptr @W, i64 0, i64 %99
  store i64 %102, ptr %103, align 8, !tbaa !9
  %104 = sext i32 %98 to i64
  %105 = getelementptr inbounds [505 x %"class.std::vector"], ptr @g, i64 0, i64 %104
  %106 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE12emplace_backIJRiEEES3_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %105, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %107 = load i32, ptr @m, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [200010 x i32], ptr @V, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [505 x %"class.std::vector"], ptr @g, i64 0, i64 %111
  %113 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE12emplace_backIJRiEEES3_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %112, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %114 = load i32, ptr @m, align 4, !tbaa !5
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr @m, align 4, !tbaa !5
  %116 = load i64, ptr @ed, align 8, !tbaa !9
  %117 = getelementptr inbounds [200010 x i32], ptr @V, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = sext i32 %115 to i64
  %120 = getelementptr inbounds [200010 x i32], ptr @U, i64 0, i64 %119
  store i32 %118, ptr %120, align 4, !tbaa !5
  %121 = load i32, ptr @n, align 4, !tbaa !5
  %122 = getelementptr inbounds [200010 x i32], ptr @V, i64 0, i64 %119
  store i32 %121, ptr %122, align 4, !tbaa !5
  %123 = getelementptr inbounds [200010 x i64], ptr @W, i64 0, i64 %116
  %124 = load i64, ptr %123, align 8, !tbaa !9
  %125 = load i64, ptr @far, align 8, !tbaa !9
  %126 = sub nsw i64 %124, %125
  %127 = getelementptr inbounds [200010 x i64], ptr @W, i64 0, i64 %119
  store i64 %126, ptr %127, align 8, !tbaa !9
  %128 = sext i32 %118 to i64
  %129 = getelementptr inbounds [505 x %"class.std::vector"], ptr @g, i64 0, i64 %128
  %130 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE12emplace_backIJRiEEES3_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %129, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %131 = load i32, ptr @m, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [200010 x i32], ptr @V, i64 0, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [505 x %"class.std::vector"], ptr @g, i64 0, i64 %135
  %137 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE12emplace_backIJRiEEES3_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %136, ptr noundef nonnull align 4 dereferenceable(4) @m)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #10
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %7)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #10
  store i32 0, ptr %8, align 4, !tbaa !5
  invoke void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE7emplaceIJiRiEEEvDpOT_(ptr noundef nonnull align 8 dereferenceable(25) %7, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) @n)
          to label %199 unwind label %207

.lr.ph168:                                        ; preds = %._crit_edge152, %._crit_edge165
  %138 = phi i32 [ %148, %._crit_edge165 ], [ %76, %._crit_edge152 ]
  %139 = sext i32 %138 to i64
  %gep = getelementptr i32, ptr getelementptr inbounds (i8, ptr @id, i64 4), i64 %139
  call void @"_ZSt4sortIPiZ4mainE3$_0EvT_S2_T0_"(ptr noundef nonnull getelementptr inbounds (i8, ptr @id, i64 4), ptr noundef nonnull %gep, ptr nonnull %4)
  %140 = load i32, ptr %4, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [505 x %"class.std::vector"], ptr @g, i64 0, i64 %141
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #10
  %143 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %142) #10
  store ptr %143, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #10
  %144 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %142) #10
  store ptr %144, ptr %6, align 8
  %145 = 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) #10
  br i1 %145, label %.lr.ph164, label %._crit_edge165

._crit_edge165:                                   ; preds = %196, %.lr.ph168
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #10
  %146 = load i32, ptr %4, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %4, align 4, !tbaa !5
  %148 = load i32, ptr @n, align 4, !tbaa !5
  %.not123.not = icmp slt i32 %146, %148
  br i1 %.not123.not, label %.lr.ph168, label %._crit_edge169, !llvm.loop !18

.lr.ph164:                                        ; preds = %.lr.ph168, %196
  %149 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #10
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [200010 x i32], ptr @U, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = load i32, ptr %4, align 4, !tbaa !5
  %155 = getelementptr inbounds [200010 x i32], ptr @V, i64 0, i64 %151
  %156 = load i32, ptr %155, align 4, !tbaa !5
  %157 = xor i32 %153, %156
  %158 = xor i32 %157, %154
  %159 = getelementptr inbounds [200010 x i64], ptr @W, i64 0, i64 %151
  %160 = load i64, ptr %159, align 8, !tbaa !9
  %161 = icmp slt i32 %158, %154
  br i1 %161, label %196, label %162

162:                                              ; preds = %.lr.ph164
  %163 = load i32, ptr getelementptr inbounds (i8, ptr @id, i64 4), align 4, !tbaa !5
  %164 = sext i32 %154 to i64
  %165 = sext i32 %163 to i64
  %166 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %164, i64 %165
  %167 = load i64, ptr %166, align 8, !tbaa !9
  %168 = load i32, ptr @n, align 4, !tbaa !5
  %.not128153 = icmp slt i32 %168, 2
  %.pre222 = sext i32 %158 to i64
  br i1 %.not128153, label %._crit_edge160, label %.lr.ph159

.lr.ph159:                                        ; preds = %162
  %169 = add nuw i32 %168, 1
  %wide.trip.count197 = zext i32 %169 to i64
  br label %174

._crit_edge160.loopexit:                          ; preds = %193
  %.pre212 = sext i32 %.1103 to i64
  br label %._crit_edge160

._crit_edge160:                                   ; preds = %162, %._crit_edge160.loopexit
  %.pre-phi = phi i64 [ %.pre212, %._crit_edge160.loopexit ], [ %165, %162 ]
  %.0107.lcssa = phi i64 [ %.2109, %._crit_edge160.loopexit ], [ 0, %162 ]
  %.0105.lcssa = phi i64 [ %.2, %._crit_edge160.loopexit ], [ %167, %162 ]
  %170 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %.pre222, i64 %.pre-phi
  %171 = load i64, ptr %170, align 8, !tbaa !9
  %spec.select132 = call i64 @llvm.smin.i64(i64 %.0105.lcssa, i64 %171)
  %172 = load i64, ptr @global, align 8, !tbaa !9
  %173 = icmp slt i64 %spec.select132, %172
  br i1 %173, label %194, label %196

174:                                              ; preds = %.lr.ph159, %193
  %indvars.iv194 = phi i64 [ 2, %.lr.ph159 ], [ %indvars.iv.next195, %193 ]
  %.0102157 = phi i32 [ %163, %.lr.ph159 ], [ %.1103, %193 ]
  %.0105155 = phi i64 [ %167, %.lr.ph159 ], [ %.2, %193 ]
  %.0107154 = phi i64 [ 0, %.lr.ph159 ], [ %.2109, %193 ]
  %175 = getelementptr inbounds [505 x i32], ptr @id, i64 0, i64 %indvars.iv194
  %176 = load i32, ptr %175, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %.pre222, i64 %177
  %179 = load i64, ptr %178, align 8, !tbaa !9
  %180 = sext i32 %.0102157 to i64
  %181 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %.pre222, i64 %180
  %182 = load i64, ptr %181, align 8, !tbaa !9
  %.not129 = icmp sgt i64 %179, %182
  br i1 %.not129, label %183, label %193

183:                                              ; preds = %174
  %184 = getelementptr inbounds [505 x [505 x i64]], ptr @d, i64 0, i64 %164, i64 %177
  %185 = load i64, ptr %184, align 8, !tbaa !9
  %186 = add i64 %182, %160
  %187 = add i64 %186, %185
  %188 = sdiv i64 %187, 2
  %189 = icmp sgt i64 %.0105155, %188
  br i1 %189, label %190, label %193

190:                                              ; preds = %183
  %191 = sub i64 %186, %185
  %192 = sdiv i64 %191, 2
  br label %193

193:                                              ; preds = %183, %190, %174
  %.2109 = phi i64 [ %.0107154, %174 ], [ %192, %190 ], [ %.0107154, %183 ]
  %.2 = phi i64 [ %.0105155, %174 ], [ %188, %190 ], [ %.0105155, %183 ]
  %.1103 = phi i32 [ %.0102157, %174 ], [ %176, %190 ], [ %176, %183 ]
  %indvars.iv.next195 = add nuw nsw i64 %indvars.iv194, 1
  %exitcond198.not = icmp eq i64 %indvars.iv.next195, %wide.trip.count197
  br i1 %exitcond198.not, label %._crit_edge160.loopexit, label %174, !llvm.loop !19

194:                                              ; preds = %._crit_edge160
  %195 = icmp sgt i64 %.0105.lcssa, %171
  %spec.select = select i1 %195, i64 %160, i64 %.0107.lcssa
  store i64 %spec.select132, ptr @global, align 8, !tbaa !9
  store i64 %151, ptr @ed, align 8, !tbaa !9
  store i64 %spec.select, ptr @far, align 8, !tbaa !9
  br label %196

196:                                              ; preds = %._crit_edge160, %194, %.lr.ph164
  %197 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #10
  %198 = 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) #10
  br i1 %198, label %.lr.ph164, label %._crit_edge165

199:                                              ; preds = %._crit_edge169
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #10
  %200 = load i32, ptr @n, align 4, !tbaa !5
  %201 = icmp sgt i32 %200, 1
  br i1 %201, label %.lr.ph172.preheader, label %.preheader

.lr.ph172.preheader:                              ; preds = %199
  %wide.trip.count202 = zext nneg i32 %200 to i64
  %202 = add nsw i64 %wide.trip.count202, -1
  %min.iters.check = icmp ult i32 %200, 5
  br i1 %min.iters.check, label %.lr.ph172.preheader233, label %vector.ph

.lr.ph172.preheader233:                           ; preds = %middle.block, %.lr.ph172.preheader
  %indvars.iv199.ph = phi i64 [ 1, %.lr.ph172.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph172

vector.ph:                                        ; preds = %.lr.ph172.preheader
  %n.vec = and i64 %202, -4
  %ind.end = or disjoint i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %203 = getelementptr inbounds [505 x i64], ptr @dist, i64 0, i64 %offset.idx
  %204 = getelementptr inbounds i8, ptr %203, i64 16
  store <2 x i64> <i64 1000000000000000000, i64 1000000000000000000>, ptr %203, align 8, !tbaa !9
  store <2 x i64> <i64 1000000000000000000, i64 1000000000000000000>, ptr %204, align 8, !tbaa !9
  %index.next = add nuw i64 %index, 4
  %205 = icmp eq i64 %index.next, %n.vec
  br i1 %205, label %middle.block, label %vector.body, !llvm.loop !20

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %202, %n.vec
  br i1 %cmp.n, label %.preheader, label %.lr.ph172.preheader233

.preheader:                                       ; preds = %.lr.ph172, %middle.block, %199
  %206 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %7)
  br i1 %206, label %._crit_edge177, label %.lr.ph176

207:                                              ; preds = %._crit_edge169
  %208 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #10
  br label %282

.lr.ph172:                                        ; preds = %.lr.ph172.preheader233, %.lr.ph172
  %indvars.iv199 = phi i64 [ %indvars.iv.next200, %.lr.ph172 ], [ %indvars.iv199.ph, %.lr.ph172.preheader233 ]
  %209 = getelementptr inbounds [505 x i64], ptr @dist, i64 0, i64 %indvars.iv199
  store i64 1000000000000000000, ptr %209, align 8, !tbaa !9
  %indvars.iv.next200 = add nuw nsw i64 %indvars.iv199, 1
  %exitcond203.not = icmp eq i64 %indvars.iv.next200, %wide.trip.count202
  br i1 %exitcond203.not, label %.preheader, label %.lr.ph172, !llvm.loop !23

.lr.ph176:                                        ; preds = %.preheader, %._crit_edge175
  %210 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %7)
  %211 = getelementptr inbounds i8, ptr %210, i64 8
  %212 = load i32, ptr %211, align 8, !tbaa !24
  invoke void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %7)
          to label %213 unwind label %221

213:                                              ; preds = %.lr.ph176
  %214 = sext i32 %212 to i64
  %215 = getelementptr inbounds [505 x %"class.std::vector"], ptr @g, i64 0, i64 %214
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #10
  %216 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %215) #10
  store ptr %216, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #10
  %217 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %215) #10
  store ptr %217, ptr %10, align 8
  %218 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #10
  br i1 %218, label %.lr.ph174, label %._crit_edge175

.lr.ph174:                                        ; preds = %213
  %219 = getelementptr inbounds [505 x i64], ptr @dist, i64 0, i64 %214
  br label %223

._crit_edge175:                                   ; preds = %250, %213
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #10
  %220 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %7)
  br i1 %220, label %._crit_edge177, label %.lr.ph176, !llvm.loop !26

221:                                              ; preds = %.lr.ph176
  %222 = landingpad { ptr, i32 }
          cleanup
  br label %282

223:                                              ; preds = %.lr.ph174, %250
  %224 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #10
  %225 = load i32, ptr %224, align 4, !tbaa !5
  %226 = sext i32 %225 to i64
  %227 = load i64, ptr @ed, align 8, !tbaa !9
  %.not125 = icmp eq i64 %227, %226
  br i1 %.not125, label %250, label %228

228:                                              ; preds = %223
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #10
  %229 = getelementptr inbounds [200010 x i32], ptr @U, i64 0, i64 %226
  %230 = load i32, ptr %229, align 4, !tbaa !5
  %231 = getelementptr inbounds [200010 x i32], ptr @V, i64 0, i64 %226
  %232 = load i32, ptr %231, align 4, !tbaa !5
  %233 = xor i32 %230, %232
  %234 = xor i32 %233, %212
  store i32 %234, ptr %11, align 4, !tbaa !5
  %235 = getelementptr inbounds [200010 x i64], ptr @W, i64 0, i64 %226
  %236 = load i64, ptr %235, align 8, !tbaa !9
  %237 = sext i32 %234 to i64
  %238 = getelementptr inbounds [505 x i64], ptr @dist, i64 0, i64 %237
  %239 = load i64, ptr %238, align 8, !tbaa !9
  %240 = load i64, ptr %219, align 8, !tbaa !9
  %241 = add nsw i64 %240, %236
  %242 = icmp sgt i64 %239, %241
  br i1 %242, label %243, label %249

243:                                              ; preds = %228
  store i64 %241, ptr %238, align 8, !tbaa !9
  %244 = getelementptr inbounds [505 x i32], ptr @par, i64 0, i64 %237
  store i32 %212, ptr %244, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #10
  %245 = sub nsw i64 0, %241
  store i64 %245, ptr %12, align 8, !tbaa !9
  invoke void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE7emplaceIJxRiEEEvDpOT_(ptr noundef nonnull align 8 dereferenceable(25) %7, ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %246 unwind label %247

246:                                              ; preds = %243
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #10
  br label %249

247:                                              ; preds = %243
  %248 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #10
  br label %282

249:                                              ; preds = %246, %228
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #10
  br label %250

250:                                              ; preds = %249, %223
  %251 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #10
  %252 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #10
  br i1 %252, label %223, label %._crit_edge175

._crit_edge177:                                   ; preds = %._crit_edge175, %.preheader
  %253 = load i64, ptr @ed, align 8, !tbaa !9
  %254 = getelementptr inbounds [200010 x i32], ptr @U, i64 0, i64 %253
  %255 = load i32, ptr %254, align 4, !tbaa !5
  %256 = getelementptr inbounds [200010 x i32], ptr @V, i64 0, i64 %253
  %257 = load i32, ptr %256, align 4, !tbaa !5
  %258 = icmp sgt i32 %255, %257
  br i1 %258, label %259, label %260

259:                                              ; preds = %._crit_edge177
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %254, ptr noundef nonnull align 4 dereferenceable(4) %256) #10
  %.pre213 = load i64, ptr @ed, align 8, !tbaa !9
  %.phi.trans.insert214 = getelementptr inbounds [200010 x i32], ptr @U, i64 0, i64 %.pre213
  %.pre215 = load i32, ptr %.phi.trans.insert214, align 4, !tbaa !5
  %.phi.trans.insert216 = getelementptr inbounds [200010 x i32], ptr @V, i64 0, i64 %.pre213
  %.pre217 = load i32, ptr %.phi.trans.insert216, align 4, !tbaa !5
  br label %260

260:                                              ; preds = %259, %._crit_edge177
  %261 = phi i32 [ %.pre217, %259 ], [ %257, %._crit_edge177 ]
  %262 = phi i32 [ %.pre215, %259 ], [ %255, %._crit_edge177 ]
  %263 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %262, i32 noundef %261)
  %264 = load i32, ptr @n, align 4, !tbaa !5
  %265 = icmp sgt i32 %264, 1
  br i1 %265, label %.lr.ph180, label %._crit_edge181

._crit_edge181:                                   ; preds = %278, %260
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %7) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #10
  br label %283

.lr.ph180:                                        ; preds = %260, %278
  %266 = phi i32 [ %279, %278 ], [ %264, %260 ]
  %indvars.iv204 = phi i64 [ %indvars.iv.next205, %278 ], [ 1, %260 ]
  %267 = getelementptr inbounds [505 x i32], ptr @par, i64 0, i64 %indvars.iv204
  %268 = load i32, ptr %267, align 4, !tbaa !5
  %.not124 = icmp eq i32 %268, %266
  br i1 %.not124, label %278, label %269

269:                                              ; preds = %.lr.ph180
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #10
  %270 = trunc nuw nsw i64 %indvars.iv204 to i32
  store i32 %270, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #10
  store i32 %268, ptr %14, align 4, !tbaa !5
  %271 = sext i32 %268 to i64
  %272 = icmp sgt i64 %indvars.iv204, %271
  br i1 %272, label %273, label %274

273:                                              ; preds = %269
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14) #10
  %.pre218 = load i32, ptr %13, align 4, !tbaa !5
  %.pre219 = load i32, ptr %14, align 4, !tbaa !5
  br label %274

274:                                              ; preds = %273, %269
  %275 = phi i32 [ %.pre219, %273 ], [ %268, %269 ]
  %276 = phi i32 [ %.pre218, %273 ], [ %270, %269 ]
  %277 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %276, i32 noundef %275)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #10
  %.pre220 = load i32, ptr @n, align 4, !tbaa !5
  br label %278

278:                                              ; preds = %.lr.ph180, %274
  %279 = phi i32 [ %266, %.lr.ph180 ], [ %.pre220, %274 ]
  %indvars.iv.next205 = add nuw nsw i64 %indvars.iv204, 1
  %280 = sext i32 %279 to i64
  %281 = icmp slt i64 %indvars.iv.next205, %280
  br i1 %281, label %.lr.ph180, label %._crit_edge181, !llvm.loop !27

282:                                              ; preds = %221, %247, %207
  %.pn.pn = phi { ptr, i32 } [ %208, %207 ], [ %248, %247 ], [ %222, %221 ]
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %7) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #10
  resume { ptr, i32 } %.pn.pn

283:                                              ; preds = %._crit_edge181, %69
  ret i32 0
}

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #7

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPiZ4mainE3$_0EvT_S2_T0_"(ptr noundef, ptr noundef, ptr) local_unnamed_addr #7

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #8 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 #8 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 #8 align 2

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #9

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = distinct !{!13, !12}
!14 = distinct !{!14, !12, !15}
!15 = !{!"llvm.loop.unswitch.partial.disable"}
!16 = distinct !{!16, !12, !15}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12, !21, !22}
!21 = !{!"llvm.loop.isvectorized", i32 1}
!22 = !{!"llvm.loop.unroll.runtime.disable"}
!23 = distinct !{!23, !12, !22, !21}
!24 = !{!25, !6, i64 8}
!25 = !{!"_ZTSSt4pairIxiE", !10, i64 0, !6, i64 8}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}


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