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

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::greater" = type { i8 }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@sz = external dso_local global [100001 x i32], align 16
@mx = external dso_local global [100001 x [2 x i32]], align 16
@seq = external dso_local global [100001 x i32], align 16
@ans = external dso_local global i32, align 4
@a = external dso_local global [100001 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::greater", align 1
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"class.std::vector", align 8
  store i32 0, ptr %1, align 4
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %17

17:                                               ; preds = %305, %0
  %18 = load i32, ptr @t, align 4, !tbaa !5
  %19 = add nsw i32 %18, -1
  store i32 %19, ptr @t, align 4, !tbaa !5
  %20 = icmp ne i32 %18, 0
  br i1 %20, label %21, label %306

21:                                               ; preds = %17
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  store i32 100001, ptr @sz, align 16, !tbaa !5
  store i32 100001, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %154, %21
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = load i32, ptr @n, align 4, !tbaa !5
  %26 = icmp sle i32 %24, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %23
  store i32 4, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %157

28:                                               ; preds = %23
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @seq)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %40, %28
  %31 = load i32, ptr %4, align 4, !tbaa !5
  %32 = load i32, ptr @seq, align 16, !tbaa !5
  %33 = icmp sle i32 %31, %32
  br i1 %33, label %35, label %34

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

35:                                               ; preds = %30
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds i32, ptr @seq, i64 %37
  %39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %38)
  br label %40

40:                                               ; preds = %35
  %41 = load i32, ptr %4, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %4, align 4, !tbaa !5
  br label %30, !llvm.loop !9

43:                                               ; preds = %34
  %44 = load i32, ptr @seq, align 16, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds i32, ptr @seq, i64 %45
  %47 = getelementptr inbounds i32, ptr %46, i64 1
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef getelementptr inbounds (i32, ptr @seq, i64 1), ptr noundef %47)
  %48 = load i32, ptr @seq, align 16, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds i32, ptr @seq, i64 %49
  %51 = getelementptr inbounds i32, ptr %50, i64 1
  %52 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef getelementptr inbounds (i32, ptr @seq, i64 1), ptr noundef %51)
  %53 = ptrtoint ptr %52 to i64
  %54 = sub i64 %53, ptrtoint (ptr @seq to i64)
  %55 = sdiv exact i64 %54, 4
  %56 = sub nsw i64 %55, 1
  %57 = trunc i64 %56 to i32
  %58 = load i32, ptr %2, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [100001 x i32], ptr @sz, i64 0, i64 %59
  store i32 %57, ptr %60, align 4, !tbaa !5
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [100001 x i32], ptr @sz, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = load i32, ptr @seq, align 16, !tbaa !5
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %67, label %75

67:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  %68 = load i32, ptr %2, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [100001 x i32], ptr @sz, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %5, align 4, !tbaa !5
  %73 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @ans, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %74 = load i32, ptr %73, align 4, !tbaa !5
  store i32 %74, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  br label %75

75:                                               ; preds = %67, %43
  %76 = load i32, ptr %2, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @a, i64 0, i64 %77
  %79 = load i32, ptr %2, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [100001 x i32], ptr @sz, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  call void @_ZNSt6vectorIiSaIiEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %78, i64 noundef %83)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %150, %75
  %85 = load i32, ptr %6, align 4, !tbaa !5
  %86 = load i32, ptr %2, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [100001 x i32], ptr @sz, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = icmp sle i32 %85, %89
  br i1 %90, label %92, label %91

91:                                               ; preds = %84
  store i32 10, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  br label %153

92:                                               ; preds = %84
  %93 = load i32, ptr %2, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @a, i64 0, i64 %94
  %96 = load i32, ptr %6, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [100001 x i32], ptr @seq, i64 0, i64 %97
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %95, ptr noundef nonnull align 4 dereferenceable(4) %98)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  %99 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %99, ptr %7, align 4, !tbaa !5
  %100 = load i32, ptr %6, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [100001 x i32], ptr @seq, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [100001 x [2 x i32]], ptr @mx, i64 0, i64 %104
  %106 = getelementptr inbounds [2 x i32], ptr %105, i64 0, i64 0
  %107 = load i32, ptr %106, align 8, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [100001 x i32], ptr @sz, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = load i32, ptr %7, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [100001 x i32], ptr @sz, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = icmp sgt i32 %110, %114
  br i1 %115, label %116, label %124

