; LLVM IR from tangjz/acm-icpc :: lydsy (2902)

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

%"struct.std::pair" = type { i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@dt = external dso_local global i32, align 4
@a = external dso_local global [150001 x i32], align 16
@op = external dso_local global [150001 x %"struct.std::pair"], align 16
@tot = external dso_local global i32, align 4
@sq = external dso_local global i32, align 4
@que = external dso_local global [300001 x i32], align 16
@nxt = external dso_local global [300001 x i32], align 16
@upp = external dso_local global [300001 x i32], align 16
@cnt = external dso_local global [300001 x i32], align 16
@jmp = external dso_local global [300001 x %"struct.std::pair"], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::pair", align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @dt, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %35, %0
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %22, label %21

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

22:                                               ; preds = %17
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds i32, ptr @a, i64 %24
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %25)
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [150001 x i32], ptr @a, i64 0, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = load i32, ptr @tot, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr @tot, align 4, !tbaa !5
  %33 = sext i32 %31 to i64
  %34 = getelementptr inbounds [300001 x i32], ptr @que, i64 0, i64 %33
  store i32 %30, ptr %34, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %22
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %2, align 4, !tbaa !5
  br label %17, !llvm.loop !9

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

39:                                               ; preds = %62, %38
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = load i32, ptr @m, align 4, !tbaa !5
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %65

44:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [150001 x %"struct.std::pair"], ptr @op, i64 0, i64 %46
  %48 = getelementptr inbounds %"struct.std::pair", ptr %47, i32 0, i32 0
  store ptr %48, ptr %4, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [150001 x %"struct.std::pair"], ptr @op, i64 0, i64 %50
  %52 = getelementptr inbounds %"struct.std::pair", ptr %51, i32 0, i32 1
  store ptr %52, ptr %5, align 8, !tbaa !11
  %53 = load ptr, ptr %4, align 8, !tbaa !11
  %54 = load ptr, ptr %5, align 8, !tbaa !11
  %55 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %53, ptr noundef %54)
  %56 = load ptr, ptr %5, align 8, !tbaa !11
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = load i32, ptr @tot, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr @tot, align 4, !tbaa !5
  %60 = sext i32 %58 to i64
  %61 = getelementptr inbounds [300001 x i32], ptr @que, i64 0, i64 %60
  store i32 %57, ptr %61, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  br label %62

62:                                               ; preds = %44
  %63 = load i32, ptr %3, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %3, align 4, !tbaa !5
  br label %39, !llvm.loop !13

65:                                               ; preds = %43
  %66 = load i32, ptr @tot, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds i32, ptr @que, i64 %67
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @que, ptr noundef %68)
  %69 = load i32, ptr @tot, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds i32, ptr @que, i64 %70
  %72 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef @que, ptr noundef %71)
  %73 = ptrtoint ptr %72 to i64
  %74 = sub i64 %73, ptrtoint (ptr @que to i64)
  %75 = sdiv exact i64 %74, 4
  %76 = trunc i64 %75 to i32
  store i32 %76, ptr @tot, align 4, !tbaa !5
  store i32 1, ptr @sq, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %84, %65
  %78 = load i32, ptr @sq, align 4, !tbaa !5
  %79 = load i32, ptr @sq, align 4, !tbaa !5
  %80 = mul nsw i32 %78, %79
  %81 = load i32, ptr @tot, align 4, !tbaa !5
  %82 = icmp slt i32 %80, %81
  br i1 %82, label %83, label %87

83:                                               ; preds = %77
  br label %84

84:                                               ; preds = %83
  %85 = load i32, ptr @sq, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr @sq, align 4, !tbaa !5
  br label %77, !llvm.loop !14

87:                                               ; preds = %77
  %88 = load i32, ptr @tot, align 4, !tbaa !5
  %89 = sub nsw i32 %88, 1
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [300001 x i32], ptr @que, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = load i32, ptr @dt, align 4, !tbaa !5
  %94 = add nsw i32 %92, %93
  %95 = load i32, ptr @tot, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [300001 x i32], ptr @que, i64 0, i64 %96
  store i32 %94, ptr %97, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %126, %87
  %99 = load i32, ptr %6, align 4, !tbaa !5
  %100 = load i32, ptr @n, align 4, !tbaa !5
  %101 = icmp slt i32 %99, %100
  br i1 %101, label %103, label %102

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

