; LLVM IR from tangjz/acm-icpc :: codeforces/gym (104022K)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<Node, std::allocator<Node>>::_Deque_impl" }
%"struct.std::_Deque_base<Node, std::allocator<Node>>::_Deque_impl" = type { %"struct.std::_Deque_base<Node, std::allocator<Node>>::_Deque_impl_data" }
%"struct.std::_Deque_base<Node, std::allocator<Node>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%struct.Node = type { i32, i32, i32, i32 }
%"class.std::queue.0" = type { %"class.std::deque.1" }
%"class.std::deque.1" = type { %"class.std::_Deque_base.2" }
%"class.std::_Deque_base.2" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.6", %"struct.std::_Deque_iterator.6" }
%"struct.std::_Deque_iterator.6" = type { ptr, ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@__dso_handle = external hidden global i8
@_ZZ4mainE3buf = external hidden global [10100003 x i8], align 16
@_ZZ4mainE3sta = external hidden global [100001 x ptr], align 16
@_ZZ4mainE3tot = external hidden global i32, align 4
@_ZZ4mainE3idx = external hidden global [257 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ4mainE3ord = external hidden global [100001 x i32], align 16
@_ZZ4mainE3ans = external hidden global [100001 x i32], align 16
@_ZZ4mainE2st = external hidden global i32, align 4
@_ZZ4mainE3tim = external hidden global [258 x i32], align 16
@_ZZ4mainE3bkt = external hidden global [258 x %"class.std::vector"], align 16
@_ZGVZ4mainE3bkt = external hidden global i64, align 8
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: nounwind
declare i32 @__cxa_atexit(ptr, ptr, ptr) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::queue", align 8
  %9 = alloca %struct.Node, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %struct.Node, align 4
  %13 = alloca i8, align 1
  %14 = alloca i8, align 1
  %15 = alloca i32, align 4
  %16 = alloca %"class.std::queue.0", align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %"class.std::vector", align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %25 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %26 = alloca i32, align 4
  %27 = alloca %struct.Node, align 4
  %28 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #0
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  store ptr @_ZZ4mainE3buf, ptr @_ZZ4mainE3sta, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #0
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %30

30:                                               ; preds = %90, %0
  %31 = load i32, ptr %3, align 4, !tbaa !9
  %32 = load i32, ptr %2, align 4, !tbaa !9
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #0
  br label %93

35:                                               ; preds = %30
  %36 = load i32, ptr %3, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [100001 x ptr], ptr @_ZZ4mainE3sta, i64 0, i64 %37
  %39 = load ptr, ptr %38, align 8, !tbaa !5
  %40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %39)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #0
  %41 = load i32, ptr %3, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [100001 x ptr], ptr @_ZZ4mainE3sta, i64 0, i64 %42
  %44 = load ptr, ptr %43, align 8, !tbaa !5
  %45 = call i64 @strlen(ptr noundef %44) #11
  %46 = trunc i64 %45 to i32
  store i32 %46, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #0
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %47

47:                                               ; preds = %74, %35
  %48 = load i32, ptr %6, align 4, !tbaa !9
  %49 = load i32, ptr %5, align 4, !tbaa !9
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %47
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #0
  br label %77

52:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #0
  %53 = load i32, ptr %3, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [100001 x ptr], ptr @_ZZ4mainE3sta, i64 0, i64 %54
  %56 = load ptr, ptr %55, align 8, !tbaa !5
  %57 = load i32, ptr %6, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds i8, ptr %56, i64 %58
  %60 = load i8, ptr %59, align 1, !tbaa !11
  %61 = sext i8 %60 to i32
  store i32 %61, ptr %7, align 4, !tbaa !9
  %62 = load i32, ptr %7, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [257 x i32], ptr @_ZZ4mainE3idx, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !9
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %73, label %67

67:                                               ; preds = %52
  %68 = load i32, ptr @_ZZ4mainE3tot, align 4, !tbaa !9
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr @_ZZ4mainE3tot, align 4, !tbaa !9
  %70 = load i32, ptr %7, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [257 x i32], ptr @_ZZ4mainE3idx, i64 0, i64 %71
  store i32 %69, ptr %72, align 4, !tbaa !9
  br label %73

73:                                               ; preds = %67, %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #0
  br label %74

74:                                               ; preds = %73
  %75 = load i32, ptr %6, align 4, !tbaa !9
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %6, align 4, !tbaa !9
  br label %47, !llvm.loop !12

77:                                               ; preds = %51
  %78 = load i32, ptr %3, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [100001 x ptr], ptr @_ZZ4mainE3sta, i64 0, i64 %79
  %81 = load ptr, ptr %80, align 8, !tbaa !5
  %82 = load i32, ptr %5, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds i8, ptr %81, i64 %83
  %85 = getelementptr inbounds i8, ptr %84, i64 1
  %86 = load i32, ptr %3, align 4, !tbaa !9
  %87 = add nsw i32 %86, 1
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [100001 x ptr], ptr @_ZZ4mainE3sta, i64 0, i64 %88
  store ptr %85, ptr %89, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #0
  br label %90

90:                                               ; preds = %77
  %91 = load i32, ptr %3, align 4, !tbaa !9
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %3, align 4, !tbaa !9
  br label %30, !llvm.loop !14

93:                                               ; preds = %34
  %94 = load i32, ptr %2, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i32, ptr @_ZZ4mainE3ord, i64 %95
  call void @_ZSt4iotaIPiiEvT_S1_T0_(ptr noundef @_ZZ4mainE3ord, ptr noundef %96, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 80, ptr %8) #0
  call void @_ZNSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #0
  %97 = getelementptr inbounds %struct.Node, ptr %9, i32 0, i32 0
  store i32 0, ptr %97, align 4, !tbaa !15
  %98 = getelementptr inbounds %struct.Node, ptr %9, i32 0, i32 1
  store i32 0, ptr %98, align 4, !tbaa !17
  %99 = getelementptr inbounds %struct.Node, ptr %9, i32 0, i32 2
  %100 = load i32, ptr %2, align 4, !tbaa !9
  store i32 %100, ptr %99, align 4, !tbaa !18
  %101 = getelementptr inbounds %struct.Node, ptr %9, i32 0, i32 3
  %102 = load i32, ptr %2, align 4, !tbaa !9
  store i32 %102, ptr %101, align 4, !tbaa !19
  invoke void @_ZNSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 4 dereferenceable(16) %9)
          to label %103 unwind label %135

103:                                              ; preds = %93
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #0
  br label %104

104:                                              ; preds = %369, %103
  %105 = invoke noundef zeroext i1 @_ZNKSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %106 unwind label %139

106:                                              ; preds = %104
  %107 = xor i1 %105, true
  br i1 %107, label %108, label %373

108:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #0
  %109 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZNSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %110 unwind label %143

110:                                              ; preds = %108
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %109, i64 16, i1 false), !tbaa.struct !20
  invoke void @_ZNSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %111 unwind label %143