116:                                              ; preds = %92
  %117 = load i32, ptr %6, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [100001 x i32], ptr @seq, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [100001 x [2 x i32]], ptr @mx, i64 0, i64 %121
  %123 = getelementptr inbounds [2 x i32], ptr %122, i64 0, i64 0
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %123, ptr noundef nonnull align 4 dereferenceable(4) %7) #8
  br label %124

124:                                              ; preds = %116, %92
  %125 = load i32, ptr %6, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [100001 x i32], ptr @seq, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [100001 x [2 x i32]], ptr @mx, i64 0, i64 %129
  %131 = getelementptr inbounds [2 x i32], ptr %130, i64 0, i64 1
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [100001 x i32], ptr @sz, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = load i32, ptr %7, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [100001 x i32], ptr @sz, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = icmp sgt i32 %135, %139
  br i1 %140, label %141, label %149

141:                                              ; preds = %124
  %142 = load i32, ptr %6, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [100001 x i32], ptr @seq, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [100001 x [2 x i32]], ptr @mx, i64 0, i64 %146
  %148 = getelementptr inbounds [2 x i32], ptr %147, i64 0, i64 1
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %148, ptr noundef nonnull align 4 dereferenceable(4) %7) #8
  br label %149

149:                                              ; preds = %141, %124
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %150

150:                                              ; preds = %149
  %151 = load i32, ptr %6, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %6, align 4, !tbaa !5
  br label %84, !llvm.loop !11

153:                                              ; preds = %91
  br label %154

154:                                              ; preds = %153
  %155 = load i32, ptr %2, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %2, align 4, !tbaa !5
  br label %23, !llvm.loop !12

157:                                              ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %158

158:                                              ; preds = %254, %157
  %159 = load i32, ptr %8, align 4, !tbaa !5
  %160 = load i32, ptr @n, align 4, !tbaa !5
  %161 = icmp sle i32 %159, %160
  br i1 %161, label %163, label %162

162:                                              ; preds = %158
  store i32 13, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %257

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

164:                                              ; preds = %222, %163
  %165 = load i32, ptr %9, align 4, !tbaa !5
  %166 = load i32, ptr %8, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [100001 x i32], ptr @sz, i64 0, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !5
  %170 = icmp slt i32 %165, %169
  br i1 %170, label %172, label %171

171:                                              ; preds = %164
  store i32 16, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %225

172:                                              ; preds = %164
  %173 = load i32, ptr %8, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @a, i64 0, i64 %174
  %176 = load i32, ptr %9, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %175, i64 noundef %177) #8
  %179 = load i32, ptr %178, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [100001 x [2 x i32]], ptr @mx, i64 0, i64 %180
  %182 = getelementptr inbounds [2 x i32], ptr %181, i64 0, i64 0
  %183 = load i32, ptr %182, align 8, !tbaa !5
  %184 = load i32, ptr %8, align 4, !tbaa !5
  %185 = icmp eq i32 %183, %184
  br i1 %185, label %186, label %201

186:                                              ; preds = %172
  %187 = load i32, ptr %8, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @a, i64 0, i64 %188
  %190 = load i32, ptr %9, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %189, i64 noundef %191) #8
  %193 = load i32, ptr %192, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [100001 x [2 x i32]], ptr @mx, i64 0, i64 %194
  %196 = getelementptr inbounds [2 x i32], ptr %195, i64 0, i64 1
  %197 = load i32, ptr %196, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [100001 x i32], ptr @sz, i64 0, i64 %198
  %200 = load i32, ptr %199, align 4, !tbaa !5
  br label %216

