; LLVM IR from tangjz/acm-icpc :: codeforces/complete (718E)

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

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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@que = external dso_local global [100001 x i32], align 16
@f = external dso_local global [100001 x i32], align 16
@low = external dso_local global [9 x [9 x i32]], align 16
@msk = external dso_local global [100001 x i32], align 16
@cnt = external dso_local global [2049 x i32], align 16
@g = external dso_local global [2049 x [2049 x i32]], align 16
@ans = external dso_local global [17 x i64], align 16
@buf = external dso_local global [100001 x i8], align 16
@e = external dso_local global [8 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1

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

26:                                               ; preds = %41, %0
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %44

31:                                               ; preds = %26
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [100001 x i8], ptr @buf, i64 0, i64 %33
  %35 = load i8, ptr %34, align 1, !tbaa !9
  %36 = sext i8 %35 to i32
  %37 = sub nsw i32 %36, 97
  %38 = trunc i32 %37 to i8
  store i8 %38, ptr %34, align 1, !tbaa !9
  %39 = sext i8 %38 to i64
  %40 = getelementptr inbounds [8 x %"class.std::vector"], ptr @e, i64 0, i64 %39
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %40, ptr noundef nonnull align 4 dereferenceable(4) %2)
  br label %41

41:                                               ; preds = %31
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %2, align 4, !tbaa !5
  br label %26, !llvm.loop !10

44:                                               ; preds = %30
  call void @llvm.memset.p0.i64(ptr align 16 @low, i8 63, i64 324, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 7, ptr %3, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %258, %44
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = icmp sge i32 %46, 0
  br i1 %47, label %49, label %48

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

49:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [9 x [9 x i32]], ptr @low, i64 0, i64 %51
  %53 = getelementptr inbounds [9 x i32], ptr %52, i64 0, i64 0
  store ptr %53, ptr %5, align 8, !tbaa !12
  %54 = load i32, ptr @n, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = mul i64 %55, 4
  call void @llvm.memset.p0.i64(ptr align 16 @f, i8 63, i64 %56, i1 false)
  store i32 0, ptr @m, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %57 = load i32, ptr %3, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [8 x %"class.std::vector"], ptr @e, i64 0, i64 %58
  store ptr %59, ptr %6, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %60 = load ptr, ptr %6, align 8, !tbaa !12
  %61 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %60) #8
  %62 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %61, ptr %62, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %63 = load ptr, ptr %6, align 8, !tbaa !12
  %64 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %63) #8
  %65 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %64, ptr %65, align 8
  br label %66

66:                                               ; preds = %81, %49
  %67 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  br i1 %67, label %69, label %68

68:                                               ; preds = %66
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  br label %83

69:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %70 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  store ptr %70, ptr %9, align 8, !tbaa !12
  %71 = load ptr, ptr %9, align 8, !tbaa !12
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %73
  store i32 0, ptr %74, align 4, !tbaa !5
  %75 = load ptr, ptr %9, align 8, !tbaa !12
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = load i32, ptr @m, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr @m, align 4, !tbaa !5
  %79 = sext i32 %77 to i64
  %80 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %79
  store i32 %76, ptr %80, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  br label %81

81:                                               ; preds = %69
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  br label %66

83:                                               ; preds = %68
  %84 = load i32, ptr @m, align 4, !tbaa !5
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %91

86:                                               ; preds = %83
  %87 = load ptr, ptr %5, align 8, !tbaa !12
  %88 = load i32, ptr %3, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds i32, ptr %87, i64 %89
  store i32 0, ptr %90, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %86, %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %221, %91
  %93 = load i32, ptr %10, align 4, !tbaa !5
  %94 = load i32, ptr @m, align 4, !tbaa !5
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %92
  store i32 10, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %224

97:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  %98 = load i32, ptr %10, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  store i32 %101, ptr %11, align 4, !tbaa !5
  %102 = load ptr, ptr %5, align 8, !tbaa !12
  %103 = load i32, ptr %11, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [100001 x i8], ptr @buf, i64 0, i64 %104
  %106 = load i8, ptr %105, align 1, !tbaa !9
  %107 = sext i8 %106 to i64
  %108 = getelementptr inbounds i32, ptr %102, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = icmp eq i32 %109, 1061109567
  br i1 %110, label %111, label %166

111:                                              ; preds = %97
  %112 = load i32, ptr %11, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = load ptr, ptr %5, align 8, !tbaa !12
  %117 = load i32, ptr %11, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [100001 x i8], ptr @buf, i64 0, i64 %118
  %120 = load i8, ptr %119, align 1, !tbaa !9
  %121 = sext i8 %120 to i64
  %122 = getelementptr inbounds i32, ptr %116, i64 %121
  store i32 %115, ptr %122, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %123 = load i32, ptr %11, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [100001 x i8], ptr @buf, i64 0, i64 %124
  %126 = load i8, ptr %125, align 1, !tbaa !9
  %127 = sext i8 %126 to i64
  %128 = getelementptr inbounds [8 x %"class.std::vector"], ptr @e, i64 0, i64 %127
  store ptr %128, ptr %12, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %129 = load ptr, ptr %12, align 8, !tbaa !12
  %130 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %129) #8
  %131 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %130, ptr %131, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %132 = load ptr, ptr %12, align 8, !tbaa !12
  %133 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %132) #8
  %134 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %133, ptr %134, align 8
  br label %135

135:                                              ; preds = %163, %111
  %136 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #8
  br i1 %136, label %138, label %137

137:                                              ; preds = %135
  store i32 13, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %165

138:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %139 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #8
  store ptr %139, ptr %15, align 8, !tbaa !12
  %140 = load ptr, ptr %15, align 8, !tbaa !12
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %142
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %145 = icmp eq i32 %144, 1061109567
  br i1 %145, label %146, label %162

146:                                              ; preds = %138
  %147 = load i32, ptr %11, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = add nsw i32 %150, 1
  %152 = load ptr, ptr %15, align 8, !tbaa !12
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %154
  store i32 %151, ptr %155, align 4, !tbaa !5
  %156 = load ptr, ptr %15, align 8, !tbaa !12
  %157 = load i32, ptr %156, align 4, !tbaa !5
  %158 = load i32, ptr @m, align 4, !tbaa !5
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr @m, align 4, !tbaa !5
  %160 = sext i32 %158 to i64
  %161 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %160
  store i32 %157, ptr %161, align 4, !tbaa !5
  br label %162

162:                                              ; preds = %146, %138
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  br label %163

163:                                              ; preds = %162
  %164 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #8
  br label %135

165:                                              ; preds = %137
  br label %166

166:                                              ; preds = %165, %97
  %167 = load i32, ptr %11, align 4, !tbaa !5
  %168 = icmp ne i32 %167, 0
  br i1 %168, label %169, label %192

169:                                              ; preds = %166
  %170 = load i32, ptr %11, align 4, !tbaa !5
  %171 = sub nsw i32 %170, 1
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %172
  %174 = load i32, ptr %173, align 4, !tbaa !5
  %175 = icmp eq i32 %174, 1061109567
  br i1 %175, label %176, label %192

