; LLVM IR from tangjz/acm-icpc :: uvalive (7219)

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

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@a = external dso_local global [101 x [3 x i32]], align 16
@busy = external dso_local global [3 x i32], align 4
@tim = external dso_local global [3 x i32], align 4
@total = external dso_local global i32, align 4
@Q = external dso_local global [3 x %"class.std::priority_queue"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [14 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 i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %298, %0
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = load i32, ptr @t, align 4, !tbaa !5
  %19 = icmp sle i32 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %301

21:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %45, %21
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = icmp slt i32 %23, 3
  br i1 %24, label %26, label %25

25:                                               ; preds = %22
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %48

26:                                               ; preds = %22
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [3 x i32], ptr @tim, i64 0, i64 %28
  store i32 0, ptr %29, align 4, !tbaa !5
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [3 x i32], ptr @busy, i64 0, i64 %31
  store i32 -1, ptr %32, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %40, %26
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [3 x %"class.std::priority_queue"], ptr @Q, i64 0, i64 %35
  %37 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %36)
  %38 = xor i1 %37, true
  br i1 %38, label %39, label %44

39:                                               ; preds = %33
  br label %40

40:                                               ; preds = %39
  %41 = load i32, ptr %4, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [3 x %"class.std::priority_queue"], ptr @Q, i64 0, i64 %42
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %43)
  br label %33, !llvm.loop !9

44:                                               ; preds = %33
  br label %45

45:                                               ; preds = %44
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %4, align 4, !tbaa !5
  br label %22, !llvm.loop !11

48:                                               ; preds = %25
  %49 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %50

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

54:                                               ; preds = %50
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %94

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

56:                                               ; preds = %87, %55
  %57 = load i32, ptr %7, align 4, !tbaa !5
  %58 = icmp slt i32 %57, 3
  br i1 %58, label %60, label %59

59:                                               ; preds = %56
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %90

60:                                               ; preds = %56
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [101 x [3 x i32]], ptr @a, i64 0, i64 %62
  %64 = getelementptr inbounds [3 x i32], ptr %63, i64 0, i64 0
  %65 = load i32, ptr %7, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds i32, ptr %64, i64 %66
  %68 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %67)
  %69 = load i8, ptr %6, align 1, !tbaa !12, !range !14, !noundef !15
  %70 = trunc i8 %69 to i1
  br i1 %70, label %86, label %71

71:                                               ; preds = %60
  %72 = load i32, ptr %5, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [101 x [3 x i32]], ptr @a, i64 0, i64 %73
  %75 = load i32, ptr %7, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [3 x i32], ptr %74, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %80, label %86

80:                                               ; preds = %71
  store i8 1, ptr %6, align 1, !tbaa !12
  %81 = load i32, ptr %7, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [3 x %"class.std::priority_queue"], ptr @Q, i64 0, i64 %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = sub nsw i32 0, %84
  store i32 %85, ptr %8, align 4, !tbaa !5
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(25) %83, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %86

86:                                               ; preds = %80, %71, %60
  br label %87

87:                                               ; preds = %86
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %7, align 4, !tbaa !5
  br label %56, !llvm.loop !16

90:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  br label %91

91:                                               ; preds = %90
  %92 = load i32, ptr %5, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %5, align 4, !tbaa !5
  br label %50, !llvm.loop !17

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

95:                                               ; preds = %131, %94
  %96 = load i32, ptr %9, align 4, !tbaa !5
  %97 = icmp slt i32 %96, 3
  br i1 %97, label %99, label %98

98:                                               ; preds = %95
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %134

99:                                               ; preds = %95
  %100 = load i32, ptr %9, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [3 x %"class.std::priority_queue"], ptr @Q, i64 0, i64 %101
  %103 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %102)
  br i1 %103, label %130, label %104

