; LLVM IR from tangjz/acm-icpc :: 51nod (1848)

; 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::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<Node, std::allocator<Node>>::_Vector_impl" }
%"struct.std::_Vector_base<Node, std::allocator<Node>>::_Vector_impl" = type { %"struct.std::_Vector_base<Node, std::allocator<Node>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Node, std::allocator<Node>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Node = type { i32, i32, i32, i32, i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global [131073 x i32], align 16
@b = external dso_local global [131073 x i32], align 16
@seq = external dso_local global [131073 x [5 x i32]], align 16
@Q = external dso_local global %"class.std::priority_queue", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %struct.Node, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %struct.Node, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.Node, align 4
  %10 = alloca %struct.Node, align 4
  %11 = alloca %struct.Node, align 4
  store i32 0, ptr %1, align 4
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) @n)
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %45, %0
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = icmp sle i32 %13, %14
  br i1 %15, label %17, label %16

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

17:                                               ; preds = %12
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [131073 x i32], ptr @a, i64 0, i64 %19
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %20)
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [131073 x i32], ptr @b, i64 0, i64 %22
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %23)
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #7
  %24 = getelementptr inbounds %struct.Node, ptr %3, i32 0, i32 0
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [131073 x i32], ptr @b, i64 0, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !5
  store i32 %28, ptr %24, align 4, !tbaa !9
  %29 = getelementptr inbounds %struct.Node, ptr %3, i32 0, i32 1
  %30 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %30, ptr %29, align 4, !tbaa !11
  %31 = getelementptr inbounds %struct.Node, ptr %3, i32 0, i32 2
  %32 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %32, ptr %31, align 4, !tbaa !12
  %33 = getelementptr inbounds %struct.Node, ptr %3, i32 0, i32 3
  %34 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %34, ptr %33, align 4, !tbaa !13
  %35 = getelementptr inbounds %struct.Node, ptr %3, i32 0, i32 4
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [131073 x i32], ptr @a, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  store i32 %39, ptr %35, align 4, !tbaa !14
  %40 = getelementptr inbounds %struct.Node, ptr %3, i32 0, i32 5
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [131073 x i32], ptr @a, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  store i32 %44, ptr %40, align 4, !tbaa !15
  call void @_ZNSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(24) %3)
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #7
  br label %45

45:                                               ; preds = %17
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %2, align 4, !tbaa !5
  br label %12, !llvm.loop !16

48:                                               ; preds = %16
  store i32 2000000001, ptr @b, align 16, !tbaa !5
  %49 = load i32, ptr @n, align 4, !tbaa !5
  %50 = call noundef i32 @_Z9seg_buildii(i32 noundef 1, i32 noundef %49)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %77, %48
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %53 = load i32, ptr @n, align 4, !tbaa !5
  %54 = icmp sle i32 %52, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %80

56:                                               ; preds = %51
  %57 = load i32, ptr %4, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [131073 x [5 x i32]], ptr @seq, i64 0, i64 %58
  %60 = getelementptr inbounds [5 x i32], ptr %59, i64 0, i64 0
  store i32 -1, ptr %60, align 4, !tbaa !5
  %61 = load i32, ptr %4, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [131073 x [5 x i32]], ptr @seq, i64 0, i64 %62
  %64 = getelementptr inbounds [5 x i32], ptr %63, i64 0, i64 1
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %64)
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [131073 x [5 x i32]], ptr @seq, i64 0, i64 %66
  %68 = getelementptr inbounds [5 x i32], ptr %67, i64 0, i64 2
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %68)
  %69 = load i32, ptr %4, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [131073 x [5 x i32]], ptr @seq, i64 0, i64 %70
  %72 = getelementptr inbounds [5 x i32], ptr %71, i64 0, i64 3
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %72)
  %73 = load i32, ptr %4, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [131073 x [5 x i32]], ptr @seq, i64 0, i64 %74
  %76 = getelementptr inbounds [5 x i32], ptr %75, i64 0, i64 4
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %76)
  br label %77