176:                                              ; preds = %169
  %177 = load i32, ptr %11, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %178
  %180 = load i32, ptr %179, align 4, !tbaa !5
  %181 = add nsw i32 %180, 1
  %182 = load i32, ptr %11, align 4, !tbaa !5
  %183 = sub nsw i32 %182, 1
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %184
  store i32 %181, ptr %185, align 4, !tbaa !5
  %186 = load i32, ptr %11, align 4, !tbaa !5
  %187 = sub nsw i32 %186, 1
  %188 = load i32, ptr @m, align 4, !tbaa !5
  %189 = add nsw i32 %188, 1
  store i32 %189, ptr @m, align 4, !tbaa !5
  %190 = sext i32 %188 to i64
  %191 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %190
  store i32 %187, ptr %191, align 4, !tbaa !5
  br label %192

192:                                              ; preds = %176, %169, %166
  %193 = load i32, ptr %11, align 4, !tbaa !5
  %194 = add nsw i32 %193, 1
  %195 = load i32, ptr @n, align 4, !tbaa !5
  %196 = icmp slt i32 %194, %195
  br i1 %196, label %197, label %220

197:                                              ; preds = %192
  %198 = load i32, ptr %11, align 4, !tbaa !5
  %199 = add nsw i32 %198, 1
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %200
  %202 = load i32, ptr %201, align 4, !tbaa !5
  %203 = icmp eq i32 %202, 1061109567
  br i1 %203, label %204, label %220

204:                                              ; preds = %197
  %205 = load i32, ptr %11, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %206
  %208 = load i32, ptr %207, align 4, !tbaa !5
  %209 = add nsw i32 %208, 1
  %210 = load i32, ptr %11, align 4, !tbaa !5
  %211 = add nsw i32 %210, 1
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %212
  store i32 %209, ptr %213, align 4, !tbaa !5
  %214 = load i32, ptr %11, align 4, !tbaa !5
  %215 = add nsw i32 %214, 1
  %216 = load i32, ptr @m, align 4, !tbaa !5
  %217 = add nsw i32 %216, 1
  store i32 %217, ptr @m, align 4, !tbaa !5
  %218 = sext i32 %216 to i64
  %219 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %218
  store i32 %215, ptr %219, align 4, !tbaa !5
  br label %220

220:                                              ; preds = %204, %197, %192
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %221

221:                                              ; preds = %220
  %222 = load i32, ptr %10, align 4, !tbaa !5
  %223 = add nsw i32 %222, 1
  store i32 %223, ptr %10, align 4, !tbaa !5
  br label %92, !llvm.loop !14

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

225:                                              ; preds = %254, %224
  %226 = load i32, ptr %16, align 4, !tbaa !5
  %227 = load i32, ptr @n, align 4, !tbaa !5
  %228 = icmp slt i32 %226, %227
  br i1 %228, label %230, label %229

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

230:                                              ; preds = %225
  %231 = load i32, ptr %16, align 4, !tbaa !5
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [100001 x i32], ptr @msk, i64 0, i64 %232
  %234 = load i32, ptr %233, align 4, !tbaa !5
  %235 = shl i32 %234, 1
  %236 = load i32, ptr %16, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %237
  %239 = load i32, ptr %238, align 4, !tbaa !5
  %240 = load ptr, ptr %5, align 8, !tbaa !12
  %241 = load i32, ptr %16, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [100001 x i8], ptr @buf, i64 0, i64 %242
  %244 = load i8, ptr %243, align 1, !tbaa !9
  %245 = sext i8 %244 to i64
  %246 = getelementptr inbounds i32, ptr %240, i64 %245
  %247 = load i32, ptr %246, align 4, !tbaa !5
  %248 = icmp sgt i32 %239, %247
  %249 = zext i1 %248 to i32
  %250 = or i32 %235, %249
  %251 = load i32, ptr %16, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [100001 x i32], ptr @msk, i64 0, i64 %252
  store i32 %250, ptr %253, align 4, !tbaa !5
  br label %254

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

257:                                              ; preds = %229
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  br label %258

258:                                              ; preds = %257
  %259 = load i32, ptr %3, align 4, !tbaa !5
  %260 = add nsw i32 %259, -1
  store i32 %260, ptr %3, align 4, !tbaa !5
  br label %45, !llvm.loop !16

261:                                              ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %262

262:                                              ; preds = %290, %261
  %263 = load i32, ptr %17, align 4, !tbaa !5
  %264 = load i32, ptr @n, align 4, !tbaa !5
  %265 = icmp slt i32 %263, %264
  br i1 %265, label %267, label %266

266:                                              ; preds = %262
  store i32 18, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %293

267:                                              ; preds = %262
  %268 = load i32, ptr %17, align 4, !tbaa !5
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [100001 x i32], ptr @msk, i64 0, i64 %269
  %271 = load i32, ptr %270, align 4, !tbaa !5
  %272 = shl i32 %271, 3
  %273 = load i32, ptr %17, align 4, !tbaa !5
  %274 = sext i32 %273 to i64
  %275 = getelementptr inbounds [100001 x i8], ptr @buf, i64 0, i64 %274
  %276 = load i8, ptr %275, align 1, !tbaa !9
  %277 = sext i8 %276 to i32
  %278 = or i32 %272, %277
  %279 = load i32, ptr %17, align 4, !tbaa !5
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds [100001 x i32], ptr @msk, i64 0, i64 %280
  store i32 %278, ptr %281, align 4, !tbaa !5
  %282 = load i32, ptr %17, align 4, !tbaa !5
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds [100001 x i32], ptr @msk, i64 0, i64 %283
  %285 = load i32, ptr %284, align 4, !tbaa !5
  %286 = sext i32 %285 to i64
  %287 = getelementptr inbounds [2049 x i32], ptr @cnt, i64 0, i64 %286
  %288 = load i32, ptr %287, align 4, !tbaa !5
  %289 = add nsw i32 %288, 1
  store i32 %289, ptr %287, align 4, !tbaa !5
  br label %290

290:                                              ; preds = %267
  %291 = load i32, ptr %17, align 4, !tbaa !5
  %292 = add nsw i32 %291, 1
  store i32 %292, ptr %17, align 4, !tbaa !5
  br label %262, !llvm.loop !17

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

294:                                              ; preds = %418, %293
  %295 = load i32, ptr %18, align 4, !tbaa !5
  %296 = icmp slt i32 %295, 2048
  br i1 %296, label %298, label %297

297:                                              ; preds = %294
  store i32 21, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %421

298:                                              ; preds = %294
  %299 = load i32, ptr %18, align 4, !tbaa !5
  %300 = sext i32 %299 to i64
  %301 = getelementptr inbounds [2049 x i32], ptr @cnt, i64 0, i64 %300
  %302 = load i32, ptr %301, align 4, !tbaa !5
  %303 = icmp ne i32 %302, 0
  br i1 %303, label %305, label %304

304:                                              ; preds = %298
  br label %418