111:                                              ; preds = %110
  %112 = getelementptr inbounds %struct.Node, ptr %12, i32 0, i32 3
  %113 = load i32, ptr %112, align 4, !tbaa !19
  %114 = load i32, ptr %2, align 4, !tbaa !9
  %115 = icmp slt i32 %113, %114
  br i1 %115, label %116, label %201

116:                                              ; preds = %111
  br label %117

117:                                              ; preds = %199, %116
  br label %118

118:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #0
  store i8 1, ptr %13, align 1, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #0
  %119 = getelementptr inbounds %struct.Node, ptr %12, i32 0, i32 1
  %120 = load i32, ptr %119, align 4, !tbaa !17
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [100001 x i32], ptr @_ZZ4mainE3ord, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !9
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [100001 x ptr], ptr @_ZZ4mainE3sta, i64 0, i64 %124
  %126 = load ptr, ptr %125, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.Node, ptr %12, i32 0, i32 0
  %128 = load i32, ptr %127, align 4, !tbaa !15
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds i8, ptr %126, i64 %129
  %131 = load i8, ptr %130, align 1, !tbaa !11
  store i8 %131, ptr %14, align 1, !tbaa !11
  %132 = load i8, ptr %14, align 1, !tbaa !11
  %133 = icmp ne i8 %132, 0
  br i1 %133, label %147, label %134

134:                                              ; preds = %118
  store i32 11, ptr %4, align 4
  br label %197

135:                                              ; preds = %93
  %136 = landingpad { ptr, i32 }
          cleanup
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %10, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #0
  br label %405

139:                                              ; preds = %104
  %140 = landingpad { ptr, i32 }
          cleanup
  %141 = extractvalue { ptr, i32 } %140, 0
  store ptr %141, ptr %10, align 8
  %142 = extractvalue { ptr, i32 } %140, 1
  store i32 %142, ptr %11, align 4
  br label %405

143:                                              ; preds = %110, %108
  %144 = landingpad { ptr, i32 }
          cleanup
  %145 = extractvalue { ptr, i32 } %144, 0
  store ptr %145, ptr %10, align 8
  %146 = extractvalue { ptr, i32 } %144, 1
  store i32 %146, ptr %11, align 4
  br label %372

147:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #0
  %148 = getelementptr inbounds %struct.Node, ptr %12, i32 0, i32 1
  %149 = load i32, ptr %148, align 4, !tbaa !17
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %15, align 4, !tbaa !9
  br label %151

151:                                              ; preds = %186, %147
  %152 = load i8, ptr %13, align 1, !tbaa !21, !range !23, !noundef !24
  %153 = trunc i8 %152 to i1
  br i1 %153, label %154, label %159

154:                                              ; preds = %151
  %155 = load i32, ptr %15, align 4, !tbaa !9
  %156 = getelementptr inbounds %struct.Node, ptr %12, i32 0, i32 2
  %157 = load i32, ptr %156, align 4, !tbaa !18
  %158 = icmp slt i32 %155, %157
  br label %159

159:                                              ; preds = %154, %151
  %160 = phi i1 [ false, %151 ], [ %158, %154 ]
  br i1 %160, label %162, label %161

161:                                              ; preds = %159
  store i32 12, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #0
  br label %189

162:                                              ; preds = %159
  %163 = load i32, ptr %15, align 4, !tbaa !9
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [100001 x i32], ptr @_ZZ4mainE3ord, i64 0, i64 %164
  %166 = load i32, ptr %165, align 4, !tbaa !9
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [100001 x ptr], ptr @_ZZ4mainE3sta, i64 0, i64 %167
  %169 = load ptr, ptr %168, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.Node, ptr %12, i32 0, i32 0
  %171 = load i32, ptr %170, align 4, !tbaa !15
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds i8, ptr %169, i64 %172
  %174 = load i8, ptr %173, align 1, !tbaa !11
  %175 = sext i8 %174 to i32
  %176 = load i8, ptr %14, align 1, !tbaa !11
  %177 = sext i8 %176 to i32
  %178 = icmp eq i32 %175, %177
  %179 = zext i1 %178 to i32
  %180 = load i8, ptr %13, align 1, !tbaa !21, !range !23, !noundef !24
  %181 = trunc i8 %180 to i1
  %182 = zext i1 %181 to i32
  %183 = and i32 %182, %179
  %184 = icmp ne i32 %183, 0
  %185 = zext i1 %184 to i8
  store i8 %185, ptr %13, align 1, !tbaa !21
  br label %186

186:                                              ; preds = %162
  %187 = load i32, ptr %15, align 4, !tbaa !9
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %15, align 4, !tbaa !9
  br label %151, !llvm.loop !25

189:                                              ; preds = %161
  %190 = load i8, ptr %13, align 1, !tbaa !21, !range !23, !noundef !24
  %191 = trunc i8 %190 to i1
  br i1 %191, label %193, label %192

192:                                              ; preds = %189
  store i32 11, ptr %4, align 4
  br label %197

193:                                              ; preds = %189
  %194 = getelementptr inbounds %struct.Node, ptr %12, i32 0, i32 0
  %195 = load i32, ptr %194, align 4, !tbaa !15
  %196 = add nsw i32 %195, 1
  store i32 %196, ptr %194, align 4, !tbaa !15
  store i32 0, ptr %4, align 4
  br label %197

197:                                              ; preds = %193, %192, %134
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #0
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #0
  %198 = load i32, ptr %4, align 4
  switch i32 %198, label %411 [
    i32 0, label %199
    i32 11, label %200
  ]

199:                                              ; preds = %197
  br label %117, !llvm.loop !26

200:                                              ; preds = %197
  br label %201

201:                                              ; preds = %200, %111
  call void @llvm.lifetime.start.p0(i64 80, ptr %16) #0
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
          to label %202 unwind label %222

202:                                              ; preds = %201
  %203 = load atomic i8, ptr @_ZGVZ4mainE3bkt acquire, align 8
  %204 = icmp eq i8 %203, 0
  br i1 %204, label %205, label %215, !prof !27

205:                                              ; preds = %202
  %206 = call i32 @__cxa_guard_acquire(ptr @_ZGVZ4mainE3bkt) #0
  %207 = icmp ne i32 %206, 0
  br i1 %207, label %208, label %215

208:                                              ; preds = %205
  br label %209

209:                                              ; preds = %209, %208
  %210 = phi ptr [ @_ZZ4mainE3bkt, %208 ], [ %211, %209 ]
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %210) #0
  %211 = getelementptr inbounds %"class.std::vector", ptr %210, i64 1
  %212 = icmp eq ptr %211, getelementptr inbounds (%"class.std::vector", ptr @_ZZ4mainE3bkt, i64 258)
  br i1 %212, label %213, label %209

213:                                              ; preds = %209
  %214 = call i32 @__cxa_atexit(ptr @__cxx_global_array_dtor, ptr null, ptr @__dso_handle) #0
  call void @__cxa_guard_release(ptr @_ZGVZ4mainE3bkt) #0
  br label %215

