; LLVM IR from tangjz/acm-icpc :: codeforces/gym (100959I)

; 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"

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

@buf = external dso_local global ptr, align 8
@n = external dso_local global i32, align 4
@x = external dso_local global [100001 x i32], align 16
@y = external dso_local global [100001 x i32], align 16
@ord = external dso_local global [100001 x i32], align 16
@qtot = external dso_local global i32, align 4
@que = external dso_local global [100001 x i32], align 16
@tot = external dso_local global i32, align 4
@lnk = external dso_local global [100001 x i32], align 16
@pos = external dso_local global [100001 x i32], align 16
@typ = external dso_local global [100001 x i8], align 16
@tim = external dso_local global i64, align 8
@dis = external dso_local global [100001 x i64], align 16
@e = external dso_local global [400001 x %struct.Edge], align 16
@Q = external dso_local global %"class.std::priority_queue", align 8
@vis = external dso_local global [100001 x i8], align 16
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@_ZL2dx = external hidden constant [4 x i32], align 16
@_ZL2dy = external hidden constant [4 x i32], align 16
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z4cmpxRKiS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z4cmpyRKiS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %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 %struct.Edge, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %struct.Edge, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %struct.Edge, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %struct.Edge, align 4
  %19 = alloca %"struct.std::pair", align 8
  %20 = alloca i32, align 4
  %21 = alloca { i64, i32 }, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i64, align 8
  %27 = alloca %"struct.std::pair", align 8
  %28 = alloca { i64, i32 }, align 8
  %29 = alloca i32, align 4
  %30 = alloca i64, align 8
  %31 = alloca i64, align 8
  %32 = alloca i64, align 8
  %33 = alloca i64, align 8
  %34 = alloca i64, align 8
  %35 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @tim)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #9
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %57, %0
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = load i32, ptr @n, align 4, !tbaa !5
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #9
  br label %60

42:                                               ; preds = %37
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds i32, ptr @x, i64 %44
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds i32, ptr @y, i64 %47
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds i8, ptr @typ, i64 %50
  %52 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %45, ptr noundef %48, ptr noundef %51)
  %53 = load i32, ptr %2, align 4, !tbaa !5
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %55
  store i32 %53, ptr %56, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %42
  %58 = load i32, ptr %2, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %2, align 4, !tbaa !5
  br label %37, !llvm.loop !9

60:                                               ; preds = %41
  %61 = load i32, ptr @n, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = mul i64 %62, 4
  call void @llvm.memset.p0.i64(ptr align 16 @lnk, i8 -1, i64 %63, i1 false)
  %64 = load i32, ptr @n, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = mul i64 %65, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 @que, ptr align 16 @x, i64 %66, i1 false)
  %67 = load i32, ptr @n, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds i32, ptr @que, i64 %68
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @que, ptr noundef %69)
  %70 = load i32, ptr @n, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds i32, ptr @que, i64 %71
  %73 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef @que, ptr noundef %72)
  %74 = ptrtoint ptr %73 to i64
  %75 = sub i64 %74, ptrtoint (ptr @que to i64)
  %76 = sdiv exact i64 %75, 4
  %77 = trunc i64 %76 to i32
  store i32 %77, ptr @qtot, align 4, !tbaa !5
  %78 = load i32, ptr @qtot, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = mul i64 %79, 4
  call void @llvm.memset.p0.i64(ptr align 16 @pos, i8 -1, i64 %80, i1 false)
  %81 = load i32, ptr @n, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds i32, ptr @ord, i64 %82
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef @ord, ptr noundef %83, ptr noundef @_Z4cmpyRKiS0_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #9
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %158, %60
  %85 = load i32, ptr %3, align 4, !tbaa !5
  %86 = load i32, ptr @n, align 4, !tbaa !5
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #9
  br label %161

89:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #9
  %90 = load i32, ptr %3, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  store i32 %93, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #9
  %94 = load i32, ptr @qtot, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i32, ptr @que, i64 %95
  %97 = load i32, ptr %4, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [100001 x i32], ptr @x, i64 0, i64 %98
  %100 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef @que, ptr noundef %96, ptr noundef nonnull align 4 dereferenceable(4) %99)
  %101 = ptrtoint ptr %100 to i64
  %102 = sub i64 %101, ptrtoint (ptr @que to i64)
  %103 = sdiv exact i64 %102, 4
  %104 = trunc i64 %103 to i32
  store i32 %104, ptr %5, align 4, !tbaa !5
  %105 = load i32, ptr %5, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = icmp ne i32 %108, -1
  br i1 %109, label %110, label %145

110:                                              ; preds = %89
  call void @llvm.lifetime.start.p0(i64 12, ptr %6) #9
  %111 = getelementptr inbounds %struct.Edge, ptr %6, i32 0, i32 0
  %112 = load i32, ptr %5, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [100001 x i32], ptr @lnk, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  store i32 %118, ptr %111, align 4, !tbaa !11
  %119 = getelementptr inbounds %struct.Edge, ptr %6, i32 0, i32 1
  %120 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %120, ptr %119, align 4, !tbaa !13
  %121 = getelementptr inbounds %struct.Edge, ptr %6, i32 0, i32 2
  %122 = load i32, ptr %4, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [100001 x i32], ptr @y, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = load i32, ptr %5, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [100001 x i32], ptr @y, i64 0, i64 %130
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %133 = sub nsw i32 %125, %132
  store i32 %133, ptr %121, align 4, !tbaa !14
  %134 = load i32, ptr @tot, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [400001 x %struct.Edge], ptr @e, i64 0, i64 %135
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %136, ptr align 4 %6, i64 12, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #9
  %137 = load i32, ptr @tot, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr @tot, align 4, !tbaa !5
  %139 = load i32, ptr %5, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [100001 x i32], ptr @lnk, i64 0, i64 %143
  store i32 %137, ptr %144, align 4, !tbaa !5
  br label %145

145:                                              ; preds = %110, %89
  %146 = load i32, ptr %4, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [100001 x i8], ptr @typ, i64 0, i64 %147
  %149 = load i8, ptr %148, align 1, !tbaa !16
  %150 = sext i8 %149 to i32
  %151 = icmp eq i32 %150, 85
  br i1 %151, label %152, label %157

152:                                              ; preds = %145
  %153 = load i32, ptr %4, align 4, !tbaa !5
  %154 = load i32, ptr %5, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %155
  store i32 %153, ptr %156, align 4, !tbaa !5
  br label %157

157:                                              ; preds = %152, %145
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #9
  br label %158

158:                                              ; preds = %157
  %159 = load i32, ptr %3, align 4, !tbaa !5
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %3, align 4, !tbaa !5
  br label %84, !llvm.loop !17

161:                                              ; preds = %88
  %162 = load i32, ptr @n, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds i32, ptr @ord, i64 %163
  call void @_ZSt7reverseIPiEvT_S1_(ptr noundef @ord, ptr noundef %164)
  %165 = load i32, ptr @qtot, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = mul i64 %166, 4
  call void @llvm.memset.p0.i64(ptr align 16 @pos, i8 -1, i64 %167, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %168

168:                                              ; preds = %242, %161
  %169 = load i32, ptr %7, align 4, !tbaa !5
  %170 = load i32, ptr @n, align 4, !tbaa !5
  %171 = icmp slt i32 %169, %170
  br i1 %171, label %173, label %172

172:                                              ; preds = %168
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  br label %245

173:                                              ; preds = %168
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  %174 = load i32, ptr %7, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %175
  %177 = load i32, ptr %176, align 4, !tbaa !5
  store i32 %177, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  %178 = load i32, ptr @qtot, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds i32, ptr @que, i64 %179
  %181 = load i32, ptr %8, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [100001 x i32], ptr @x, i64 0, i64 %182
  %184 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef @que, ptr noundef %180, ptr noundef nonnull align 4 dereferenceable(4) %183)
  %185 = ptrtoint ptr %184 to i64
  %186 = sub i64 %185, ptrtoint (ptr @que to i64)
  %187 = sdiv exact i64 %186, 4
  %188 = trunc i64 %187 to i32
  store i32 %188, ptr %9, align 4, !tbaa !5
  %189 = load i32, ptr %9, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %190
  %192 = load i32, ptr %191, align 4, !tbaa !5
  %193 = icmp ne i32 %192, -1
  br i1 %193, label %194, label %229

