; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Company Contests/CodeStorm/Problem E (brute)

; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"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
@m = external dso_local global i32, align 4
@dp = external dso_local global [1000100 x i32], align 16
@cnt = external dso_local global [1000100 x [4 x i32]], align 16
@a = external dso_local global [1000100 x i32], align 16
@d = external dso_local global [10 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

35:                                               ; preds = %43, %0
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = icmp slt i32 %36, 10
  br i1 %37, label %39, label %38

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

39:                                               ; preds = %35
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %41
  store i32 1, ptr %42, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %39
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %2, align 4, !tbaa !5
  br label %35, !llvm.loop !9

46:                                               ; preds = %38
  store i32 1, ptr @d, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %61, %46
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = icmp sle i32 %48, 9
  br i1 %49, label %51, label %50

50:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %64

51:                                               ; preds = %47
  %52 = load i32, ptr %3, align 4, !tbaa !5
  %53 = sub nsw i32 %52, 1
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [10 x i32], ptr @d, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = mul nsw i32 %56, 10
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [10 x i32], ptr @d, i64 0, i64 %59
  store i32 %57, ptr %60, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %51
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %3, align 4, !tbaa !5
  br label %47, !llvm.loop !11

64:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 10, ptr %4, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %220, %64
  %66 = load i32, ptr %4, align 4, !tbaa !5
  %67 = icmp slt i32 %66, 1000100
  br i1 %67, label %69, label %68

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

69:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %70 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %70, ptr %8, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %74, %69
  %72 = load i32, ptr %8, align 4, !tbaa !5
  %73 = icmp ne i32 %72, 0
  br i1 %73, label %74, label %79

74:                                               ; preds = %71
  %75 = load i32, ptr %7, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %7, align 4, !tbaa !5
  %77 = load i32, ptr %8, align 4, !tbaa !5
  %78 = sdiv i32 %77, 10
  store i32 %78, ptr %8, align 4, !tbaa !5
  br label %71, !llvm.loop !12

79:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %153, %79
  %81 = load i32, ptr %9, align 4, !tbaa !5
  %82 = load i32, ptr %7, align 4, !tbaa !5
  %83 = icmp slt i32 %81, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %80
  store i32 13, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %156

85:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %86 = load i32, ptr %4, align 4, !tbaa !5
  %87 = load i32, ptr %9, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [10 x i32], ptr @d, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = srem i32 %86, %91
  %93 = load i32, ptr %9, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [10 x i32], ptr @d, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = sdiv i32 %92, %96
  store i32 %97, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %98 = load i32, ptr %4, align 4, !tbaa !5
  %99 = load i32, ptr %9, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [10 x i32], ptr @d, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = srem i32 %98, %102
  %104 = load i32, ptr %9, align 4, !tbaa !5
  %105 = sub nsw i32 %104, 1
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [10 x i32], ptr @d, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = sdiv i32 %103, %108
  store i32 %109, ptr %11, align 4, !tbaa !5
  %110 = load i32, ptr %11, align 4, !tbaa !5
  %111 = load i32, ptr %10, align 4, !tbaa !5
  %112 = add nsw i32 %111, %110
  store i32 %112, ptr %10, align 4, !tbaa !5
  %113 = load i32, ptr %10, align 4, !tbaa !5
  %114 = icmp sge i32 %113, 10
  br i1 %114, label %115, label %118

115:                                              ; preds = %85
  %116 = load i32, ptr %10, align 4, !tbaa !5
  %117 = sub nsw i32 %116, 10
  store i32 %117, ptr %10, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %115, %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %119 = load i32, ptr %4, align 4, !tbaa !5
  %120 = load i32, ptr %9, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [10 x i32], ptr @d, i64 0, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = sdiv i32 %119, %124
  %126 = load i32, ptr %9, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [10 x i32], ptr @d, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = mul nsw i32 %125, %129
  %131 = load i32, ptr %10, align 4, !tbaa !5
  %132 = load i32, ptr %9, align 4, !tbaa !5
  %133 = sub nsw i32 %132, 1
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [10 x i32], ptr @d, i64 0, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !5
  %137 = mul nsw i32 %131, %136
  %138 = add nsw i32 %130, %137
  %139 = load i32, ptr %4, align 4, !tbaa !5
  %140 = load i32, ptr %9, align 4, !tbaa !5
  %141 = sub nsw i32 %140, 1
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [10 x i32], ptr @d, i64 0, i64 %142
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %145 = srem i32 %139, %144
  %146 = add nsw i32 %138, %145
  store i32 %146, ptr %12, align 4, !tbaa !5
  %147 = load i32, ptr %12, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = load i32, ptr %6, align 4, !tbaa !5
  %152 = or i32 %151, %150
  store i32 %152, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %153

153:                                              ; preds = %118
  %154 = load i32, ptr %9, align 4, !tbaa !5
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %9, align 4, !tbaa !5
  br label %80, !llvm.loop !13

156:                                              ; preds = %84
  %157 = load i32, ptr %6, align 4, !tbaa !5
  %158 = icmp eq i32 %157, 1
  br i1 %158, label %159, label %163

159:                                              ; preds = %156
  %160 = load i32, ptr %4, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %161
  store i32 2, ptr %162, align 4, !tbaa !5
  br label %219

163:                                              ; preds = %156
  %164 = load i32, ptr %6, align 4, !tbaa !5
  %165 = icmp eq i32 %164, 2
  br i1 %165, label %166, label %170

166:                                              ; preds = %163
  %167 = load i32, ptr %4, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %168
  store i32 1, ptr %169, align 4, !tbaa !5
  br label %218

170:                                              ; preds = %163
  %171 = load i32, ptr %6, align 4, !tbaa !5
  %172 = and i32 %171, 8
  %173 = icmp sgt i32 %172, 0
  br i1 %173, label %174, label %178

174:                                              ; preds = %170
  %175 = load i32, ptr %4, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %176
  store i32 4, ptr %177, align 4, !tbaa !5
  br label %217

178:                                              ; preds = %170
  %179 = load i32, ptr %6, align 4, !tbaa !5
  %180 = and i32 %179, 1
  %181 = icmp sgt i32 %180, 0
  br i1 %181, label %182, label %190

182:                                              ; preds = %178
  %183 = load i32, ptr %6, align 4, !tbaa !5
  %184 = and i32 %183, 2
  %185 = icmp sgt i32 %184, 0
  br i1 %185, label %186, label %190

186:                                              ; preds = %182
  %187 = load i32, ptr %4, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %188
  store i32 4, ptr %189, align 4, !tbaa !5
  br label %216

190:                                              ; preds = %182, %178
  %191 = load i32, ptr %6, align 4, !tbaa !5
  %192 = and i32 %191, 1
  %193 = icmp sgt i32 %192, 0
  br i1 %193, label %194, label %198

194:                                              ; preds = %190
  %195 = load i32, ptr %4, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %196
  store i32 2, ptr %197, align 4, !tbaa !5
  br label %215

198:                                              ; preds = %190
  %199 = load i32, ptr %6, align 4, !tbaa !5
  %200 = and i32 %199, 2
  %201 = icmp sgt i32 %200, 0
  br i1 %201, label %202, label %206

202:                                              ; preds = %198
  %203 = load i32, ptr %4, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %204
  store i32 1, ptr %205, align 4, !tbaa !5
  br label %214

206:                                              ; preds = %198
  %207 = load i32, ptr %6, align 4, !tbaa !5
  %208 = icmp eq i32 %207, 4
  br i1 %208, label %209, label %213

209:                                              ; preds = %206
  %210 = load i32, ptr %4, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %211
  store i32 8, ptr %212, align 4, !tbaa !5
  br label %213

213:                                              ; preds = %209, %206
  br label %214

214:                                              ; preds = %213, %202
  br label %215

215:                                              ; preds = %214, %194
  br label %216

216:                                              ; preds = %215, %186
  br label %217

217:                                              ; preds = %216, %174
  br label %218

218:                                              ; preds = %217, %166
  br label %219

219:                                              ; preds = %218, %159
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %220

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

223:                                              ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %224

224:                                              ; preds = %261, %223
  %225 = load i32, ptr %13, align 4, !tbaa !5
  %226 = icmp slt i32 %225, 1000100
  br i1 %226, label %228, label %227

227:                                              ; preds = %224
  store i32 16, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %264

228:                                              ; preds = %224
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %229

229:                                              ; preds = %257, %228
  %230 = load i32, ptr %14, align 4, !tbaa !5
  %231 = icmp slt i32 %230, 4
  br i1 %231, label %233, label %232

232:                                              ; preds = %229
  store i32 19, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %260

233:                                              ; preds = %229
  %234 = load i32, ptr %13, align 4, !tbaa !5
  %235 = sub nsw i32 %234, 1
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [1000100 x [4 x i32]], ptr @cnt, i64 0, i64 %236
  %238 = load i32, ptr %14, align 4, !tbaa !5
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [4 x i32], ptr %237, i64 0, i64 %239
  %241 = load i32, ptr %240, align 4, !tbaa !5
  %242 = load i32, ptr %13, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %243
  %245 = load i32, ptr %244, align 4, !tbaa !5
  %246 = load i32, ptr %14, align 4, !tbaa !5
  %247 = shl i32 1, %246
  %248 = icmp eq i32 %245, %247
  %249 = zext i1 %248 to i32
  %250 = add nsw i32 %241, %249
  %251 = load i32, ptr %13, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [1000100 x [4 x i32]], ptr @cnt, i64 0, i64 %252
  %254 = load i32, ptr %14, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [4 x i32], ptr %253, i64 0, i64 %255
  store i32 %250, ptr %256, align 4, !tbaa !5
  br label %257

257:                                              ; preds = %233
  %258 = load i32, ptr %14, align 4, !tbaa !5
  %259 = add nsw i32 %258, 1
  store i32 %259, ptr %14, align 4, !tbaa !5
  br label %229, !llvm.loop !15

260:                                              ; preds = %232
  br label %261

261:                                              ; preds = %260
  %262 = load i32, ptr %13, align 4, !tbaa !5
  %263 = add nsw i32 %262, 1
  store i32 %263, ptr %13, align 4, !tbaa !5
  br label %224, !llvm.loop !16

264:                                              ; preds = %227
  %265 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %266

266:                                              ; preds = %471, %264
  %267 = load i32, ptr @t, align 4, !tbaa !5
  %268 = add nsw i32 %267, -1
  store i32 %268, ptr @t, align 4, !tbaa !5
  %269 = icmp ne i32 %267, 0
  br i1 %269, label %270, label %478

270:                                              ; preds = %266
  %271 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 48, ptr %15) #6
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %15) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %272