77:                                               ; preds = %56
  %78 = load i32, ptr %4, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %4, align 4, !tbaa !5
  br label %51, !llvm.loop !18

80:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %81

81:                                               ; preds = %314, %80
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = load i32, ptr @m, align 4, !tbaa !5
  %84 = icmp sle i32 %82, %83
  br i1 %84, label %86, label %85

85:                                               ; preds = %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %317

86:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #7
  %87 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNKSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 %87, i64 24, i1 false), !tbaa.struct !19
  call void @_ZNSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %88 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 0
  %89 = load i32, ptr %88, align 4, !tbaa !9
  store i32 %89, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %90 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 1
  %91 = load i32, ptr %90, align 4, !tbaa !11
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [131073 x [5 x i32]], ptr @seq, i64 0, i64 %92
  %94 = getelementptr inbounds [5 x i32], ptr %93, i64 0, i64 0
  %95 = load i32, ptr %94, align 4, !tbaa !5
  store i32 %95, ptr %8, align 4, !tbaa !5
  %96 = load i32, ptr %8, align 4, !tbaa !5
  %97 = icmp slt i32 %96, 0
  br i1 %97, label %98, label %130

98:                                               ; preds = %86
  %99 = load i32, ptr @n, align 4, !tbaa !5
  %100 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 1
  %101 = load i32, ptr %100, align 4, !tbaa !11
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [131073 x [5 x i32]], ptr @seq, i64 0, i64 %102
  %104 = getelementptr inbounds [5 x i32], ptr %103, i64 0, i64 1
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 1
  %107 = load i32, ptr %106, align 4, !tbaa !11
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [131073 x [5 x i32]], ptr @seq, i64 0, i64 %108
  %110 = getelementptr inbounds [5 x i32], ptr %109, i64 0, i64 2
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 1
  %113 = load i32, ptr %112, align 4, !tbaa !11
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [131073 x [5 x i32]], ptr @seq, i64 0, i64 %114
  %116 = getelementptr inbounds [5 x i32], ptr %115, i64 0, i64 3
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 1
  %119 = load i32, ptr %118, align 4, !tbaa !11
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [131073 x [5 x i32]], ptr @seq, i64 0, i64 %120
  %122 = getelementptr inbounds [5 x i32], ptr %121, i64 0, i64 4
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = call noundef i32 @_Z7seg_queiiiiii(i32 noundef 1, i32 noundef %99, i32 noundef %105, i32 noundef %111, i32 noundef %117, i32 noundef %123)
  %125 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 1
  %126 = load i32, ptr %125, align 4, !tbaa !11
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [131073 x [5 x i32]], ptr @seq, i64 0, i64 %127
  %129 = getelementptr inbounds [5 x i32], ptr %128, i64 0, i64 0
  store i32 %124, ptr %129, align 4, !tbaa !5
  store i32 %124, ptr %8, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %98, %86
  %131 = load i32, ptr %8, align 4, !tbaa !5
  %132 = icmp ne i32 %131, 0
  br i1 %132, label %133, label %181

133:                                              ; preds = %130
  %134 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 0
  %135 = load i32, ptr %134, align 4, !tbaa !9
  %136 = load i32, ptr %8, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [131073 x i32], ptr @b, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = add nsw i32 %135, %139
  %141 = icmp slt i32 %140, 2000000001
  br i1 %141, label %142, label %181

142:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #7
  %143 = getelementptr inbounds %struct.Node, ptr %9, i32 0, i32 0
  %144 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 0
  %145 = load i32, ptr %144, align 4, !tbaa !9
  %146 = load i32, ptr %8, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [131073 x i32], ptr @b, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = add nsw i32 %145, %149
  store i32 %150, ptr %143, align 4, !tbaa !9
  %151 = getelementptr inbounds %struct.Node, ptr %9, i32 0, i32 1
  %152 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %152, ptr %151, align 4, !tbaa !11
  %153 = getelementptr inbounds %struct.Node, ptr %9, i32 0, i32 2
  %154 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 1
  %155 = load i32, ptr %154, align 4, !tbaa !11
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [131073 x [5 x i32]], ptr @seq, i64 0, i64 %156
  %158 = getelementptr inbounds [5 x i32], ptr %157, i64 0, i64 1
  %159 = load i32, ptr %158, align 4, !tbaa !5
  store i32 %159, ptr %153, align 4, !tbaa !12
  %160 = getelementptr inbounds %struct.Node, ptr %9, i32 0, i32 3
  %161 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 1
  %162 = load i32, ptr %161, align 4, !tbaa !11
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [131073 x [5 x i32]], ptr @seq, i64 0, i64 %163
  %165 = getelementptr inbounds [5 x i32], ptr %164, i64 0, i64 2
  %166 = load i32, ptr %165, align 4, !tbaa !5
  store i32 %166, ptr %160, align 4, !tbaa !13
  %167 = getelementptr inbounds %struct.Node, ptr %9, i32 0, i32 4
  %168 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 1
  %169 = load i32, ptr %168, align 4, !tbaa !11
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [131073 x [5 x i32]], ptr @seq, i64 0, i64 %170
  %172 = getelementptr inbounds [5 x i32], ptr %171, i64 0, i64 3
  %173 = load i32, ptr %172, align 4, !tbaa !5
  store i32 %173, ptr %167, align 4, !tbaa !14
  %174 = getelementptr inbounds %struct.Node, ptr %9, i32 0, i32 5
  %175 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 1
  %176 = load i32, ptr %175, align 4, !tbaa !11
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [131073 x [5 x i32]], ptr @seq, i64 0, i64 %177
  %179 = getelementptr inbounds [5 x i32], ptr %178, i64 0, i64 4
  %180 = load i32, ptr %179, align 4, !tbaa !5
  store i32 %180, ptr %174, align 4, !tbaa !15
  call void @_ZNSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(24) %9)
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #7
  br label %181

181:                                              ; preds = %142, %133, %130
  %182 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 2
  %183 = load i32, ptr %182, align 4, !tbaa !12
  %184 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 1
  %185 = load i32, ptr %184, align 4, !tbaa !11
  %186 = icmp slt i32 %183, %185
  br i1 %186, label %187, label %247

187:                                              ; preds = %181
  %188 = load i32, ptr @n, align 4, !tbaa !5
  %189 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 2
  %190 = load i32, ptr %189, align 4, !tbaa !12
  %191 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 1
  %192 = load i32, ptr %191, align 4, !tbaa !11
  %193 = sub nsw i32 %192, 1
  %194 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 4
  %195 = load i32, ptr %194, align 4, !tbaa !14
  %196 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 5
  %197 = load i32, ptr %196, align 4, !tbaa !15
  %198 = call noundef i32 @_Z7seg_queiiiiii(i32 noundef 1, i32 noundef %188, i32 noundef %190, i32 noundef %193, i32 noundef %195, i32 noundef %197)
  store i32 %198, ptr %8, align 4, !tbaa !5
  %199 = load i32, ptr %8, align 4, !tbaa !5
  %200 = icmp ne i32 %199, 0
  br i1 %200, label %201, label %246

201:                                              ; preds = %187
  %202 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 0
  %203 = load i32, ptr %202, align 4, !tbaa !9
  %204 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 1
  %205 = load i32, ptr %204, align 4, !tbaa !11
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [131073 x i32], ptr @b, i64 0, i64 %206
  %208 = load i32, ptr %207, align 4, !tbaa !5
  %209 = sub nsw i32 %203, %208
  %210 = load i32, ptr %8, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [131073 x i32], ptr @b, i64 0, i64 %211
  %213 = load i32, ptr %212, align 4, !tbaa !5
  %214 = add nsw i32 %209, %213
  %215 = icmp slt i32 %214, 2000000001
  br i1 %215, label %216, label %246