201:                                              ; preds = %172
  %202 = load i32, ptr %8, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @a, i64 0, i64 %203
  %205 = load i32, ptr %9, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %204, i64 noundef %206) #8
  %208 = load i32, ptr %207, align 4, !tbaa !5
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [100001 x [2 x i32]], ptr @mx, i64 0, i64 %209
  %211 = getelementptr inbounds [2 x i32], ptr %210, i64 0, i64 0
  %212 = load i32, ptr %211, align 8, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [100001 x i32], ptr @sz, i64 0, i64 %213
  %215 = load i32, ptr %214, align 4, !tbaa !5
  br label %216

216:                                              ; preds = %201, %186
  %217 = phi i32 [ %200, %186 ], [ %215, %201 ]
  %218 = load i32, ptr %9, align 4, !tbaa !5
  %219 = add nsw i32 %218, 1
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [100001 x i32], ptr @seq, i64 0, i64 %220
  store i32 %217, ptr %221, align 4, !tbaa !5
  br label %222

222:                                              ; preds = %216
  %223 = load i32, ptr %9, align 4, !tbaa !5
  %224 = add nsw i32 %223, 1
  store i32 %224, ptr %9, align 4, !tbaa !5
  br label %164, !llvm.loop !13

225:                                              ; preds = %171
  %226 = load i32, ptr %8, align 4, !tbaa !5
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [100001 x i32], ptr @sz, i64 0, i64 %227
  %229 = load i32, ptr %228, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds i32, ptr @seq, i64 %230
  %232 = getelementptr inbounds i32, ptr %231, i64 1
  call void @_ZSt4sortIPiSt7greaterIiEEvT_S3_T0_(ptr noundef getelementptr inbounds (i32, ptr @seq, i64 1), ptr noundef %232)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %233

233:                                              ; preds = %250, %225
  %234 = load i32, ptr %11, align 4, !tbaa !5
  %235 = load i32, ptr %8, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [100001 x i32], ptr @sz, i64 0, i64 %236
  %238 = load i32, ptr %237, align 4, !tbaa !5
  %239 = icmp sle i32 %234, %238
  br i1 %239, label %241, label %240

240:                                              ; preds = %233
  store i32 19, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %253

241:                                              ; preds = %233
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %242 = load i32, ptr %11, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [100001 x i32], ptr @seq, i64 0, i64 %243
  %245 = load i32, ptr %244, align 4, !tbaa !5
  %246 = load i32, ptr %11, align 4, !tbaa !5
  %247 = add nsw i32 %245, %246
  store i32 %247, ptr %12, align 4, !tbaa !5
  %248 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @ans, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %249 = load i32, ptr %248, align 4, !tbaa !5
  store i32 %249, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %250

250:                                              ; preds = %241
  %251 = load i32, ptr %11, align 4, !tbaa !5
  %252 = add nsw i32 %251, 1
  store i32 %252, ptr %11, align 4, !tbaa !5
  br label %233, !llvm.loop !14

253:                                              ; preds = %240
  br label %254

254:                                              ; preds = %253
  %255 = load i32, ptr %8, align 4, !tbaa !5
  %256 = add nsw i32 %255, 1
  store i32 %256, ptr %8, align 4, !tbaa !5
  br label %158, !llvm.loop !15

257:                                              ; preds = %162
  %258 = load i32, ptr @ans, align 4, !tbaa !5
  %259 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %258)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %260

260:                                              ; preds = %302, %257
  %261 = load i32, ptr %13, align 4, !tbaa !5
  %262 = load i32, ptr @n, align 4, !tbaa !5
  %263 = icmp sle i32 %261, %262
  br i1 %263, label %265, label %264

264:                                              ; preds = %260
  store i32 22, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %305

265:                                              ; preds = %260
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %266

266:                                              ; preds = %295, %265
  %267 = load i32, ptr %14, align 4, !tbaa !5
  %268 = load i32, ptr %13, align 4, !tbaa !5
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [100001 x i32], ptr @sz, i64 0, i64 %269
  %271 = load i32, ptr %270, align 4, !tbaa !5
  %272 = icmp slt i32 %267, %271
  br i1 %272, label %274, label %273

273:                                              ; preds = %266
  store i32 25, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %298