272:                                              ; preds = %336, %270
  %273 = load i32, ptr %20, align 4, !tbaa !5
  %274 = load i32, ptr @m, align 4, !tbaa !5
  %275 = icmp slt i32 %273, %274
  br i1 %275, label %277, label %276

276:                                              ; preds = %272
  store i32 24, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %343

277:                                              ; preds = %272
  %278 = load i32, ptr %20, align 4, !tbaa !5
  %279 = sext i32 %278 to i64
  %280 = getelementptr inbounds [1000100 x i32], ptr @a, i64 0, i64 %279
  %281 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %280)
          to label %282 unwind label %339

282:                                              ; preds = %277
  %283 = load i32, ptr %20, align 4, !tbaa !5
  %284 = sext i32 %283 to i64
  %285 = getelementptr inbounds [1000100 x i32], ptr @a, i64 0, i64 %284
  %286 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %15, ptr noundef nonnull align 4 dereferenceable(4) %285)
          to label %287 unwind label %339

287:                                              ; preds = %282
  %288 = getelementptr inbounds { ptr, i8 }, ptr %23, i32 0, i32 0
  %289 = extractvalue { ptr, i8 } %286, 0
  store ptr %289, ptr %288, align 8
  %290 = getelementptr inbounds { ptr, i8 }, ptr %23, i32 0, i32 1
  %291 = extractvalue { ptr, i8 } %286, 1
  store i8 %291, ptr %290, align 8
  %292 = load i32, ptr %20, align 4, !tbaa !5
  %293 = sext i32 %292 to i64
  %294 = getelementptr inbounds [1000100 x i32], ptr @a, i64 0, i64 %293
  %295 = load i32, ptr %294, align 4, !tbaa !5
  %296 = sext i32 %295 to i64
  %297 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %296
  %298 = load i32, ptr %297, align 4, !tbaa !5
  %299 = icmp eq i32 %298, 1
  %300 = zext i1 %299 to i32
  %301 = load i32, ptr %16, align 4, !tbaa !5
  %302 = add nsw i32 %301, %300
  store i32 %302, ptr %16, align 4, !tbaa !5
  %303 = load i32, ptr %20, align 4, !tbaa !5
  %304 = sext i32 %303 to i64
  %305 = getelementptr inbounds [1000100 x i32], ptr @a, i64 0, i64 %304
  %306 = load i32, ptr %305, align 4, !tbaa !5
  %307 = sext i32 %306 to i64
  %308 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %307
  %309 = load i32, ptr %308, align 4, !tbaa !5
  %310 = icmp eq i32 %309, 2
  %311 = zext i1 %310 to i32
  %312 = load i32, ptr %17, align 4, !tbaa !5
  %313 = add nsw i32 %312, %311
  store i32 %313, ptr %17, align 4, !tbaa !5
  %314 = load i32, ptr %20, align 4, !tbaa !5
  %315 = sext i32 %314 to i64
  %316 = getelementptr inbounds [1000100 x i32], ptr @a, i64 0, i64 %315
  %317 = load i32, ptr %316, align 4, !tbaa !5
  %318 = sext i32 %317 to i64
  %319 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %318
  %320 = load i32, ptr %319, align 4, !tbaa !5
  %321 = icmp eq i32 %320, 4
  %322 = zext i1 %321 to i32
  %323 = load i32, ptr %18, align 4, !tbaa !5
  %324 = add nsw i32 %323, %322
  store i32 %324, ptr %18, align 4, !tbaa !5
  %325 = load i32, ptr %20, align 4, !tbaa !5
  %326 = sext i32 %325 to i64
  %327 = getelementptr inbounds [1000100 x i32], ptr @a, i64 0, i64 %326
  %328 = load i32, ptr %327, align 4, !tbaa !5
  %329 = sext i32 %328 to i64
  %330 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %329
  %331 = load i32, ptr %330, align 4, !tbaa !5
  %332 = icmp eq i32 %331, 8
  %333 = zext i1 %332 to i32
  %334 = load i32, ptr %19, align 4, !tbaa !5
  %335 = add nsw i32 %334, %333
  store i32 %335, ptr %19, align 4, !tbaa !5
  br label %336