216:                                              ; preds = %201
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #7
  %217 = getelementptr inbounds %struct.Node, ptr %10, i32 0, i32 0
  %218 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 0
  %219 = load i32, ptr %218, align 4, !tbaa !9
  %220 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 1
  %221 = load i32, ptr %220, align 4, !tbaa !11
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [131073 x i32], ptr @b, i64 0, i64 %222
  %224 = load i32, ptr %223, align 4, !tbaa !5
  %225 = sub nsw i32 %219, %224
  %226 = load i32, ptr %8, align 4, !tbaa !5
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [131073 x i32], ptr @b, i64 0, i64 %227
  %229 = load i32, ptr %228, align 4, !tbaa !5
  %230 = add nsw i32 %225, %229
  store i32 %230, ptr %217, align 4, !tbaa !9
  %231 = getelementptr inbounds %struct.Node, ptr %10, i32 0, i32 1
  %232 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %232, ptr %231, align 4, !tbaa !11
  %233 = getelementptr inbounds %struct.Node, ptr %10, i32 0, i32 2
  %234 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 2
  %235 = load i32, ptr %234, align 4, !tbaa !12
  store i32 %235, ptr %233, align 4, !tbaa !12
  %236 = getelementptr inbounds %struct.Node, ptr %10, i32 0, i32 3
  %237 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 1
  %238 = load i32, ptr %237, align 4, !tbaa !11
  %239 = sub nsw i32 %238, 1
  store i32 %239, ptr %236, align 4, !tbaa !13
  %240 = getelementptr inbounds %struct.Node, ptr %10, i32 0, i32 4
  %241 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 4
  %242 = load i32, ptr %241, align 4, !tbaa !14
  store i32 %242, ptr %240, align 4, !tbaa !14
  %243 = getelementptr inbounds %struct.Node, ptr %10, i32 0, i32 5
  %244 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 5
  %245 = load i32, ptr %244, align 4, !tbaa !15
  store i32 %245, ptr %243, align 4, !tbaa !15
  call void @_ZNSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(24) %10)
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #7
  br label %246

246:                                              ; preds = %216, %201, %187
  br label %247

247:                                              ; preds = %246, %181
  %248 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 1
  %249 = load i32, ptr %248, align 4, !tbaa !11
  %250 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 3
  %251 = load i32, ptr %250, align 4, !tbaa !13
  %252 = icmp slt i32 %249, %251
  br i1 %252, label %253, label %313

253:                                              ; preds = %247
  %254 = load i32, ptr @n, align 4, !tbaa !5
  %255 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 1
  %256 = load i32, ptr %255, align 4, !tbaa !11
  %257 = add nsw i32 %256, 1
  %258 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 3
  %259 = load i32, ptr %258, align 4, !tbaa !13
  %260 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 4
  %261 = load i32, ptr %260, align 4, !tbaa !14
  %262 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 5
  %263 = load i32, ptr %262, align 4, !tbaa !15
  %264 = call noundef i32 @_Z7seg_queiiiiii(i32 noundef 1, i32 noundef %254, i32 noundef %257, i32 noundef %259, i32 noundef %261, i32 noundef %263)
  store i32 %264, ptr %8, align 4, !tbaa !5
  %265 = load i32, ptr %8, align 4, !tbaa !5
  %266 = icmp ne i32 %265, 0
  br i1 %266, label %267, label %312