103:                                              ; preds = %98
  %104 = load i32, ptr @tot, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds i32, ptr @que, i64 %105
  %107 = load i32, ptr %6, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [150001 x i32], ptr @a, i64 0, i64 %108
  %110 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef @que, ptr noundef %106, ptr noundef nonnull align 4 dereferenceable(4) %109)
  %111 = ptrtoint ptr %110 to i64
  %112 = sub i64 %111, ptrtoint (ptr @que to i64)
  %113 = sdiv exact i64 %112, 4
  %114 = trunc i64 %113 to i32
  %115 = load i32, ptr %6, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [150001 x i32], ptr @a, i64 0, i64 %116
  store i32 %114, ptr %117, align 4, !tbaa !5
  %118 = load i32, ptr %6, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [150001 x i32], ptr @a, i64 0, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [300001 x i32], ptr @cnt, i64 0, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %123, align 4, !tbaa !5
  br label %126

126:                                              ; preds = %103
  %127 = load i32, ptr %6, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %6, align 4, !tbaa !5
  br label %98, !llvm.loop !15

129:                                              ; preds = %102
  %130 = load i32, ptr @tot, align 4, !tbaa !5
  %131 = load i32, ptr @tot, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [300001 x i32], ptr @nxt, i64 0, i64 %132
  store i32 %130, ptr %133, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %134 = load i32, ptr @tot, align 4, !tbaa !5
  %135 = sub nsw i32 %134, 1
  store i32 %135, ptr %7, align 4, !tbaa !5
  br label %136

136:                                              ; preds = %233, %129
  %137 = load i32, ptr %7, align 4, !tbaa !5
  %138 = icmp sge i32 %137, 0
  br i1 %138, label %140, label %139

139:                                              ; preds = %136
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %236

140:                                              ; preds = %136
  %141 = load i32, ptr %7, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [300001 x i32], ptr @nxt, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = load i32, ptr %7, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [300001 x i32], ptr @nxt, i64 0, i64 %147
  store i32 %145, ptr %148, align 4, !tbaa !5
  br label %149

149:                                              ; preds = %166, %140
  %150 = load i32, ptr %7, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [300001 x i32], ptr @nxt, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = sub nsw i32 %153, 1
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [300001 x i32], ptr @que, i64 0, i64 %155
  %157 = load i32, ptr %156, align 4, !tbaa !5
  %158 = load i32, ptr %7, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [300001 x i32], ptr @que, i64 0, i64 %159
  %161 = load i32, ptr %160, align 4, !tbaa !5
  %162 = sub nsw i32 %157, %161
  %163 = load i32, ptr @dt, align 4, !tbaa !5
  %164 = icmp sgt i32 %162, %163
  br i1 %164, label %165, label %172

165:                                              ; preds = %149
  br label %166

166:                                              ; preds = %165
  %167 = load i32, ptr %7, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [300001 x i32], ptr @nxt, i64 0, i64 %168
  %170 = load i32, ptr %169, align 4, !tbaa !5
  %171 = add nsw i32 %170, -1
  store i32 %171, ptr %169, align 4, !tbaa !5
  br label %149, !llvm.loop !16

172:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %173 = load i32, ptr %7, align 4, !tbaa !5
  %174 = load i32, ptr @sq, align 4, !tbaa !5
  %175 = sdiv i32 %173, %174
  %176 = add nsw i32 %175, 1
  %177 = load i32, ptr @sq, align 4, !tbaa !5
  %178 = mul nsw i32 %176, %177
  store i32 %178, ptr %8, align 4, !tbaa !5
  %179 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @tot, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %180 = load i32, ptr %179, align 4, !tbaa !5
  %181 = load i32, ptr %7, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [300001 x i32], ptr @upp, i64 0, i64 %182
  store i32 %180, ptr %183, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %184 = load i32, ptr %7, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [300001 x i32], ptr @cnt, i64 0, i64 %185
  %187 = load i32, ptr %186, align 4, !tbaa !5
  %188 = icmp ne i32 %187, 0
  br i1 %188, label %189, label %194