336:                                              ; preds = %287
  %337 = load i32, ptr %20, align 4, !tbaa !5
  %338 = add nsw i32 %337, 1
  store i32 %338, ptr %20, align 4, !tbaa !5
  br label %272, !llvm.loop !17

339:                                              ; preds = %282, %277
  %340 = landingpad { ptr, i32 }
          cleanup
  %341 = extractvalue { ptr, i32 } %340, 0
  store ptr %341, ptr %21, align 8
  %342 = extractvalue { ptr, i32 } %340, 1
  store i32 %342, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %477

343:                                              ; preds = %276
  call void @llvm.lifetime.start.p0(i64 24, ptr %24) #6
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  store i32 1, ptr %25, align 4, !tbaa !5
  br label %344

344:                                              ; preds = %360, %343
  %345 = load i32, ptr %25, align 4, !tbaa !5
  %346 = load i32, ptr @n, align 4, !tbaa !5
  %347 = icmp sle i32 %345, %346
  br i1 %347, label %349, label %348

348:                                              ; preds = %344
  store i32 27, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  br label %363

349:                                              ; preds = %344
  %350 = invoke noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(48) %15, ptr noundef nonnull align 4 dereferenceable(4) %25)
          to label %351 unwind label %355

351:                                              ; preds = %349
  %352 = icmp ne i64 %350, 0
  br i1 %352, label %359, label %353