267:                                              ; preds = %253
  %268 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 0
  %269 = load i32, ptr %268, align 4, !tbaa !9
  %270 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 1
  %271 = load i32, ptr %270, align 4, !tbaa !11
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds [131073 x i32], ptr @b, i64 0, i64 %272
  %274 = load i32, ptr %273, align 4, !tbaa !5
  %275 = sub nsw i32 %269, %274
  %276 = load i32, ptr %8, align 4, !tbaa !5
  %277 = sext i32 %276 to i64
  %278 = getelementptr inbounds [131073 x i32], ptr @b, i64 0, i64 %277
  %279 = load i32, ptr %278, align 4, !tbaa !5
  %280 = add nsw i32 %275, %279
  %281 = icmp slt i32 %280, 2000000001
  br i1 %281, label %282, label %312

282:                                              ; preds = %267
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #7
  %283 = getelementptr inbounds %struct.Node, ptr %11, i32 0, i32 0
  %284 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 0
  %285 = load i32, ptr %284, align 4, !tbaa !9
  %286 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 1
  %287 = load i32, ptr %286, align 4, !tbaa !11
  %288 = sext i32 %287 to i64
  %289 = getelementptr inbounds [131073 x i32], ptr @b, i64 0, i64 %288
  %290 = load i32, ptr %289, align 4, !tbaa !5
  %291 = sub nsw i32 %285, %290
  %292 = load i32, ptr %8, align 4, !tbaa !5
  %293 = sext i32 %292 to i64
  %294 = getelementptr inbounds [131073 x i32], ptr @b, i64 0, i64 %293
  %295 = load i32, ptr %294, align 4, !tbaa !5
  %296 = add nsw i32 %291, %295
  store i32 %296, ptr %283, align 4, !tbaa !9
  %297 = getelementptr inbounds %struct.Node, ptr %11, i32 0, i32 1
  %298 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %298, ptr %297, align 4, !tbaa !11
  %299 = getelementptr inbounds %struct.Node, ptr %11, i32 0, i32 2
  %300 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 1
  %301 = load i32, ptr %300, align 4, !tbaa !11
  %302 = add nsw i32 %301, 1
  store i32 %302, ptr %299, align 4, !tbaa !12
  %303 = getelementptr inbounds %struct.Node, ptr %11, i32 0, i32 3
  %304 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 3
  %305 = load i32, ptr %304, align 4, !tbaa !13
  store i32 %305, ptr %303, align 4, !tbaa !13
  %306 = getelementptr inbounds %struct.Node, ptr %11, i32 0, i32 4
  %307 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 4
  %308 = load i32, ptr %307, align 4, !tbaa !14
  store i32 %308, ptr %306, align 4, !tbaa !14
  %309 = getelementptr inbounds %struct.Node, ptr %11, i32 0, i32 5
  %310 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 5
  %311 = load i32, ptr %310, align 4, !tbaa !15
  store i32 %311, ptr %309, align 4, !tbaa !15
  call void @_ZNSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(24) %11)
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #7
  br label %312

312:                                              ; preds = %282, %267, %253
  br label %313

313:                                              ; preds = %312, %247
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #7
  br label %314

314:                                              ; preds = %313
  %315 = load i32, ptr %6, align 4, !tbaa !5
  %316 = add nsw i32 %315, 1
  store i32 %316, ptr %6, align 4, !tbaa !5
  br label %81, !llvm.loop !20

317:                                              ; preds = %85
  %318 = load i32, ptr %5, align 4, !tbaa !5
  %319 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %318)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  ret i32 0
}

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z9seg_buildii(i32 noundef, i32 noundef) #1

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z7seg_queiiiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #1

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

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

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

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