104:                                              ; preds = %99
  %105 = load i32, ptr %9, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [3 x %"class.std::priority_queue"], ptr @Q, i64 0, i64 %106
  %108 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %107)
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = sub nsw i32 0, %109
  %111 = load i32, ptr %9, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [3 x i32], ptr @busy, i64 0, i64 %112
  store i32 %110, ptr %113, align 4, !tbaa !5
  %114 = load i32, ptr %9, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [3 x %"class.std::priority_queue"], ptr @Q, i64 0, i64 %115
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %116)
  %117 = load i32, ptr %9, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [3 x i32], ptr @busy, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [101 x [3 x i32]], ptr @a, i64 0, i64 %121
  %123 = load i32, ptr %9, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [3 x i32], ptr %122, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = load i32, ptr %9, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [3 x i32], ptr @tim, i64 0, i64 %128
  store i32 %126, ptr %129, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %104, %99
  br label %131

131:                                              ; preds = %130
  %132 = load i32, ptr %9, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %9, align 4, !tbaa !5
  br label %95, !llvm.loop !18

134:                                              ; preds = %98
  store i32 0, ptr @total, align 4, !tbaa !5
  br label %135

135:                                              ; preds = %293, %134
  br label %136

136:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 1061109567, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %137

137:                                              ; preds = %160, %136
  %138 = load i32, ptr %11, align 4, !tbaa !5
  %139 = icmp slt i32 %138, 3
  br i1 %139, label %141, label %140

140:                                              ; preds = %137
  store i32 22, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %163

141:                                              ; preds = %137
  %142 = load i32, ptr %11, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [3 x i32], ptr @busy, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = icmp sge i32 %145, 0
  br i1 %146, label %147, label %159

147:                                              ; preds = %141
  %148 = load i32, ptr %10, align 4, !tbaa !5
  %149 = load i32, ptr %11, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [3 x i32], ptr @tim, i64 0, i64 %150
  %152 = load i32, ptr %151, align 4, !tbaa !5
  %153 = icmp sgt i32 %148, %152
  br i1 %153, label %154, label %159

154:                                              ; preds = %147
  %155 = load i32, ptr %11, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [3 x i32], ptr @tim, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !5
  store i32 %158, ptr %10, align 4, !tbaa !5
  br label %159

159:                                              ; preds = %154, %147, %141
  br label %160

160:                                              ; preds = %159
  %161 = load i32, ptr %11, align 4, !tbaa !5
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %11, align 4, !tbaa !5
  br label %137, !llvm.loop !19

163:                                              ; preds = %140
  %164 = load i32, ptr %10, align 4, !tbaa !5
  %165 = icmp eq i32 %164, 1061109567
  br i1 %165, label %166, label %167

166:                                              ; preds = %163
  store i32 21, ptr %3, align 4
  br label %291

167:                                              ; preds = %163
  %168 = load i32, ptr %10, align 4, !tbaa !5
  %169 = load i32, ptr @total, align 4, !tbaa !5
  %170 = add nsw i32 %169, %168
  store i32 %170, ptr @total, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 2, ptr %12, align 4, !tbaa !5
  br label %171

171:                                              ; preds = %287, %167
  %172 = load i32, ptr %12, align 4, !tbaa !5
  %173 = icmp sge i32 %172, 0
  br i1 %173, label %175, label %174

174:                                              ; preds = %171
  store i32 25, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %290

175:                                              ; preds = %171
  %176 = load i32, ptr %12, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [3 x i32], ptr @busy, i64 0, i64 %177
  %179 = load i32, ptr %178, align 4, !tbaa !5
  %180 = icmp slt i32 %179, 0
  br i1 %180, label %189, label %181

181:                                              ; preds = %175
  %182 = load i32, ptr %10, align 4, !tbaa !5
  %183 = load i32, ptr %12, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [3 x i32], ptr @tim, i64 0, i64 %184
  %186 = load i32, ptr %185, align 4, !tbaa !5
  %187 = sub nsw i32 %186, %182
  store i32 %187, ptr %185, align 4, !tbaa !5
  %188 = icmp sgt i32 %187, 0
  br i1 %188, label %189, label %190