194:                                              ; preds = %173
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #9
  %195 = getelementptr inbounds %struct.Edge, ptr %10, i32 0, i32 0
  %196 = load i32, ptr %9, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %197
  %199 = load i32, ptr %198, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [100001 x i32], ptr @lnk, i64 0, i64 %200
  %202 = load i32, ptr %201, align 4, !tbaa !5
  store i32 %202, ptr %195, align 4, !tbaa !11
  %203 = getelementptr inbounds %struct.Edge, ptr %10, i32 0, i32 1
  %204 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %204, ptr %203, align 4, !tbaa !13
  %205 = getelementptr inbounds %struct.Edge, ptr %10, i32 0, i32 2
  %206 = load i32, ptr %9, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %207
  %209 = load i32, ptr %208, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [100001 x i32], ptr @y, i64 0, i64 %210
  %212 = load i32, ptr %211, align 4, !tbaa !5
  %213 = load i32, ptr %8, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [100001 x i32], ptr @y, i64 0, i64 %214
  %216 = load i32, ptr %215, align 4, !tbaa !5
  %217 = sub nsw i32 %212, %216
  store i32 %217, ptr %205, align 4, !tbaa !14
  %218 = load i32, ptr @tot, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [400001 x %struct.Edge], ptr @e, i64 0, i64 %219
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %220, ptr align 4 %10, i64 12, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #9
  %221 = load i32, ptr @tot, align 4, !tbaa !5
  %222 = add nsw i32 %221, 1
  store i32 %222, ptr @tot, align 4, !tbaa !5
  %223 = load i32, ptr %9, align 4, !tbaa !5
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %224
  %226 = load i32, ptr %225, align 4, !tbaa !5
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [100001 x i32], ptr @lnk, i64 0, i64 %227
  store i32 %221, ptr %228, align 4, !tbaa !5
  br label %229

229:                                              ; preds = %194, %173
  %230 = load i32, ptr %8, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [100001 x i8], ptr @typ, i64 0, i64 %231
  %233 = load i8, ptr %232, align 1, !tbaa !16
  %234 = sext i8 %233 to i32
  %235 = icmp eq i32 %234, 68
  br i1 %235, label %236, label %241

236:                                              ; preds = %229
  %237 = load i32, ptr %8, align 4, !tbaa !5
  %238 = load i32, ptr %9, align 4, !tbaa !5
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %239
  store i32 %237, ptr %240, align 4, !tbaa !5
  br label %241

241:                                              ; preds = %236, %229
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  br label %242

242:                                              ; preds = %241
  %243 = load i32, ptr %7, align 4, !tbaa !5
  %244 = add nsw i32 %243, 1
  store i32 %244, ptr %7, align 4, !tbaa !5
  br label %168, !llvm.loop !18

245:                                              ; preds = %172
  %246 = load i32, ptr @n, align 4, !tbaa !5
  %247 = sext i32 %246 to i64
  %248 = mul i64 %247, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 @que, ptr align 16 @y, i64 %248, i1 false)
  %249 = load i32, ptr @n, align 4, !tbaa !5
  %250 = sext i32 %249 to i64
  %251 = getelementptr inbounds i32, ptr @que, i64 %250
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @que, ptr noundef %251)
  %252 = load i32, ptr @n, align 4, !tbaa !5
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds i32, ptr @que, i64 %253
  %255 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef @que, ptr noundef %254)
  %256 = ptrtoint ptr %255 to i64
  %257 = sub i64 %256, ptrtoint (ptr @que to i64)
  %258 = sdiv exact i64 %257, 4
  %259 = trunc i64 %258 to i32
  store i32 %259, ptr @qtot, align 4, !tbaa !5
  %260 = load i32, ptr @qtot, align 4, !tbaa !5
  %261 = sext i32 %260 to i64
  %262 = mul i64 %261, 4
  call void @llvm.memset.p0.i64(ptr align 16 @pos, i8 -1, i64 %262, i1 false)
  %263 = load i32, ptr @n, align 4, !tbaa !5
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds i32, ptr @ord, i64 %264
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef @ord, ptr noundef %265, ptr noundef @_Z4cmpxRKiS0_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #9
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %266

266:                                              ; preds = %340, %245
  %267 = load i32, ptr %11, align 4, !tbaa !5
  %268 = load i32, ptr @n, align 4, !tbaa !5
  %269 = icmp slt i32 %267, %268
  br i1 %269, label %271, label %270

270:                                              ; preds = %266
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #9
  br label %343

271:                                              ; preds = %266
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  %272 = load i32, ptr %11, align 4, !tbaa !5
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %273
  %275 = load i32, ptr %274, align 4, !tbaa !5
  store i32 %275, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  %276 = load i32, ptr @qtot, align 4, !tbaa !5
  %277 = sext i32 %276 to i64
  %278 = getelementptr inbounds i32, ptr @que, i64 %277
  %279 = load i32, ptr %12, align 4, !tbaa !5
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds [100001 x i32], ptr @y, i64 0, i64 %280
  %282 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef @que, ptr noundef %278, ptr noundef nonnull align 4 dereferenceable(4) %281)
  %283 = ptrtoint ptr %282 to i64
  %284 = sub i64 %283, ptrtoint (ptr @que to i64)
  %285 = sdiv exact i64 %284, 4
  %286 = trunc i64 %285 to i32
  store i32 %286, ptr %13, align 4, !tbaa !5
  %287 = load i32, ptr %13, align 4, !tbaa !5
  %288 = sext i32 %287 to i64
  %289 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %288
  %290 = load i32, ptr %289, align 4, !tbaa !5
  %291 = icmp ne i32 %290, -1
  br i1 %291, label %292, label %327

292:                                              ; preds = %271
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #9
  %293 = getelementptr inbounds %struct.Edge, ptr %14, i32 0, i32 0
  %294 = load i32, ptr %13, align 4, !tbaa !5
  %295 = sext i32 %294 to i64
  %296 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %295
  %297 = load i32, ptr %296, align 4, !tbaa !5
  %298 = sext i32 %297 to i64
  %299 = getelementptr inbounds [100001 x i32], ptr @lnk, i64 0, i64 %298
  %300 = load i32, ptr %299, align 4, !tbaa !5
  store i32 %300, ptr %293, align 4, !tbaa !11
  %301 = getelementptr inbounds %struct.Edge, ptr %14, i32 0, i32 1
  %302 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %302, ptr %301, align 4, !tbaa !13
  %303 = getelementptr inbounds %struct.Edge, ptr %14, i32 0, i32 2
  %304 = load i32, ptr %12, align 4, !tbaa !5
  %305 = sext i32 %304 to i64
  %306 = getelementptr inbounds [100001 x i32], ptr @x, i64 0, i64 %305
  %307 = load i32, ptr %306, align 4, !tbaa !5
  %308 = load i32, ptr %13, align 4, !tbaa !5
  %309 = sext i32 %308 to i64
  %310 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %309
  %311 = load i32, ptr %310, align 4, !tbaa !5
  %312 = sext i32 %311 to i64
  %313 = getelementptr inbounds [100001 x i32], ptr @x, i64 0, i64 %312
  %314 = load i32, ptr %313, align 4, !tbaa !5
  %315 = sub nsw i32 %307, %314
  store i32 %315, ptr %303, align 4, !tbaa !14
  %316 = load i32, ptr @tot, align 4, !tbaa !5
  %317 = sext i32 %316 to i64
  %318 = getelementptr inbounds [400001 x %struct.Edge], ptr @e, i64 0, i64 %317
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %318, ptr align 4 %14, i64 12, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #9
  %319 = load i32, ptr @tot, align 4, !tbaa !5
  %320 = add nsw i32 %319, 1
  store i32 %320, ptr @tot, align 4, !tbaa !5
  %321 = load i32, ptr %13, align 4, !tbaa !5
  %322 = sext i32 %321 to i64
  %323 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %322
  %324 = load i32, ptr %323, align 4, !tbaa !5
  %325 = sext i32 %324 to i64
  %326 = getelementptr inbounds [100001 x i32], ptr @lnk, i64 0, i64 %325
  store i32 %319, ptr %326, align 4, !tbaa !5
  br label %327