305:                                              ; preds = %298
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #8
  %306 = load i32, ptr %18, align 4, !tbaa !5
  %307 = ashr i32 %306, 3
  %308 = load i32, ptr %18, align 4, !tbaa !5
  %309 = ashr i32 %308, 3
  %310 = load i32, ptr %18, align 4, !tbaa !5
  %311 = and i32 %310, 7
  %312 = sext i32 %311 to i64
  %313 = getelementptr inbounds [9 x [9 x i32]], ptr @low, i64 0, i64 %312
  %314 = getelementptr inbounds [9 x i32], ptr %313, i64 0, i64 0
  %315 = load i32, ptr %18, align 4, !tbaa !5
  %316 = and i32 %315, 7
  %317 = sext i32 %316 to i64
  %318 = getelementptr inbounds [9 x [9 x i32]], ptr @low, i64 0, i64 %317
  %319 = getelementptr inbounds [9 x i32], ptr %318, i64 0, i64 0
  %320 = call noundef i32 @"_ZZ4mainENK3$_0clEiiPiS0_"(ptr noundef nonnull align 1 dereferenceable(1) %19, i32 noundef %307, i32 noundef %309, ptr noundef %314, ptr noundef %319)
  %321 = load i32, ptr %18, align 4, !tbaa !5
  %322 = sext i32 %321 to i64
  %323 = getelementptr inbounds [2049 x [2049 x i32]], ptr @g, i64 0, i64 %322
  %324 = load i32, ptr %18, align 4, !tbaa !5
  %325 = sext i32 %324 to i64
  %326 = getelementptr inbounds [2049 x i32], ptr %323, i64 0, i64 %325
  store i32 %320, ptr %326, align 4, !tbaa !5
  %327 = load i32, ptr %18, align 4, !tbaa !5
  %328 = sext i32 %327 to i64
  %329 = getelementptr inbounds [2049 x i32], ptr @cnt, i64 0, i64 %328
  %330 = load i32, ptr %329, align 4, !tbaa !5
  %331 = sext i32 %330 to i64
  %332 = load i32, ptr %18, align 4, !tbaa !5
  %333 = sext i32 %332 to i64
  %334 = getelementptr inbounds [2049 x i32], ptr @cnt, i64 0, i64 %333
  %335 = load i32, ptr %334, align 4, !tbaa !5
  %336 = sext i32 %335 to i64
  %337 = sub nsw i64 %336, 1
  %338 = mul nsw i64 %331, %337
  %339 = sdiv i64 %338, 2
  %340 = load i32, ptr %18, align 4, !tbaa !5
  %341 = sext i32 %340 to i64
  %342 = getelementptr inbounds [2049 x [2049 x i32]], ptr @g, i64 0, i64 %341
  %343 = load i32, ptr %18, align 4, !tbaa !5
  %344 = sext i32 %343 to i64
  %345 = getelementptr inbounds [2049 x i32], ptr %342, i64 0, i64 %344
  %346 = load i32, ptr %345, align 4, !tbaa !5
  %347 = sext i32 %346 to i64
  %348 = getelementptr inbounds [17 x i64], ptr @ans, i64 0, i64 %347
  %349 = load i64, ptr %348, align 8, !tbaa !18
  %350 = add nsw i64 %349, %339
  store i64 %350, ptr %348, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  %351 = load i32, ptr %18, align 4, !tbaa !5
  %352 = add nsw i32 %351, 1
  store i32 %352, ptr %20, align 4, !tbaa !5
  br label %353

353:                                              ; preds = %414, %305
  %354 = load i32, ptr %20, align 4, !tbaa !5
  %355 = icmp slt i32 %354, 2048
  br i1 %355, label %357, label %356

356:                                              ; preds = %353
  store i32 24, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  br label %417

357:                                              ; preds = %353
  %358 = load i32, ptr %20, align 4, !tbaa !5
  %359 = sext i32 %358 to i64
  %360 = getelementptr inbounds [2049 x i32], ptr @cnt, i64 0, i64 %359
  %361 = load i32, ptr %360, align 4, !tbaa !5
  %362 = icmp ne i32 %361, 0
  br i1 %362, label %364, label %363

363:                                              ; preds = %357
  br label %414

364:                                              ; preds = %357
  %365 = load i32, ptr %18, align 4, !tbaa !5
  %366 = ashr i32 %365, 3
  %367 = load i32, ptr %20, align 4, !tbaa !5
  %368 = ashr i32 %367, 3
  %369 = load i32, ptr %18, align 4, !tbaa !5
  %370 = and i32 %369, 7
  %371 = sext i32 %370 to i64
  %372 = getelementptr inbounds [9 x [9 x i32]], ptr @low, i64 0, i64 %371
  %373 = getelementptr inbounds [9 x i32], ptr %372, i64 0, i64 0
  %374 = load i32, ptr %20, align 4, !tbaa !5
  %375 = and i32 %374, 7
  %376 = sext i32 %375 to i64
  %377 = getelementptr inbounds [9 x [9 x i32]], ptr @low, i64 0, i64 %376
  %378 = getelementptr inbounds [9 x i32], ptr %377, i64 0, i64 0
  %379 = call noundef i32 @"_ZZ4mainENK3$_0clEiiPiS0_"(ptr noundef nonnull align 1 dereferenceable(1) %19, i32 noundef %366, i32 noundef %368, ptr noundef %373, ptr noundef %378)
  %380 = load i32, ptr %20, align 4, !tbaa !5
  %381 = sext i32 %380 to i64
  %382 = getelementptr inbounds [2049 x [2049 x i32]], ptr @g, i64 0, i64 %381
  %383 = load i32, ptr %18, align 4, !tbaa !5
  %384 = sext i32 %383 to i64
  %385 = getelementptr inbounds [2049 x i32], ptr %382, i64 0, i64 %384
  store i32 %379, ptr %385, align 4, !tbaa !5
  %386 = load i32, ptr %18, align 4, !tbaa !5
  %387 = sext i32 %386 to i64
  %388 = getelementptr inbounds [2049 x [2049 x i32]], ptr @g, i64 0, i64 %387
  %389 = load i32, ptr %20, align 4, !tbaa !5
  %390 = sext i32 %389 to i64
  %391 = getelementptr inbounds [2049 x i32], ptr %388, i64 0, i64 %390
  store i32 %379, ptr %391, align 4, !tbaa !5
  %392 = load i32, ptr %18, align 4, !tbaa !5
  %393 = sext i32 %392 to i64
  %394 = getelementptr inbounds [2049 x i32], ptr @cnt, i64 0, i64 %393
  %395 = load i32, ptr %394, align 4, !tbaa !5
  %396 = sext i32 %395 to i64
  %397 = load i32, ptr %20, align 4, !tbaa !5
  %398 = sext i32 %397 to i64
  %399 = getelementptr inbounds [2049 x i32], ptr @cnt, i64 0, i64 %398
  %400 = load i32, ptr %399, align 4, !tbaa !5
  %401 = sext i32 %400 to i64
  %402 = mul nsw i64 %396, %401
  %403 = load i32, ptr %18, align 4, !tbaa !5
  %404 = sext i32 %403 to i64
  %405 = getelementptr inbounds [2049 x [2049 x i32]], ptr @g, i64 0, i64 %404
  %406 = load i32, ptr %20, align 4, !tbaa !5
  %407 = sext i32 %406 to i64
  %408 = getelementptr inbounds [2049 x i32], ptr %405, i64 0, i64 %407
  %409 = load i32, ptr %408, align 4, !tbaa !5
  %410 = sext i32 %409 to i64
  %411 = getelementptr inbounds [17 x i64], ptr @ans, i64 0, i64 %410
  %412 = load i64, ptr %411, align 8, !tbaa !18
  %413 = add nsw i64 %412, %402
  store i64 %413, ptr %411, align 8, !tbaa !18
  br label %414

414:                                              ; preds = %364, %363
  %415 = load i32, ptr %20, align 4, !tbaa !5
  %416 = add nsw i32 %415, 1
  store i32 %416, ptr %20, align 4, !tbaa !5
  br label %353, !llvm.loop !20

417:                                              ; preds = %356
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #8
  br label %418