189:                                              ; preds = %181, %175
  br label %287

190:                                              ; preds = %181
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %191 = load i32, ptr %12, align 4, !tbaa !5
  %192 = add nsw i32 %191, 1
  store i32 %192, ptr %13, align 4, !tbaa !5
  br label %193

193:                                              ; preds = %247, %190
  %194 = load i32, ptr %13, align 4, !tbaa !5
  %195 = icmp slt i32 %194, 3
  br i1 %195, label %197, label %196

196:                                              ; preds = %193
  store i32 28, ptr %3, align 4
  br label %250

197:                                              ; preds = %193
  %198 = load i32, ptr %12, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [3 x i32], ptr @busy, i64 0, i64 %199
  %201 = load i32, ptr %200, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [101 x [3 x i32]], ptr @a, i64 0, i64 %202
  %204 = load i32, ptr %13, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [3 x i32], ptr %203, i64 0, i64 %205
  %207 = load i32, ptr %206, align 4, !tbaa !5
  %208 = icmp ne i32 %207, 0
  br i1 %208, label %209, label %246

209:                                              ; preds = %197
  %210 = load i32, ptr %13, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [3 x i32], ptr @busy, i64 0, i64 %211
  %213 = load i32, ptr %212, align 4, !tbaa !5
  %214 = icmp slt i32 %213, 0
  br i1 %214, label %215, label %236

215:                                              ; preds = %209
  %216 = load i32, ptr %12, align 4, !tbaa !5
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [3 x i32], ptr @busy, i64 0, i64 %217
  %219 = load i32, ptr %218, align 4, !tbaa !5
  %220 = load i32, ptr %13, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [3 x i32], ptr @busy, i64 0, i64 %221
  store i32 %219, ptr %222, align 4, !tbaa !5
  %223 = load i32, ptr %13, align 4, !tbaa !5
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds [3 x i32], ptr @busy, i64 0, i64 %224
  %226 = load i32, ptr %225, align 4, !tbaa !5
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [101 x [3 x i32]], ptr @a, i64 0, i64 %227
  %229 = load i32, ptr %13, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [3 x i32], ptr %228, i64 0, i64 %230
  %232 = load i32, ptr %231, align 4, !tbaa !5
  %233 = load i32, ptr %13, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [3 x i32], ptr @tim, i64 0, i64 %234
  store i32 %232, ptr %235, align 4, !tbaa !5
  br label %245

236:                                              ; preds = %209
  %237 = load i32, ptr %13, align 4, !tbaa !5
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds [3 x %"class.std::priority_queue"], ptr @Q, i64 0, i64 %238
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %240 = load i32, ptr %12, align 4, !tbaa !5
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds [3 x i32], ptr @busy, i64 0, i64 %241
  %243 = load i32, ptr %242, align 4, !tbaa !5
  %244 = sub nsw i32 0, %243
  store i32 %244, ptr %14, align 4, !tbaa !5
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(25) %239, ptr noundef nonnull align 4 dereferenceable(4) %14)
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %245

245:                                              ; preds = %236, %215
  store i32 28, ptr %3, align 4
  br label %250

246:                                              ; preds = %197
  br label %247

247:                                              ; preds = %246
  %248 = load i32, ptr %13, align 4, !tbaa !5
  %249 = add nsw i32 %248, 1
  store i32 %249, ptr %13, align 4, !tbaa !5
  br label %193, !llvm.loop !20

250:                                              ; preds = %245, %196
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %251

251:                                              ; preds = %250
  %252 = load i32, ptr %12, align 4, !tbaa !5
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds [3 x %"class.std::priority_queue"], ptr @Q, i64 0, i64 %253
  %255 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %254)
  br i1 %255, label %282, label %256