327:                                              ; preds = %292, %271
  %328 = load i32, ptr %12, align 4, !tbaa !5
  %329 = sext i32 %328 to i64
  %330 = getelementptr inbounds [100001 x i8], ptr @typ, i64 0, i64 %329
  %331 = load i8, ptr %330, align 1, !tbaa !16
  %332 = sext i8 %331 to i32
  %333 = icmp eq i32 %332, 82
  br i1 %333, label %334, label %339

334:                                              ; preds = %327
  %335 = load i32, ptr %12, align 4, !tbaa !5
  %336 = load i32, ptr %13, align 4, !tbaa !5
  %337 = sext i32 %336 to i64
  %338 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %337
  store i32 %335, ptr %338, align 4, !tbaa !5
  br label %339

339:                                              ; preds = %334, %327
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  br label %340

340:                                              ; preds = %339
  %341 = load i32, ptr %11, align 4, !tbaa !5
  %342 = add nsw i32 %341, 1
  store i32 %342, ptr %11, align 4, !tbaa !5
  br label %266, !llvm.loop !19

343:                                              ; preds = %270
  %344 = load i32, ptr @n, align 4, !tbaa !5
  %345 = sext i32 %344 to i64
  %346 = getelementptr inbounds i32, ptr @ord, i64 %345
  call void @_ZSt7reverseIPiEvT_S1_(ptr noundef @ord, ptr noundef %346)
  %347 = load i32, ptr @qtot, align 4, !tbaa !5
  %348 = sext i32 %347 to i64
  %349 = mul i64 %348, 4
  call void @llvm.memset.p0.i64(ptr align 16 @pos, i8 -1, i64 %349, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #9
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %350

350:                                              ; preds = %424, %343
  %351 = load i32, ptr %15, align 4, !tbaa !5
  %352 = load i32, ptr @n, align 4, !tbaa !5
  %353 = icmp slt i32 %351, %352
  br i1 %353, label %355, label %354

354:                                              ; preds = %350
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  br label %427

355:                                              ; preds = %350
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #9
  %356 = load i32, ptr %15, align 4, !tbaa !5
  %357 = sext i32 %356 to i64
  %358 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %357
  %359 = load i32, ptr %358, align 4, !tbaa !5
  store i32 %359, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #9
  %360 = load i32, ptr @qtot, align 4, !tbaa !5
  %361 = sext i32 %360 to i64
  %362 = getelementptr inbounds i32, ptr @que, i64 %361
  %363 = load i32, ptr %16, align 4, !tbaa !5
  %364 = sext i32 %363 to i64
  %365 = getelementptr inbounds [100001 x i32], ptr @y, i64 0, i64 %364
  %366 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef @que, ptr noundef %362, ptr noundef nonnull align 4 dereferenceable(4) %365)
  %367 = ptrtoint ptr %366 to i64
  %368 = sub i64 %367, ptrtoint (ptr @que to i64)
  %369 = sdiv exact i64 %368, 4
  %370 = trunc i64 %369 to i32
  store i32 %370, ptr %17, align 4, !tbaa !5
  %371 = load i32, ptr %17, align 4, !tbaa !5
  %372 = sext i32 %371 to i64
  %373 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %372
  %374 = load i32, ptr %373, align 4, !tbaa !5
  %375 = icmp ne i32 %374, -1
  br i1 %375, label %376, label %411

376:                                              ; preds = %355
  call void @llvm.lifetime.start.p0(i64 12, ptr %18) #9
  %377 = getelementptr inbounds %struct.Edge, ptr %18, i32 0, i32 0
  %378 = load i32, ptr %17, align 4, !tbaa !5
  %379 = sext i32 %378 to i64
  %380 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %379
  %381 = load i32, ptr %380, align 4, !tbaa !5
  %382 = sext i32 %381 to i64
  %383 = getelementptr inbounds [100001 x i32], ptr @lnk, i64 0, i64 %382
  %384 = load i32, ptr %383, align 4, !tbaa !5
  store i32 %384, ptr %377, align 4, !tbaa !11
  %385 = getelementptr inbounds %struct.Edge, ptr %18, i32 0, i32 1
  %386 = load i32, ptr %16, align 4, !tbaa !5
  store i32 %386, ptr %385, align 4, !tbaa !13
  %387 = getelementptr inbounds %struct.Edge, ptr %18, i32 0, i32 2
  %388 = load i32, ptr %17, align 4, !tbaa !5
  %389 = sext i32 %388 to i64
  %390 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %389
  %391 = load i32, ptr %390, align 4, !tbaa !5
  %392 = sext i32 %391 to i64
  %393 = getelementptr inbounds [100001 x i32], ptr @x, i64 0, i64 %392
  %394 = load i32, ptr %393, align 4, !tbaa !5
  %395 = load i32, ptr %16, align 4, !tbaa !5
  %396 = sext i32 %395 to i64
  %397 = getelementptr inbounds [100001 x i32], ptr @x, i64 0, i64 %396
  %398 = load i32, ptr %397, align 4, !tbaa !5
  %399 = sub nsw i32 %394, %398
  store i32 %399, ptr %387, align 4, !tbaa !14
  %400 = load i32, ptr @tot, align 4, !tbaa !5
  %401 = sext i32 %400 to i64
  %402 = getelementptr inbounds [400001 x %struct.Edge], ptr @e, i64 0, i64 %401
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %402, ptr align 4 %18, i64 12, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #9
  %403 = load i32, ptr @tot, align 4, !tbaa !5
  %404 = add nsw i32 %403, 1
  store i32 %404, ptr @tot, align 4, !tbaa !5
  %405 = load i32, ptr %17, align 4, !tbaa !5
  %406 = sext i32 %405 to i64
  %407 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %406
  %408 = load i32, ptr %407, align 4, !tbaa !5
  %409 = sext i32 %408 to i64
  %410 = getelementptr inbounds [100001 x i32], ptr @lnk, i64 0, i64 %409
  store i32 %403, ptr %410, align 4, !tbaa !5
  br label %411

411:                                              ; preds = %376, %355
  %412 = load i32, ptr %16, align 4, !tbaa !5
  %413 = sext i32 %412 to i64
  %414 = getelementptr inbounds [100001 x i8], ptr @typ, i64 0, i64 %413
  %415 = load i8, ptr %414, align 1, !tbaa !16
  %416 = sext i8 %415 to i32
  %417 = icmp eq i32 %416, 76
  br i1 %417, label %418, label %423

418:                                              ; preds = %411
  %419 = load i32, ptr %16, align 4, !tbaa !5
  %420 = load i32, ptr %17, align 4, !tbaa !5
  %421 = sext i32 %420 to i64
  %422 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %421
  store i32 %419, ptr %422, align 4, !tbaa !5
  br label %423

423:                                              ; preds = %418, %411
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  br label %424