215:                                              ; preds = %213, %205, %202
  %216 = load i32, ptr @_ZZ4mainE2st, align 4, !tbaa !9
  %217 = add nsw i32 %216, 1
  store i32 %217, ptr @_ZZ4mainE2st, align 4, !tbaa !9
  %218 = icmp ne i32 %217, 0
  br i1 %218, label %226, label %219

219:                                              ; preds = %215
  call void @llvm.memset.p0.i64(ptr align 16 @_ZZ4mainE3tim, i8 0, i64 1032, i1 false)
  %220 = load i32, ptr @_ZZ4mainE2st, align 4, !tbaa !9
  %221 = add nsw i32 %220, 1
  store i32 %221, ptr @_ZZ4mainE2st, align 4, !tbaa !9
  br label %226

222:                                              ; preds = %201
  %223 = landingpad { ptr, i32 }
          cleanup
  %224 = extractvalue { ptr, i32 } %223, 0
  store ptr %224, ptr %10, align 8
  %225 = extractvalue { ptr, i32 } %223, 1
  store i32 %225, ptr %11, align 4
  br label %371

226:                                              ; preds = %219, %215
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #0
  %227 = getelementptr inbounds %struct.Node, ptr %12, i32 0, i32 1
  %228 = load i32, ptr %227, align 4, !tbaa !17
  store i32 %228, ptr %17, align 4, !tbaa !9
  br label %229

229:                                              ; preds = %286, %226
  %230 = load i32, ptr %17, align 4, !tbaa !9
  %231 = getelementptr inbounds %struct.Node, ptr %12, i32 0, i32 2
  %232 = load i32, ptr %231, align 4, !tbaa !18
  %233 = icmp slt i32 %230, %232
  br i1 %233, label %235, label %234

234:                                              ; preds = %229
  store i32 15, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #0
  br label %289

235:                                              ; preds = %229
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #0
  %236 = load i32, ptr %17, align 4, !tbaa !9
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [100001 x i32], ptr @_ZZ4mainE3ord, i64 0, i64 %237
  %239 = load i32, ptr %238, align 4, !tbaa !9
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds [100001 x ptr], ptr @_ZZ4mainE3sta, i64 0, i64 %240
  %242 = load ptr, ptr %241, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.Node, ptr %12, i32 0, i32 0
  %244 = load i32, ptr %243, align 4, !tbaa !15
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds i8, ptr %242, i64 %245
  %247 = load i8, ptr %246, align 1, !tbaa !11
  %248 = sext i8 %247 to i32
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [257 x i32], ptr @_ZZ4mainE3idx, i64 0, i64 %249
  %251 = load i32, ptr %250, align 4, !tbaa !9
  store i32 %251, ptr %18, align 4, !tbaa !9
  %252 = load i32, ptr %18, align 4, !tbaa !9
  %253 = icmp ne i32 %252, 0
  br i1 %253, label %255, label %254

254:                                              ; preds = %235
  store i32 17, ptr %4, align 4
  br label %283

255:                                              ; preds = %235
  %256 = load i32, ptr %18, align 4, !tbaa !9
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds [258 x i32], ptr @_ZZ4mainE3tim, i64 0, i64 %257
  %259 = load i32, ptr %258, align 4, !tbaa !9
  %260 = load i32, ptr @_ZZ4mainE2st, align 4, !tbaa !9
  %261 = icmp ne i32 %259, %260
  br i1 %261, label %262, label %275

262:                                              ; preds = %255
  %263 = load i32, ptr @_ZZ4mainE2st, align 4, !tbaa !9
  %264 = load i32, ptr %18, align 4, !tbaa !9
  %265 = sext i32 %264 to i64
  %266 = getelementptr inbounds [258 x i32], ptr @_ZZ4mainE3tim, i64 0, i64 %265
  store i32 %263, ptr %266, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #0
  call void @llvm.memset.p0.i64(ptr align 8 %19, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #0
  %267 = load i32, ptr %18, align 4, !tbaa !9
  %268 = sext i32 %267 to i64
  %269 = getelementptr inbounds [258 x %"class.std::vector"], ptr @_ZZ4mainE3bkt, i64 0, i64 %268
  call void @_ZNSt6vectorIiSaIiEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(24) %269) #0
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #0
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #0
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %16, ptr noundef nonnull align 4 dereferenceable(4) %18)
          to label %270 unwind label %271

270:                                              ; preds = %262
  br label %275

271:                                              ; preds = %275, %262
  %272 = landingpad { ptr, i32 }
          cleanup
  %273 = extractvalue { ptr, i32 } %272, 0
  store ptr %273, ptr %10, align 8
  %274 = extractvalue { ptr, i32 } %272, 1
  store i32 %274, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #0
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #0
  br label %370

275:                                              ; preds = %270, %255
  %276 = load i32, ptr %18, align 4, !tbaa !9
  %277 = sext i32 %276 to i64
  %278 = getelementptr inbounds [258 x %"class.std::vector"], ptr @_ZZ4mainE3bkt, i64 0, i64 %277
  %279 = load i32, ptr %17, align 4, !tbaa !9
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds [100001 x i32], ptr @_ZZ4mainE3ord, i64 0, i64 %280
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %278, ptr noundef nonnull align 4 dereferenceable(4) %281)
          to label %282 unwind label %271

282:                                              ; preds = %275
  store i32 0, ptr %4, align 4
  br label %283

283:                                              ; preds = %282, %254
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #0
  %284 = load i32, ptr %4, align 4
  switch i32 %284, label %411 [
    i32 0, label %285
    i32 17, label %286
  ]

285:                                              ; preds = %283
  br label %286

286:                                              ; preds = %285, %283
  %287 = load i32, ptr %17, align 4, !tbaa !9
  %288 = add nsw i32 %287, 1
  store i32 %288, ptr %17, align 4, !tbaa !9
  br label %229, !llvm.loop !28

289:                                              ; preds = %234
  br label %290

290:                                              ; preds = %351, %289
  %291 = invoke noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
          to label %292 unwind label %313

292:                                              ; preds = %290
  %293 = xor i1 %291, true
  br i1 %293, label %294, label %369

294:                                              ; preds = %292
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #0
  %295 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
          to label %296 unwind label %317

296:                                              ; preds = %294
  %297 = load i32, ptr %295, align 4, !tbaa !9
  store i32 %297, ptr %20, align 4, !tbaa !9
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
          to label %298 unwind label %317

298:                                              ; preds = %296
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #0
  %299 = getelementptr inbounds %struct.Node, ptr %12, i32 0, i32 1
  %300 = load i32, ptr %299, align 4, !tbaa !17
  store i32 %300, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #0
  store i32 -1, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #0
  %301 = load i32, ptr %20, align 4, !tbaa !9
  %302 = sext i32 %301 to i64
  %303 = getelementptr inbounds [258 x %"class.std::vector"], ptr @_ZZ4mainE3bkt, i64 0, i64 %302
  store ptr %303, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #0
  %304 = load ptr, ptr %23, align 8, !tbaa !5
  %305 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %304) #0
  %306 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %24, i32 0, i32 0
  store ptr %305, ptr %306, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #0
  %307 = load ptr, ptr %23, align 8, !tbaa !5
  %308 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %307) #0
  %309 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %25, i32 0, i32 0
  store ptr %308, ptr %309, align 8
  br label %310