256:                                              ; preds = %251
  %257 = load i32, ptr %12, align 4, !tbaa !5
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds [3 x %"class.std::priority_queue"], ptr @Q, i64 0, i64 %258
  %260 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %259)
  %261 = load i32, ptr %260, align 4, !tbaa !5
  %262 = sub nsw i32 0, %261
  %263 = load i32, ptr %12, align 4, !tbaa !5
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds [3 x i32], ptr @busy, i64 0, i64 %264
  store i32 %262, ptr %265, align 4, !tbaa !5
  %266 = load i32, ptr %12, align 4, !tbaa !5
  %267 = sext i32 %266 to i64
  %268 = getelementptr inbounds [3 x %"class.std::priority_queue"], ptr @Q, i64 0, i64 %267
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %268)
  %269 = load i32, ptr %12, align 4, !tbaa !5
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds [3 x i32], ptr @busy, i64 0, i64 %270
  %272 = load i32, ptr %271, align 4, !tbaa !5
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds [101 x [3 x i32]], ptr @a, i64 0, i64 %273
  %275 = load i32, ptr %12, align 4, !tbaa !5
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds [3 x i32], ptr %274, i64 0, i64 %276
  %278 = load i32, ptr %277, align 4, !tbaa !5
  %279 = load i32, ptr %12, align 4, !tbaa !5
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds [3 x i32], ptr @tim, i64 0, i64 %280
  store i32 %278, ptr %281, align 4, !tbaa !5
  br label %286

282:                                              ; preds = %251
  %283 = load i32, ptr %12, align 4, !tbaa !5
  %284 = sext i32 %283 to i64
  %285 = getelementptr inbounds [3 x i32], ptr @busy, i64 0, i64 %284
  store i32 -1, ptr %285, align 4, !tbaa !5
  br label %286

286:                                              ; preds = %282, %256
  br label %287

287:                                              ; preds = %286, %189
  %288 = load i32, ptr %12, align 4, !tbaa !5
  %289 = add nsw i32 %288, -1
  store i32 %289, ptr %12, align 4, !tbaa !5
  br label %171, !llvm.loop !21

290:                                              ; preds = %174
  store i32 0, ptr %3, align 4
  br label %291

291:                                              ; preds = %290, %166
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  %292 = load i32, ptr %3, align 4
  switch i32 %292, label %302 [
    i32 0, label %293
    i32 21, label %294
  ]

293:                                              ; preds = %291
  br label %135, !llvm.loop !22

294:                                              ; preds = %291
  %295 = load i32, ptr %2, align 4, !tbaa !5
  %296 = load i32, ptr @total, align 4, !tbaa !5
  %297 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %295, i32 noundef %296)
  br label %298

298:                                              ; preds = %294
  %299 = load i32, ptr %2, align 4, !tbaa !5
  %300 = add nsw i32 %299, 1
  store i32 %300, ptr %2, align 4, !tbaa !5
  br label %16, !llvm.loop !23

301:                                              ; preds = %20
  ret i32 0

302:                                              ; preds = %291
  unreachable
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #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 nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) #4 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: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 4 dereferenceable(4)) #4 align 2

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

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

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

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

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


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

%"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<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 }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@a = external dso_local global [101 x [3 x i32]], align 16
@busy = external dso_local local_unnamed_addr global [3 x i32], align 4
@tim = external dso_local local_unnamed_addr global [3 x i32], align 4
@total = external dso_local local_unnamed_addr global i32, align 4
@Q = external dso_local global [3 x %"class.std::priority_queue"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %4 = load i32, ptr @t, align 4, !tbaa !5
  %.not93 = icmp slt i32 %4, 1
  br i1 %.not93, label %._crit_edge95, label %.preheader83

.preheader83:                                     ; preds = %0, %158
  %.07494 = phi i32 [ %160, %158 ], [ 1, %0 ]
  store i32 0, ptr @tim, align 4, !tbaa !5
  store i32 -1, ptr @busy, align 4, !tbaa !5
  %5 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %5, label %._crit_edge, label %.lr.ph

._crit_edge95:                                    ; preds = %158, %0
  ret i32 0

.lr.ph:                                           ; preds = %.preheader83, %.lr.ph
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %6 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %6, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %.preheader83
  store i32 0, ptr getelementptr inbounds (i8, ptr @tim, i64 4), align 4, !tbaa !5
  store i32 -1, ptr getelementptr inbounds (i8, ptr @busy, i64 4), align 4, !tbaa !5
  %7 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 32))
  br i1 %7, label %._crit_edge.1, label %.lr.ph.1