424:                                              ; preds = %423
  %425 = load i32, ptr %15, align 4, !tbaa !5
  %426 = add nsw i32 %425, 1
  store i32 %426, ptr %15, align 4, !tbaa !5
  br label %350, !llvm.loop !20

427:                                              ; preds = %354
  %428 = load i32, ptr @n, align 4, !tbaa !5
  %429 = sext i32 %428 to i64
  %430 = mul i64 %429, 8
  call void @llvm.memset.p0.i64(ptr align 16 @dis, i8 63, i64 %430, i1 false)
  store i64 0, ptr @dis, align 16, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #9
  store i32 0, ptr %20, align 4, !tbaa !5
  %431 = call { i64, i32 } @_ZSt9make_pairIRxiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) @dis, ptr noundef nonnull align 4 dereferenceable(4) %20)
  store { i64, i32 } %431, ptr %21, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %21, i64 12, i1 false)
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 8 dereferenceable(12) %19)
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #9
  br label %432

432:                                              ; preds = %499, %497, %427
  %433 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %434 = xor i1 %433, true
  br i1 %434, label %435, label %500

435:                                              ; preds = %432
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #9
  %436 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %437 = getelementptr inbounds %"struct.std::pair", ptr %436, i32 0, i32 1
  %438 = load i32, ptr %437, align 8, !tbaa !23
  store i32 %438, ptr %22, align 4, !tbaa !5
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %439 = load i32, ptr %22, align 4, !tbaa !5
  %440 = sext i32 %439 to i64
  %441 = getelementptr inbounds [100001 x i8], ptr @vis, i64 0, i64 %440
  %442 = load i8, ptr %441, align 1, !tbaa !25, !range !27, !noundef !28
  %443 = trunc i8 %442 to i1
  br i1 %443, label %444, label %445

444:                                              ; preds = %435
  store i32 17, ptr %23, align 4
  br label %497, !llvm.loop !29

445:                                              ; preds = %435
  %446 = load i32, ptr %22, align 4, !tbaa !5
  %447 = sext i32 %446 to i64
  %448 = getelementptr inbounds [100001 x i8], ptr @vis, i64 0, i64 %447
  store i8 1, ptr %448, align 1, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #9
  %449 = load i32, ptr %22, align 4, !tbaa !5
  %450 = sext i32 %449 to i64
  %451 = getelementptr inbounds [100001 x i32], ptr @lnk, i64 0, i64 %450
  %452 = load i32, ptr %451, align 4, !tbaa !5
  store i32 %452, ptr %24, align 4, !tbaa !5
  br label %453

453:                                              ; preds = %490, %445
  %454 = load i32, ptr %24, align 4, !tbaa !5
  %455 = icmp ne i32 %454, -1
  br i1 %455, label %457, label %456

456:                                              ; preds = %453
  store i32 19, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #9
  br label %496

457:                                              ; preds = %453
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #9
  %458 = load i32, ptr %24, align 4, !tbaa !5
  %459 = sext i32 %458 to i64
  %460 = getelementptr inbounds [400001 x %struct.Edge], ptr @e, i64 0, i64 %459
  %461 = getelementptr inbounds %struct.Edge, ptr %460, i32 0, i32 1
  %462 = load i32, ptr %461, align 4, !tbaa !13
  store i32 %462, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #9
  %463 = load i32, ptr %22, align 4, !tbaa !5
  %464 = sext i32 %463 to i64
  %465 = getelementptr inbounds [100001 x i64], ptr @dis, i64 0, i64 %464
  %466 = load i64, ptr %465, align 8, !tbaa !21
  %467 = load i32, ptr %24, align 4, !tbaa !5
  %468 = sext i32 %467 to i64
  %469 = getelementptr inbounds [400001 x %struct.Edge], ptr @e, i64 0, i64 %468
  %470 = getelementptr inbounds %struct.Edge, ptr %469, i32 0, i32 2
  %471 = load i32, ptr %470, align 4, !tbaa !14
  %472 = sext i32 %471 to i64
  %473 = add nsw i64 %466, %472
  store i64 %473, ptr %26, align 8, !tbaa !21
  %474 = load i64, ptr %26, align 8, !tbaa !21
  %475 = load i32, ptr %25, align 4, !tbaa !5
  %476 = sext i32 %475 to i64
  %477 = getelementptr inbounds [100001 x i64], ptr @dis, i64 0, i64 %476
  %478 = load i64, ptr %477, align 8, !tbaa !21
  %479 = icmp slt i64 %474, %478
  br i1 %479, label %480, label %489

480:                                              ; preds = %457
  %481 = load i64, ptr %26, align 8, !tbaa !21
  %482 = load i32, ptr %25, align 4, !tbaa !5
  %483 = sext i32 %482 to i64
  %484 = getelementptr inbounds [100001 x i64], ptr @dis, i64 0, i64 %483
  store i64 %481, ptr %484, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 16, ptr %27) #9
  %485 = load i32, ptr %25, align 4, !tbaa !5
  %486 = sext i32 %485 to i64
  %487 = getelementptr inbounds [100001 x i64], ptr @dis, i64 0, i64 %486
  %488 = call { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %487, ptr noundef nonnull align 4 dereferenceable(4) %25)
  store { i64, i32 } %488, ptr %28, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %27, ptr align 8 %28, i64 12, i1 false)
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 8 dereferenceable(12) %27)
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #9
  br label %489

489:                                              ; preds = %480, %457
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #9
  br label %490

490:                                              ; preds = %489
  %491 = load i32, ptr %24, align 4, !tbaa !5
  %492 = sext i32 %491 to i64
  %493 = getelementptr inbounds [400001 x %struct.Edge], ptr @e, i64 0, i64 %492
  %494 = getelementptr inbounds %struct.Edge, ptr %493, i32 0, i32 0
  %495 = load i32, ptr %494, align 4, !tbaa !11
  store i32 %495, ptr %24, align 4, !tbaa !5
  br label %453, !llvm.loop !30

496:                                              ; preds = %456
  store i32 0, ptr %23, align 4
  br label %497

497:                                              ; preds = %496, %444
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #9
  %498 = load i32, ptr %23, align 4
  switch i32 %498, label %577 [
    i32 0, label %499
    i32 17, label %432
  ]

499:                                              ; preds = %497
  br label %432, !llvm.loop !29

500:                                              ; preds = %432
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #9
  store i32 0, ptr %29, align 4, !tbaa !5
  br label %501

501:                                              ; preds = %573, %500
  %502 = load i32, ptr %29, align 4, !tbaa !5
  %503 = load i32, ptr @n, align 4, !tbaa !5
  %504 = icmp slt i32 %502, %503
  br i1 %504, label %506, label %505

505:                                              ; preds = %501
  store i32 22, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #9
  br label %576

506:                                              ; preds = %501
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #9
  %507 = load i64, ptr @tim, align 8, !tbaa !21
  %508 = load i32, ptr %29, align 4, !tbaa !5
  %509 = sext i32 %508 to i64
  %510 = getelementptr inbounds [100001 x i64], ptr @dis, i64 0, i64 %509
  %511 = load i64, ptr %510, align 8, !tbaa !21
  %512 = sub nsw i64 %507, %511
  store i64 %512, ptr %31, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #9
  store i64 0, ptr %32, align 8, !tbaa !21
  %513 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull align 8 dereferenceable(8) %32)
  %514 = load i64, ptr %513, align 8, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #9
  store i64 %514, ptr %30, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #9
  %515 = load i32, ptr %29, align 4, !tbaa !5
  %516 = sext i32 %515 to i64
  %517 = getelementptr inbounds [100001 x i32], ptr @x, i64 0, i64 %516
  %518 = load i32, ptr %517, align 4, !tbaa !5
  %519 = sext i32 %518 to i64
  store i64 %519, ptr %33, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #9
  %520 = load i32, ptr %29, align 4, !tbaa !5
  %521 = sext i32 %520 to i64
  %522 = getelementptr inbounds [100001 x i32], ptr @y, i64 0, i64 %521
  %523 = load i32, ptr %522, align 4, !tbaa !5
  %524 = sext i32 %523 to i64
  store i64 %524, ptr %34, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #9
  store i32 0, ptr %35, align 4, !tbaa !5
  br label %525