189:                                              ; preds = %172
  %190 = load i32, ptr %7, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [300001 x i32], ptr @nxt, i64 0, i64 %191
  %193 = load i32, ptr %192, align 4, !tbaa !5
  br label %197

194:                                              ; preds = %172
  %195 = load i32, ptr %7, align 4, !tbaa !5
  %196 = add nsw i32 %195, 1
  br label %197

197:                                              ; preds = %194, %189
  %198 = phi i32 [ %193, %189 ], [ %196, %194 ]
  store i32 %198, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %199 = load i32, ptr %7, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [300001 x i32], ptr @cnt, i64 0, i64 %200
  %202 = load i32, ptr %201, align 4, !tbaa !5
  %203 = icmp ne i32 %202, 0
  %204 = xor i1 %203, true
  %205 = xor i1 %204, true
  %206 = zext i1 %205 to i32
  store i32 %206, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %207 = load i32, ptr %9, align 4, !tbaa !5
  %208 = load i32, ptr %7, align 4, !tbaa !5
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [300001 x i32], ptr @upp, i64 0, i64 %209
  %211 = load i32, ptr %210, align 4, !tbaa !5
  %212 = icmp slt i32 %207, %211
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  br i1 %212, label %213, label %226

213:                                              ; preds = %197
  %214 = load i32, ptr %9, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [300001 x %"struct.std::pair"], ptr @jmp, i64 0, i64 %215
  %217 = getelementptr inbounds %"struct.std::pair", ptr %216, i32 0, i32 0
  %218 = load i32, ptr %9, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [300001 x %"struct.std::pair"], ptr @jmp, i64 0, i64 %219
  %221 = getelementptr inbounds %"struct.std::pair", ptr %220, i32 0, i32 1
  %222 = load i32, ptr %221, align 4, !tbaa !17
  %223 = load i32, ptr %10, align 4, !tbaa !5
  %224 = add nsw i32 %222, %223
  store i32 %224, ptr %12, align 4, !tbaa !5
  %225 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %217, ptr noundef nonnull align 4 dereferenceable(4) %12)
  store i64 %225, ptr %11, align 4
  br label %228

226:                                              ; preds = %197
  %227 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  store i64 %227, ptr %11, align 4
  br label %228

228:                                              ; preds = %226, %213
  %229 = load i32, ptr %7, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [300001 x %"struct.std::pair"], ptr @jmp, i64 0, i64 %230
  %232 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %231, ptr noundef nonnull align 4 dereferenceable(8) %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %233

233:                                              ; preds = %228
  %234 = load i32, ptr %7, align 4, !tbaa !5
  %235 = add nsw i32 %234, -1
  store i32 %235, ptr %7, align 4, !tbaa !5
  br label %136, !llvm.loop !19

236:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %237

237:                                              ; preds = %289, %236
  %238 = load i32, ptr %13, align 4, !tbaa !5
  %239 = load i32, ptr @m, align 4, !tbaa !5
  %240 = icmp slt i32 %238, %239
  br i1 %240, label %242, label %241

241:                                              ; preds = %237
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %292

242:                                              ; preds = %237
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %243 = load i32, ptr %13, align 4, !tbaa !5
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds [150001 x %"struct.std::pair"], ptr @op, i64 0, i64 %244
  %246 = getelementptr inbounds %"struct.std::pair", ptr %245, i32 0, i32 0
  %247 = load i32, ptr %246, align 8, !tbaa !20
  store i32 %247, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %248 = load i32, ptr %13, align 4, !tbaa !5
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [150001 x %"struct.std::pair"], ptr @op, i64 0, i64 %249
  %251 = getelementptr inbounds %"struct.std::pair", ptr %250, i32 0, i32 1
  %252 = load i32, ptr %251, align 4, !tbaa !17
  store i32 %252, ptr %15, align 4, !tbaa !5
  %253 = load i32, ptr %14, align 4, !tbaa !5
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds [150001 x i32], ptr @a, i64 0, i64 %254
  %256 = load i32, ptr %255, align 4, !tbaa !5
  call void @_Z3updii(i32 noundef %256, i32 noundef -1)
  %257 = load i32, ptr @tot, align 4, !tbaa !5
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds i32, ptr @que, i64 %258
  %260 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef @que, ptr noundef %259, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %261 = ptrtoint ptr %260 to i64
  %262 = sub i64 %261, ptrtoint (ptr @que to i64)
  %263 = sdiv exact i64 %262, 4
  %264 = trunc i64 %263 to i32
  %265 = load i32, ptr %14, align 4, !tbaa !5
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds [150001 x i32], ptr @a, i64 0, i64 %266
  store i32 %264, ptr %267, align 4, !tbaa !5
  call void @_Z3updii(i32 noundef %264, i32 noundef 1)
  store i32 0, ptr %15, align 4, !tbaa !5
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %268