310:                                              ; preds = %333, %298
  %311 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %25) #0
  br i1 %311, label %321, label %312

312:                                              ; preds = %310
  store i32 20, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #0
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #0
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #0
  br label %339

313:                                              ; preds = %290
  %314 = landingpad { ptr, i32 }
          cleanup
  %315 = extractvalue { ptr, i32 } %314, 0
  store ptr %315, ptr %10, align 8
  %316 = extractvalue { ptr, i32 } %314, 1
  store i32 %316, ptr %11, align 4
  br label %370

317:                                              ; preds = %296, %294
  %318 = landingpad { ptr, i32 }
          cleanup
  %319 = extractvalue { ptr, i32 } %318, 0
  store ptr %319, ptr %10, align 8
  %320 = extractvalue { ptr, i32 } %318, 1
  store i32 %320, ptr %11, align 4
  br label %368

321:                                              ; preds = %310
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #0
  %322 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %24) #0
  %323 = load i32, ptr %322, align 4, !tbaa !9
  store i32 %323, ptr %26, align 4, !tbaa !9
  %324 = load i32, ptr %26, align 4, !tbaa !9
  %325 = getelementptr inbounds %struct.Node, ptr %12, i32 0, i32 1
  %326 = load i32, ptr %325, align 4, !tbaa !17
  %327 = add nsw i32 %326, 1
  store i32 %327, ptr %325, align 4, !tbaa !17
  %328 = sext i32 %326 to i64
  %329 = getelementptr inbounds [100001 x i32], ptr @_ZZ4mainE3ord, i64 0, i64 %328
  store i32 %324, ptr %329, align 4, !tbaa !9
  %330 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %22, ptr noundef nonnull align 4 dereferenceable(4) %26)
          to label %331 unwind label %335

331:                                              ; preds = %321
  %332 = load i32, ptr %330, align 4, !tbaa !9
  store i32 %332, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #0
  br label %333

333:                                              ; preds = %331
  %334 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %24) #0
  br label %310

335:                                              ; preds = %321
  %336 = landingpad { ptr, i32 }
          cleanup
  %337 = extractvalue { ptr, i32 } %336, 0
  store ptr %337, ptr %10, align 8
  %338 = extractvalue { ptr, i32 } %336, 1
  store i32 %338, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #0
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #0
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #0
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #0
  br label %367

339:                                              ; preds = %312
  call void @llvm.lifetime.start.p0(i64 16, ptr %27) #0
  %340 = getelementptr inbounds %struct.Node, ptr %27, i32 0, i32 0
  %341 = getelementptr inbounds %struct.Node, ptr %12, i32 0, i32 0
  %342 = load i32, ptr %341, align 4, !tbaa !15
  %343 = add nsw i32 %342, 1
  store i32 %343, ptr %340, align 4, !tbaa !15
  %344 = getelementptr inbounds %struct.Node, ptr %27, i32 0, i32 1
  %345 = load i32, ptr %21, align 4, !tbaa !9
  store i32 %345, ptr %344, align 4, !tbaa !17
  %346 = getelementptr inbounds %struct.Node, ptr %27, i32 0, i32 2
  %347 = getelementptr inbounds %struct.Node, ptr %12, i32 0, i32 1
  %348 = load i32, ptr %347, align 4, !tbaa !17
  store i32 %348, ptr %346, align 4, !tbaa !18
  %349 = getelementptr inbounds %struct.Node, ptr %27, i32 0, i32 3
  %350 = load i32, ptr %22, align 4, !tbaa !9
  store i32 %350, ptr %349, align 4, !tbaa !19
  invoke void @_ZNSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 4 dereferenceable(16) %27)
          to label %351 unwind label %363

351:                                              ; preds = %339
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #0
  %352 = load i32, ptr %22, align 4, !tbaa !9
  %353 = sext i32 %352 to i64
  %354 = getelementptr inbounds [100001 x i32], ptr @_ZZ4mainE3ans, i64 0, i64 %353
  %355 = load i32, ptr %354, align 4, !tbaa !9
  %356 = add nsw i32 %355, 1
  store i32 %356, ptr %354, align 4, !tbaa !9
  %357 = getelementptr inbounds %struct.Node, ptr %12, i32 0, i32 3
  %358 = load i32, ptr %357, align 4, !tbaa !19
  %359 = sext i32 %358 to i64
  %360 = getelementptr inbounds [100001 x i32], ptr @_ZZ4mainE3ans, i64 0, i64 %359
  %361 = load i32, ptr %360, align 4, !tbaa !9
  %362 = add nsw i32 %361, -1
  store i32 %362, ptr %360, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #0
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #0
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #0
  br label %290, !llvm.loop !29

363:                                              ; preds = %339
  %364 = landingpad { ptr, i32 }
          cleanup
  %365 = extractvalue { ptr, i32 } %364, 0
  store ptr %365, ptr %10, align 8
  %366 = extractvalue { ptr, i32 } %364, 1
  store i32 %366, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #0
  br label %367

367:                                              ; preds = %363, %335
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #0
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #0
  br label %368

368:                                              ; preds = %367, %317
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #0
  br label %370

369:                                              ; preds = %292
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %16) #0
  call void @llvm.lifetime.end.p0(i64 80, ptr %16) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #0
  br label %104, !llvm.loop !30

370:                                              ; preds = %368, %313, %271
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %16) #0
  br label %371

371:                                              ; preds = %370, %222
  call void @llvm.lifetime.end.p0(i64 80, ptr %16) #0
  br label %372

372:                                              ; preds = %371, %143
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #0
  br label %405

373:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #0
  store i32 0, ptr %28, align 4, !tbaa !9
  br label %374

374:                                              ; preds = %396, %373
  %375 = load i32, ptr %28, align 4, !tbaa !9
  %376 = load i32, ptr %2, align 4, !tbaa !9
  %377 = icmp slt i32 %375, %376
  br i1 %377, label %379, label %378

378:                                              ; preds = %374
  store i32 22, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #0
  br label %403

379:                                              ; preds = %374
  %380 = load i32, ptr %28, align 4, !tbaa !9
  %381 = sext i32 %380 to i64
  %382 = getelementptr inbounds [100001 x i32], ptr @_ZZ4mainE3ans, i64 0, i64 %381
  %383 = load i32, ptr %382, align 4, !tbaa !9
  %384 = load i32, ptr %28, align 4, !tbaa !9
  %385 = add nsw i32 %384, 1
  %386 = sext i32 %385 to i64
  %387 = getelementptr inbounds [100001 x i32], ptr @_ZZ4mainE3ans, i64 0, i64 %386
  %388 = load i32, ptr %387, align 4, !tbaa !9
  %389 = add nsw i32 %388, %383
  store i32 %389, ptr %387, align 4, !tbaa !9
  %390 = load i32, ptr %28, align 4, !tbaa !9
  %391 = sext i32 %390 to i64
  %392 = getelementptr inbounds [100001 x i32], ptr @_ZZ4mainE3ans, i64 0, i64 %391
  %393 = load i32, ptr %392, align 4, !tbaa !9
  %394 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %393)
          to label %395 unwind label %399