; 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::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<Node, std::allocator<Node>>::_Vector_impl" }
%"struct.std::_Vector_base<Node, std::allocator<Node>>::_Vector_impl" = type { %"struct.std::_Vector_base<Node, std::allocator<Node>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Node, std::allocator<Node>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Node = type { i32, i32, i32, i32, i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global [131073 x i32], align 16
@b = external dso_local global [131073 x i32], align 16
@seq = external dso_local global [131073 x [5 x i32]], align 16
@Q = external dso_local global %"class.std::priority_queue", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca %struct.Node, align 4
  %2 = alloca %struct.Node, align 4
  %3 = alloca %struct.Node, align 4
  %4 = alloca %struct.Node, align 4
  tail call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) @n)
  tail call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) @m)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %.not80 = icmp slt i32 %5, 1
  br i1 %.not80, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0
  %6 = getelementptr inbounds i8, ptr %1, i64 4
  %7 = getelementptr inbounds i8, ptr %1, i64 8
  %8 = getelementptr inbounds i8, ptr %1, i64 12
  %9 = getelementptr inbounds i8, ptr %1, i64 16
  %10 = getelementptr inbounds i8, ptr %1, i64 20
  br label %13

._crit_edge:                                      ; preds = %13, %0
  %.lcssa = phi i32 [ %5, %0 ], [ %19, %13 ]
  store i32 2000000001, ptr @b, align 16, !tbaa !5
  %11 = call noundef i32 @_Z9seg_buildii(i32 noundef 1, i32 noundef %.lcssa)
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %.not7582 = icmp slt i32 %12, 1
  br i1 %.not7582, label %.preheader, label %.lr.ph85

13:                                               ; preds = %.lr.ph, %13
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %13 ]
  %14 = getelementptr inbounds [131073 x i32], ptr @a, i64 0, i64 %indvars.iv
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %14)
  %15 = getelementptr inbounds [131073 x i32], ptr @b, i64 0, i64 %indvars.iv
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %15)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #6
  %16 = load i32, ptr %15, align 4, !tbaa !5
  store i32 %16, ptr %1, align 4, !tbaa !9
  %17 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %17, ptr %6, align 4, !tbaa !11
  store i32 %17, ptr %7, align 4, !tbaa !12
  store i32 %17, ptr %8, align 4, !tbaa !13
  %18 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %18, ptr %9, align 4, !tbaa !14
  store i32 %18, ptr %10, align 4, !tbaa !15
  call void @_ZNSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(24) %1)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %.not.not = icmp slt i64 %indvars.iv, %20
  br i1 %.not.not, label %13, label %._crit_edge, !llvm.loop !16

.preheader:                                       ; preds = %.lr.ph85, %._crit_edge
  %21 = load i32, ptr @m, align 4, !tbaa !5
  %.not7686 = icmp slt i32 %21, 1
  br i1 %.not7686, label %._crit_edge89, label %.lr.ph88

.lr.ph88:                                         ; preds = %.preheader
  %22 = getelementptr inbounds i8, ptr %2, i64 4
  %23 = getelementptr inbounds i8, ptr %2, i64 8
  %24 = getelementptr inbounds i8, ptr %3, i64 4
  %25 = getelementptr inbounds i8, ptr %3, i64 8
  %26 = getelementptr inbounds i8, ptr %3, i64 12
  %27 = getelementptr inbounds i8, ptr %3, i64 16
  %28 = getelementptr inbounds i8, ptr %3, i64 20
  %29 = getelementptr inbounds i8, ptr %4, i64 4
  %30 = getelementptr inbounds i8, ptr %4, i64 8
  %31 = getelementptr inbounds i8, ptr %4, i64 12
  %32 = getelementptr inbounds i8, ptr %4, i64 16
  %33 = getelementptr inbounds i8, ptr %4, i64 20
  br label %42

.lr.ph85:                                         ; preds = %._crit_edge, %.lr.ph85
  %indvars.iv93 = phi i64 [ %indvars.iv.next94, %.lr.ph85 ], [ 1, %._crit_edge ]
  %34 = getelementptr inbounds [131073 x [5 x i32]], ptr @seq, i64 0, i64 %indvars.iv93
  store i32 -1, ptr %34, align 4, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %34, i64 4
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %35)
  %36 = getelementptr inbounds i8, ptr %34, i64 8
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %36)
  %37 = getelementptr inbounds i8, ptr %34, i64 12
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %37)
  %38 = getelementptr inbounds i8, ptr %34, i64 16
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %38)
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %39 = load i32, ptr @n, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %.not75.not = icmp slt i64 %indvars.iv93, %40
  br i1 %.not75.not, label %.lr.ph85, label %.preheader, !llvm.loop !18