418:                                              ; preds = %417, %304
  %419 = load i32, ptr %18, align 4, !tbaa !5
  %420 = add nsw i32 %419, 1
  store i32 %420, ptr %18, align 4, !tbaa !5
  br label %294, !llvm.loop !21

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

422:                                              ; preds = %480, %421
  %423 = load i32, ptr %21, align 4, !tbaa !5
  %424 = load i32, ptr @n, align 4, !tbaa !5
  %425 = icmp slt i32 %423, %424
  br i1 %425, label %427, label %426

426:                                              ; preds = %422
  store i32 27, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %483

427:                                              ; preds = %422
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  %428 = load i32, ptr %21, align 4, !tbaa !5
  %429 = add nsw i32 %428, 1
  store i32 %429, ptr %22, align 4, !tbaa !5
  br label %430

430:                                              ; preds = %476, %427
  %431 = load i32, ptr %22, align 4, !tbaa !5
  %432 = load i32, ptr %21, align 4, !tbaa !5
  %433 = add nsw i32 %432, 8
  %434 = add nsw i32 %433, 8
  %435 = icmp slt i32 %431, %434
  br i1 %435, label %436, label %440

436:                                              ; preds = %430
  %437 = load i32, ptr %22, align 4, !tbaa !5
  %438 = load i32, ptr @n, align 4, !tbaa !5
  %439 = icmp slt i32 %437, %438
  br label %440

440:                                              ; preds = %436, %430
  %441 = phi i1 [ false, %430 ], [ %439, %436 ]
  br i1 %441, label %443, label %442

442:                                              ; preds = %440
  store i32 30, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %479

443:                                              ; preds = %440
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  %444 = load i32, ptr %21, align 4, !tbaa !5
  %445 = sext i32 %444 to i64
  %446 = getelementptr inbounds [100001 x i32], ptr @msk, i64 0, i64 %445
  %447 = load i32, ptr %446, align 4, !tbaa !5
  %448 = sext i32 %447 to i64
  %449 = getelementptr inbounds [2049 x [2049 x i32]], ptr @g, i64 0, i64 %448
  %450 = load i32, ptr %22, align 4, !tbaa !5
  %451 = sext i32 %450 to i64
  %452 = getelementptr inbounds [100001 x i32], ptr @msk, i64 0, i64 %451
  %453 = load i32, ptr %452, align 4, !tbaa !5
  %454 = sext i32 %453 to i64
  %455 = getelementptr inbounds [2049 x i32], ptr %449, i64 0, i64 %454
  %456 = load i32, ptr %455, align 4, !tbaa !5
  store i32 %456, ptr %23, align 4, !tbaa !5
  %457 = load i32, ptr %22, align 4, !tbaa !5
  %458 = load i32, ptr %21, align 4, !tbaa !5
  %459 = sub nsw i32 %457, %458
  %460 = load i32, ptr %23, align 4, !tbaa !5
  %461 = icmp slt i32 %459, %460
  br i1 %461, label %462, label %475

462:                                              ; preds = %443
  %463 = load i32, ptr %23, align 4, !tbaa !5
  %464 = sext i32 %463 to i64
  %465 = getelementptr inbounds [17 x i64], ptr @ans, i64 0, i64 %464
  %466 = load i64, ptr %465, align 8, !tbaa !18
  %467 = add nsw i64 %466, -1
  store i64 %467, ptr %465, align 8, !tbaa !18
  %468 = load i32, ptr %22, align 4, !tbaa !5
  %469 = load i32, ptr %21, align 4, !tbaa !5
  %470 = sub nsw i32 %468, %469
  %471 = sext i32 %470 to i64
  %472 = getelementptr inbounds [17 x i64], ptr @ans, i64 0, i64 %471
  %473 = load i64, ptr %472, align 8, !tbaa !18
  %474 = add nsw i64 %473, 1
  store i64 %474, ptr %472, align 8, !tbaa !18
  br label %475

475:                                              ; preds = %462, %443
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %476

476:                                              ; preds = %475
  %477 = load i32, ptr %22, align 4, !tbaa !5
  %478 = add nsw i32 %477, 1
  store i32 %478, ptr %22, align 4, !tbaa !5
  br label %430, !llvm.loop !22

479:                                              ; preds = %442
  br label %480

480:                                              ; preds = %479
  %481 = load i32, ptr %21, align 4, !tbaa !5
  %482 = add nsw i32 %481, 1
  store i32 %482, ptr %21, align 4, !tbaa !5
  br label %422, !llvm.loop !23

483:                                              ; preds = %426
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  store i32 15, ptr %24, align 4, !tbaa !5
  br label %484

484:                                              ; preds = %502, %483
  %485 = load i32, ptr %24, align 4, !tbaa !5
  %486 = icmp sge i32 %485, 0
  br i1 %486, label %488, label %487

487:                                              ; preds = %484
  store i32 33, ptr %4, align 4
  br label %505

488:                                              ; preds = %484
  %489 = load i32, ptr %24, align 4, !tbaa !5
  %490 = sext i32 %489 to i64
  %491 = getelementptr inbounds [17 x i64], ptr @ans, i64 0, i64 %490
  %492 = load i64, ptr %491, align 8, !tbaa !18
  %493 = icmp ne i64 %492, 0
  br i1 %493, label %494, label %501

494:                                              ; preds = %488
  %495 = load i32, ptr %24, align 4, !tbaa !5
  %496 = load i32, ptr %24, align 4, !tbaa !5
  %497 = sext i32 %496 to i64
  %498 = getelementptr inbounds [17 x i64], ptr @ans, i64 0, i64 %497
  %499 = load i64, ptr %498, align 8, !tbaa !18
  %500 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %495, i64 noundef %499)
  store i32 33, ptr %4, align 4
  br label %505

501:                                              ; preds = %488
  br label %502

502:                                              ; preds = %501
  %503 = load i32, ptr %24, align 4, !tbaa !5
  %504 = add nsw i32 %503, -1
  store i32 %504, ptr %24, align 4, !tbaa !5
  br label %484, !llvm.loop !24

505:                                              ; preds = %494, %487
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  br label %506