353:                                              ; preds = %351
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef nonnull align 4 dereferenceable(4) %25)
          to label %354 unwind label %355

354:                                              ; preds = %353
  br label %359

355:                                              ; preds = %353, %349
  %356 = landingpad { ptr, i32 }
          cleanup
  %357 = extractvalue { ptr, i32 } %356, 0
  store ptr %357, ptr %21, align 8
  %358 = extractvalue { ptr, i32 } %356, 1
  store i32 %358, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  br label %476

359:                                              ; preds = %354, %351
  br label %360

360:                                              ; preds = %359
  %361 = load i32, ptr %25, align 4, !tbaa !5
  %362 = add nsw i32 %361, 1
  store i32 %362, ptr %25, align 4, !tbaa !5
  br label %344, !llvm.loop !18

363:                                              ; preds = %348
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  %364 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %24) #6
  %365 = trunc i64 %364 to i32
  store i32 %365, ptr %26, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  %366 = load i32, ptr %26, align 4, !tbaa !5
  %367 = zext i32 %366 to i64
  %368 = shl i64 1, %367
  %369 = trunc i64 %368 to i32
  store i32 %369, ptr %27, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  store i64 0, ptr %28, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #6
  store i32 1, ptr %29, align 4, !tbaa !5
  br label %370

370:                                              ; preds = %463, %363
  %371 = load i32, ptr %29, align 4, !tbaa !5
  %372 = load i32, ptr %27, align 4, !tbaa !5
  %373 = icmp slt i32 %371, %372
  br i1 %373, label %375, label %374

374:                                              ; preds = %370
  store i32 30, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #6
  br label %466

375:                                              ; preds = %370
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #6
  %376 = load i32, ptr %16, align 4, !tbaa !5
  store i32 %376, ptr %30, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #6
  %377 = load i32, ptr %17, align 4, !tbaa !5
  store i32 %377, ptr %31, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #6
  %378 = load i32, ptr %18, align 4, !tbaa !5
  store i32 %378, ptr %32, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #6
  %379 = load i32, ptr %19, align 4, !tbaa !5
  store i32 %379, ptr %33, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #6
  store i32 0, ptr %34, align 4, !tbaa !5
  br label %380

380:                                              ; preds = %439, %375
  %381 = load i32, ptr %34, align 4, !tbaa !5
  %382 = load i32, ptr %26, align 4, !tbaa !5
  %383 = icmp slt i32 %381, %382
  br i1 %383, label %385, label %384

384:                                              ; preds = %380
  store i32 33, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #6
  br label %442

385:                                              ; preds = %380
  %386 = load i32, ptr %29, align 4, !tbaa !5
  %387 = sext i32 %386 to i64
  %388 = load i32, ptr %34, align 4, !tbaa !5
  %389 = zext i32 %388 to i64
  %390 = shl i64 1, %389
  %391 = and i64 %387, %390
  %392 = icmp sgt i64 %391, 0
  br i1 %392, label %393, label %438

393:                                              ; preds = %385
  %394 = load i32, ptr %34, align 4, !tbaa !5
  %395 = sext i32 %394 to i64
  %396 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %395) #6
  %397 = load i32, ptr %396, align 4, !tbaa !5
  %398 = sext i32 %397 to i64
  %399 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %398
  %400 = load i32, ptr %399, align 4, !tbaa !5
  %401 = icmp eq i32 %400, 1
  %402 = zext i1 %401 to i32
  %403 = load i32, ptr %30, align 4, !tbaa !5
  %404 = add nsw i32 %403, %402
  store i32 %404, ptr %30, align 4, !tbaa !5
  %405 = load i32, ptr %34, align 4, !tbaa !5
  %406 = sext i32 %405 to i64
  %407 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %406) #6
  %408 = load i32, ptr %407, align 4, !tbaa !5
  %409 = sext i32 %408 to i64
  %410 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %409
  %411 = load i32, ptr %410, align 4, !tbaa !5
  %412 = icmp eq i32 %411, 2
  %413 = zext i1 %412 to i32
  %414 = load i32, ptr %31, align 4, !tbaa !5
  %415 = add nsw i32 %414, %413
  store i32 %415, ptr %31, align 4, !tbaa !5
  %416 = load i32, ptr %34, align 4, !tbaa !5
  %417 = sext i32 %416 to i64
  %418 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %417) #6
  %419 = load i32, ptr %418, align 4, !tbaa !5
  %420 = sext i32 %419 to i64
  %421 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %420
  %422 = load i32, ptr %421, align 4, !tbaa !5
  %423 = icmp eq i32 %422, 4
  %424 = zext i1 %423 to i32
  %425 = load i32, ptr %32, align 4, !tbaa !5
  %426 = add nsw i32 %425, %424
  store i32 %426, ptr %32, align 4, !tbaa !5
  %427 = load i32, ptr %34, align 4, !tbaa !5
  %428 = sext i32 %427 to i64
  %429 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %428) #6
  %430 = load i32, ptr %429, align 4, !tbaa !5
  %431 = sext i32 %430 to i64
  %432 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %431
  %433 = load i32, ptr %432, align 4, !tbaa !5
  %434 = icmp eq i32 %433, 8
  %435 = zext i1 %434 to i32
  %436 = load i32, ptr %33, align 4, !tbaa !5
  %437 = add nsw i32 %436, %435
  store i32 %437, ptr %33, align 4, !tbaa !5
  br label %438