._crit_edge89:                                    ; preds = %101, %.preheader
  %.070.lcssa = phi i32 [ 0, %.preheader ], [ %.sroa.0.0.copyload, %101 ]
  %41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.070.lcssa)
  ret i32 0

42:                                               ; preds = %.lr.ph88, %101
  %.07187 = phi i32 [ 1, %.lr.ph88 ], [ %102, %101 ]
  %43 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNKSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %.sroa.0.0.copyload = load i32, ptr %43, align 4, !tbaa !5
  %.sroa.10.0..sroa_idx = getelementptr inbounds i8, ptr %43, i64 4
  %.sroa.10.0.copyload = load i32, ptr %.sroa.10.0..sroa_idx, align 4, !tbaa !5
  %.sroa.30.0..sroa_idx = getelementptr inbounds i8, ptr %43, i64 8
  %.sroa.30.0.copyload = load i32, ptr %.sroa.30.0..sroa_idx, align 4, !tbaa !5
  %.sroa.33.0..sroa_idx = getelementptr inbounds i8, ptr %43, i64 12
  %.sroa.33.0.copyload = load i32, ptr %.sroa.33.0..sroa_idx, align 4, !tbaa !5
  %.sroa.36.0..sroa_idx = getelementptr inbounds i8, ptr %43, i64 16
  %.sroa.36.0.copyload = load i32, ptr %.sroa.36.0..sroa_idx, align 4, !tbaa !5
  %.sroa.40.0..sroa_idx = getelementptr inbounds i8, ptr %43, i64 20
  %.sroa.40.0.copyload = load i32, ptr %.sroa.40.0..sroa_idx, align 4, !tbaa !5
  call void @_ZNSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %44 = sext i32 %.sroa.10.0.copyload to i64
  %45 = getelementptr inbounds [131073 x [5 x i32]], ptr @seq, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = icmp slt i32 %46, 0
  br i1 %47, label %48, label %59

48:                                               ; preds = %42
  %49 = load i32, ptr @n, align 4, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %45, i64 4
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = getelementptr inbounds i8, ptr %45, i64 8
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %45, i64 12
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = getelementptr inbounds i8, ptr %45, i64 16
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = call noundef i32 @_Z7seg_queiiiiii(i32 noundef 1, i32 noundef %49, i32 noundef %51, i32 noundef %53, i32 noundef %55, i32 noundef %57)
  store i32 %58, ptr %45, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %48, %42
  %.0 = phi i32 [ %58, %48 ], [ %46, %42 ]
  %.not77 = icmp eq i32 %.0, 0
  br i1 %.not77, label %69, label %60

60:                                               ; preds = %59
  %61 = sext i32 %.0 to i64
  %62 = getelementptr inbounds [131073 x i32], ptr @b, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = add nsw i32 %63, %.sroa.0.0.copyload
  %65 = icmp slt i32 %64, 2000000001
  br i1 %65, label %66, label %69

66:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #6
  store i32 %64, ptr %2, align 4, !tbaa !9
  store i32 %.0, ptr %22, align 4, !tbaa !11
  %67 = getelementptr inbounds i8, ptr %45, i64 4
  %68 = load <4 x i32>, ptr %67, align 4, !tbaa !5
  store <4 x i32> %68, ptr %23, align 4, !tbaa !5
  call void @_ZNSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(24) %2)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  br label %69

69:                                               ; preds = %66, %60, %59
  %70 = icmp slt i32 %.sroa.30.0.copyload, %.sroa.10.0.copyload
  br i1 %70, label %71, label %85