525:                                              ; preds = %566, %506
  %526 = load ptr, ptr @buf, align 8, !tbaa !31
  %527 = load i32, ptr %35, align 4, !tbaa !5
  %528 = sext i32 %527 to i64
  %529 = getelementptr inbounds i8, ptr %526, i64 %528
  %530 = load i8, ptr %529, align 1, !tbaa !16
  %531 = icmp ne i8 %530, 0
  br i1 %531, label %533, label %532

532:                                              ; preds = %525
  store i32 25, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #9
  br label %569

533:                                              ; preds = %525
  %534 = load i32, ptr %29, align 4, !tbaa !5
  %535 = sext i32 %534 to i64
  %536 = getelementptr inbounds [100001 x i8], ptr @typ, i64 0, i64 %535
  %537 = load i8, ptr %536, align 1, !tbaa !16
  %538 = sext i8 %537 to i32
  %539 = load ptr, ptr @buf, align 8, !tbaa !31
  %540 = load i32, ptr %35, align 4, !tbaa !5
  %541 = sext i32 %540 to i64
  %542 = getelementptr inbounds i8, ptr %539, i64 %541
  %543 = load i8, ptr %542, align 1, !tbaa !16
  %544 = sext i8 %543 to i32
  %545 = icmp eq i32 %538, %544
  br i1 %545, label %546, label %565

546:                                              ; preds = %533
  %547 = load i64, ptr %30, align 8, !tbaa !21
  %548 = load i32, ptr %35, align 4, !tbaa !5
  %549 = sext i32 %548 to i64
  %550 = getelementptr inbounds [4 x i32], ptr @_ZL2dx, i64 0, i64 %549
  %551 = load i32, ptr %550, align 4, !tbaa !5
  %552 = sext i32 %551 to i64
  %553 = mul nsw i64 %547, %552
  %554 = load i64, ptr %33, align 8, !tbaa !21
  %555 = add nsw i64 %554, %553
  store i64 %555, ptr %33, align 8, !tbaa !21
  %556 = load i64, ptr %30, align 8, !tbaa !21
  %557 = load i32, ptr %35, align 4, !tbaa !5
  %558 = sext i32 %557 to i64
  %559 = getelementptr inbounds [4 x i32], ptr @_ZL2dy, i64 0, i64 %558
  %560 = load i32, ptr %559, align 4, !tbaa !5
  %561 = sext i32 %560 to i64
  %562 = mul nsw i64 %556, %561
  %563 = load i64, ptr %34, align 8, !tbaa !21
  %564 = add nsw i64 %563, %562
  store i64 %564, ptr %34, align 8, !tbaa !21
  br label %565

565:                                              ; preds = %546, %533
  br label %566

566:                                              ; preds = %565
  %567 = load i32, ptr %35, align 4, !tbaa !5
  %568 = add nsw i32 %567, 1
  store i32 %568, ptr %35, align 4, !tbaa !5
  br label %525, !llvm.loop !33

569:                                              ; preds = %532
  %570 = load i64, ptr %33, align 8, !tbaa !21
  %571 = load i64, ptr %34, align 8, !tbaa !21
  %572 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %570, i64 noundef %571)
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #9
  br label %573

573:                                              ; preds = %569
  %574 = load i32, ptr %29, align 4, !tbaa !5
  %575 = add nsw i32 %574, 1
  store i32 %575, ptr %29, align 4, !tbaa !5
  br label %501, !llvm.loop !34

576:                                              ; preds = %505
  ret i32 0

577:                                              ; preds = %497
  unreachable
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef, ptr noundef) #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef, ptr noundef, ptr noundef) #6

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIPiEvT_S1_(ptr noundef, ptr noundef) #6

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

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

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

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

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

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

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

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

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

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

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


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

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

@buf = external dso_local local_unnamed_addr global ptr, align 8
@n = external dso_local global i32, align 4
@x = external dso_local global [100001 x i32], align 16
@y = external dso_local global [100001 x i32], align 16
@ord = external dso_local global [100001 x i32], align 16
@qtot = external dso_local local_unnamed_addr global i32, align 4
@que = external dso_local global [100001 x i32], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@lnk = external dso_local local_unnamed_addr global [100001 x i32], align 16
@pos = external dso_local local_unnamed_addr global [100001 x i32], align 16
@typ = external dso_local global [100001 x i8], align 16
@tim = external dso_local global i64, align 8
@dis = external dso_local global [100001 x i64], align 16
@e = external dso_local local_unnamed_addr global [400001 x %struct.Edge], align 16
@Q = external dso_local global %"class.std::priority_queue", align 8
@vis = external dso_local local_unnamed_addr global [100001 x i8], align 16
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@_ZL2dx = external hidden local_unnamed_addr constant [4 x i32], align 16
@_ZL2dy = external hidden local_unnamed_addr constant [4 x i32], align 16
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z4cmpxRKiS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z4cmpyRKiS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca %"struct.std::pair", align 8
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @tim)
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre = sext i32 %8 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.._crit_edge_crit_edge ], [ %34, %.lr.ph ]
  %10 = shl nsw i64 %.pre-phi, 2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @lnk, i8 -1, i64 %10, i1 false)
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @que, ptr nonnull align 16 @x, i64 %10, i1 false)
  %11 = getelementptr inbounds i32, ptr @que, i64 %.pre-phi
  tail call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @que, ptr noundef nonnull %11)
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds i32, ptr @que, i64 %13
  %15 = tail call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef nonnull @que, ptr noundef nonnull %14)
  %16 = ptrtoint ptr %15 to i64
  %17 = sub i64 %16, ptrtoint (ptr @que to i64)
  %18 = lshr exact i64 %17, 2
  %19 = trunc i64 %18 to i32
  store i32 %19, ptr @qtot, align 4, !tbaa !5
  %sext = shl i64 %17, 30
  %20 = ashr exact i64 %sext, 30
  %21 = and i64 %20, -4
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @pos, i8 -1, i64 %21, i1 false)
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds i32, ptr @ord, i64 %23
  tail call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef nonnull @ord, ptr noundef nonnull %24, ptr noundef nonnull @_Z4cmpyRKiS0_)
  %25 = load i32, ptr @n, align 4, !tbaa !5
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %.lr.ph138, label %._crit_edge.._crit_edge139_crit_edge

._crit_edge.._crit_edge139_crit_edge:             ; preds = %._crit_edge
  %.pre198 = sext i32 %25 to i64
  br label %._crit_edge139

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %27 = getelementptr inbounds i32, ptr @x, i64 %indvars.iv
  %28 = getelementptr inbounds i32, ptr @y, i64 %indvars.iv
  %29 = getelementptr inbounds i8, ptr @typ, i64 %indvars.iv
  %30 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %27, ptr noundef nonnull %28, ptr noundef nonnull %29)
  %31 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %indvars.iv
  %32 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %32, ptr %31, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %33 = load i32, ptr @n, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = icmp slt i64 %indvars.iv.next, %34
  br i1 %35, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge139:                                   ; preds = %73, %._crit_edge.._crit_edge139_crit_edge
  %.pre-phi199 = phi i64 [ %.pre198, %._crit_edge.._crit_edge139_crit_edge ], [ %75, %73 ]
  %36 = getelementptr inbounds i32, ptr @ord, i64 %.pre-phi199
  tail call void @_ZSt7reverseIPiEvT_S1_(ptr noundef nonnull @ord, ptr noundef nonnull %36)
  %37 = load i32, ptr @qtot, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = shl nsw i64 %38, 2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @pos, i8 -1, i64 %39, i1 false)
  %40 = load i32, ptr @n, align 4, !tbaa !5
  %41 = icmp sgt i32 %40, 0
  br i1 %41, label %.lr.ph143, label %._crit_edge139.._crit_edge144_crit_edge