438:                                              ; preds = %393, %385
  br label %439

439:                                              ; preds = %438
  %440 = load i32, ptr %34, align 4, !tbaa !5
  %441 = add nsw i32 %440, 1
  store i32 %441, ptr %34, align 4, !tbaa !5
  br label %380, !llvm.loop !21

442:                                              ; preds = %384
  %443 = load i32, ptr %31, align 4, !tbaa !5
  %444 = srem i32 %443, 2
  %445 = icmp eq i32 %444, 1
  br i1 %445, label %446, label %454

446:                                              ; preds = %442
  %447 = load i32, ptr %32, align 4, !tbaa !5
  %448 = srem i32 %447, 2
  %449 = icmp eq i32 %448, 1
  br i1 %449, label %450, label %453

450:                                              ; preds = %446
  %451 = load i64, ptr %28, align 8, !tbaa !19
  %452 = add nsw i64 %451, 1
  store i64 %452, ptr %28, align 8, !tbaa !19
  br label %453

453:                                              ; preds = %450, %446
  br label %462

454:                                              ; preds = %442
  %455 = load i32, ptr %32, align 4, !tbaa !5
  %456 = srem i32 %455, 2
  %457 = icmp eq i32 %456, 0
  br i1 %457, label %458, label %461

458:                                              ; preds = %454
  %459 = load i64, ptr %28, align 8, !tbaa !19
  %460 = add nsw i64 %459, 1
  store i64 %460, ptr %28, align 8, !tbaa !19
  br label %461

461:                                              ; preds = %458, %454
  br label %462

462:                                              ; preds = %461, %453
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #6
  br label %463

463:                                              ; preds = %462
  %464 = load i32, ptr %29, align 4, !tbaa !5
  %465 = add nsw i32 %464, 1
  store i32 %465, ptr %29, align 4, !tbaa !5
  br label %370, !llvm.loop !22

466:                                              ; preds = %374
  %467 = load i64, ptr %28, align 8, !tbaa !19
  %468 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %467)
          to label %469 unwind label %472

469:                                              ; preds = %466
  %470 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %468, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %471 unwind label %472

471:                                              ; preds = %469
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %15) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %15) #6
  br label %266, !llvm.loop !23

472:                                              ; preds = %469, %466
  %473 = landingpad { ptr, i32 }
          cleanup
  %474 = extractvalue { ptr, i32 } %473, 0
  store ptr %474, ptr %21, align 8
  %475 = extractvalue { ptr, i32 } %473, 1
  store i32 %475, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  br label %476

476:                                              ; preds = %472, %355
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #6
  br label %477

477:                                              ; preds = %476, %339
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %15) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %15) #6
  br label %479

478:                                              ; preds = %266
  ret i32 0

479:                                              ; preds = %477
  %480 = load ptr, ptr %21, align 8
  %481 = load i32, ptr %22, align 4
  %482 = insertvalue { ptr, i32 } poison, ptr %480, 0
  %483 = insertvalue { ptr, i32 } %482, i32 %481, 1
  resume { ptr, i32 } %483
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #4 align 2

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

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

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

; 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) #3 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #4 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

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

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

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


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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"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
@m = external dso_local global i32, align 4
@dp = external dso_local local_unnamed_addr global [1000100 x i32], align 16
@cnt = external dso_local local_unnamed_addr global [1000100 x [4 x i32]], align 16
@a = external dso_local global [1000100 x i32], align 16
@d = external dso_local local_unnamed_addr global [10 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
.preheader148.preheader:
  %0 = alloca %"class.std::set", align 8
  %1 = alloca %"class.std::vector", align 8
  %2 = alloca i32, align 4
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr @dp, align 16, !tbaa !5
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr getelementptr inbounds (i8, ptr @dp, i64 16), align 16, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @dp, i64 32), align 16, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @dp, i64 36), align 4, !tbaa !5
  store <4 x i32> <i32 1, i32 10, i32 100, i32 1000>, ptr @d, align 16, !tbaa !5
  store <4 x i32> <i32 10000, i32 100000, i32 1000000, i32 10000000>, ptr getelementptr inbounds (i8, ptr @d, i64 16), align 16, !tbaa !5
  store i32 100000000, ptr getelementptr inbounds (i8, ptr @d, i64 32), align 16, !tbaa !5
  store i32 1000000000, ptr getelementptr inbounds (i8, ptr @d, i64 36), align 4, !tbaa !5
  br label %.preheader148

.preheader148:                                    ; preds = %.preheader148.preheader, %.thread265
  %indvars.iv215 = phi i64 [ 10, %.preheader148.preheader ], [ %indvars.iv.next216, %.thread265 ]
  %3 = trunc nuw nsw i64 %indvars.iv215 to i32
  br label %4