71:                                               ; preds = %69
  %72 = load i32, ptr @n, align 4, !tbaa !5
  %73 = add nsw i32 %.sroa.10.0.copyload, -1
  %74 = call noundef i32 @_Z7seg_queiiiiii(i32 noundef 1, i32 noundef %72, i32 noundef %.sroa.30.0.copyload, i32 noundef %73, i32 noundef %.sroa.36.0.copyload, i32 noundef %.sroa.40.0.copyload)
  %.not78 = icmp eq i32 %74, 0
  br i1 %.not78, label %85, label %75

75:                                               ; preds = %71
  %76 = getelementptr inbounds [131073 x i32], ptr @b, i64 0, i64 %44
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = sub nsw i32 %.sroa.0.0.copyload, %77
  %79 = sext i32 %74 to i64
  %80 = getelementptr inbounds [131073 x i32], ptr @b, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = add nsw i32 %78, %81
  %83 = icmp slt i32 %82, 2000000001
  br i1 %83, label %84, label %85

84:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  store i32 %82, ptr %3, align 4, !tbaa !9
  store i32 %74, ptr %24, align 4, !tbaa !11
  store i32 %.sroa.30.0.copyload, ptr %25, align 4, !tbaa !12
  store i32 %73, ptr %26, align 4, !tbaa !13
  store i32 %.sroa.36.0.copyload, ptr %27, align 4, !tbaa !14
  store i32 %.sroa.40.0.copyload, ptr %28, align 4, !tbaa !15
  call void @_ZNSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(24) %3)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  br label %85

85:                                               ; preds = %71, %75, %84, %69
  %86 = icmp slt i32 %.sroa.10.0.copyload, %.sroa.33.0.copyload
  br i1 %86, label %87, label %101

87:                                               ; preds = %85
  %88 = load i32, ptr @n, align 4, !tbaa !5
  %89 = add nsw i32 %.sroa.10.0.copyload, 1
  %90 = call noundef i32 @_Z7seg_queiiiiii(i32 noundef 1, i32 noundef %88, i32 noundef %89, i32 noundef %.sroa.33.0.copyload, i32 noundef %.sroa.36.0.copyload, i32 noundef %.sroa.40.0.copyload)
  %.not79 = icmp eq i32 %90, 0
  br i1 %.not79, label %101, label %91

91:                                               ; preds = %87
  %92 = getelementptr inbounds [131073 x i32], ptr @b, i64 0, i64 %44
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = sub nsw i32 %.sroa.0.0.copyload, %93
  %95 = sext i32 %90 to i64
  %96 = getelementptr inbounds [131073 x i32], ptr @b, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = add nsw i32 %94, %97
  %99 = icmp slt i32 %98, 2000000001
  br i1 %99, label %100, label %101

100:                                              ; preds = %91
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #6
  store i32 %98, ptr %4, align 4, !tbaa !9
  store i32 %90, ptr %29, align 4, !tbaa !11
  store i32 %89, ptr %30, align 4, !tbaa !12
  store i32 %.sroa.33.0.copyload, ptr %31, align 4, !tbaa !13
  store i32 %.sroa.36.0.copyload, ptr %32, align 4, !tbaa !14
  store i32 %.sroa.40.0.copyload, ptr %33, align 4, !tbaa !15
  call void @_ZNSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(24) %4)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  br label %101

101:                                              ; preds = %87, %91, %100, %85
  %102 = add nuw nsw i32 %.07187, 1
  %103 = load i32, ptr @m, align 4, !tbaa !5
  %.not76.not = icmp slt i32 %.07187, %103
  br i1 %.not76.not, label %42, label %._crit_edge89, !llvm.loop !19
}

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z9seg_buildii(i32 noundef, i32 noundef) local_unnamed_addr #1

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z7seg_queiiiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

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

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 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 = { 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 #6 = { nounwind }

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

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


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