268:                                              ; preds = %273, %242
  %269 = load i32, ptr %14, align 4, !tbaa !5
  %270 = load i32, ptr @tot, align 4, !tbaa !5
  %271 = icmp slt i32 %269, %270
  br i1 %271, label %272, label %286

272:                                              ; preds = %268
  br label %273

273:                                              ; preds = %272
  %274 = load i32, ptr %14, align 4, !tbaa !5
  %275 = sext i32 %274 to i64
  %276 = getelementptr inbounds [300001 x %"struct.std::pair"], ptr @jmp, i64 0, i64 %275
  %277 = getelementptr inbounds %"struct.std::pair", ptr %276, i32 0, i32 1
  %278 = load i32, ptr %277, align 4, !tbaa !17
  %279 = load i32, ptr %15, align 4, !tbaa !5
  %280 = add nsw i32 %279, %278
  store i32 %280, ptr %15, align 4, !tbaa !5
  %281 = load i32, ptr %14, align 4, !tbaa !5
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds [300001 x %"struct.std::pair"], ptr @jmp, i64 0, i64 %282
  %284 = getelementptr inbounds %"struct.std::pair", ptr %283, i32 0, i32 0
  %285 = load i32, ptr %284, align 8, !tbaa !20
  store i32 %285, ptr %14, align 4, !tbaa !5
  br label %268, !llvm.loop !21

286:                                              ; preds = %268
  %287 = load i32, ptr %15, align 4, !tbaa !5
  %288 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %287)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %289

289:                                              ; preds = %286
  %290 = load i32, ptr %13, align 4, !tbaa !5
  %291 = add nsw i32 %290, 1
  store i32 %291, ptr %13, align 4, !tbaa !5
  br label %237, !llvm.loop !22

292:                                              ; preds = %241
  ret i32 0
}

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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z3updii(i32 noundef, i32 noundef) #3

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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nounwind }

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

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


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

%"struct.std::pair" = type { i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@dt = external dso_local global i32, align 4
@a = external dso_local global [150001 x i32], align 16
@op = external dso_local global [150001 x %"struct.std::pair"], align 16
@tot = external dso_local global i32, align 4
@sq = external dso_local local_unnamed_addr global i32, align 4
@que = external dso_local global [300001 x i32], align 16
@nxt = external dso_local local_unnamed_addr global [300001 x i32], align 16
@upp = external dso_local local_unnamed_addr global [300001 x i32], align 16
@cnt = external dso_local local_unnamed_addr global [300001 x i32], align 16
@jmp = external dso_local global [300001 x %"struct.std::pair"], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

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

.preheader49:                                     ; preds = %.lr.ph, %0
  %10 = load i32, ptr @m, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph52, label %.preheader49.._crit_edge_crit_edge

.preheader49.._crit_edge_crit_edge:               ; preds = %.preheader49
  %.pre = load i32, ptr @tot, align 4, !tbaa !5
  br label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %12 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv
  %13 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %12)
  %14 = load i32, ptr %12, align 4, !tbaa !5
  %15 = load i32, ptr @tot, align 4, !tbaa !5
  %16 = add nsw i32 %15, 1
  store i32 %16, ptr @tot, align 4, !tbaa !5
  %17 = sext i32 %15 to i64
  %18 = getelementptr inbounds [300001 x i32], ptr @que, i64 0, i64 %17
  store i32 %14, ptr %18, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = icmp slt i64 %indvars.iv.next, %20
  br i1 %21, label %.lr.ph, label %.preheader49, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph52, %.preheader49.._crit_edge_crit_edge
  %22 = phi i32 [ %.pre, %.preheader49.._crit_edge_crit_edge ], [ %38, %.lr.ph52 ]
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds i32, ptr @que, i64 %23
  tail call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @que, ptr noundef nonnull %24)
  %25 = load i32, ptr @tot, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds i32, ptr @que, i64 %26
  %28 = tail call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef nonnull @que, ptr noundef nonnull %27)
  %29 = ptrtoint ptr %28 to i64
  %30 = sub i64 %29, ptrtoint (ptr @que to i64)
  %31 = lshr exact i64 %30, 2
  %32 = trunc i64 %31 to i32
  store i32 %32, ptr @tot, align 4, !tbaa !5
  br label %44