506:                                              ; preds = %505
  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: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef i32 @"_ZZ4mainENK3$_0clEiiPiS0_"(ptr noundef nonnull align 1 dereferenceable(1), i32 noundef, i32 noundef, ptr noundef, ptr noundef) #7 align 2

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { 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 #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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = !{!19, !19, i64 0}
!19 = !{!"long long", !7, i64 0}
!20 = distinct !{!20, !11}
!21 = distinct !{!21, !11}
!22 = distinct !{!22, !11}
!23 = distinct !{!23, !11}
!24 = distinct !{!24, !11}


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

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

@n = external dso_local global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@que = external dso_local local_unnamed_addr global [100001 x i32], align 16
@f = external dso_local local_unnamed_addr global [100001 x i32], align 16
@low = external dso_local global [9 x [9 x i32]], align 16
@msk = external dso_local local_unnamed_addr global [100001 x i32], align 16
@cnt = external dso_local local_unnamed_addr global [2049 x i32], align 16
@g = external dso_local local_unnamed_addr global [2049 x [2049 x i32]], align 16
@ans = external dso_local local_unnamed_addr global [17 x i64], align 16
@buf = external dso_local global [100001 x i8], align 16
@e = external dso_local global [8 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 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 %"class.__gnu_cxx::__normal_iterator", align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %class.anon, align 1
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @buf)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #9
  store i32 0, ptr %1, align 4, !tbaa !5
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %10 = phi i32 [ %8, %0 ], [ %19, %.lr.ph ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(324) @low, i8 63, i64 324, i1 false)
  br label %33

.lr.ph:                                           ; preds = %0, %.lr.ph
  %storemerge120 = phi i32 [ %18, %.lr.ph ], [ 0, %0 ]
  %11 = sext i32 %storemerge120 to i64
  %12 = getelementptr inbounds [100001 x i8], ptr @buf, i64 0, i64 %11
  %13 = load i8, ptr %12, align 1, !tbaa !9
  %14 = add i8 %13, -97
  store i8 %14, ptr %12, align 1, !tbaa !9
  %15 = sext i8 %14 to i64
  %16 = getelementptr inbounds [8 x %"class.std::vector"], ptr @e, i64 0, i64 %15
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %17 = load i32, ptr %1, align 4, !tbaa !5
  %18 = add nsw i32 %17, 1
  store i32 %18, ptr %1, align 4, !tbaa !5
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %.lr.ph, label %._crit_edge, !llvm.loop !10

.preheader117:                                    ; preds = %._crit_edge132
  br i1 %58, label %.lr.ph135.preheader, label %.preheader116.preheader

.preheader116.preheader.loopexit.unr-lcssa:       ; preds = %.lr.ph135, %.lr.ph135.preheader
  %indvars.iv157.unr = phi i64 [ 0, %.lr.ph135.preheader ], [ %indvars.iv.next158.1, %.lr.ph135 ]
  %lcmp.mod208.not = icmp eq i64 %xtraiter207, 0
  br i1 %lcmp.mod208.not, label %.preheader116.preheader, label %.lr.ph135.epil

.lr.ph135.epil:                                   ; preds = %.preheader116.preheader.loopexit.unr-lcssa
  %21 = getelementptr inbounds [100001 x i32], ptr @msk, i64 0, i64 %indvars.iv157.unr
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = shl i32 %22, 3
  %24 = getelementptr inbounds [100001 x i8], ptr @buf, i64 0, i64 %indvars.iv157.unr
  %25 = load i8, ptr %24, align 1, !tbaa !9
  %26 = sext i8 %25 to i32
  %27 = or i32 %23, %26
  store i32 %27, ptr %21, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [2049 x i32], ptr @cnt, i64 0, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %29, align 4, !tbaa !5
  br label %.preheader116.preheader

.preheader116.preheader:                          ; preds = %._crit_edge132.thread, %.lr.ph135.epil, %.preheader116.preheader.loopexit.unr-lcssa, %.preheader117
  br label %.preheader116

.lr.ph135.preheader:                              ; preds = %.preheader117
  %wide.trip.count160 = zext nneg i32 %57 to i64
  %xtraiter207 = and i64 %wide.trip.count160, 1
  %32 = icmp eq i32 %57, 1
  br i1 %32, label %.preheader116.preheader.loopexit.unr-lcssa, label %.lr.ph135.preheader.new

.lr.ph135.preheader.new:                          ; preds = %.lr.ph135.preheader
  %unroll_iter209 = and i64 %wide.trip.count160, 2147483646
  br label %.lr.ph135

33:                                               ; preds = %.backedge, %._crit_edge
  %34 = phi i32 [ %10, %._crit_edge ], [ %57, %.backedge ]
  %indvars.iv154 = phi i64 [ 7, %._crit_edge ], [ %indvars.iv154.be, %.backedge ]
  %35 = getelementptr inbounds [9 x [9 x i32]], ptr @low, i64 0, i64 %indvars.iv154
  %36 = sext i32 %34 to i64
  %37 = shl nsw i64 %36, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @f, i8 63, i64 %37, i1 false)
  store i32 0, ptr @m, align 4, !tbaa !5
  %38 = getelementptr inbounds [8 x %"class.std::vector"], ptr @e, i64 0, i64 %indvars.iv154
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #9
  %39 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %38) #9
  store ptr %39, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #9
  %40 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %38) #9
  store ptr %40, ptr %3, align 8
  %41 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #9
  br i1 %41, label %.lr.ph122, label %._crit_edge123

._crit_edge123:                                   ; preds = %.lr.ph122, %33
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9
  %42 = load i32, ptr @m, align 4, !tbaa !5
  %.not112 = icmp eq i32 %42, 0
  br i1 %.not112, label %..preheader118_crit_edge, label %54

.lr.ph122:                                        ; preds = %33, %.lr.ph122
  %43 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #9
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %45
  store i32 0, ptr %46, align 4, !tbaa !5
  %47 = load i32, ptr %43, align 4, !tbaa !5
  %48 = load i32, ptr @m, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr @m, align 4, !tbaa !5
  %50 = sext i32 %48 to i64
  %51 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %50
  store i32 %47, ptr %51, align 4, !tbaa !5
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #9
  %53 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #9
  br i1 %53, label %.lr.ph122, label %._crit_edge123

54:                                               ; preds = %._crit_edge123
  %55 = getelementptr inbounds i32, ptr %35, i64 %indvars.iv154
  store i32 0, ptr %55, align 4, !tbaa !5
  %56 = icmp sgt i32 %42, 0
  br i1 %56, label %.lr.ph129, label %..preheader118_crit_edge

..preheader118_crit_edge:                         ; preds = %._crit_edge123, %54
  %.pre182 = load i32, ptr @n, align 4, !tbaa !5
  br label %.preheader118

.preheader118:                                    ; preds = %124, %..preheader118_crit_edge
  %57 = phi i32 [ %.pre182, %..preheader118_crit_edge ], [ %110, %124 ]
  %58 = icmp sgt i32 %57, 0
  br i1 %58, label %.lr.ph131.preheader, label %._crit_edge132.thread

.lr.ph131.preheader:                              ; preds = %.preheader118
  %wide.trip.count = zext nneg i32 %57 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %59 = icmp eq i32 %57, 1
  br i1 %59, label %._crit_edge132.unr-lcssa, label %.lr.ph131.preheader.new

.lr.ph131.preheader.new:                          ; preds = %.lr.ph131.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.lr.ph131

.lr.ph129:                                        ; preds = %54, %124
  %indvars.iv = phi i64 [ %indvars.iv.next, %124 ], [ 0, %54 ]
  %60 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %indvars.iv
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [100001 x i8], ptr @buf, i64 0, i64 %62
  %64 = load i8, ptr %63, align 1, !tbaa !9
  %65 = sext i8 %64 to i64
  %66 = getelementptr inbounds i32, ptr %35, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = icmp eq i32 %67, 1061109567
  br i1 %68, label %69, label %93

69:                                               ; preds = %.lr.ph129
  %70 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %62
  %71 = load i32, ptr %70, align 4, !tbaa !5
  store i32 %71, ptr %66, align 4, !tbaa !5
  %72 = getelementptr inbounds [8 x %"class.std::vector"], ptr @e, i64 0, i64 %65
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  %73 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %72) #9
  store ptr %73, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #9
  %74 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %72) #9
  store ptr %74, ptr %5, align 8
  %75 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #9
  br i1 %75, label %.lr.ph125, label %._crit_edge126

._crit_edge126:                                   ; preds = %90, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  br label %93

.lr.ph125:                                        ; preds = %69, %90
  %76 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #9
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = icmp eq i32 %80, 1061109567
  br i1 %81, label %82, label %90