395:                                              ; preds = %379
  br label %396

396:                                              ; preds = %395
  %397 = load i32, ptr %28, align 4, !tbaa !9
  %398 = add nsw i32 %397, 1
  store i32 %398, ptr %28, align 4, !tbaa !9
  br label %374, !llvm.loop !31

399:                                              ; preds = %379
  %400 = landingpad { ptr, i32 }
          cleanup
  %401 = extractvalue { ptr, i32 } %400, 0
  store ptr %401, ptr %10, align 8
  %402 = extractvalue { ptr, i32 } %400, 1
  store i32 %402, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #0
  br label %405

403:                                              ; preds = %378
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @_ZNSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #0
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #0
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #0
  %404 = load i32, ptr %1, align 4
  ret i32 %404

405:                                              ; preds = %399, %372, %139, %135
  call void @_ZNSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #0
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #0
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #0
  br label %406

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

411:                                              ; preds = %283, %197
  unreachable
}

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt4iotaIPiiEvT_S1_T0_(ptr noundef, ptr noundef, i32 noundef) #5

; Function Attrs: mustprogress uwtable
declare hidden void @_ZNSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZNSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(16)) #6 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZNKSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef nonnull align 4 dereferenceable(16) ptr @_ZNSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80)) #5 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) #7

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZNSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #6 align 2

; Function Attrs: nounwind
declare i32 @__cxa_guard_acquire(ptr) #0

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

; Function Attrs: uwtable
declare hidden void @__cxx_global_array_dtor(ptr noundef) #8 section ".text.startup"

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

; Function Attrs: nounwind
declare void @__cxa_guard_release(ptr) #0

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #5 align 2

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #10 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZNSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #10 align 2

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

!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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = !{!16, !10, i64 0}
!16 = !{!"_ZTSZ4mainE4Node", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!17 = !{!16, !10, i64 4}
!18 = !{!16, !10, i64 8}
!19 = !{!16, !10, i64 12}
!20 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9, i64 12, i64 4, !9}
!21 = !{!22, !22, i64 0}
!22 = !{!"bool", !7, i64 0}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = distinct !{!25, !13}
!26 = distinct !{!26, !13}
!27 = !{!"branch_weights", i32 1, i32 1048575}
!28 = distinct !{!28, !13}
!29 = distinct !{!29, !13}
!30 = distinct !{!30, !13}
!31 = distinct !{!31, !13}


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<Node, std::allocator<Node>>::_Deque_impl" }
%"struct.std::_Deque_base<Node, std::allocator<Node>>::_Deque_impl" = type { %"struct.std::_Deque_base<Node, std::allocator<Node>>::_Deque_impl_data" }
%"struct.std::_Deque_base<Node, std::allocator<Node>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%struct.Node = type { i32, i32, i32, i32 }
%"class.std::queue.0" = type { %"class.std::deque.1" }
%"class.std::deque.1" = type { %"class.std::_Deque_base.2" }
%"class.std::_Deque_base.2" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.6", %"struct.std::_Deque_iterator.6" }
%"struct.std::_Deque_iterator.6" = type { ptr, ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@__dso_handle = external hidden global i8
@_ZZ4mainE3buf = external hidden global [10100003 x i8], align 16
@_ZZ4mainE3sta = external hidden local_unnamed_addr global [100001 x ptr], align 16
@_ZZ4mainE3tot = external hidden local_unnamed_addr global i32, align 4
@_ZZ4mainE3idx = external hidden local_unnamed_addr global [257 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ4mainE3ord = external hidden global [100001 x i32], align 16
@_ZZ4mainE3ans = external hidden local_unnamed_addr global [100001 x i32], align 16
@_ZZ4mainE2st = external hidden local_unnamed_addr global i32, align 4
@_ZZ4mainE3tim = external hidden local_unnamed_addr global [258 x i32], align 16
@_ZZ4mainE3bkt = external hidden global [258 x %"class.std::vector"], align 16
@_ZGVZ4mainE3bkt = external hidden global i64, align 8
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: nofree nounwind
declare i32 @__cxa_atexit(ptr, ptr, ptr) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::queue", align 8
  %3 = alloca %struct.Node, align 4
  %4 = alloca %"class.std::queue.0", align 8
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::vector", align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca i32, align 4
  %11 = alloca %struct.Node, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #10
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  store ptr @_ZZ4mainE3buf, ptr @_ZZ4mainE3sta, align 16, !tbaa !5
  %13 = load i32, ptr %1, align 4, !tbaa !9
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph84, label %.._crit_edge85_crit_edge

.._crit_edge85_crit_edge:                         ; preds = %0
  %.pre136 = sext i32 %13 to i64
  br label %._crit_edge85

._crit_edge85:                                    ; preds = %._crit_edge, %.._crit_edge85_crit_edge
  %.pre-phi137 = phi i64 [ %.pre136, %.._crit_edge85_crit_edge ], [ %40, %._crit_edge ]
  %15 = getelementptr inbounds i32, ptr @_ZZ4mainE3ord, i64 %.pre-phi137
  call void @_ZSt4iotaIPiiEvT_S1_T0_(ptr noundef nonnull @_ZZ4mainE3ord, ptr noundef nonnull %15, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %2) #10
  call void @_ZNSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #10
  store i32 0, ptr %3, align 4, !tbaa !11
  %16 = getelementptr inbounds i8, ptr %3, i64 4
  store i32 0, ptr %16, align 4, !tbaa !13
  %17 = getelementptr inbounds i8, ptr %3, i64 8
  %18 = load i32, ptr %1, align 4, !tbaa !9
  store i32 %18, ptr %17, align 4, !tbaa !14
  %19 = getelementptr inbounds i8, ptr %3, i64 12
  store i32 %18, ptr %19, align 4, !tbaa !15
  invoke void @_ZNSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(16) %3)
          to label %60 unwind label %96

.lr.ph84:                                         ; preds = %0, %._crit_edge
  %20 = phi ptr [ %37, %._crit_edge ], [ @_ZZ4mainE3buf, %0 ]
  %indvars.iv112 = phi i64 [ %indvars.iv.next113, %._crit_edge ], [ 0, %0 ]
  %21 = getelementptr inbounds [100001 x ptr], ptr @_ZZ4mainE3sta, i64 0, i64 %indvars.iv112
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %20)
  %23 = load ptr, ptr %21, align 8, !tbaa !5
  %24 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %23) #11
  %25 = trunc i64 %24 to i32
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.lr.ph84
  %_ZZ4mainE3tot.promoted = load i32, ptr @_ZZ4mainE3tot, align 4, !tbaa !9
  %wide.trip.count = and i64 %24, 2147483647
  %xtraiter = and i64 %24, 1
  %27 = icmp eq i64 %wide.trip.count, 1
  br i1 %27, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter
  br label %.lr.ph

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