.lr.ph52:                                         ; preds = %.preheader49, %.lr.ph52
  %indvars.iv70 = phi i64 [ %indvars.iv.next71, %.lr.ph52 ], [ 0, %.preheader49 ]
  %33 = getelementptr inbounds [150001 x %"struct.std::pair"], ptr @op, i64 0, i64 %indvars.iv70
  %34 = getelementptr inbounds i8, ptr %33, i64 4
  %35 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %33, ptr noundef nonnull %34)
  %36 = load i32, ptr %34, align 4, !tbaa !5
  %37 = load i32, ptr @tot, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr @tot, align 4, !tbaa !5
  %39 = sext i32 %37 to i64
  %40 = getelementptr inbounds [300001 x i32], ptr @que, i64 0, i64 %39
  store i32 %36, ptr %40, align 4, !tbaa !5
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  %41 = load i32, ptr @m, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = icmp slt i64 %indvars.iv.next71, %42
  br i1 %43, label %.lr.ph52, label %._crit_edge, !llvm.loop !11

44:                                               ; preds = %44, %._crit_edge
  %storemerge = phi i32 [ 1, %._crit_edge ], [ %47, %44 ]
  %45 = mul nuw nsw i32 %storemerge, %storemerge
  %46 = icmp slt i32 %45, %32
  %47 = add nuw nsw i32 %storemerge, 1
  br i1 %46, label %44, label %48, !llvm.loop !12

48:                                               ; preds = %44
  store i32 %storemerge, ptr @sq, align 4, !tbaa !5
  %49 = shl i64 %30, 30
  %sext47 = add i64 %49, -4294967296
  %50 = ashr i64 %sext47, 32
  %51 = getelementptr inbounds [300001 x i32], ptr @que, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = load i32, ptr @dt, align 4, !tbaa !5
  %54 = add nsw i32 %53, %52
  %55 = ashr i64 %49, 32
  %56 = getelementptr inbounds [300001 x i32], ptr @que, i64 0, i64 %55
  store i32 %54, ptr %56, align 4, !tbaa !5
  %57 = load i32, ptr @n, align 4, !tbaa !5
  %58 = icmp sgt i32 %57, 0
  br i1 %58, label %.lr.ph55, label %._crit_edge56

._crit_edge56.loopexit:                           ; preds = %.lr.ph55
  %.pre85 = load i32, ptr @tot, align 4, !tbaa !5
  br label %._crit_edge56

._crit_edge56:                                    ; preds = %._crit_edge56.loopexit, %48
  %59 = phi i32 [ %.pre85, %._crit_edge56.loopexit ], [ %32, %48 ]
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [300001 x i32], ptr @nxt, i64 0, i64 %60
  store i32 %59, ptr %61, align 4, !tbaa !5
  %62 = icmp sgt i32 %59, 0
  br i1 %62, label %.lr.ph61.preheader, label %.preheader

.lr.ph61.preheader:                               ; preds = %._crit_edge56
  %63 = zext nneg i32 %59 to i64
  br label %.lr.ph61