82:                                               ; preds = %.lr.ph125
  %83 = load i32, ptr %70, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %79, align 4, !tbaa !5
  %85 = load i32, ptr %76, align 4, !tbaa !5
  %86 = load i32, ptr @m, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr @m, align 4, !tbaa !5
  %88 = sext i32 %86 to i64
  %89 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %88
  store i32 %85, ptr %89, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %82, %.lr.ph125
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #9
  %92 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #9
  br i1 %92, label %.lr.ph125, label %._crit_edge126

93:                                               ; preds = %._crit_edge126, %.lr.ph129
  %.not113 = icmp eq i32 %61, 0
  br i1 %.not113, label %108, label %94

94:                                               ; preds = %93
  %95 = add nsw i32 %61, -1
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = icmp eq i32 %98, 1061109567
  br i1 %99, label %100, label %108

100:                                              ; preds = %94
  %101 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %62
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %97, align 4, !tbaa !5
  %104 = load i32, ptr @m, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr @m, align 4, !tbaa !5
  %106 = sext i32 %104 to i64
  %107 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %106
  store i32 %95, ptr %107, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %100, %94, %93
  %109 = add nsw i32 %61, 1
  %110 = load i32, ptr @n, align 4, !tbaa !5
  %111 = icmp slt i32 %109, %110
  br i1 %111, label %112, label %._crit_edge180

._crit_edge180:                                   ; preds = %108
  %.pre = load i32, ptr @m, align 4, !tbaa !5
  br label %124

112:                                              ; preds = %108
  %113 = sext i32 %109 to i64
  %114 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = icmp eq i32 %115, 1061109567
  %.pre181 = load i32, ptr @m, align 4, !tbaa !5
  br i1 %116, label %117, label %124

117:                                              ; preds = %112
  %118 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %62
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %114, align 4, !tbaa !5
  %121 = add nsw i32 %.pre181, 1
  store i32 %121, ptr @m, align 4, !tbaa !5
  %122 = sext i32 %.pre181 to i64
  %123 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %122
  store i32 %109, ptr %123, align 4, !tbaa !5
  br label %124