.lr.ph.1:                                         ; preds = %._crit_edge, %.lr.ph.1
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 32))
  %8 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 32))
  br i1 %8, label %._crit_edge.1, label %.lr.ph.1, !llvm.loop !9

._crit_edge.1:                                    ; preds = %.lr.ph.1, %._crit_edge
  store i32 0, ptr getelementptr inbounds (i8, ptr @tim, i64 8), align 4, !tbaa !5
  store i32 -1, ptr getelementptr inbounds (i8, ptr @busy, i64 8), align 4, !tbaa !5
  %9 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 64))
  br i1 %9, label %._crit_edge.2, label %.lr.ph.2

.lr.ph.2:                                         ; preds = %._crit_edge.1, %.lr.ph.2
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 64))
  %10 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 64))
  br i1 %10, label %._crit_edge.2, label %.lr.ph.2, !llvm.loop !9

._crit_edge.2:                                    ; preds = %.lr.ph.2, %._crit_edge.1
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.preheader81.preheader, label %.preheader82

.preheader82:                                     ; preds = %39, %._crit_edge.2
  %14 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %14, label %51, label %43

.preheader81.preheader:                           ; preds = %._crit_edge.2, %39
  %indvars.iv = phi i64 [ %indvars.iv.next, %39 ], [ 0, %._crit_edge.2 ]
  %15 = getelementptr inbounds [101 x [3 x i32]], ptr @a, i64 0, i64 %indvars.iv
  %16 = sub nsw i64 0, %indvars.iv
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %15)
  %18 = load i32, ptr %15, align 4, !tbaa !5
  %.not77.not = icmp eq i32 %18, 0
  br i1 %.not77.not, label %23, label %19

19:                                               ; preds = %.preheader81.preheader
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %20 = trunc nsw i64 %16 to i32
  store i32 %20, ptr %1, align 4, !tbaa !5
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %21 = getelementptr inbounds i8, ptr %15, i64 4
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %21)
  br label %.thread111

23:                                               ; preds = %.preheader81.preheader
  %24 = getelementptr inbounds i8, ptr %15, i64 4
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %24)
  %26 = getelementptr inbounds [101 x [3 x i32]], ptr @a, i64 0, i64 %indvars.iv, i64 1
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %.not77.1 = icmp eq i32 %27, 0
  br i1 %.not77.1, label %32, label %28

28:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %29 = trunc nsw i64 %16 to i32
  store i32 %29, ptr %1, align 4, !tbaa !5
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 32), ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  br label %.thread111

.thread111:                                       ; preds = %19, %28
  %30 = getelementptr inbounds i8, ptr %15, i64 8
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %30)
  br label %39

32:                                               ; preds = %23
  %33 = getelementptr inbounds i8, ptr %15, i64 8
  %34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %33)
  %35 = getelementptr inbounds [101 x [3 x i32]], ptr @a, i64 0, i64 %indvars.iv, i64 2
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %.not77.2 = icmp eq i32 %36, 0
  br i1 %.not77.2, label %39, label %37

37:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %38 = trunc nsw i64 %16 to i32
  store i32 %38, ptr %1, align 4, !tbaa !5
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 64), ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  br label %39

39:                                               ; preds = %.thread111, %37, %32
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %40 = load i32, ptr @n, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = icmp slt i64 %indvars.iv.next, %41
  br i1 %42, label %.preheader81.preheader, label %.preheader82, !llvm.loop !11