.lr.ph55:                                         ; preds = %48, %.lr.ph55
  %indvars.iv73 = phi i64 [ %indvars.iv.next74, %.lr.ph55 ], [ 0, %48 ]
  %64 = load i32, ptr @tot, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds i32, ptr @que, i64 %65
  %67 = getelementptr inbounds [150001 x i32], ptr @a, i64 0, i64 %indvars.iv73
  %68 = tail call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull @que, ptr noundef nonnull %66, ptr noundef nonnull align 4 dereferenceable(4) %67)
  %69 = ptrtoint ptr %68 to i64
  %70 = sub i64 %69, ptrtoint (ptr @que to i64)
  %71 = lshr exact i64 %70, 2
  %72 = trunc i64 %71 to i32
  store i32 %72, ptr %67, align 4, !tbaa !5
  %sext = shl i64 %70, 30
  %73 = ashr i64 %sext, 32
  %74 = getelementptr inbounds [300001 x i32], ptr @cnt, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %74, align 4, !tbaa !5
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %77 = load i32, ptr @n, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = icmp slt i64 %indvars.iv.next74, %78
  br i1 %79, label %.lr.ph55, label %._crit_edge56.loopexit, !llvm.loop !13

.preheader:                                       ; preds = %123, %._crit_edge56
  %80 = load i32, ptr @m, align 4, !tbaa !5
  %81 = icmp sgt i32 %80, 0
  br i1 %81, label %.lr.ph67, label %._crit_edge68

.lr.ph61:                                         ; preds = %.lr.ph61.preheader, %123
  %indvars.iv79 = phi i64 [ %63, %.lr.ph61.preheader ], [ %indvars.iv.next80, %123 ]
  %indvars.iv.next80 = add nsw i64 %indvars.iv79, -1
  %82 = getelementptr inbounds [300001 x i32], ptr @nxt, i64 0, i64 %indvars.iv79
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = getelementptr inbounds [300001 x i32], ptr @que, i64 0, i64 %indvars.iv.next80
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = load i32, ptr @dt, align 4, !tbaa !5
  %87 = sext i32 %83 to i64
  br label %88

88:                                               ; preds = %88, %.lr.ph61
  %indvars.iv76 = phi i64 [ %indvars.iv.next77, %88 ], [ %87, %.lr.ph61 ]
  %indvars.iv.next77 = add nsw i64 %indvars.iv76, -1
  %89 = getelementptr inbounds [300001 x i32], ptr @que, i64 0, i64 %indvars.iv.next77
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = sub nsw i32 %90, %85
  %92 = icmp sgt i32 %91, %86
  br i1 %92, label %88, label %93, !llvm.loop !14

93:                                               ; preds = %88
  %94 = getelementptr inbounds [300001 x i32], ptr @nxt, i64 0, i64 %indvars.iv.next80
  %95 = trunc nsw i64 %indvars.iv76 to i32
  store i32 %95, ptr %94, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %96 = load i32, ptr @sq, align 4, !tbaa !5
  %97 = trunc nuw nsw i64 %indvars.iv.next80 to i32
  %98 = sdiv i32 %97, %96
  %99 = add nsw i32 %98, 1
  %100 = mul nsw i32 %99, %96
  store i32 %100, ptr %1, align 4, !tbaa !5
  %101 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @tot, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = getelementptr inbounds [300001 x i32], ptr @upp, i64 0, i64 %indvars.iv.next80
  store i32 %102, ptr %103, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %104 = getelementptr inbounds [300001 x i32], ptr @cnt, i64 0, i64 %indvars.iv.next80
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %.not = icmp eq i32 %105, 0
  %106 = trunc nuw nsw i64 %indvars.iv79 to i32
  br i1 %.not, label %109, label %107

107:                                              ; preds = %93
  %108 = load i32, ptr %94, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %93, %107
  %110 = phi i32 [ %108, %107 ], [ %106, %93 ]
  store i32 %110, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %111 = icmp ne i32 %105, 0
  %112 = zext i1 %111 to i32
  store i32 %112, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %113 = icmp slt i32 %110, %102
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  br i1 %113, label %114, label %121