124:                                              ; preds = %._crit_edge180, %117, %112
  %125 = phi i32 [ %.pre, %._crit_edge180 ], [ %121, %117 ], [ %.pre181, %112 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %126 = sext i32 %125 to i64
  %127 = icmp slt i64 %indvars.iv.next, %126
  br i1 %127, label %.lr.ph129, label %.preheader118, !llvm.loop !12

._crit_edge132.unr-lcssa:                         ; preds = %.lr.ph131, %.lr.ph131.preheader
  %indvars.iv151.unr = phi i64 [ 0, %.lr.ph131.preheader ], [ %indvars.iv.next152.1, %.lr.ph131 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge132, label %.lr.ph131.epil

.lr.ph131.epil:                                   ; preds = %._crit_edge132.unr-lcssa
  %128 = getelementptr inbounds [100001 x i32], ptr @msk, i64 0, i64 %indvars.iv151.unr
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = shl i32 %129, 1
  %131 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %indvars.iv151.unr
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %133 = getelementptr inbounds [100001 x i8], ptr @buf, i64 0, i64 %indvars.iv151.unr
  %134 = load i8, ptr %133, align 1, !tbaa !9
  %135 = sext i8 %134 to i64
  %136 = getelementptr inbounds i32, ptr %35, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = icmp sgt i32 %132, %137
  %139 = zext i1 %138 to i32
  %140 = or disjoint i32 %130, %139
  store i32 %140, ptr %128, align 4, !tbaa !5
  br label %._crit_edge132

._crit_edge132:                                   ; preds = %._crit_edge132.unr-lcssa, %.lr.ph131.epil
  %.not183 = icmp eq i64 %indvars.iv154, 0
  br i1 %.not183, label %.preheader117, label %.backedge

.backedge:                                        ; preds = %._crit_edge132, %._crit_edge132.thread
  %indvars.iv154.be = add nsw i64 %indvars.iv154, -1
  br label %33, !llvm.loop !13

._crit_edge132.thread:                            ; preds = %.preheader118
  %.not183185 = icmp eq i64 %indvars.iv154, 0
  br i1 %.not183185, label %.preheader116.preheader, label %.backedge

.lr.ph131:                                        ; preds = %.lr.ph131, %.lr.ph131.preheader.new
  %indvars.iv151 = phi i64 [ 0, %.lr.ph131.preheader.new ], [ %indvars.iv.next152.1, %.lr.ph131 ]
  %niter = phi i64 [ 0, %.lr.ph131.preheader.new ], [ %niter.next.1, %.lr.ph131 ]
  %141 = getelementptr inbounds [100001 x i32], ptr @msk, i64 0, i64 %indvars.iv151
  %142 = load i32, ptr %141, align 8, !tbaa !5
  %143 = shl i32 %142, 1
  %144 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %indvars.iv151
  %145 = load i32, ptr %144, align 8, !tbaa !5
  %146 = getelementptr inbounds [100001 x i8], ptr @buf, i64 0, i64 %indvars.iv151
  %147 = load i8, ptr %146, align 2, !tbaa !9
  %148 = sext i8 %147 to i64
  %149 = getelementptr inbounds i32, ptr %35, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = icmp sgt i32 %145, %150
  %152 = zext i1 %151 to i32
  %153 = or disjoint i32 %143, %152
  store i32 %153, ptr %141, align 8, !tbaa !5
  %indvars.iv.next152 = or disjoint i64 %indvars.iv151, 1
  %154 = getelementptr inbounds [100001 x i32], ptr @msk, i64 0, i64 %indvars.iv.next152
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = shl i32 %155, 1
  %157 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %indvars.iv.next152
  %158 = load i32, ptr %157, align 4, !tbaa !5
  %159 = getelementptr inbounds [100001 x i8], ptr @buf, i64 0, i64 %indvars.iv.next152
  %160 = load i8, ptr %159, align 1, !tbaa !9
  %161 = sext i8 %160 to i64
  %162 = getelementptr inbounds i32, ptr %35, i64 %161
  %163 = load i32, ptr %162, align 4, !tbaa !5
  %164 = icmp sgt i32 %158, %163
  %165 = zext i1 %164 to i32
  %166 = or disjoint i32 %156, %165
  store i32 %166, ptr %154, align 4, !tbaa !5
  %indvars.iv.next152.1 = add nuw nsw i64 %indvars.iv151, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge132.unr-lcssa, label %.lr.ph131, !llvm.loop !14

.lr.ph135:                                        ; preds = %.lr.ph135, %.lr.ph135.preheader.new
  %indvars.iv157 = phi i64 [ 0, %.lr.ph135.preheader.new ], [ %indvars.iv.next158.1, %.lr.ph135 ]
  %niter210 = phi i64 [ 0, %.lr.ph135.preheader.new ], [ %niter210.next.1, %.lr.ph135 ]
  %167 = getelementptr inbounds [100001 x i32], ptr @msk, i64 0, i64 %indvars.iv157
  %168 = load i32, ptr %167, align 8, !tbaa !5
  %169 = shl i32 %168, 3
  %170 = getelementptr inbounds [100001 x i8], ptr @buf, i64 0, i64 %indvars.iv157
  %171 = load i8, ptr %170, align 2, !tbaa !9
  %172 = sext i8 %171 to i32
  %173 = or i32 %169, %172
  store i32 %173, ptr %167, align 8, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [2049 x i32], ptr @cnt, i64 0, i64 %174
  %176 = load i32, ptr %175, align 4, !tbaa !5
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %175, align 4, !tbaa !5
  %indvars.iv.next158 = or disjoint i64 %indvars.iv157, 1
  %178 = getelementptr inbounds [100001 x i32], ptr @msk, i64 0, i64 %indvars.iv.next158
  %179 = load i32, ptr %178, align 4, !tbaa !5
  %180 = shl i32 %179, 3
  %181 = getelementptr inbounds [100001 x i8], ptr @buf, i64 0, i64 %indvars.iv.next158
  %182 = load i8, ptr %181, align 1, !tbaa !9
  %183 = sext i8 %182 to i32
  %184 = or i32 %180, %183
  store i32 %184, ptr %178, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [2049 x i32], ptr @cnt, i64 0, i64 %185
  %187 = load i32, ptr %186, align 4, !tbaa !5
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %186, align 4, !tbaa !5
  %indvars.iv.next158.1 = add nuw nsw i64 %indvars.iv157, 2
  %niter210.next.1 = add i64 %niter210, 2
  %niter210.ncmp.1 = icmp eq i64 %niter210.next.1, %unroll_iter209
  br i1 %niter210.ncmp.1, label %.preheader116.preheader.loopexit.unr-lcssa, label %.lr.ph135, !llvm.loop !15

.preheader115:                                    ; preds = %231
  %189 = load i32, ptr @n, align 4
  %190 = icmp sgt i32 %189, 0
  br i1 %190, label %.lr.ph146.preheader, label %.preheader

.lr.ph146.preheader:                              ; preds = %.preheader115
  %191 = zext nneg i32 %189 to i64
  %wide.trip.count178 = zext nneg i32 %189 to i64
  br label %.lr.ph146

.preheader116:                                    ; preds = %.preheader116.preheader, %231
  %indvars.iv162 = phi i64 [ %indvars.iv.next163, %231 ], [ 0, %.preheader116.preheader ]
  %192 = getelementptr inbounds [2049 x i32], ptr @cnt, i64 0, i64 %indvars.iv162
  %193 = load i32, ptr %192, align 4, !tbaa !5
  %.not110 = icmp eq i32 %193, 0
  br i1 %.not110, label %231, label %194

194:                                              ; preds = %.preheader116
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #9
  %195 = trunc nuw nsw i64 %indvars.iv162 to i32
  %196 = lshr i32 %195, 3
  %197 = and i64 %indvars.iv162, 7
  %198 = getelementptr inbounds [9 x [9 x i32]], ptr @low, i64 0, i64 %197
  %199 = call noundef i32 @"_ZZ4mainENK3$_0clEiiPiS0_"(ptr noundef nonnull align 1 dereferenceable(1) %6, i32 noundef %196, i32 noundef %196, ptr noundef nonnull %198, ptr noundef nonnull %198)
  %200 = getelementptr inbounds [2049 x [2049 x i32]], ptr @g, i64 0, i64 %indvars.iv162, i64 %indvars.iv162
  store i32 %199, ptr %200, align 4, !tbaa !5
  %201 = load i32, ptr %192, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = add nsw i64 %202, -1
  %204 = mul nsw i64 %203, %202
  %205 = sdiv i64 %204, 2
  %206 = sext i32 %199 to i64
  %207 = getelementptr inbounds [17 x i64], ptr @ans, i64 0, i64 %206
  %208 = load i64, ptr %207, align 8, !tbaa !16
  %209 = add nsw i64 %205, %208
  store i64 %209, ptr %207, align 8, !tbaa !16
  %210 = icmp ult i64 %indvars.iv162, 2047
  br i1 %210, label %.lr.ph139, label %._crit_edge140

._crit_edge140:                                   ; preds = %230, %194
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #9
  br label %231

.lr.ph139:                                        ; preds = %194, %230
  %indvars.iv164 = phi i64 [ %indvars.iv.next165, %230 ], [ %indvars.iv162, %194 ]
  %indvars.iv.next165 = add nuw nsw i64 %indvars.iv164, 1
  %211 = getelementptr inbounds [2049 x i32], ptr @cnt, i64 0, i64 %indvars.iv.next165
  %212 = load i32, ptr %211, align 4, !tbaa !5
  %.not111 = icmp eq i32 %212, 0
  br i1 %.not111, label %230, label %213

213:                                              ; preds = %.lr.ph139
  %214 = trunc nuw nsw i64 %indvars.iv.next165 to i32
  %215 = lshr i32 %214, 3
  %216 = and i64 %indvars.iv.next165, 7
  %217 = getelementptr inbounds [9 x [9 x i32]], ptr @low, i64 0, i64 %216
  %218 = call noundef i32 @"_ZZ4mainENK3$_0clEiiPiS0_"(ptr noundef nonnull align 1 dereferenceable(1) %6, i32 noundef %196, i32 noundef %215, ptr noundef nonnull %198, ptr noundef nonnull %217)
  %219 = getelementptr inbounds [2049 x [2049 x i32]], ptr @g, i64 0, i64 %indvars.iv.next165, i64 %indvars.iv162
  store i32 %218, ptr %219, align 4, !tbaa !5
  %220 = getelementptr inbounds [2049 x [2049 x i32]], ptr @g, i64 0, i64 %indvars.iv162, i64 %indvars.iv.next165
  store i32 %218, ptr %220, align 4, !tbaa !5
  %221 = load i32, ptr %192, align 4, !tbaa !5
  %222 = sext i32 %221 to i64
  %223 = load i32, ptr %211, align 4, !tbaa !5
  %224 = sext i32 %223 to i64
  %225 = mul nsw i64 %224, %222
  %226 = sext i32 %218 to i64
  %227 = getelementptr inbounds [17 x i64], ptr @ans, i64 0, i64 %226
  %228 = load i64, ptr %227, align 8, !tbaa !16
  %229 = add nsw i64 %225, %228
  store i64 %229, ptr %227, align 8, !tbaa !16
  br label %230

230:                                              ; preds = %.lr.ph139, %213
  %exitcond167.not = icmp eq i64 %indvars.iv.next165, 2047
  br i1 %exitcond167.not, label %._crit_edge140, label %.lr.ph139, !llvm.loop !18

231:                                              ; preds = %.preheader116, %._crit_edge140
  %indvars.iv.next163 = add nuw nsw i64 %indvars.iv162, 1
  %exitcond169.not = icmp eq i64 %indvars.iv.next163, 2048
  br i1 %exitcond169.not, label %.preheader115, label %.preheader116, !llvm.loop !19

.loopexit114:                                     ; preds = %254, %.lr.ph146
  %indvars.iv.next171 = add nuw nsw i64 %indvars.iv170, 1
  %exitcond179.not = icmp eq i64 %indvars.iv.next176, %wide.trip.count178
  br i1 %exitcond179.not, label %.preheader, label %.lr.ph146, !llvm.loop !20

.preheader:                                       ; preds = %.loopexit114, %.preheader115
  %232 = load i64, ptr getelementptr inbounds (i8, ptr @ans, i64 120), align 8, !tbaa !16
  %.not = icmp eq i64 %232, 0
  br i1 %.not, label %258, label %256

.lr.ph146:                                        ; preds = %.lr.ph146.preheader, %.loopexit114
  %indvars.iv175 = phi i64 [ 0, %.lr.ph146.preheader ], [ %indvars.iv.next176, %.loopexit114 ]
  %indvars.iv170 = phi i64 [ 1, %.lr.ph146.preheader ], [ %indvars.iv.next171, %.loopexit114 ]
  %indvars.iv.next176 = add nuw nsw i64 %indvars.iv175, 1
  %233 = icmp ult i64 %indvars.iv.next176, %191
  br i1 %233, label %.lr.ph144, label %.loopexit114

.lr.ph144:                                        ; preds = %.lr.ph146
  %234 = getelementptr inbounds [100001 x i32], ptr @msk, i64 0, i64 %indvars.iv175
  %235 = load i32, ptr %234, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = add nuw i64 %indvars.iv175, 16
  %zext = and i64 %237, 4294967295
  %invariant.umin = call i64 @llvm.umin.i64(i64 %zext, i64 %191)
  br label %238

238:                                              ; preds = %.lr.ph144, %254
  %indvars.iv172 = phi i64 [ %indvars.iv170, %.lr.ph144 ], [ %indvars.iv.next173, %254 ]
  %239 = getelementptr inbounds [100001 x i32], ptr @msk, i64 0, i64 %indvars.iv172
  %240 = load i32, ptr %239, align 4, !tbaa !5
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds [2049 x [2049 x i32]], ptr @g, i64 0, i64 %236, i64 %241
  %243 = load i32, ptr %242, align 4, !tbaa !5
  %244 = sub nuw nsw i64 %indvars.iv172, %indvars.iv175
  %245 = sext i32 %243 to i64
  %246 = icmp slt i64 %244, %245
  br i1 %246, label %247, label %254

247:                                              ; preds = %238
  %248 = getelementptr inbounds [17 x i64], ptr @ans, i64 0, i64 %245
  %249 = load i64, ptr %248, align 8, !tbaa !16
  %250 = add nsw i64 %249, -1
  store i64 %250, ptr %248, align 8, !tbaa !16
  %251 = getelementptr inbounds [17 x i64], ptr @ans, i64 0, i64 %244
  %252 = load i64, ptr %251, align 8, !tbaa !16
  %253 = add nsw i64 %252, 1
  store i64 %253, ptr %251, align 8, !tbaa !16
  br label %254

254:                                              ; preds = %247, %238
  %indvars.iv.next173 = add nuw nsw i64 %indvars.iv172, 1
  %255 = icmp ult i64 %indvars.iv.next173, %invariant.umin
  br i1 %255, label %238, label %.loopexit114, !llvm.loop !21

256:                                              ; preds = %286, %284, %282, %280, %278, %276, %274, %272, %270, %268, %266, %264, %262, %260, %258, %.preheader
  %.0147.lcssa = phi i32 [ 15, %.preheader ], [ 14, %258 ], [ 13, %260 ], [ 12, %262 ], [ 11, %264 ], [ 10, %266 ], [ 9, %268 ], [ 8, %270 ], [ 7, %272 ], [ 6, %274 ], [ 5, %276 ], [ 4, %278 ], [ 3, %280 ], [ 2, %282 ], [ 1, %284 ], [ 0, %286 ]
  %.lcssa = phi i64 [ %232, %.preheader ], [ %259, %258 ], [ %261, %260 ], [ %263, %262 ], [ %265, %264 ], [ %267, %266 ], [ %269, %268 ], [ %271, %270 ], [ %273, %272 ], [ %275, %274 ], [ %277, %276 ], [ %279, %278 ], [ %281, %280 ], [ %283, %282 ], [ %285, %284 ], [ %287, %286 ]
  %257 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.0147.lcssa, i64 noundef %.lcssa)
  br label %.loopexit

258:                                              ; preds = %.preheader
  %259 = load i64, ptr getelementptr inbounds (i8, ptr @ans, i64 112), align 16, !tbaa !16
  %.not.1 = icmp eq i64 %259, 0
  br i1 %.not.1, label %260, label %256

260:                                              ; preds = %258
  %261 = load i64, ptr getelementptr inbounds (i8, ptr @ans, i64 104), align 8, !tbaa !16
  %.not.2 = icmp eq i64 %261, 0
  br i1 %.not.2, label %262, label %256

262:                                              ; preds = %260
  %263 = load i64, ptr getelementptr inbounds (i8, ptr @ans, i64 96), align 16, !tbaa !16
  %.not.3 = icmp eq i64 %263, 0
  br i1 %.not.3, label %264, label %256

264:                                              ; preds = %262
  %265 = load i64, ptr getelementptr inbounds (i8, ptr @ans, i64 88), align 8, !tbaa !16
  %.not.4 = icmp eq i64 %265, 0
  br i1 %.not.4, label %266, label %256

266:                                              ; preds = %264
  %267 = load i64, ptr getelementptr inbounds (i8, ptr @ans, i64 80), align 16, !tbaa !16
  %.not.5 = icmp eq i64 %267, 0
  br i1 %.not.5, label %268, label %256

268:                                              ; preds = %266
  %269 = load i64, ptr getelementptr inbounds (i8, ptr @ans, i64 72), align 8, !tbaa !16
  %.not.6 = icmp eq i64 %269, 0
  br i1 %.not.6, label %270, label %256

270:                                              ; preds = %268
  %271 = load i64, ptr getelementptr inbounds (i8, ptr @ans, i64 64), align 16, !tbaa !16
  %.not.7 = icmp eq i64 %271, 0
  br i1 %.not.7, label %272, label %256

272:                                              ; preds = %270
  %273 = load i64, ptr getelementptr inbounds (i8, ptr @ans, i64 56), align 8, !tbaa !16
  %.not.8 = icmp eq i64 %273, 0
  br i1 %.not.8, label %274, label %256

274:                                              ; preds = %272
  %275 = load i64, ptr getelementptr inbounds (i8, ptr @ans, i64 48), align 16, !tbaa !16
  %.not.9 = icmp eq i64 %275, 0
  br i1 %.not.9, label %276, label %256

276:                                              ; preds = %274
  %277 = load i64, ptr getelementptr inbounds (i8, ptr @ans, i64 40), align 8, !tbaa !16
  %.not.10 = icmp eq i64 %277, 0
  br i1 %.not.10, label %278, label %256

278:                                              ; preds = %276
  %279 = load i64, ptr getelementptr inbounds (i8, ptr @ans, i64 32), align 16, !tbaa !16
  %.not.11 = icmp eq i64 %279, 0
  br i1 %.not.11, label %280, label %256

280:                                              ; preds = %278
  %281 = load i64, ptr getelementptr inbounds (i8, ptr @ans, i64 24), align 8, !tbaa !16
  %.not.12 = icmp eq i64 %281, 0
  br i1 %.not.12, label %282, label %256

282:                                              ; preds = %280
  %283 = load i64, ptr getelementptr inbounds (i8, ptr @ans, i64 16), align 16, !tbaa !16
  %.not.13 = icmp eq i64 %283, 0
  br i1 %.not.13, label %284, label %256

284:                                              ; preds = %282
  %285 = load i64, ptr getelementptr inbounds (i8, ptr @ans, i64 8), align 8, !tbaa !16
  %.not.14 = icmp eq i64 %285, 0
  br i1 %.not.14, label %286, label %256

286:                                              ; preds = %284
  %287 = load i64, ptr @ans, align 16, !tbaa !16
  %.not.15 = icmp eq i64 %287, 0
  br i1 %.not.15, label %.loopexit, label %256

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

; 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 uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef i32 @"_ZZ4mainENK3$_0clEiiPiS0_"(ptr noundef nonnull align 1 dereferenceable(1), i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #7 align 2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #8

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


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