._crit_edge139.._crit_edge144_crit_edge:          ; preds = %._crit_edge139
  %.pre200 = sext i32 %40 to i64
  br label %._crit_edge144

.lr.ph138:                                        ; preds = %._crit_edge, %73
  %indvars.iv181 = phi i64 [ %indvars.iv.next182, %73 ], [ 0, %._crit_edge ]
  %42 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %indvars.iv181
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = load i32, ptr @qtot, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds i32, ptr @que, i64 %45
  %47 = sext i32 %43 to i64
  %48 = getelementptr inbounds [100001 x i32], ptr @x, i64 0, i64 %47
  %49 = tail call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull @que, ptr noundef nonnull %46, ptr noundef nonnull align 4 dereferenceable(4) %48)
  %50 = ptrtoint ptr %49 to i64
  %51 = sub i64 %50, ptrtoint (ptr @que to i64)
  %sext129 = shl i64 %51, 30
  %52 = ashr i64 %sext129, 32
  %53 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %.not130 = icmp eq i32 %54, -1
  br i1 %.not130, label %68, label %55

55:                                               ; preds = %.lr.ph138
  %56 = sext i32 %54 to i64
  %57 = getelementptr inbounds [100001 x i32], ptr @lnk, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = getelementptr inbounds [100001 x i32], ptr @y, i64 0, i64 %47
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = getelementptr inbounds [100001 x i32], ptr @y, i64 0, i64 %56
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = sub nsw i32 %60, %62
  %64 = load i32, ptr @tot, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [400001 x %struct.Edge], ptr @e, i64 0, i64 %65
  store i32 %58, ptr %66, align 4, !tbaa !5
  %.sroa.478.0..sroa_idx = getelementptr inbounds i8, ptr %66, i64 4
  store i32 %43, ptr %.sroa.478.0..sroa_idx, align 4, !tbaa !5
  %.sroa.579.0..sroa_idx = getelementptr inbounds i8, ptr %66, i64 8
  store i32 %63, ptr %.sroa.579.0..sroa_idx, align 4, !tbaa !5
  %67 = add nsw i32 %64, 1
  store i32 %67, ptr @tot, align 4, !tbaa !5
  store i32 %64, ptr %57, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %55, %.lr.ph138
  %69 = getelementptr inbounds [100001 x i8], ptr @typ, i64 0, i64 %47
  %70 = load i8, ptr %69, align 1, !tbaa !11
  %71 = icmp eq i8 %70, 85
  br i1 %71, label %72, label %73

72:                                               ; preds = %68
  store i32 %43, ptr %53, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %72, %68
  %indvars.iv.next182 = add nuw nsw i64 %indvars.iv181, 1
  %74 = load i32, ptr @n, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = icmp slt i64 %indvars.iv.next182, %75
  br i1 %76, label %.lr.ph138, label %._crit_edge139, !llvm.loop !12

._crit_edge144:                                   ; preds = %125, %._crit_edge139.._crit_edge144_crit_edge
  %.pre-phi201 = phi i64 [ %.pre200, %._crit_edge139.._crit_edge144_crit_edge ], [ %127, %125 ]
  %77 = shl nsw i64 %.pre-phi201, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @que, ptr nonnull align 16 @y, i64 %77, i1 false)
  %78 = getelementptr inbounds i32, ptr @que, i64 %.pre-phi201
  tail call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @que, ptr noundef nonnull %78)
  %79 = load i32, ptr @n, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds i32, ptr @que, i64 %80
  %82 = tail call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef nonnull @que, ptr noundef nonnull %81)
  %83 = ptrtoint ptr %82 to i64
  %84 = sub i64 %83, ptrtoint (ptr @que to i64)
  %85 = lshr exact i64 %84, 2
  %86 = trunc i64 %85 to i32
  store i32 %86, ptr @qtot, align 4, !tbaa !5
  %sext121 = shl i64 %84, 30
  %87 = ashr exact i64 %sext121, 30
  %88 = and i64 %87, -4
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @pos, i8 -1, i64 %88, i1 false)
  %89 = load i32, ptr @n, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds i32, ptr @ord, i64 %90
  tail call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef nonnull @ord, ptr noundef nonnull %91, ptr noundef nonnull @_Z4cmpxRKiS0_)
  %92 = load i32, ptr @n, align 4, !tbaa !5
  %93 = icmp sgt i32 %92, 0
  br i1 %93, label %.lr.ph148, label %._crit_edge144.._crit_edge149_crit_edge

._crit_edge144.._crit_edge149_crit_edge:          ; preds = %._crit_edge144
  %.pre202 = sext i32 %92 to i64
  br label %._crit_edge149

.lr.ph143:                                        ; preds = %._crit_edge139, %125
  %indvars.iv184 = phi i64 [ %indvars.iv.next185, %125 ], [ 0, %._crit_edge139 ]
  %94 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %indvars.iv184
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = load i32, ptr @qtot, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds i32, ptr @que, i64 %97
  %99 = sext i32 %95 to i64
  %100 = getelementptr inbounds [100001 x i32], ptr @x, i64 0, i64 %99
  %101 = tail call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull @que, ptr noundef nonnull %98, ptr noundef nonnull align 4 dereferenceable(4) %100)
  %102 = ptrtoint ptr %101 to i64
  %103 = sub i64 %102, ptrtoint (ptr @que to i64)
  %sext127 = shl i64 %103, 30
  %104 = ashr i64 %sext127, 32
  %105 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %.not128 = icmp eq i32 %106, -1
  br i1 %.not128, label %120, label %107

107:                                              ; preds = %.lr.ph143
  %108 = sext i32 %106 to i64
  %109 = getelementptr inbounds [100001 x i32], ptr @lnk, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = getelementptr inbounds [100001 x i32], ptr @y, i64 0, i64 %108
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = getelementptr inbounds [100001 x i32], ptr @y, i64 0, i64 %99
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = sub nsw i32 %112, %114
  %116 = load i32, ptr @tot, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [400001 x %struct.Edge], ptr @e, i64 0, i64 %117
  store i32 %110, ptr %118, align 4, !tbaa !5
  %.sroa.462.0..sroa_idx = getelementptr inbounds i8, ptr %118, i64 4
  store i32 %95, ptr %.sroa.462.0..sroa_idx, align 4, !tbaa !5
  %.sroa.563.0..sroa_idx = getelementptr inbounds i8, ptr %118, i64 8
  store i32 %115, ptr %.sroa.563.0..sroa_idx, align 4, !tbaa !5
  %119 = add nsw i32 %116, 1
  store i32 %119, ptr @tot, align 4, !tbaa !5
  store i32 %116, ptr %109, align 4, !tbaa !5
  br label %120

120:                                              ; preds = %107, %.lr.ph143
  %121 = getelementptr inbounds [100001 x i8], ptr @typ, i64 0, i64 %99
  %122 = load i8, ptr %121, align 1, !tbaa !11
  %123 = icmp eq i8 %122, 68
  br i1 %123, label %124, label %125

124:                                              ; preds = %120
  store i32 %95, ptr %105, align 4, !tbaa !5
  br label %125

125:                                              ; preds = %124, %120
  %indvars.iv.next185 = add nuw nsw i64 %indvars.iv184, 1
  %126 = load i32, ptr @n, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = icmp slt i64 %indvars.iv.next185, %127
  br i1 %128, label %.lr.ph143, label %._crit_edge144, !llvm.loop !13