274:                                              ; preds = %266
  %275 = load i32, ptr %13, align 4, !tbaa !5
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @a, i64 0, i64 %276
  %278 = load i32, ptr %14, align 4, !tbaa !5
  %279 = sext i32 %278 to i64
  %280 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %277, i64 noundef %279) #8
  %281 = load i32, ptr %280, align 4, !tbaa !5
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds [100001 x [2 x i32]], ptr @mx, i64 0, i64 %282
  %284 = getelementptr inbounds [2 x i32], ptr %283, i64 0, i64 1
  store i32 0, ptr %284, align 4, !tbaa !5
  %285 = load i32, ptr %13, align 4, !tbaa !5
  %286 = sext i32 %285 to i64
  %287 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @a, i64 0, i64 %286
  %288 = load i32, ptr %14, align 4, !tbaa !5
  %289 = sext i32 %288 to i64
  %290 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %287, i64 noundef %289) #8
  %291 = load i32, ptr %290, align 4, !tbaa !5
  %292 = sext i32 %291 to i64
  %293 = getelementptr inbounds [100001 x [2 x i32]], ptr @mx, i64 0, i64 %292
  %294 = getelementptr inbounds [2 x i32], ptr %293, i64 0, i64 0
  store i32 0, ptr %294, align 8, !tbaa !5
  br label %295

295:                                              ; preds = %274
  %296 = load i32, ptr %14, align 4, !tbaa !5
  %297 = add nsw i32 %296, 1
  store i32 %297, ptr %14, align 4, !tbaa !5
  br label %266, !llvm.loop !16

298:                                              ; preds = %273
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #8
  call void @llvm.memset.p0.i64(ptr align 8 %15, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #8
  %299 = load i32, ptr %13, align 4, !tbaa !5
  %300 = sext i32 %299 to i64
  %301 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @a, i64 0, i64 %300
  call void @_ZNSt6vectorIiSaIiEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 8 dereferenceable(24) %301) #8
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #8
  br label %302

302:                                              ; preds = %298
  %303 = load i32, ptr %13, align 4, !tbaa !5
  %304 = add nsw i32 %303, 1
  store i32 %304, ptr %13, align 4, !tbaa !5
  br label %260, !llvm.loop !17

305:                                              ; preds = %264
  br label %17, !llvm.loop !18

306:                                              ; preds = %17
  ret i32 0
}

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

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

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

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

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