43:                                               ; preds = %.preheader82
  %44 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = sub nsw i32 0, %45
  store i32 %46, ptr @busy, align 4, !tbaa !5
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %47 = load i32, ptr @busy, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [101 x [3 x i32]], ptr @a, i64 0, i64 %48, i64 0
  %50 = load i32, ptr %49, align 4, !tbaa !5
  store i32 %50, ptr @tim, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %.preheader82, %43
  %52 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 32))
  br i1 %52, label %61, label %53

53:                                               ; preds = %51
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 32))
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = sub nsw i32 0, %55
  store i32 %56, ptr getelementptr inbounds (i8, ptr @busy, i64 4), align 4, !tbaa !5
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 32))
  %57 = load i32, ptr getelementptr inbounds (i8, ptr @busy, i64 4), align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [101 x [3 x i32]], ptr @a, i64 0, i64 %58, i64 1
  %60 = load i32, ptr %59, align 4, !tbaa !5
  store i32 %60, ptr getelementptr inbounds (i8, ptr @tim, i64 4), align 4, !tbaa !5
  br label %61

61:                                               ; preds = %53, %51
  %62 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 64))
  br i1 %62, label %71, label %63

63:                                               ; preds = %61
  %64 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 64))
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = sub nsw i32 0, %65
  store i32 %66, ptr getelementptr inbounds (i8, ptr @busy, i64 8), align 4, !tbaa !5
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 64))
  %67 = load i32, ptr getelementptr inbounds (i8, ptr @busy, i64 8), align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [101 x [3 x i32]], ptr @a, i64 0, i64 %68, i64 2
  %70 = load i32, ptr %69, align 4, !tbaa !5
  store i32 %70, ptr getelementptr inbounds (i8, ptr @tim, i64 8), align 4, !tbaa !5
  br label %71

71:                                               ; preds = %63, %61
  store i32 0, ptr @total, align 4, !tbaa !5
  %.pre = load i32, ptr @busy, align 4, !tbaa !5
  br label %.loopexit80

.loopexit80:                                      ; preds = %.loopexit80.backedge, %71
  %72 = phi i32 [ %.pre, %71 ], [ %.be, %.loopexit80.backedge ]
  %73 = icmp sgt i32 %72, -1
  %74 = load i32, ptr @tim, align 4
  %spec.select = call i32 @llvm.smin.i32(i32 %74, i32 1061109567)
  %.1 = select i1 %73, i32 %spec.select, i32 1061109567
  %75 = load i32, ptr getelementptr inbounds (i8, ptr @busy, i64 4), align 4, !tbaa !5
  %76 = load i32, ptr getelementptr inbounds (i8, ptr @tim, i64 4), align 4
  %spec.select.1 = call i32 @llvm.smin.i32(i32 %.1, i32 %76)
  %77 = icmp slt i32 %75, 0
  %.1.1 = select i1 %77, i32 %.1, i32 %spec.select.1
  %78 = load i32, ptr getelementptr inbounds (i8, ptr @busy, i64 8), align 4, !tbaa !5
  %79 = load i32, ptr getelementptr inbounds (i8, ptr @tim, i64 8), align 4
  %spec.select.2 = call i32 @llvm.smin.i32(i32 %.1.1, i32 %79)
  %80 = icmp slt i32 %78, 0
  %.1.2 = select i1 %80, i32 %.1.1, i32 %spec.select.2
  %81 = icmp eq i32 %.1.2, 1061109567
  %82 = load i32, ptr @total, align 4, !tbaa !5
  br i1 %81, label %158, label %83

83:                                               ; preds = %.loopexit80
  %84 = add nsw i32 %82, %.1.2
  store i32 %84, ptr @total, align 4, !tbaa !5
  %85 = icmp slt i32 %78, 0
  br i1 %85, label %100, label %86