.lr.ph.epil:                                      ; preds = %._crit_edge.loopexit.unr-lcssa
  %28 = getelementptr inbounds i8, ptr %23, i64 %indvars.iv.unr
  %29 = load i8, ptr %28, align 1, !tbaa !16
  %30 = sext i8 %29 to i64
  %31 = getelementptr inbounds [257 x i32], ptr @_ZZ4mainE3idx, i64 0, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !9
  %.not72.epil = icmp eq i32 %32, 0
  br i1 %.not72.epil, label %33, label %._crit_edge

33:                                               ; preds = %.lr.ph.epil
  %34 = add nsw i32 %.unr, 1
  store i32 %34, ptr @_ZZ4mainE3tot, align 4, !tbaa !9
  store i32 %34, ptr %31, align 4, !tbaa !9
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %33, %.lr.ph.epil, %.lr.ph84
  %sext = shl i64 %24, 32
  %35 = ashr exact i64 %sext, 32
  %36 = getelementptr inbounds i8, ptr %23, i64 %35
  %37 = getelementptr inbounds i8, ptr %36, i64 1
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %38 = getelementptr inbounds [100001 x ptr], ptr @_ZZ4mainE3sta, i64 0, i64 %indvars.iv.next113
  store ptr %37, ptr %38, align 8, !tbaa !5
  %39 = load i32, ptr %1, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = icmp slt i64 %indvars.iv.next113, %40
  br i1 %41, label %.lr.ph84, label %._crit_edge85, !llvm.loop !17

.lr.ph:                                           ; preds = %58, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.1, %58 ]
  %42 = phi i32 [ %_ZZ4mainE3tot.promoted, %.lr.ph.preheader.new ], [ %59, %58 ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %58 ]
  %43 = getelementptr inbounds i8, ptr %23, i64 %indvars.iv
  %44 = load i8, ptr %43, align 1, !tbaa !16
  %45 = sext i8 %44 to i64
  %46 = getelementptr inbounds [257 x i32], ptr @_ZZ4mainE3idx, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !9
  %.not72 = icmp eq i32 %47, 0
  br i1 %.not72, label %48, label %.lr.ph.1

48:                                               ; preds = %.lr.ph
  %49 = add nsw i32 %42, 1
  store i32 %49, ptr @_ZZ4mainE3tot, align 4, !tbaa !9
  store i32 %49, ptr %46, align 4, !tbaa !9
  br label %.lr.ph.1

.lr.ph.1:                                         ; preds = %48, %.lr.ph
  %50 = phi i32 [ %49, %48 ], [ %42, %.lr.ph ]
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %51 = getelementptr inbounds i8, ptr %23, i64 %indvars.iv.next
  %52 = load i8, ptr %51, align 1, !tbaa !16
  %53 = sext i8 %52 to i64
  %54 = getelementptr inbounds [257 x i32], ptr @_ZZ4mainE3idx, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !9
  %.not72.1 = icmp eq i32 %55, 0
  br i1 %.not72.1, label %56, label %58

56:                                               ; preds = %.lr.ph.1
  %57 = add nsw i32 %50, 1
  store i32 %57, ptr @_ZZ4mainE3tot, align 4, !tbaa !9
  store i32 %57, ptr %54, align 4, !tbaa !9
  br label %58

58:                                               ; preds = %56, %.lr.ph.1
  %59 = phi i32 [ %57, %56 ], [ %50, %.lr.ph.1 ]
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !19

60:                                               ; preds = %._crit_edge85
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #10
  %61 = call noundef zeroext i1 @_ZNKSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  br i1 %61, label %.preheader, label %.lr.ph103

.lr.ph103:                                        ; preds = %60
  %62 = getelementptr inbounds i8, ptr %11, i64 4
  %63 = getelementptr inbounds i8, ptr %11, i64 8
  %64 = getelementptr inbounds i8, ptr %11, i64 12
  br label %67

.preheader:                                       ; preds = %._crit_edge101, %60
  %65 = load i32, ptr %1, align 4, !tbaa !9
  %66 = icmp sgt i32 %65, 0
  br i1 %66, label %.lr.ph105, label %._crit_edge106

67:                                               ; preds = %.lr.ph103, %._crit_edge101
  %68 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZNSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %.sroa.0.0.copyload = load i32, ptr %68, align 4, !tbaa !9
  %.sroa.10.0..sroa_idx = getelementptr inbounds i8, ptr %68, i64 4
  %.sroa.10.0.copyload = load i32, ptr %.sroa.10.0..sroa_idx, align 4, !tbaa !9
  %.sroa.17.0..sroa_idx = getelementptr inbounds i8, ptr %68, i64 8
  %.sroa.17.0.copyload = load i32, ptr %.sroa.17.0..sroa_idx, align 4, !tbaa !9
  %.sroa.19.0..sroa_idx = getelementptr inbounds i8, ptr %68, i64 12
  %.sroa.19.0.copyload = load i32, ptr %.sroa.19.0..sroa_idx, align 4, !tbaa !9
  call void @_ZNSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %69 = load i32, ptr %1, align 4, !tbaa !9
  %70 = icmp slt i32 %.sroa.19.0.copyload, %69
  br i1 %70, label %.preheader80, label %.thread

.preheader80:                                     ; preds = %67
  %71 = sext i32 %.sroa.10.0.copyload to i64
  %72 = getelementptr inbounds [100001 x i32], ptr @_ZZ4mainE3ord, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !9
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [100001 x ptr], ptr @_ZZ4mainE3sta, i64 0, i64 %74
  %76 = load ptr, ptr %75, align 8, !tbaa !5
  %.05286 = add i32 %.sroa.10.0.copyload, 1
  %77 = icmp slt i32 %.05286, %.sroa.17.0.copyload
  %.fr = freeze i1 %77
  br i1 %.fr, label %.preheader80.split.us.preheader, label %.preheader77.preheader

.preheader77.preheader:                           ; preds = %.preheader80
  %78 = sext i32 %.sroa.0.0.copyload to i64
  br label %.preheader77

.preheader80.split.us.preheader:                  ; preds = %.preheader80
  %79 = sext i32 %.05286 to i64
  %80 = sext i32 %.sroa.17.0.copyload to i64
  %81 = sext i32 %.sroa.0.0.copyload to i64
  br label %.preheader80.split.us

.preheader80.split.us:                            ; preds = %.preheader80.split.us.preheader, %._crit_edge89.us
  %indvars.iv121 = phi i64 [ %81, %.preheader80.split.us.preheader ], [ %indvars.iv.next122, %._crit_edge89.us ]
  %82 = getelementptr inbounds i8, ptr %76, i64 %indvars.iv121
  %83 = load i8, ptr %82, align 1, !tbaa !16
  %.not.us = icmp eq i8 %83, 0
  br i1 %.not.us, label %.thread.loopexit, label %.preheader77.us