.preheader147:                                    ; preds = %4
  %.not203 = icmp eq i32 %.0125157, 0
  br i1 %.not203, label %.thread265, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader147
  %wide.trip.count = zext i32 %indvars.iv213 to i64
  br label %.lr.ph

4:                                                ; preds = %.preheader148, %4
  %indvars.iv213 = phi i32 [ 1, %.preheader148 ], [ %indvars.iv.next214, %4 ]
  %.0125157 = phi i32 [ 0, %.preheader148 ], [ %5, %4 ]
  %.0128156 = phi i32 [ %3, %.preheader148 ], [ %6, %4 ]
  %5 = add nuw nsw i32 %.0125157, 1
  %6 = sdiv i32 %.0128156, 10
  %.0128156.off = add nsw i32 %.0128156, 9
  %.not137 = icmp ult i32 %.0128156.off, 19
  %indvars.iv.next214 = add nuw i32 %indvars.iv213, 1
  br i1 %.not137, label %.preheader147, label %4, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph
  switch i32 %29, label %31 [
    i32 1, label %.thread265.sink.split
    i32 2, label %30
  ]

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %7 = phi i32 [ 10, %.lr.ph.preheader ], [ %9, %.lr.ph ]
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %.0124159 = phi i32 [ 0, %.lr.ph.preheader ], [ %29, %.lr.ph ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %8 = getelementptr inbounds [10 x i32], ptr @d, i64 0, i64 %indvars.iv.next
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %10 = srem i32 %3, %9
  %11 = sdiv i32 %10, %7
  %12 = srem i32 %3, %7
  %13 = add nsw i64 %indvars.iv, -1
  %14 = getelementptr inbounds [10 x i32], ptr @d, i64 0, i64 %13
  %15 = load i32, ptr %14, align 4, !tbaa !5
  %16 = sdiv i32 %12, %15
  %17 = add nsw i32 %16, %11
  %18 = icmp sgt i32 %17, 9
  %19 = add nsw i32 %17, -10
  %spec.select = select i1 %18, i32 %19, i32 %17
  %20 = sdiv i32 %3, %9
  %21 = mul nsw i32 %20, %7
  %22 = mul nsw i32 %spec.select, %15
  %23 = srem i32 %3, %15
  %24 = add i32 %23, %21
  %25 = add i32 %24, %22
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = or i32 %28, %.0124159
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !11

30:                                               ; preds = %._crit_edge
  br label %.thread265.sink.split

31:                                               ; preds = %._crit_edge
  %32 = and i32 %29, 8
  %.not138 = icmp ne i32 %32, 0
  %33 = and i32 %29, 3
  %or.cond.not = icmp eq i32 %33, 3
  %or.cond = or i1 %.not138, %or.cond.not
  br i1 %or.cond, label %.thread265.sink.split, label %34

34:                                               ; preds = %31
  %35 = and i32 %29, 1
  %.not139.not = icmp eq i32 %35, 0
  %36 = and i32 %29, 3
  %brmerge.not = icmp eq i32 %36, 0
  %.mux = select i1 %.not139.not, i32 1, i32 2
  br i1 %brmerge.not, label %37, label %.thread265.sink.split

37:                                               ; preds = %34
  %38 = icmp eq i32 %29, 4
  br i1 %38, label %.thread265.sink.split, label %.thread265

.thread265.sink.split:                            ; preds = %34, %37, %31, %._crit_edge, %30
  %.sink = phi i32 [ 1, %30 ], [ 2, %._crit_edge ], [ 4, %31 ], [ %.mux, %34 ], [ 8, %37 ]
  %39 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %indvars.iv215
  store i32 %.sink, ptr %39, align 4, !tbaa !5
  br label %.thread265

.thread265:                                       ; preds = %.thread265.sink.split, %.preheader147, %37
  %indvars.iv.next216 = add nuw nsw i64 %indvars.iv215, 1
  %exitcond218.not = icmp eq i64 %indvars.iv.next216, 1000100
  br i1 %exitcond218.not, label %.preheader145.preheader, label %.preheader148, !llvm.loop !12

.preheader145.preheader:                          ; preds = %.thread265
  %40 = load <4 x i32>, ptr @cnt, align 16, !tbaa !5
  br label %.preheader145

.preheader145:                                    ; preds = %.preheader145.1, %.preheader145.preheader
  %indvars.iv223 = phi i64 [ 1, %.preheader145.preheader ], [ %indvars.iv.next224.1, %.preheader145.1 ]
  %41 = phi <4 x i32> [ %40, %.preheader145.preheader ], [ %57, %.preheader145.1 ]
  %42 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %indvars.iv223
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = getelementptr inbounds [1000100 x [4 x i32]], ptr @cnt, i64 0, i64 %indvars.iv223, i64 0
  %45 = insertelement <4 x i32> poison, i32 %43, i64 0
  %46 = shufflevector <4 x i32> %45, <4 x i32> poison, <4 x i32> zeroinitializer
  %47 = icmp eq <4 x i32> %46, <i32 1, i32 2, i32 4, i32 8>
  %48 = zext <4 x i1> %47 to <4 x i32>
  %49 = add nsw <4 x i32> %41, %48
  store <4 x i32> %49, ptr %44, align 16, !tbaa !5
  %indvars.iv.next224 = add nuw nsw i64 %indvars.iv223, 1
  %exitcond226.not = icmp eq i64 %indvars.iv.next224, 1000100
  br i1 %exitcond226.not, label %58, label %.preheader145.1, !llvm.loop !13

.preheader145.1:                                  ; preds = %.preheader145
  %50 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %indvars.iv.next224
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = getelementptr inbounds [1000100 x [4 x i32]], ptr @cnt, i64 0, i64 %indvars.iv.next224, i64 0
  %53 = insertelement <4 x i32> poison, i32 %51, i64 0
  %54 = shufflevector <4 x i32> %53, <4 x i32> poison, <4 x i32> zeroinitializer
  %55 = icmp eq <4 x i32> %54, <i32 1, i32 2, i32 4, i32 8>
  %56 = zext <4 x i1> %55 to <4 x i32>
  %57 = add nsw <4 x i32> %49, %56
  store <4 x i32> %57, ptr %52, align 16, !tbaa !5
  %indvars.iv.next224.1 = add nuw nsw i64 %indvars.iv223, 2
  br label %.preheader145

58:                                               ; preds = %.preheader145
  %59 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %60 = load i32, ptr @t, align 4, !tbaa !5
  %61 = add nsw i32 %60, -1
  store i32 %61, ptr @t, align 4, !tbaa !5
  %.not199 = icmp eq i32 %60, 0
  br i1 %.not199, label %._crit_edge202, label %.lr.ph201

.lr.ph201:                                        ; preds = %58, %153
  %62 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @m)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %0) #6
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #6
  %63 = load i32, ptr @m, align 4, !tbaa !5
  %64 = icmp sgt i32 %63, 0
  br i1 %64, label %.lr.ph169, label %._crit_edge170