; 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)) #5

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(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(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

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

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

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

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #6 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { 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 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !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::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
@sz = external dso_local local_unnamed_addr global [100001 x i32], align 16
@mx = external dso_local global [100001 x [2 x i32]], align 16
@seq = external dso_local global [100001 x i32], align 16
@ans = external dso_local global i32, align 4
@a = external dso_local global [100001 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::vector", align 8
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %6 = load i32, ptr @t, align 4, !tbaa !5
  %7 = add nsw i32 %6, -1
  store i32 %7, ptr @t, align 4, !tbaa !5
  %.not102 = icmp eq i32 %6, 0
  br i1 %.not102, label %._crit_edge105, label %.lr.ph104

.loopexit:                                        ; preds = %._crit_edge98, %._crit_edge95
  %8 = load i32, ptr @t, align 4, !tbaa !5
  %9 = add nsw i32 %8, -1
  store i32 %9, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %._crit_edge105, label %.lr.ph104, !llvm.loop !9

.lr.ph104:                                        ; preds = %0, %.loopexit
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  store i32 100001, ptr @sz, align 16, !tbaa !5
  store i32 100001, ptr @ans, align 4, !tbaa !5
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %.not5877 = icmp slt i32 %11, 1
  br i1 %.not5877, label %._crit_edge95, label %.lr.ph80

.preheader65:                                     ; preds = %._crit_edge75
  %.not5993 = icmp slt i32 %38, 1
  br i1 %.not5993, label %._crit_edge95, label %.preheader64

.lr.ph80:                                         ; preds = %.lr.ph104, %._crit_edge75
  %indvars.iv112 = phi i64 [ %indvars.iv.next113, %._crit_edge75 ], [ 1, %.lr.ph104 ]
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @seq)
  %13 = load i32, ptr @seq, align 16, !tbaa !5
  %.not6269 = icmp slt i32 %13, 1
  br i1 %.not6269, label %.lr.ph80.._crit_edge_crit_edge, label %.lr.ph

.lr.ph80.._crit_edge_crit_edge:                   ; preds = %.lr.ph80
  %.pre135 = sext i32 %13 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph80.._crit_edge_crit_edge
  %.pre-phi136 = phi i64 [ %.pre135, %.lr.ph80.._crit_edge_crit_edge ], [ %28, %.lr.ph ]
  %gep = getelementptr i32, ptr getelementptr inbounds (i8, ptr @seq, i64 4), i64 %.pre-phi136
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull getelementptr inbounds (i8, ptr @seq, i64 4), ptr noundef nonnull %gep)
  %14 = load i32, ptr @seq, align 16, !tbaa !5
  %15 = sext i32 %14 to i64
  %gep76 = getelementptr i32, ptr getelementptr inbounds (i8, ptr @seq, i64 4), i64 %15
  %16 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef nonnull getelementptr inbounds (i8, ptr @seq, i64 4), ptr noundef nonnull %gep76)
  %17 = ptrtoint ptr %16 to i64
  %18 = sub i64 %17, ptrtoint (ptr @seq to i64)
  %19 = lshr exact i64 %18, 2
  %20 = trunc i64 %19 to i32
  %21 = add i32 %20, -1
  %22 = getelementptr inbounds [100001 x i32], ptr @sz, i64 0, i64 %indvars.iv112
  store i32 %21, ptr %22, align 4, !tbaa !5
  %23 = load i32, ptr @seq, align 16, !tbaa !5
  %24 = icmp slt i32 %21, %23
  br i1 %24, label %29, label %32

.lr.ph:                                           ; preds = %.lr.ph80, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.lr.ph80 ]
  %25 = getelementptr inbounds i32, ptr @seq, i64 %indvars.iv
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %25)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %27 = load i32, ptr @seq, align 16, !tbaa !5
  %28 = sext i32 %27 to i64
  %.not62.not = icmp slt i64 %indvars.iv, %28
  br i1 %.not62.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

29:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  store i32 %20, ptr %1, align 4, !tbaa !5
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @ans, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %31 = load i32, ptr %30, align 4, !tbaa !5
  store i32 %31, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  %.pre = load i32, ptr %22, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %29, %._crit_edge
  %33 = phi i32 [ %.pre, %29 ], [ %21, %._crit_edge ]
  %34 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @a, i64 0, i64 %indvars.iv112
  %35 = sext i32 %33 to i64
  call void @_ZNSt6vectorIiSaIiEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %34, i64 noundef %35)
  %36 = load i32, ptr %22, align 4, !tbaa !5
  %.not6371 = icmp slt i32 %36, 1
  br i1 %.not6371, label %._crit_edge75, label %.lr.ph74.preheader

.lr.ph74.preheader:                               ; preds = %32
  %37 = trunc nuw nsw i64 %indvars.iv112 to i32
  br label %.lr.ph74

._crit_edge75:                                    ; preds = %63, %32
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %38 = load i32, ptr @n, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %.not58.not = icmp slt i64 %indvars.iv112, %39
  br i1 %.not58.not, label %.lr.ph80, label %.preheader65, !llvm.loop !12

.lr.ph74:                                         ; preds = %.lr.ph74.preheader, %63
  %indvars.iv109 = phi i64 [ 1, %.lr.ph74.preheader ], [ %indvars.iv.next110, %63 ]
  %40 = getelementptr inbounds [100001 x i32], ptr @seq, i64 0, i64 %indvars.iv109
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %34, ptr noundef nonnull align 4 dereferenceable(4) %40)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  store i32 %37, ptr %2, align 4, !tbaa !5
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [100001 x [2 x i32]], ptr @mx, i64 0, i64 %42
  %44 = load i32, ptr %43, align 8, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100001 x i32], ptr @sz, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = load i32, ptr %22, align 4, !tbaa !5
  %49 = icmp sgt i32 %47, %48
  br i1 %49, label %50, label %51