.preheader77.us:                                  ; preds = %.preheader80.split.us, %.preheader77.us
  %indvars.iv118 = phi i64 [ %indvars.iv.next119, %.preheader77.us ], [ %79, %.preheader80.split.us ]
  %84 = getelementptr inbounds [100001 x i32], ptr @_ZZ4mainE3ord, i64 0, i64 %indvars.iv118
  %85 = load i32, ptr %84, align 4, !tbaa !9
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [100001 x ptr], ptr @_ZZ4mainE3sta, i64 0, i64 %86
  %88 = load ptr, ptr %87, align 8, !tbaa !5
  %89 = getelementptr inbounds i8, ptr %88, i64 %indvars.iv121
  %90 = load i8, ptr %89, align 1, !tbaa !16
  %91 = icmp eq i8 %90, %83
  %indvars.iv.next119 = add nsw i64 %indvars.iv118, 1
  %92 = icmp slt i64 %indvars.iv.next119, %80
  %93 = select i1 %91, i1 %92, i1 false
  br i1 %93, label %.preheader77.us, label %._crit_edge89.us, !llvm.loop !20

._crit_edge89.us:                                 ; preds = %.preheader77.us
  %indvars.iv.next122 = add nsw i64 %indvars.iv121, 1
  br i1 %91, label %.preheader80.split.us, label %.thread.loopexit

.preheader77:                                     ; preds = %.preheader77.preheader, %.preheader77
  %indvars.iv115 = phi i64 [ %78, %.preheader77.preheader ], [ %indvars.iv.next116, %.preheader77 ]
  %94 = getelementptr inbounds i8, ptr %76, i64 %indvars.iv115
  %95 = load i8, ptr %94, align 1, !tbaa !16
  %.not = icmp eq i8 %95, 0
  %indvars.iv.next116 = add nsw i64 %indvars.iv115, 1
  br i1 %.not, label %.thread.loopexit107, label %.preheader77

96:                                               ; preds = %._crit_edge85
  %97 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #10
  br label %189

.thread.loopexit107:                              ; preds = %.preheader77
  %98 = trunc nsw i64 %indvars.iv115 to i32
  br label %.thread

.thread.loopexit:                                 ; preds = %.preheader80.split.us, %._crit_edge89.us
  %99 = trunc nsw i64 %indvars.iv121 to i32
  br label %.thread

.thread:                                          ; preds = %.thread.loopexit, %.thread.loopexit107, %67
  %.sroa.0.2 = phi i32 [ %.sroa.0.0.copyload, %67 ], [ %98, %.thread.loopexit107 ], [ %99, %.thread.loopexit ]
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %4) #10
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %100 unwind label %113

100:                                              ; preds = %.thread
  %101 = load atomic i8, ptr @_ZGVZ4mainE3bkt acquire, align 8
  %102 = icmp eq i8 %101, 0
  br i1 %102, label %103, label %108, !prof !21

103:                                              ; preds = %100
  %104 = call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZ4mainE3bkt) #10
  %.not64 = icmp eq i32 %104, 0
  br i1 %.not64, label %108, label %.preheader79

.preheader79:                                     ; preds = %103, %.preheader79
  %.idx = phi i64 [ %.add, %.preheader79 ], [ 0, %103 ]
  %.ptr = getelementptr inbounds i8, ptr @_ZZ4mainE3bkt, i64 %.idx
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr) #10
  %.add = add nuw nsw i64 %.idx, 24
  %105 = icmp eq i64 %.add, 6192
  br i1 %105, label %106, label %.preheader79

106:                                              ; preds = %.preheader79
  %107 = call i32 @__cxa_atexit(ptr nonnull @__cxx_global_array_dtor, ptr null, ptr nonnull @__dso_handle) #10
  call void @__cxa_guard_release(ptr nonnull @_ZGVZ4mainE3bkt) #10
  br label %108

108:                                              ; preds = %106, %103, %100
  %109 = load i32, ptr @_ZZ4mainE2st, align 4, !tbaa !9
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr @_ZZ4mainE2st, align 4, !tbaa !9
  %.not66 = icmp eq i32 %110, 0
  br i1 %.not66, label %111, label %115

111:                                              ; preds = %108
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1032) @_ZZ4mainE3tim, i8 0, i64 1032, i1 false)
  %112 = add nsw i32 %109, 2
  store i32 %112, ptr @_ZZ4mainE2st, align 4, !tbaa !9
  br label %115

113:                                              ; preds = %.thread
  %114 = landingpad { ptr, i32 }
          cleanup
  br label %179

115:                                              ; preds = %111, %108
  %116 = icmp slt i32 %.sroa.10.0.copyload, %.sroa.17.0.copyload
  br i1 %116, label %.lr.ph93, label %.preheader78

.lr.ph93:                                         ; preds = %115
  %117 = sext i32 %.sroa.0.2 to i64
  %118 = sext i32 %.sroa.10.0.copyload to i64
  br label %123

.preheader78:                                     ; preds = %147, %115
  %119 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  br i1 %119, label %._crit_edge101, label %.lr.ph100

.lr.ph100:                                        ; preds = %.preheader78
  %120 = add nsw i32 %.sroa.0.2, 1
  %121 = sext i32 %.sroa.19.0.copyload to i64
  %122 = getelementptr inbounds [100001 x i32], ptr @_ZZ4mainE3ans, i64 0, i64 %121
  br label %148

123:                                              ; preds = %.lr.ph93, %147
  %indvars.iv124 = phi i64 [ %118, %.lr.ph93 ], [ %indvars.iv.next125, %147 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #10
  %124 = getelementptr inbounds [100001 x i32], ptr @_ZZ4mainE3ord, i64 0, i64 %indvars.iv124
  %125 = load i32, ptr %124, align 4, !tbaa !9
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [100001 x ptr], ptr @_ZZ4mainE3sta, i64 0, i64 %126
  %128 = load ptr, ptr %127, align 8, !tbaa !5
  %129 = getelementptr inbounds i8, ptr %128, i64 %117
  %130 = load i8, ptr %129, align 1, !tbaa !16
  %131 = sext i8 %130 to i64
  %132 = getelementptr inbounds [257 x i32], ptr @_ZZ4mainE3idx, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !9
  store i32 %133, ptr %5, align 4, !tbaa !9
  %.not67 = icmp eq i32 %133, 0
  br i1 %.not67, label %147, label %134

134:                                              ; preds = %123
  %135 = sext i32 %133 to i64
  %136 = getelementptr inbounds [258 x i32], ptr @_ZZ4mainE3tim, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !9
  %138 = load i32, ptr @_ZZ4mainE2st, align 4, !tbaa !9
  %.not68 = icmp eq i32 %137, %138
  br i1 %.not68, label %145, label %139

139:                                              ; preds = %134
  store i32 %138, ptr %136, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #10
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %6, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #10
  %140 = load i32, ptr %5, align 4, !tbaa !9
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [258 x %"class.std::vector"], ptr @_ZZ4mainE3bkt, i64 0, i64 %141
  call void @_ZNSt6vectorIiSaIiEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %142) #10
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #10
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %._crit_edge134 unwind label %143

._crit_edge134:                                   ; preds = %139
  %.pre = load i32, ptr %5, align 4, !tbaa !9
  %.pre135 = sext i32 %.pre to i64
  br label %145

143:                                              ; preds = %145, %139
  %144 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #10
  br label %178