114:                                              ; preds = %109
  %115 = sext i32 %110 to i64
  %116 = getelementptr inbounds [300001 x %"struct.std::pair"], ptr @jmp, i64 0, i64 %115
  %117 = getelementptr inbounds i8, ptr %116, i64 4
  %118 = load i32, ptr %117, align 4, !tbaa !15
  %119 = add nsw i32 %118, %112
  store i32 %119, ptr %5, align 4, !tbaa !5
  %120 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %116, ptr noundef nonnull align 4 dereferenceable(4) %5)
  br label %123

121:                                              ; preds = %109
  %122 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  br label %123

123:                                              ; preds = %121, %114
  %storemerge46 = phi i64 [ %122, %121 ], [ %120, %114 ]
  store i64 %storemerge46, ptr %4, align 8
  %124 = getelementptr inbounds [300001 x %"struct.std::pair"], ptr @jmp, i64 0, i64 %indvars.iv.next80
  %125 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %124, ptr noundef nonnull align 4 dereferenceable(8) %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %126 = icmp sgt i64 %indvars.iv79, 1
  br i1 %126, label %.lr.ph61, label %.preheader, !llvm.loop !17

._crit_edge68:                                    ; preds = %152, %.preheader
  ret i32 0

.lr.ph67:                                         ; preds = %.preheader, %152
  %indvars.iv82 = phi i64 [ %indvars.iv.next83, %152 ], [ 0, %.preheader ]
  %127 = getelementptr inbounds [150001 x %"struct.std::pair"], ptr @op, i64 0, i64 %indvars.iv82
  %128 = load i32, ptr %127, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %129 = getelementptr inbounds i8, ptr %127, i64 4
  %130 = load i32, ptr %129, align 4, !tbaa !15
  store i32 %130, ptr %6, align 4, !tbaa !5
  %131 = sext i32 %128 to i64
  %132 = getelementptr inbounds [150001 x i32], ptr @a, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !5
  call void @_Z3updii(i32 noundef %133, i32 noundef -1)
  %134 = load i32, ptr @tot, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds i32, ptr @que, i64 %135
  %137 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull @que, ptr noundef nonnull %136, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %138 = ptrtoint ptr %137 to i64
  %139 = sub i64 %138, ptrtoint (ptr @que to i64)
  %140 = lshr exact i64 %139, 2
  %141 = trunc i64 %140 to i32
  store i32 %141, ptr %132, align 4, !tbaa !5
  call void @_Z3updii(i32 noundef %141, i32 noundef 1)
  store i32 0, ptr %6, align 4, !tbaa !5
  %142 = load i32, ptr @tot, align 4, !tbaa !5
  %143 = icmp sgt i32 %142, 0
  br i1 %143, label %.lr.ph64, label %152

.lr.ph64:                                         ; preds = %.lr.ph67, %.lr.ph64
  %.062 = phi i32 [ %150, %.lr.ph64 ], [ 0, %.lr.ph67 ]
  %144 = phi i32 [ %149, %.lr.ph64 ], [ 0, %.lr.ph67 ]
  %145 = sext i32 %.062 to i64
  %146 = getelementptr inbounds [300001 x %"struct.std::pair"], ptr @jmp, i64 0, i64 %145
  %147 = getelementptr inbounds i8, ptr %146, i64 4
  %148 = load i32, ptr %147, align 4, !tbaa !15
  %149 = add nsw i32 %144, %148
  %150 = load i32, ptr %146, align 8, !tbaa !18
  %151 = icmp slt i32 %150, %142
  br i1 %151, label %.lr.ph64, label %._crit_edge65, !llvm.loop !19

._crit_edge65:                                    ; preds = %.lr.ph64
  store i32 %149, ptr %6, align 4, !tbaa !5
  br label %152

152:                                              ; preds = %._crit_edge65, %.lr.ph67
  %153 = phi i32 [ %149, %._crit_edge65 ], [ 0, %.lr.ph67 ]
  %154 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %153)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %155 = load i32, ptr @m, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = icmp slt i64 %indvars.iv.next83, %156
  br i1 %157, label %.lr.ph67, label %._crit_edge68, !llvm.loop !20
}

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z3updii(i32 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 = { 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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nounwind }

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

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


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