._crit_edge149:                                   ; preds = %166, %._crit_edge144.._crit_edge149_crit_edge
  %.pre-phi203 = phi i64 [ %.pre202, %._crit_edge144.._crit_edge149_crit_edge ], [ %168, %166 ]
  %129 = getelementptr inbounds i32, ptr @ord, i64 %.pre-phi203
  tail call void @_ZSt7reverseIPiEvT_S1_(ptr noundef nonnull @ord, ptr noundef nonnull %129)
  %130 = load i32, ptr @qtot, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = shl nsw i64 %131, 2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @pos, i8 -1, i64 %132, i1 false)
  %133 = load i32, ptr @n, align 4, !tbaa !5
  %134 = icmp sgt i32 %133, 0
  br i1 %134, label %.lr.ph153, label %._crit_edge149.._crit_edge154_crit_edge

._crit_edge149.._crit_edge154_crit_edge:          ; preds = %._crit_edge149
  %.pre204 = sext i32 %133 to i64
  br label %._crit_edge154

.lr.ph148:                                        ; preds = %._crit_edge144, %166
  %indvars.iv187 = phi i64 [ %indvars.iv.next188, %166 ], [ 0, %._crit_edge144 ]
  %135 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %indvars.iv187
  %136 = load i32, ptr %135, align 4, !tbaa !5
  %137 = load i32, ptr @qtot, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds i32, ptr @que, i64 %138
  %140 = sext i32 %136 to i64
  %141 = getelementptr inbounds [100001 x i32], ptr @y, i64 0, i64 %140
  %142 = tail call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull @que, ptr noundef nonnull %139, ptr noundef nonnull align 4 dereferenceable(4) %141)
  %143 = ptrtoint ptr %142 to i64
  %144 = sub i64 %143, ptrtoint (ptr @que to i64)
  %sext125 = shl i64 %144, 30
  %145 = ashr i64 %sext125, 32
  %146 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %145
  %147 = load i32, ptr %146, align 4, !tbaa !5
  %.not126 = icmp eq i32 %147, -1
  br i1 %.not126, label %161, label %148

148:                                              ; preds = %.lr.ph148
  %149 = sext i32 %147 to i64
  %150 = getelementptr inbounds [100001 x i32], ptr @lnk, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = getelementptr inbounds [100001 x i32], ptr @x, i64 0, i64 %140
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = getelementptr inbounds [100001 x i32], ptr @x, i64 0, i64 %149
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = sub nsw i32 %153, %155
  %157 = load i32, ptr @tot, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [400001 x %struct.Edge], ptr @e, i64 0, i64 %158
  store i32 %151, ptr %159, align 4, !tbaa !5
  %.sroa.446.0..sroa_idx = getelementptr inbounds i8, ptr %159, i64 4
  store i32 %136, ptr %.sroa.446.0..sroa_idx, align 4, !tbaa !5
  %.sroa.547.0..sroa_idx = getelementptr inbounds i8, ptr %159, i64 8
  store i32 %156, ptr %.sroa.547.0..sroa_idx, align 4, !tbaa !5
  %160 = add nsw i32 %157, 1
  store i32 %160, ptr @tot, align 4, !tbaa !5
  store i32 %157, ptr %150, align 4, !tbaa !5
  br label %161

161:                                              ; preds = %148, %.lr.ph148
  %162 = getelementptr inbounds [100001 x i8], ptr @typ, i64 0, i64 %140
  %163 = load i8, ptr %162, align 1, !tbaa !11
  %164 = icmp eq i8 %163, 82
  br i1 %164, label %165, label %166

165:                                              ; preds = %161
  store i32 %136, ptr %146, align 4, !tbaa !5
  br label %166

166:                                              ; preds = %165, %161
  %indvars.iv.next188 = add nuw nsw i64 %indvars.iv187, 1
  %167 = load i32, ptr @n, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = icmp slt i64 %indvars.iv.next188, %168
  br i1 %169, label %.lr.ph148, label %._crit_edge149, !llvm.loop !14

._crit_edge154:                                   ; preds = %204, %._crit_edge149.._crit_edge154_crit_edge
  %.pre-phi205 = phi i64 [ %.pre204, %._crit_edge149.._crit_edge154_crit_edge ], [ %206, %204 ]
  %170 = shl nsw i64 %.pre-phi205, 3
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @dis, i8 63, i64 %170, i1 false)
  store i64 0, ptr @dis, align 16, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #9
  store i32 0, ptr %2, align 4, !tbaa !5
  %171 = call { i64, i32 } @_ZSt9make_pairIRxiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) @dis, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %.fca.0.extract27 = extractvalue { i64, i32 } %171, 0
  %.fca.1.extract28 = extractvalue { i64, i32 } %171, 1
  store i64 %.fca.0.extract27, ptr %1, align 8
  %.sroa.230.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 8
  store i32 %.fca.1.extract28, ptr %.sroa.230.0..sroa_idx, align 8
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 8 dereferenceable(12) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #9
  %172 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %172, label %.preheader, label %.lr.ph162

.lr.ph162:                                        ; preds = %._crit_edge154
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  br label %210

.lr.ph153:                                        ; preds = %._crit_edge149, %204
  %indvars.iv190 = phi i64 [ %indvars.iv.next191, %204 ], [ 0, %._crit_edge149 ]
  %173 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %indvars.iv190
  %174 = load i32, ptr %173, align 4, !tbaa !5
  %175 = load i32, ptr @qtot, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds i32, ptr @que, i64 %176
  %178 = sext i32 %174 to i64
  %179 = getelementptr inbounds [100001 x i32], ptr @y, i64 0, i64 %178
  %180 = tail call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull @que, ptr noundef nonnull %177, ptr noundef nonnull align 4 dereferenceable(4) %179)
  %181 = ptrtoint ptr %180 to i64
  %182 = sub i64 %181, ptrtoint (ptr @que to i64)
  %sext123 = shl i64 %182, 30
  %183 = ashr i64 %sext123, 32
  %184 = getelementptr inbounds [100001 x i32], ptr @pos, i64 0, i64 %183
  %185 = load i32, ptr %184, align 4, !tbaa !5
  %.not124 = icmp eq i32 %185, -1
  br i1 %.not124, label %199, label %186

186:                                              ; preds = %.lr.ph153
  %187 = sext i32 %185 to i64
  %188 = getelementptr inbounds [100001 x i32], ptr @lnk, i64 0, i64 %187
  %189 = load i32, ptr %188, align 4, !tbaa !5
  %190 = getelementptr inbounds [100001 x i32], ptr @x, i64 0, i64 %187
  %191 = load i32, ptr %190, align 4, !tbaa !5
  %192 = getelementptr inbounds [100001 x i32], ptr @x, i64 0, i64 %178
  %193 = load i32, ptr %192, align 4, !tbaa !5
  %194 = sub nsw i32 %191, %193
  %195 = load i32, ptr @tot, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [400001 x %struct.Edge], ptr @e, i64 0, i64 %196
  store i32 %189, ptr %197, align 4, !tbaa !5
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %197, i64 4
  store i32 %174, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !5
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %197, i64 8
  store i32 %194, ptr %.sroa.5.0..sroa_idx, align 4, !tbaa !5
  %198 = add nsw i32 %195, 1
  store i32 %198, ptr @tot, align 4, !tbaa !5
  store i32 %195, ptr %188, align 4, !tbaa !5
  br label %199

199:                                              ; preds = %186, %.lr.ph153
  %200 = getelementptr inbounds [100001 x i8], ptr @typ, i64 0, i64 %178
  %201 = load i8, ptr %200, align 1, !tbaa !11
  %202 = icmp eq i8 %201, 76
  br i1 %202, label %203, label %204

203:                                              ; preds = %199
  store i32 %174, ptr %184, align 4, !tbaa !5
  br label %204