._crit_edge170:                                   ; preds = %69, %.lr.ph201
  %.0120.lcssa = phi i32 [ 0, %.lr.ph201 ], [ %76, %69 ]
  %.0119.lcssa = phi i32 [ 0, %.lr.ph201 ], [ %79, %69 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #6
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  %65 = load i32, ptr @n, align 4, !tbaa !5
  %.not131175 = icmp slt i32 %65, 1
  br i1 %.not131175, label %._crit_edge178, label %.lr.ph177

.lr.ph169:                                        ; preds = %.lr.ph201, %69
  %indvars.iv227 = phi i64 [ %indvars.iv.next228, %69 ], [ 0, %.lr.ph201 ]
  %.0119165 = phi i32 [ %79, %69 ], [ 0, %.lr.ph201 ]
  %.0120164 = phi i32 [ %76, %69 ], [ 0, %.lr.ph201 ]
  %66 = getelementptr inbounds [1000100 x i32], ptr @a, i64 0, i64 %indvars.iv227
  %67 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %66)
  %68 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 4 dereferenceable(4) %66)
          to label %69 unwind label %83

69:                                               ; preds = %.lr.ph169
  %70 = load i32, ptr %66, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = icmp eq i32 %73, 2
  %75 = zext i1 %74 to i32
  %76 = add nuw nsw i32 %.0120164, %75
  %77 = icmp eq i32 %73, 4
  %78 = zext i1 %77 to i32
  %79 = add nuw nsw i32 %.0119165, %78
  %indvars.iv.next228 = add nuw nsw i64 %indvars.iv227, 1
  %80 = load i32, ptr @m, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = icmp slt i64 %indvars.iv.next228, %81
  br i1 %82, label %.lr.ph169, label %._crit_edge170, !llvm.loop !14

83:                                               ; preds = %.lr.ph169
  %84 = landingpad { ptr, i32 }
          cleanup
  br label %159

._crit_edge178:                                   ; preds = %146, %._crit_edge170
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  %85 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %86 = and i64 %85, 4294967295
  %87 = shl nuw i64 1, %86
  %88 = trunc i64 %87 to i32
  %89 = icmp sgt i32 %88, 1
  br i1 %89, label %.preheader.lr.ph, label %._crit_edge190

.preheader.lr.ph:                                 ; preds = %._crit_edge178
  %90 = trunc i64 %85 to i32
  %91 = icmp sgt i32 %90, 0
  br i1 %91, label %.preheader.us.preheader, label %.preheader.lr.ph.split

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph
  %wide.trip.count238 = and i64 %87, 2147483647
  %wide.trip.count233 = and i64 %85, 2147483647
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %100
  %indvars.iv235 = phi i64 [ 1, %.preheader.us.preheader ], [ %indvars.iv.next236, %100 ]
  %.0108188.us = phi i64 [ 0, %.preheader.us.preheader ], [ %.1109.us, %100 ]
  br label %101

92:                                               ; preds = %._crit_edge185.us
  %93 = and i32 %.1102.us, 1
  %94 = xor i32 %93, 1
  %95 = zext nneg i32 %94 to i64
  br label %100

96:                                               ; preds = %._crit_edge185.us
  %97 = and i32 %.1102.us, -2147483647
  %98 = icmp eq i32 %97, 1
  %99 = zext i1 %98 to i64
  br label %100

100:                                              ; preds = %96, %92
  %.pn144.us = phi i64 [ %99, %96 ], [ %95, %92 ]
  %.1109.us = add i64 %.pn144.us, %.0108188.us
  %indvars.iv.next236 = add nuw nsw i64 %indvars.iv235, 1
  %exitcond239.not = icmp eq i64 %indvars.iv.next236, %wide.trip.count238
  br i1 %exitcond239.not, label %._crit_edge190, label %.preheader.us, !llvm.loop !15