145:                                              ; preds = %._crit_edge134, %134
  %.pre-phi = phi i64 [ %.pre135, %._crit_edge134 ], [ %135, %134 ]
  %146 = getelementptr inbounds [258 x %"class.std::vector"], ptr @_ZZ4mainE3bkt, i64 0, i64 %.pre-phi
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %146, ptr noundef nonnull align 4 dereferenceable(4) %124)
          to label %147 unwind label %143

147:                                              ; preds = %145, %123
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #10
  %indvars.iv.next125 = add nsw i64 %indvars.iv124, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next125 to i32
  %exitcond127.not = icmp eq i32 %.sroa.17.0.copyload, %lftr.wideiv
  br i1 %exitcond127.not, label %.preheader78, label %123, !llvm.loop !22

148:                                              ; preds = %.lr.ph100, %166
  %.sroa.10.099 = phi i32 [ %.sroa.10.0.copyload, %.lr.ph100 ], [ %.sroa.10.1.lcssa, %166 ]
  %149 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  %150 = load i32, ptr %149, align 4, !tbaa !9
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #10
  store i32 -1, ptr %7, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [258 x %"class.std::vector"], ptr @_ZZ4mainE3bkt, i64 0, i64 %151
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #10
  %153 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %152) #10
  store ptr %153, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #10
  %154 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %152) #10
  store ptr %154, ptr %9, align 8
  %155 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #10
  br i1 %155, label %.lr.ph96.preheader, label %._crit_edge97

.lr.ph96.preheader:                               ; preds = %148
  %156 = sext i32 %.sroa.10.099 to i64
  br label %.lr.ph96

._crit_edge97.loopexit:                           ; preds = %.lr.ph96
  %157 = trunc nsw i64 %indvars.iv.next129 to i32
  br label %._crit_edge97

._crit_edge97:                                    ; preds = %._crit_edge97.loopexit, %148
  %.sroa.10.1.lcssa = phi i32 [ %.sroa.10.099, %148 ], [ %157, %._crit_edge97.loopexit ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #10
  store i32 %120, ptr %11, align 4, !tbaa !11
  store i32 %.sroa.10.099, ptr %62, align 4, !tbaa !13
  store i32 %.sroa.10.1.lcssa, ptr %63, align 4, !tbaa !14
  %158 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %158, ptr %64, align 4, !tbaa !15
  invoke void @_ZNSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(16) %11)
          to label %166 unwind label %175

.lr.ph96:                                         ; preds = %.lr.ph96.preheader, %.lr.ph96
  %indvars.iv128 = phi i64 [ %156, %.lr.ph96.preheader ], [ %indvars.iv.next129, %.lr.ph96 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #10
  %159 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #10
  %160 = load i32, ptr %159, align 4, !tbaa !9
  store i32 %160, ptr %10, align 4, !tbaa !9
  %indvars.iv.next129 = add nsw i64 %indvars.iv128, 1
  %161 = getelementptr inbounds [100001 x i32], ptr @_ZZ4mainE3ord, i64 0, i64 %indvars.iv128
  store i32 %160, ptr %161, align 4, !tbaa !9
  %162 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %163 = load i32, ptr %162, align 4, !tbaa !9
  store i32 %163, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #10
  %164 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #10
  %165 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #10
  br i1 %165, label %.lr.ph96, label %._crit_edge97.loopexit

166:                                              ; preds = %._crit_edge97
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #10
  %167 = load i32, ptr %7, align 4, !tbaa !9
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [100001 x i32], ptr @_ZZ4mainE3ans, i64 0, i64 %168
  %170 = load i32, ptr %169, align 4, !tbaa !9
  %171 = add nsw i32 %170, 1
  store i32 %171, ptr %169, align 4, !tbaa !9
  %172 = load i32, ptr %122, align 4, !tbaa !9
  %173 = add nsw i32 %172, -1
  store i32 %173, ptr %122, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #10
  %174 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  br i1 %174, label %._crit_edge101, label %148, !llvm.loop !23

175:                                              ; preds = %._crit_edge97
  %176 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #10
  br label %178

._crit_edge101:                                   ; preds = %166, %.preheader78
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #10
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %4) #10
  %177 = call noundef zeroext i1 @_ZNKSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  br i1 %177, label %.preheader, label %67, !llvm.loop !24

178:                                              ; preds = %175, %143
  %.pn = phi { ptr, i32 } [ %144, %143 ], [ %176, %175 ]
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #10
  br label %179

179:                                              ; preds = %178, %113
  %.pn.pn = phi { ptr, i32 } [ %.pn, %178 ], [ %114, %113 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %4) #10
  br label %189

._crit_edge106:                                   ; preds = %.lr.ph105, %.preheader
  call void @_ZNSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #10
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #10
  ret i32 0

.lr.ph105:                                        ; preds = %.preheader, %.lr.ph105
  %indvars.iv131 = phi i64 [ %indvars.iv.next132, %.lr.ph105 ], [ 0, %.preheader ]
  %180 = getelementptr inbounds [100001 x i32], ptr @_ZZ4mainE3ans, i64 0, i64 %indvars.iv131
  %181 = load i32, ptr %180, align 4, !tbaa !9
  %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
  %182 = getelementptr inbounds [100001 x i32], ptr @_ZZ4mainE3ans, i64 0, i64 %indvars.iv.next132
  %183 = load i32, ptr %182, align 4, !tbaa !9
  %184 = add nsw i32 %183, %181
  store i32 %184, ptr %182, align 4, !tbaa !9
  %185 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %181)
  %186 = load i32, ptr %1, align 4, !tbaa !9
  %187 = sext i32 %186 to i64
  %188 = icmp slt i64 %indvars.iv.next132, %187
  br i1 %188, label %.lr.ph105, label %._crit_edge106, !llvm.loop !25

189:                                              ; preds = %179, %96
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %179 ], [ %97, %96 ]
  call void @_ZNSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #10
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #10
  resume { ptr, i32 } %.pn.pn.pn
}

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt4iotaIPiiEvT_S1_T0_(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare hidden void @_ZNSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZNSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEE4pushEOS0_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #6 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZNKSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef nonnull align 4 dereferenceable(16) ptr @_ZNSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZNSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #6 align 2

; Function Attrs: nofree nounwind
declare i32 @__cxa_guard_acquire(ptr) local_unnamed_addr #0

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

; Function Attrs: uwtable
declare hidden void @__cxx_global_array_dtor(ptr noundef) #7 section ".text.startup"

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

; Function Attrs: nofree nounwind
declare void @__cxa_guard_release(ptr) local_unnamed_addr #0

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #5 align 2

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #9 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZNSt5queueIZ4mainE4NodeSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #9 align 2

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

!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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTSZ4mainE4Node", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!13 = !{!12, !10, i64 4}
!14 = !{!12, !10, i64 8}
!15 = !{!12, !10, i64 12}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}
!21 = !{!"branch_weights", i32 1, i32 1048575}
!22 = distinct !{!22, !18}
!23 = distinct !{!23, !18}
!24 = distinct !{!24, !18}
!25 = distinct !{!25, !18}


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