204:                                              ; preds = %203, %199
  %indvars.iv.next191 = add nuw nsw i64 %indvars.iv190, 1
  %205 = load i32, ptr @n, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = icmp slt i64 %indvars.iv.next191, %206
  br i1 %207, label %.lr.ph153, label %._crit_edge154, !llvm.loop !17

.preheader:                                       ; preds = %.loopexit, %._crit_edge154
  %208 = load i32, ptr @n, align 4, !tbaa !5
  %209 = icmp sgt i32 %208, 0
  br i1 %209, label %.lr.ph173, label %._crit_edge174

210:                                              ; preds = %.lr.ph162, %.loopexit
  %211 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %212 = getelementptr inbounds i8, ptr %211, i64 8
  %213 = load i32, ptr %212, align 8, !tbaa !18
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [100001 x i8], ptr @vis, i64 0, i64 %214
  %216 = load i8, ptr %215, align 1, !tbaa !20, !range !22, !noundef !23
  %217 = trunc nuw i8 %216 to i1
  br i1 %217, label %.loopexit, label %218, !llvm.loop !24

218:                                              ; preds = %210
  store i8 1, ptr %215, align 1, !tbaa !20
  %219 = getelementptr inbounds [100001 x i32], ptr @lnk, i64 0, i64 %214
  %.0108156 = load i32, ptr %219, align 4, !tbaa !5
  %.not122157 = icmp eq i32 %.0108156, -1
  br i1 %.not122157, label %.loopexit, label %.lr.ph160

.lr.ph160:                                        ; preds = %218
  %220 = getelementptr inbounds [100001 x i64], ptr @dis, i64 0, i64 %214
  br label %221

221:                                              ; preds = %.lr.ph160, %237
  %.0108158 = phi i32 [ %.0108156, %.lr.ph160 ], [ %.0108, %237 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #9
  %222 = sext i32 %.0108158 to i64
  %223 = getelementptr inbounds [400001 x %struct.Edge], ptr @e, i64 0, i64 %222
  %224 = getelementptr inbounds i8, ptr %223, i64 4
  %225 = load i32, ptr %224, align 4, !tbaa !25
  store i32 %225, ptr %3, align 4, !tbaa !5
  %226 = load i64, ptr %220, align 8, !tbaa !15
  %227 = getelementptr inbounds i8, ptr %223, i64 8
  %228 = load i32, ptr %227, align 4, !tbaa !27
  %229 = sext i32 %228 to i64
  %230 = add nsw i64 %226, %229
  %231 = sext i32 %225 to i64
  %232 = getelementptr inbounds [100001 x i64], ptr @dis, i64 0, i64 %231
  %233 = load i64, ptr %232, align 8, !tbaa !15
  %234 = icmp slt i64 %230, %233
  br i1 %234, label %235, label %237

235:                                              ; preds = %221
  store i64 %230, ptr %232, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #9
  %236 = call { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %232, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %.fca.0.extract = extractvalue { i64, i32 } %236, 0
  %.fca.1.extract = extractvalue { i64, i32 } %236, 1
  store i64 %.fca.0.extract, ptr %4, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 8 dereferenceable(12) %4)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #9
  br label %237

237:                                              ; preds = %235, %221
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  %.0108 = load i32, ptr %223, align 4, !tbaa !5
  %.not122 = icmp eq i32 %.0108, -1
  br i1 %.not122, label %.loopexit, label %221, !llvm.loop !28

.loopexit:                                        ; preds = %237, %218, %210
  %238 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %238, label %.preheader, label %210

._crit_edge174:                                   ; preds = %._crit_edge169, %.preheader
  ret i32 0

.lr.ph173:                                        ; preds = %.preheader, %._crit_edge169
  %indvars.iv195 = phi i64 [ %indvars.iv.next196, %._crit_edge169 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #9
  %239 = load i64, ptr @tim, align 8, !tbaa !15
  %240 = getelementptr inbounds [100001 x i64], ptr @dis, i64 0, i64 %indvars.iv195
  %241 = load i64, ptr %240, align 8, !tbaa !15
  %242 = sub nsw i64 %239, %241
  store i64 %242, ptr %5, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #9
  store i64 0, ptr %6, align 8, !tbaa !15
  %243 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %244 = load i64, ptr %243, align 8, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  %245 = getelementptr inbounds [100001 x i32], ptr @x, i64 0, i64 %indvars.iv195
  %246 = load i32, ptr %245, align 4, !tbaa !5
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds [100001 x i32], ptr @y, i64 0, i64 %indvars.iv195
  %249 = load i32, ptr %248, align 4, !tbaa !5
  %250 = sext i32 %249 to i64
  %251 = load ptr, ptr @buf, align 8, !tbaa !29
  %252 = load i8, ptr %251, align 1, !tbaa !11
  %.not163 = icmp eq i8 %252, 0
  br i1 %.not163, label %._crit_edge169, label %.lr.ph168

.lr.ph168:                                        ; preds = %.lr.ph173
  %253 = getelementptr inbounds [100001 x i8], ptr @typ, i64 0, i64 %indvars.iv195
  %254 = load i8, ptr %253, align 1, !tbaa !11
  br label %259

._crit_edge169:                                   ; preds = %273, %.lr.ph173
  %.0101.lcssa = phi i64 [ %247, %.lr.ph173 ], [ %.1102, %273 ]
  %.0100.lcssa = phi i64 [ %250, %.lr.ph173 ], [ %.1, %273 ]
  %255 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %.0101.lcssa, i64 noundef %.0100.lcssa)
  %indvars.iv.next196 = add nuw nsw i64 %indvars.iv195, 1
  %256 = load i32, ptr @n, align 4, !tbaa !5
  %257 = sext i32 %256 to i64
  %258 = icmp slt i64 %indvars.iv.next196, %257
  br i1 %258, label %.lr.ph173, label %._crit_edge174, !llvm.loop !31

259:                                              ; preds = %.lr.ph168, %273
  %indvars.iv193 = phi i64 [ 0, %.lr.ph168 ], [ %indvars.iv.next194, %273 ]
  %260 = phi i8 [ %252, %.lr.ph168 ], [ %275, %273 ]
  %.0100165 = phi i64 [ %250, %.lr.ph168 ], [ %.1, %273 ]
  %.0101164 = phi i64 [ %247, %.lr.ph168 ], [ %.1102, %273 ]
  %261 = icmp eq i8 %254, %260
  br i1 %261, label %262, label %273

262:                                              ; preds = %259
  %263 = getelementptr inbounds [4 x i32], ptr @_ZL2dx, i64 0, i64 %indvars.iv193
  %264 = load i32, ptr %263, align 4, !tbaa !5
  %265 = sext i32 %264 to i64
  %266 = mul nsw i64 %244, %265
  %267 = add nsw i64 %266, %.0101164
  %268 = getelementptr inbounds [4 x i32], ptr @_ZL2dy, i64 0, i64 %indvars.iv193
  %269 = load i32, ptr %268, align 4, !tbaa !5
  %270 = sext i32 %269 to i64
  %271 = mul nsw i64 %244, %270
  %272 = add nsw i64 %271, %.0100165
  br label %273

273:                                              ; preds = %259, %262
  %.1102 = phi i64 [ %267, %262 ], [ %.0101164, %259 ]
  %.1 = phi i64 [ %272, %262 ], [ %.0100165, %259 ]
  %indvars.iv.next194 = add nuw nsw i64 %indvars.iv193, 1
  %274 = getelementptr inbounds i8, ptr %251, i64 %indvars.iv.next194
  %275 = load i8, ptr %274, align 1, !tbaa !11
  %.not = icmp eq i8 %275, 0
  br i1 %.not, label %._crit_edge169, label %259, !llvm.loop !32
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #6

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #6

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

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

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

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

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

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

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

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

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

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

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


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