50:                                               ; preds = %.lr.ph74
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %43, ptr noundef nonnull align 4 dereferenceable(4) %2) #8
  %.pre130 = load i32, ptr %40, align 4, !tbaa !5
  %.pre131 = load i32, ptr %2, align 4, !tbaa !5
  %.pre132 = sext i32 %.pre130 to i64
  br label %51

51:                                               ; preds = %50, %.lr.ph74
  %.pre-phi = phi i64 [ %.pre132, %50 ], [ %42, %.lr.ph74 ]
  %52 = phi i32 [ %.pre131, %50 ], [ %37, %.lr.ph74 ]
  %53 = getelementptr inbounds [100001 x [2 x i32]], ptr @mx, i64 0, i64 %.pre-phi, i64 1
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [100001 x i32], ptr @sz, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = sext i32 %52 to i64
  %59 = getelementptr inbounds [100001 x i32], ptr @sz, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = icmp sgt i32 %57, %60
  br i1 %61, label %62, label %63

62:                                               ; preds = %51
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %53, ptr noundef nonnull align 4 dereferenceable(4) %2) #8
  br label %63

63:                                               ; preds = %62, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
  %64 = load i32, ptr %22, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %.not63.not = icmp slt i64 %indvars.iv109, %65
  br i1 %.not63.not, label %.lr.ph74, label %._crit_edge75, !llvm.loop !13

.preheader64:                                     ; preds = %.preheader65, %._crit_edge91
  %indvars.iv121 = phi i64 [ %indvars.iv.next122, %._crit_edge91 ], [ 1, %.preheader65 ]
  %66 = getelementptr inbounds [100001 x i32], ptr @sz, i64 0, i64 %indvars.iv121
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = icmp sgt i32 %67, 0
  br i1 %68, label %.lr.ph83, label %.preheader64.._crit_edge84_crit_edge

.preheader64.._crit_edge84_crit_edge:             ; preds = %.preheader64
  %.pre133 = sext i32 %67 to i64
  br label %._crit_edge84

.lr.ph83:                                         ; preds = %.preheader64
  %69 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @a, i64 0, i64 %indvars.iv121
  br label %74

._crit_edge95:                                    ; preds = %._crit_edge91, %.lr.ph104, %.preheader65
  %70 = load i32, ptr @ans, align 4, !tbaa !5
  %71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %70)
  %72 = load i32, ptr @n, align 4, !tbaa !5
  %.not60100 = icmp slt i32 %72, 1
  br i1 %.not60100, label %.loopexit, label %.preheader

._crit_edge84:                                    ; preds = %74, %.preheader64.._crit_edge84_crit_edge
  %.pre-phi134 = phi i64 [ %.pre133, %.preheader64.._crit_edge84_crit_edge ], [ %90, %74 ]
  %gep92 = getelementptr i32, ptr getelementptr inbounds (i8, ptr @seq, i64 4), i64 %.pre-phi134
  call void @_ZSt4sortIPiSt7greaterIiEEvT_S3_T0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @seq, i64 4), ptr noundef nonnull %gep92)
  %73 = load i32, ptr %66, align 4, !tbaa !5
  %.not6187 = icmp slt i32 %73, 1
  br i1 %.not6187, label %._crit_edge91, label %.lr.ph90