86:                                               ; preds = %83
  %87 = load i32, ptr getelementptr inbounds (i8, ptr @tim, i64 8), align 4, !tbaa !5
  %88 = sub nsw i32 %87, %.1.2
  store i32 %88, ptr getelementptr inbounds (i8, ptr @tim, i64 8), align 4, !tbaa !5
  %89 = icmp sgt i32 %88, 0
  br i1 %89, label %100, label %.loopexit

.loopexit:                                        ; preds = %86
  %90 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 64))
  br i1 %90, label %99, label %91

91:                                               ; preds = %.loopexit
  %92 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 64))
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = sub nsw i32 0, %93
  store i32 %94, ptr getelementptr inbounds (i8, ptr @busy, i64 8), align 4, !tbaa !5
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 64))
  %95 = load i32, ptr getelementptr inbounds (i8, ptr @busy, i64 8), align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [101 x [3 x i32]], ptr @a, i64 0, i64 %96, i64 2
  %98 = load i32, ptr %97, align 4, !tbaa !5
  store i32 %98, ptr getelementptr inbounds (i8, ptr @tim, i64 8), align 4, !tbaa !5
  br label %100

99:                                               ; preds = %.loopexit
  store i32 -1, ptr getelementptr inbounds (i8, ptr @busy, i64 8), align 4, !tbaa !5
  br label %100

100:                                              ; preds = %91, %99, %83, %86
  %101 = phi i32 [ %95, %91 ], [ -1, %99 ], [ %78, %83 ], [ %78, %86 ]
  %102 = load i32, ptr getelementptr inbounds (i8, ptr @busy, i64 4), align 4, !tbaa !5
  %103 = icmp slt i32 %102, 0
  br i1 %103, label %126, label %104

104:                                              ; preds = %100
  %105 = load i32, ptr getelementptr inbounds (i8, ptr @tim, i64 4), align 4, !tbaa !5
  %106 = sub nsw i32 %105, %.1.2
  store i32 %106, ptr getelementptr inbounds (i8, ptr @tim, i64 4), align 4, !tbaa !5
  %107 = icmp sgt i32 %106, 0
  br i1 %107, label %126, label %.preheader.1

.preheader.1:                                     ; preds = %104
  %108 = zext nneg i32 %102 to i64
  %109 = getelementptr inbounds [101 x [3 x i32]], ptr @a, i64 0, i64 %108, i64 2
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %.not76.1 = icmp eq i32 %110, 0
  br i1 %.not76.1, label %.loopexit.1, label %111, !llvm.loop !12

111:                                              ; preds = %.preheader.1
  %112 = icmp slt i32 %101, 0
  br i1 %112, label %115, label %113

113:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %114 = sub nsw i32 0, %102
  store i32 %114, ptr %2, align 4, !tbaa !5
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 64), ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  br label %.loopexit.1

115:                                              ; preds = %111
  store i32 %102, ptr getelementptr inbounds (i8, ptr @busy, i64 8), align 4, !tbaa !5
  store i32 %110, ptr getelementptr inbounds (i8, ptr @tim, i64 8), align 4, !tbaa !5
  br label %.loopexit.1

.loopexit.1:                                      ; preds = %.preheader.1, %115, %113
  %116 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 32))
  br i1 %116, label %125, label %117

117:                                              ; preds = %.loopexit.1
  %118 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 32))
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = sub nsw i32 0, %119
  store i32 %120, ptr getelementptr inbounds (i8, ptr @busy, i64 4), align 4, !tbaa !5
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) getelementptr inbounds (i8, ptr @Q, i64 32))
  %121 = load i32, ptr getelementptr inbounds (i8, ptr @busy, i64 4), align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [101 x [3 x i32]], ptr @a, i64 0, i64 %122, i64 1
  %124 = load i32, ptr %123, align 4, !tbaa !5
  store i32 %124, ptr getelementptr inbounds (i8, ptr @tim, i64 4), align 4, !tbaa !5
  br label %126