101:                                              ; preds = %.preheader.us, %123
  %indvars.iv230 = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next231, %123 ]
  %.0101181.us = phi i32 [ %.0119.lcssa, %.preheader.us ], [ %.1102.us, %123 ]
  %.0103180.us = phi i32 [ %.0120.lcssa, %.preheader.us ], [ %.1104.us, %123 ]
  %102 = shl nuw i64 1, %indvars.iv230
  %103 = and i64 %102, %indvars.iv235
  %.not132.us = icmp eq i64 %103, 0
  br i1 %.not132.us, label %123, label %104

104:                                              ; preds = %101
  %105 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv230) #6
  %106 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv230) #6
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = icmp eq i32 %110, 2
  %112 = zext i1 %111 to i32
  %113 = add nsw i32 %.0103180.us, %112
  %114 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv230) #6
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [1000100 x i32], ptr @dp, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = icmp eq i32 %118, 4
  %120 = zext i1 %119 to i32
  %121 = add nsw i32 %.0101181.us, %120
  %122 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv230) #6
  br label %123

123:                                              ; preds = %104, %101
  %.1104.us = phi i32 [ %113, %104 ], [ %.0103180.us, %101 ]
  %.1102.us = phi i32 [ %121, %104 ], [ %.0101181.us, %101 ]
  %indvars.iv.next231 = add nuw nsw i64 %indvars.iv230, 1
  %exitcond234.not = icmp eq i64 %indvars.iv.next231, %wide.trip.count233
  br i1 %exitcond234.not, label %._crit_edge185.us, label %101, !llvm.loop !16

._crit_edge185.us:                                ; preds = %123
  %124 = and i32 %.1104.us, -2147483647
  %125 = icmp eq i32 %124, 1
  br i1 %125, label %96, label %92

.preheader.lr.ph.split:                           ; preds = %.preheader.lr.ph
  %126 = and i32 %.0120.lcssa, -2147483647
  %127 = icmp eq i32 %126, 1
  br i1 %127, label %.preheader.us192.preheader, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader.lr.ph.split
  %128 = and i32 %.0119.lcssa, 1
  %129 = xor i32 %128, 1
  %130 = zext nneg i32 %129 to i64
  %131 = add nuw i64 %87, 4294967294
  %132 = and i64 %131, 4294967295
  %133 = add nuw nsw i64 %132, 1
  %134 = mul nuw nsw i64 %133, %130
  br label %._crit_edge190

.preheader.us192.preheader:                       ; preds = %.preheader.lr.ph.split
  %135 = and i32 %.0119.lcssa, -2147483647
  %136 = icmp eq i32 %135, 1
  %137 = add nuw i64 %87, 4294967294
  %138 = and i64 %137, 4294967295
  %139 = add nuw nsw i64 %138, 1
  %140 = select i1 %136, i64 %139, i64 0
  br label %._crit_edge190

.lr.ph177:                                        ; preds = %._crit_edge170, %146
  %141 = invoke noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %142 unwind label %144

142:                                              ; preds = %.lr.ph177
  %.not133 = icmp eq i64 %141, 0
  br i1 %.not133, label %143, label %146

143:                                              ; preds = %142
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %146 unwind label %144

144:                                              ; preds = %143, %.lr.ph177
  %145 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  br label %158

146:                                              ; preds = %142, %143
  %147 = load i32, ptr %2, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %2, align 4, !tbaa !5
  %149 = load i32, ptr @n, align 4, !tbaa !5
  %.not131.not = icmp slt i32 %147, %149
  br i1 %.not131.not, label %.lr.ph177, label %._crit_edge178, !llvm.loop !17

._crit_edge190:                                   ; preds = %100, %.preheader.preheader, %.preheader.us192.preheader, %._crit_edge178
  %.0108.lcssa = phi i64 [ 0, %._crit_edge178 ], [ %140, %.preheader.us192.preheader ], [ %134, %.preheader.preheader ], [ %.1109.us, %100 ]
  %150 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.0108.lcssa)
          to label %151 unwind label %156

151:                                              ; preds = %._crit_edge190
  %152 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %150, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %153 unwind label %156

153:                                              ; preds = %151
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #6
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %0) #6
  %154 = load i32, ptr @t, align 4, !tbaa !5
  %155 = add nsw i32 %154, -1
  store i32 %155, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %154, 0
  br i1 %.not, label %._crit_edge202, label %.lr.ph201, !llvm.loop !18

156:                                              ; preds = %151, %._crit_edge190
  %157 = landingpad { ptr, i32 }
          cleanup
  br label %158

158:                                              ; preds = %156, %144
  %.pn = phi { ptr, i32 } [ %145, %144 ], [ %157, %156 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #6
  br label %159

159:                                              ; preds = %158, %83
  %.pn135 = phi { ptr, i32 } [ %84, %83 ], [ %.pn, %158 ]
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %0) #6
  resume { ptr, i32 } %.pn135

._crit_edge202:                                   ; preds = %153, %58
  ret i32 0
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4 align 2

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

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

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

; 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 #3 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #4 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

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

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

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


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