74:                                               ; preds = %.lr.ph83, %74
  %indvars.iv115 = phi i64 [ 0, %.lr.ph83 ], [ %indvars.iv.next116, %74 ]
  %75 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %69, i64 noundef %indvars.iv115) #8
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [100001 x [2 x i32]], ptr @mx, i64 0, i64 %77
  %79 = load i32, ptr %78, align 8, !tbaa !5
  %80 = zext i32 %79 to i64
  %81 = icmp eq i64 %indvars.iv121, %80
  %82 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %69, i64 noundef %indvars.iv115) #8
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [100001 x [2 x i32]], ptr @mx, i64 0, i64 %84, i64 1
  %86 = getelementptr inbounds [100001 x [2 x i32]], ptr @mx, i64 0, i64 %84
  %.pn.in.in = select i1 %81, ptr %85, ptr %86
  %.pn.in = load i32, ptr %.pn.in.in, align 4, !tbaa !5
  %.pn = sext i32 %.pn.in to i64
  %.in = getelementptr inbounds [100001 x i32], ptr @sz, i64 0, i64 %.pn
  %87 = load i32, ptr %.in, align 4, !tbaa !5
  %indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
  %88 = getelementptr inbounds [100001 x i32], ptr @seq, i64 0, i64 %indvars.iv.next116
  store i32 %87, ptr %88, align 4, !tbaa !5
  %89 = load i32, ptr %66, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = icmp slt i64 %indvars.iv.next116, %90
  br i1 %91, label %74, label %._crit_edge84, !llvm.loop !14

._crit_edge91:                                    ; preds = %.lr.ph90, %._crit_edge84
  %indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1
  %92 = load i32, ptr @n, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %.not59.not = icmp slt i64 %indvars.iv121, %93
  br i1 %.not59.not, label %.preheader64, label %._crit_edge95, !llvm.loop !15

.lr.ph90:                                         ; preds = %._crit_edge84, %.lr.ph90
  %indvars.iv118 = phi i64 [ %indvars.iv.next119, %.lr.ph90 ], [ 1, %._crit_edge84 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  %94 = getelementptr inbounds [100001 x i32], ptr @seq, i64 0, i64 %indvars.iv118
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = trunc nuw nsw i64 %indvars.iv118 to i32
  %97 = add nsw i32 %95, %96
  store i32 %97, ptr %3, align 4, !tbaa !5
  %98 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @ans, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %99 = load i32, ptr %98, align 4, !tbaa !5
  store i32 %99, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
  %100 = load i32, ptr %66, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %.not61.not = icmp slt i64 %indvars.iv118, %101
  br i1 %.not61.not, label %.lr.ph90, label %._crit_edge91, !llvm.loop !16

.preheader:                                       ; preds = %._crit_edge95, %._crit_edge98
  %indvars.iv127 = phi i64 [ %indvars.iv.next128, %._crit_edge98 ], [ 1, %._crit_edge95 ]
  %102 = getelementptr inbounds [100001 x i32], ptr @sz, i64 0, i64 %indvars.iv127
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = icmp sgt i32 %103, 0
  br i1 %104, label %.lr.ph97, label %._crit_edge98

.lr.ph97:                                         ; preds = %.preheader
  %105 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @a, i64 0, i64 %indvars.iv127
  br label %109

._crit_edge98:                                    ; preds = %109, %.preheader
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %4, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  %106 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @a, i64 0, i64 %indvars.iv127
  call void @_ZNSt6vectorIiSaIiEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %106) #8
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #8
  %indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1
  %107 = load i32, ptr @n, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %.not60.not = icmp slt i64 %indvars.iv127, %108
  br i1 %.not60.not, label %.preheader, label %.loopexit, !llvm.loop !17

109:                                              ; preds = %.lr.ph97, %109
  %indvars.iv124 = phi i64 [ 0, %.lr.ph97 ], [ %indvars.iv.next125, %109 ]
  %110 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %105, i64 noundef %indvars.iv124) #8
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [100001 x [2 x i32]], ptr @mx, i64 0, i64 %112, i64 1
  store i32 0, ptr %113, align 4, !tbaa !5
  %114 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %105, i64 noundef %indvars.iv124) #8
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [100001 x [2 x i32]], ptr @mx, i64 0, i64 %116
  store i32 0, ptr %117, align 8, !tbaa !5
  %indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1
  %118 = load i32, ptr %102, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = icmp slt i64 %indvars.iv.next125, %119
  br i1 %120, label %109, label %._crit_edge98, !llvm.loop !18

._crit_edge105:                                   ; preds = %.loopexit, %0
  ret i32 0
}

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

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

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

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

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

; 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 #5

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(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(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

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

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

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

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

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


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