125:                                              ; preds = %.loopexit.1
  store i32 -1, ptr getelementptr inbounds (i8, ptr @busy, i64 4), align 4, !tbaa !5
  br label %126

126:                                              ; preds = %125, %117, %104, %100
  %127 = load i32, ptr @busy, align 4, !tbaa !5
  %128 = icmp slt i32 %127, 0
  br i1 %128, label %.loopexit80.backedge, label %129

129:                                              ; preds = %126
  %130 = load i32, ptr @tim, align 4, !tbaa !5
  %131 = sub nsw i32 %130, %.1.2
  store i32 %131, ptr @tim, align 4, !tbaa !5
  %132 = icmp sgt i32 %131, 0
  br i1 %132, label %.loopexit80.backedge, label %.preheader.2

.preheader.2:                                     ; preds = %129
  %133 = zext nneg i32 %127 to i64
  %134 = getelementptr inbounds [101 x [3 x i32]], ptr @a, i64 0, i64 %133, i64 1
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %.not76.2 = icmp eq i32 %135, 0
  br i1 %.not76.2, label %136, label %139, !llvm.loop !12

136:                                              ; preds = %.preheader.2
  %137 = getelementptr inbounds [101 x [3 x i32]], ptr @a, i64 0, i64 %133, i64 2
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %.not76.2.1 = icmp eq i32 %138, 0
  br i1 %.not76.2.1, label %.loopexit.2, label %139, !llvm.loop !12

139:                                              ; preds = %136, %.preheader.2
  %.lcssa96.2 = phi i64 [ 1, %.preheader.2 ], [ 2, %136 ]
  %.lcssa.2 = phi i32 [ %135, %.preheader.2 ], [ %138, %136 ]
  %140 = getelementptr inbounds [3 x i32], ptr @busy, i64 0, i64 %.lcssa96.2
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = icmp slt i32 %141, 0
  br i1 %142, label %146, label %143

143:                                              ; preds = %139
  %144 = getelementptr inbounds [3 x %"class.std::priority_queue"], ptr @Q, i64 0, i64 %.lcssa96.2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %145 = sub nsw i32 0, %127
  store i32 %145, ptr %2, align 4, !tbaa !5
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(25) %144, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  br label %.loopexit.2

146:                                              ; preds = %139
  store i32 %127, ptr %140, align 4, !tbaa !5
  %147 = getelementptr inbounds [3 x i32], ptr @tim, i64 0, i64 %.lcssa96.2
  store i32 %.lcssa.2, ptr %147, align 4, !tbaa !5
  br label %.loopexit.2

.loopexit.2:                                      ; preds = %136, %146, %143
  %148 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %148, label %157, label %149

149:                                              ; preds = %.loopexit.2
  %150 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = sub nsw i32 0, %151
  store i32 %152, ptr @busy, align 4, !tbaa !5
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %153 = load i32, ptr @busy, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [101 x [3 x i32]], ptr @a, i64 0, i64 %154, i64 0
  %156 = load i32, ptr %155, align 4, !tbaa !5
  store i32 %156, ptr @tim, align 4, !tbaa !5
  br label %.loopexit80.backedge

157:                                              ; preds = %.loopexit.2
  store i32 -1, ptr @busy, align 4, !tbaa !5
  br label %.loopexit80.backedge

.loopexit80.backedge:                             ; preds = %157, %149, %129, %126
  %.be = phi i32 [ -1, %157 ], [ %153, %149 ], [ %127, %129 ], [ %127, %126 ]
  br label %.loopexit80, !llvm.loop !13

158:                                              ; preds = %.loopexit80
  %159 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.07494, i32 noundef %82)
  %160 = add nuw nsw i32 %.07494, 1
  %161 = load i32, ptr @t, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.07494, %161
  br i1 %.not.not, label %.preheader83, label %._crit_edge95, !llvm.loop !14
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) 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 nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #4 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: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4 align 2

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #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 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


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