; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/307 Division 2/Problem E (E)

; 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<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type <{ i64, i32, [4 x i8] }>
%"struct.std::pair.0" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@l = external dso_local global i32, align 4
@r = external dso_local global i32, align 4
@x = external dso_local global i32, align 4
@y = external dso_local global i32, align 4
@rt = external dso_local global i32, align 4
@type = external dso_local global i32, align 4
@group = external dso_local global [500100 x i32], align 16
@up = external dso_local global [800 x i64], align 16
@num = external dso_local global [500100 x i64], align 16
@a = external dso_local global [800 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca %"struct.std::pair.0", align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %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 %"struct.std::pair", align 8
  %15 = alloca { i64, i32 }, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %"struct.std::pair", align 8
  %19 = alloca { i64, i32 }, align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %22 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %23 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @q)
  %32 = load i32, ptr @n, align 4, !tbaa !5
  %33 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %32)
  %34 = call double @llvm.ceil.f64(double %33)
  %35 = fptosi double %34 to i32
  store i32 %35, ptr @rt, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #9
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #9
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %67, %0
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = load i32, ptr @n, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #9
  br label %70

41:                                               ; preds = %36
  %42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @x)
  %43 = load i32, ptr @x, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [500100 x i64], ptr @num, i64 0, i64 %46
  store i64 %44, ptr %47, align 8, !tbaa !9
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %49
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #9
  %51 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) @x, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i64 %51, ptr %5, align 4
  call void @_ZNSt4pairIxiEC2IiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 8 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(8) %5)
  call void @_ZNSt6vectorISt4pairIxiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %50, ptr noundef nonnull align 8 dereferenceable(12) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #9
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %54
  store i32 %52, ptr %55, align 4, !tbaa !5
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %57
  %59 = call noundef i64 @_ZNKSt6vectorISt4pairIxiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %58) #9
  %60 = load i32, ptr @rt, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = icmp eq i64 %59, %61
  br i1 %62, label %63, label %66

63:                                               ; preds = %41
  %64 = load i32, ptr %2, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %2, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %63, %41
  br label %67

67:                                               ; preds = %66
  %68 = load i32, ptr %3, align 4, !tbaa !5
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %3, align 4, !tbaa !5
  br label %36, !llvm.loop !11

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

71:                                               ; preds = %91, %70
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = load i32, ptr %2, align 4, !tbaa !5
  %74 = icmp sle i32 %72, %73
  br i1 %74, label %76, label %75

75:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  br label %94

76:                                               ; preds = %71
  %77 = load i32, ptr %6, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %78
  %80 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %79) #9
  %81 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %80, ptr %81, align 8
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %83
  %85 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %84) #9
  %86 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %85, ptr %86, align 8
  %87 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  %88 = load ptr, ptr %87, align 8
  %89 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  %90 = load ptr, ptr %89, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIxiESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %88, ptr %90)
  br label %91

91:                                               ; preds = %76
  %92 = load i32, ptr %6, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %6, align 4, !tbaa !5
  br label %71, !llvm.loop !13

94:                                               ; preds = %75
  br label %95

95:                                               ; preds = %511, %94
  %96 = load i32, ptr @q, align 4, !tbaa !5
  %97 = add nsw i32 %96, -1
  store i32 %97, ptr @q, align 4, !tbaa !5
  %98 = icmp ne i32 %96, 0
  br i1 %98, label %99, label %512

99:                                               ; preds = %95
  %100 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @type)
  %101 = load i32, ptr @type, align 4, !tbaa !5
  %102 = icmp eq i32 %101, 1
  br i1 %102, label %103, label %350

103:                                              ; preds = %99
  %104 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef @l, ptr noundef @r, ptr noundef @x)
  %105 = load i32, ptr @l, align 4, !tbaa !5
  %106 = add nsw i32 %105, -1
  store i32 %106, ptr @l, align 4, !tbaa !5
  %107 = load i32, ptr @r, align 4, !tbaa !5
  %108 = add nsw i32 %107, -1
  store i32 %108, ptr @r, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  %109 = load i32, ptr @l, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %9, align 4, !tbaa !5
  br label %114

114:                                              ; preds = %131, %103
  %115 = load i32, ptr %9, align 4, !tbaa !5
  %116 = load i32, ptr @r, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = sub nsw i32 %119, 1
  %121 = icmp sle i32 %115, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %114
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  br label %134

123:                                              ; preds = %114
  %124 = load i32, ptr @x, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = load i32, ptr %9, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [800 x i64], ptr @up, i64 0, i64 %127
  %129 = load i64, ptr %128, align 8, !tbaa !9
  %130 = add nsw i64 %129, %125
  store i64 %130, ptr %128, align 8, !tbaa !9
  br label %131

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

134:                                              ; preds = %122
  %135 = load i32, ptr @l, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %139
  call void @_ZNSt6vectorISt4pairIxiESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %140) #9
  %141 = load i32, ptr @r, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %142
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %145
  call void @_ZNSt6vectorISt4pairIxiESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %146) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  %147 = load i32, ptr @l, align 4, !tbaa !5
  store i32 %147, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #9
  %148 = load i32, ptr @l, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  store i32 %151, ptr %11, align 4, !tbaa !5
  br label %152

152:                                              ; preds = %174, %134
  %153 = load i32, ptr %10, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %154
  %156 = load i32, ptr %155, align 4, !tbaa !5
  %157 = load i32, ptr %11, align 4, !tbaa !5
  %158 = icmp eq i32 %156, %157
  br i1 %158, label %159, label %163

159:                                              ; preds = %152
  %160 = load i32, ptr %10, align 4, !tbaa !5
  %161 = load i32, ptr @r, align 4, !tbaa !5
  %162 = icmp sle i32 %160, %161
  br label %163

163:                                              ; preds = %159, %152
  %164 = phi i1 [ false, %152 ], [ %162, %159 ]
  br i1 %164, label %166, label %165

165:                                              ; preds = %163
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  br label %177

166:                                              ; preds = %163
  %167 = load i32, ptr @x, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = load i32, ptr %10, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [500100 x i64], ptr @num, i64 0, i64 %170
  %172 = load i64, ptr %171, align 8, !tbaa !9
  %173 = add nsw i64 %172, %168
  store i64 %173, ptr %171, align 8, !tbaa !9
  br label %174

174:                                              ; preds = %166
  %175 = load i32, ptr %10, align 4, !tbaa !5
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %10, align 4, !tbaa !5
  br label %152, !llvm.loop !15

177:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  %178 = load i32, ptr @l, align 4, !tbaa !5
  store i32 %178, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  %179 = load i32, ptr @l, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %180
  %182 = load i32, ptr %181, align 4, !tbaa !5
  store i32 %182, ptr %13, align 4, !tbaa !5
  br label %183

183:                                              ; preds = %195, %177
  %184 = load i32, ptr %12, align 4, !tbaa !5
  %185 = icmp sge i32 %184, 0
  br i1 %185, label %186, label %193

186:                                              ; preds = %183
  %187 = load i32, ptr %12, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %188
  %190 = load i32, ptr %189, align 4, !tbaa !5
  %191 = load i32, ptr %13, align 4, !tbaa !5
  %192 = icmp eq i32 %190, %191
  br label %193

193:                                              ; preds = %186, %183
  %194 = phi i1 [ false, %183 ], [ %192, %186 ]
  br i1 %194, label %195, label %198

195:                                              ; preds = %193
  %196 = load i32, ptr %12, align 4, !tbaa !5
  %197 = add nsw i32 %196, -1
  store i32 %197, ptr %12, align 4, !tbaa !5
  br label %183, !llvm.loop !16

198:                                              ; preds = %193
  %199 = load i32, ptr %12, align 4, !tbaa !5
  %200 = add nsw i32 %199, 1
  store i32 %200, ptr %12, align 4, !tbaa !5
  br label %201

201:                                              ; preds = %222, %198
  %202 = load i32, ptr %12, align 4, !tbaa !5
  %203 = load i32, ptr @n, align 4, !tbaa !5
  %204 = icmp slt i32 %202, %203
  br i1 %204, label %205, label %212

205:                                              ; preds = %201
  %206 = load i32, ptr %12, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %207
  %209 = load i32, ptr %208, align 4, !tbaa !5
  %210 = load i32, ptr %13, align 4, !tbaa !5
  %211 = icmp eq i32 %209, %210
  br label %212

212:                                              ; preds = %205, %201
  %213 = phi i1 [ false, %201 ], [ %211, %205 ]
  br i1 %213, label %214, label %225

214:                                              ; preds = %212
  %215 = load i32, ptr %13, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %216
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #9
  %218 = load i32, ptr %12, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [500100 x i64], ptr @num, i64 0, i64 %219
  %221 = call { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %220, ptr noundef nonnull align 4 dereferenceable(4) %12)
  store { i64, i32 } %221, ptr %15, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %15, i64 12, i1 false)
  call void @_ZNSt6vectorISt4pairIxiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %217, ptr noundef nonnull align 8 dereferenceable(12) %14)
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #9
  br label %222

222:                                              ; preds = %214
  %223 = load i32, ptr %12, align 4, !tbaa !5
  %224 = add nsw i32 %223, 1
  store i32 %224, ptr %12, align 4, !tbaa !5
  br label %201, !llvm.loop !17

225:                                              ; preds = %212
  %226 = load i32, ptr @l, align 4, !tbaa !5
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %227
  %229 = load i32, ptr %228, align 4, !tbaa !5
  %230 = load i32, ptr @r, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %231
  %233 = load i32, ptr %232, align 4, !tbaa !5
  %234 = icmp ne i32 %229, %233
  br i1 %234, label %235, label %309

235:                                              ; preds = %225
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #9
  %236 = load i32, ptr @r, align 4, !tbaa !5
  store i32 %236, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #9
  %237 = load i32, ptr @r, align 4, !tbaa !5
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %238
  %240 = load i32, ptr %239, align 4, !tbaa !5
  store i32 %240, ptr %17, align 4, !tbaa !5
  br label %241

241:                                              ; preds = %257, %235
  %242 = load i32, ptr %16, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %243
  %245 = load i32, ptr %244, align 4, !tbaa !5
  %246 = load i32, ptr %17, align 4, !tbaa !5
  %247 = icmp eq i32 %245, %246
  br i1 %247, label %249, label %248

248:                                              ; preds = %241
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  br label %260

249:                                              ; preds = %241
  %250 = load i32, ptr @x, align 4, !tbaa !5
  %251 = sext i32 %250 to i64
  %252 = load i32, ptr %16, align 4, !tbaa !5
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds [500100 x i64], ptr @num, i64 0, i64 %253
  %255 = load i64, ptr %254, align 8, !tbaa !9
  %256 = add nsw i64 %255, %251
  store i64 %256, ptr %254, align 8, !tbaa !9
  br label %257

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

260:                                              ; preds = %248
  %261 = load i32, ptr @r, align 4, !tbaa !5
  store i32 %261, ptr %12, align 4, !tbaa !5
  %262 = load i32, ptr @r, align 4, !tbaa !5
  %263 = sext i32 %262 to i64
  %264 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %263
  %265 = load i32, ptr %264, align 4, !tbaa !5
  store i32 %265, ptr %13, align 4, !tbaa !5
  br label %266

266:                                              ; preds = %278, %260
  %267 = load i32, ptr %12, align 4, !tbaa !5
  %268 = icmp sge i32 %267, 0
  br i1 %268, label %269, label %276

269:                                              ; preds = %266
  %270 = load i32, ptr %12, align 4, !tbaa !5
  %271 = sext i32 %270 to i64
  %272 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %271
  %273 = load i32, ptr %272, align 4, !tbaa !5
  %274 = load i32, ptr %13, align 4, !tbaa !5
  %275 = icmp eq i32 %273, %274
  br label %276

276:                                              ; preds = %269, %266
  %277 = phi i1 [ false, %266 ], [ %275, %269 ]
  br i1 %277, label %278, label %281

278:                                              ; preds = %276
  %279 = load i32, ptr %12, align 4, !tbaa !5
  %280 = add nsw i32 %279, -1
  store i32 %280, ptr %12, align 4, !tbaa !5
  br label %266, !llvm.loop !19

281:                                              ; preds = %276
  %282 = load i32, ptr %12, align 4, !tbaa !5
  %283 = add nsw i32 %282, 1
  store i32 %283, ptr %12, align 4, !tbaa !5
  br label %284

284:                                              ; preds = %305, %281
  %285 = load i32, ptr %12, align 4, !tbaa !5
  %286 = load i32, ptr @n, align 4, !tbaa !5
  %287 = icmp slt i32 %285, %286
  br i1 %287, label %288, label %295

288:                                              ; preds = %284
  %289 = load i32, ptr %12, align 4, !tbaa !5
  %290 = sext i32 %289 to i64
  %291 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %290
  %292 = load i32, ptr %291, align 4, !tbaa !5
  %293 = load i32, ptr %13, align 4, !tbaa !5
  %294 = icmp eq i32 %292, %293
  br label %295

295:                                              ; preds = %288, %284
  %296 = phi i1 [ false, %284 ], [ %294, %288 ]
  br i1 %296, label %297, label %308

297:                                              ; preds = %295
  %298 = load i32, ptr %13, align 4, !tbaa !5
  %299 = sext i32 %298 to i64
  %300 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %299
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #9
  %301 = load i32, ptr %12, align 4, !tbaa !5
  %302 = sext i32 %301 to i64
  %303 = getelementptr inbounds [500100 x i64], ptr @num, i64 0, i64 %302
  %304 = call { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %303, ptr noundef nonnull align 4 dereferenceable(4) %12)
  store { i64, i32 } %304, ptr %19, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %19, i64 12, i1 false)
  call void @_ZNSt6vectorISt4pairIxiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %300, ptr noundef nonnull align 8 dereferenceable(12) %18)
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #9
  br label %305

305:                                              ; preds = %297
  %306 = load i32, ptr %12, align 4, !tbaa !5
  %307 = add nsw i32 %306, 1
  store i32 %307, ptr %12, align 4, !tbaa !5
  br label %284, !llvm.loop !20

308:                                              ; preds = %295
  br label %309

309:                                              ; preds = %308, %225
  %310 = load i32, ptr @l, align 4, !tbaa !5
  %311 = sext i32 %310 to i64
  %312 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %311
  %313 = load i32, ptr %312, align 4, !tbaa !5
  %314 = sext i32 %313 to i64
  %315 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %314
  %316 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %315) #9
  %317 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %316, ptr %317, align 8
  %318 = load i32, ptr @l, align 4, !tbaa !5
  %319 = sext i32 %318 to i64
  %320 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %319
  %321 = load i32, ptr %320, align 4, !tbaa !5
  %322 = sext i32 %321 to i64
  %323 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %322
  %324 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %323) #9
  %325 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %21, i32 0, i32 0
  store ptr %324, ptr %325, align 8
  %326 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  %327 = load ptr, ptr %326, align 8
  %328 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %21, i32 0, i32 0
  %329 = load ptr, ptr %328, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIxiESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %327, ptr %329)
  %330 = load i32, ptr @r, align 4, !tbaa !5
  %331 = sext i32 %330 to i64
  %332 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %331
  %333 = load i32, ptr %332, align 4, !tbaa !5
  %334 = sext i32 %333 to i64
  %335 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %334
  %336 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %335) #9
  %337 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %22, i32 0, i32 0
  store ptr %336, ptr %337, align 8
  %338 = load i32, ptr @r, align 4, !tbaa !5
  %339 = sext i32 %338 to i64
  %340 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %339
  %341 = load i32, ptr %340, align 4, !tbaa !5
  %342 = sext i32 %341 to i64
  %343 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %342
  %344 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %343) #9
  %345 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %23, i32 0, i32 0
  store ptr %344, ptr %345, align 8
  %346 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %22, i32 0, i32 0
  %347 = load ptr, ptr %346, align 8
  %348 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %23, i32 0, i32 0
  %349 = load ptr, ptr %348, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIxiESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %347, ptr %349)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  br label %511

350:                                              ; preds = %99
  %351 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @y)
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #9
  store i32 0, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #9
  store i32 10000000, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #9
  store i32 0, ptr %26, align 4, !tbaa !5
  br label %352

352:                                              ; preds = %497, %350
  %353 = load i32, ptr %26, align 4, !tbaa !5
  %354 = load i32, ptr %2, align 4, !tbaa !5
  %355 = icmp sle i32 %353, %354
  br i1 %355, label %357, label %356

356:                                              ; preds = %352
  store i32 29, ptr %27, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #9
  br label %500

357:                                              ; preds = %352
  %358 = load i32, ptr %26, align 4, !tbaa !5
  %359 = sext i32 %358 to i64
  %360 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %359
  %361 = call noundef i64 @_ZNKSt6vectorISt4pairIxiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %360) #9
  %362 = icmp eq i64 %361, 0
  br i1 %362, label %363, label %364

363:                                              ; preds = %357
  br label %497

364:                                              ; preds = %357
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #9
  store i32 -1, ptr %28, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #9
  %365 = load i32, ptr %26, align 4, !tbaa !5
  %366 = sext i32 %365 to i64
  %367 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %366
  %368 = call noundef i64 @_ZNKSt6vectorISt4pairIxiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %367) #9
  %369 = sub i64 %368, 1
  %370 = trunc i64 %369 to i32
  store i32 %370, ptr %29, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #9
  br label %371

371:                                              ; preds = %401, %364
  %372 = load i32, ptr %28, align 4, !tbaa !5
  %373 = add nsw i32 %372, 1
  %374 = load i32, ptr %29, align 4, !tbaa !5
  %375 = icmp slt i32 %373, %374
  br i1 %375, label %376, label %402

376:                                              ; preds = %371
  %377 = load i32, ptr %28, align 4, !tbaa !5
  %378 = load i32, ptr %29, align 4, !tbaa !5
  %379 = add nsw i32 %377, %378
  %380 = sdiv i32 %379, 2
  store i32 %380, ptr %30, align 4, !tbaa !5
  %381 = load i32, ptr %26, align 4, !tbaa !5
  %382 = sext i32 %381 to i64
  %383 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %382
  %384 = load i32, ptr %30, align 4, !tbaa !5
  %385 = sext i32 %384 to i64
  %386 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIxiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %383, i64 noundef %385) #9
  %387 = getelementptr inbounds %"struct.std::pair", ptr %386, i32 0, i32 0
  %388 = load i64, ptr %387, align 8, !tbaa !21
  %389 = load i32, ptr %26, align 4, !tbaa !5
  %390 = sext i32 %389 to i64
  %391 = getelementptr inbounds [800 x i64], ptr @up, i64 0, i64 %390
  %392 = load i64, ptr %391, align 8, !tbaa !9
  %393 = add nsw i64 %388, %392
  %394 = load i32, ptr @y, align 4, !tbaa !5
  %395 = sext i32 %394 to i64
  %396 = icmp sge i64 %393, %395
  br i1 %396, label %397, label %399

397:                                              ; preds = %376
  %398 = load i32, ptr %30, align 4, !tbaa !5
  store i32 %398, ptr %29, align 4, !tbaa !5
  br label %401

399:                                              ; preds = %376
  %400 = load i32, ptr %30, align 4, !tbaa !5
  store i32 %400, ptr %28, align 4, !tbaa !5
  br label %401

401:                                              ; preds = %399, %397
  br label %371, !llvm.loop !23

402:                                              ; preds = %371
  %403 = load i32, ptr %26, align 4, !tbaa !5
  %404 = sext i32 %403 to i64
  %405 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %404
  %406 = load i32, ptr %29, align 4, !tbaa !5
  %407 = sext i32 %406 to i64
  %408 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIxiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %405, i64 noundef %407) #9
  %409 = getelementptr inbounds %"struct.std::pair", ptr %408, i32 0, i32 0
  %410 = load i64, ptr %409, align 8, !tbaa !21
  %411 = load i32, ptr %26, align 4, !tbaa !5
  %412 = sext i32 %411 to i64
  %413 = getelementptr inbounds [800 x i64], ptr @up, i64 0, i64 %412
  %414 = load i64, ptr %413, align 8, !tbaa !9
  %415 = add nsw i64 %410, %414
  %416 = load i32, ptr @y, align 4, !tbaa !5
  %417 = sext i32 %416 to i64
  %418 = icmp ne i64 %415, %417
  br i1 %418, label %419, label %420

419:                                              ; preds = %402
  store i32 31, ptr %27, align 4
  br label %494

420:                                              ; preds = %402
  %421 = load i32, ptr %26, align 4, !tbaa !5
  %422 = sext i32 %421 to i64
  %423 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %422
  %424 = load i32, ptr %29, align 4, !tbaa !5
  %425 = sext i32 %424 to i64
  %426 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIxiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %423, i64 noundef %425) #9
  %427 = getelementptr inbounds %"struct.std::pair", ptr %426, i32 0, i32 1
  %428 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %25, ptr noundef nonnull align 4 dereferenceable(4) %427)
  %429 = load i32, ptr %428, align 4, !tbaa !5
  store i32 %429, ptr %25, align 4, !tbaa !5
  store i32 0, ptr %28, align 4, !tbaa !5
  %430 = load i32, ptr %26, align 4, !tbaa !5
  %431 = sext i32 %430 to i64
  %432 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %431
  %433 = call noundef i64 @_ZNKSt6vectorISt4pairIxiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %432) #9
  %434 = trunc i64 %433 to i32
  store i32 %434, ptr %29, align 4, !tbaa !5
  br label %435

435:                                              ; preds = %465, %420
  %436 = load i32, ptr %28, align 4, !tbaa !5
  %437 = add nsw i32 %436, 1
  %438 = load i32, ptr %29, align 4, !tbaa !5
  %439 = icmp slt i32 %437, %438
  br i1 %439, label %440, label %466

440:                                              ; preds = %435
  %441 = load i32, ptr %28, align 4, !tbaa !5
  %442 = load i32, ptr %29, align 4, !tbaa !5
  %443 = add nsw i32 %441, %442
  %444 = sdiv i32 %443, 2
  store i32 %444, ptr %30, align 4, !tbaa !5
  %445 = load i32, ptr %26, align 4, !tbaa !5
  %446 = sext i32 %445 to i64
  %447 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %446
  %448 = load i32, ptr %30, align 4, !tbaa !5
  %449 = sext i32 %448 to i64
  %450 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIxiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %447, i64 noundef %449) #9
  %451 = getelementptr inbounds %"struct.std::pair", ptr %450, i32 0, i32 0
  %452 = load i64, ptr %451, align 8, !tbaa !21
  %453 = load i32, ptr %26, align 4, !tbaa !5
  %454 = sext i32 %453 to i64
  %455 = getelementptr inbounds [800 x i64], ptr @up, i64 0, i64 %454
  %456 = load i64, ptr %455, align 8, !tbaa !9
  %457 = add nsw i64 %452, %456
  %458 = load i32, ptr @y, align 4, !tbaa !5
  %459 = sext i32 %458 to i64
  %460 = icmp sgt i64 %457, %459
  br i1 %460, label %461, label %463

461:                                              ; preds = %440
  %462 = load i32, ptr %30, align 4, !tbaa !5
  store i32 %462, ptr %29, align 4, !tbaa !5
  br label %465

463:                                              ; preds = %440
  %464 = load i32, ptr %30, align 4, !tbaa !5
  store i32 %464, ptr %28, align 4, !tbaa !5
  br label %465

465:                                              ; preds = %463, %461
  br label %435, !llvm.loop !24

466:                                              ; preds = %435
  %467 = load i32, ptr %26, align 4, !tbaa !5
  %468 = sext i32 %467 to i64
  %469 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %468
  %470 = load i32, ptr %28, align 4, !tbaa !5
  %471 = sext i32 %470 to i64
  %472 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIxiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %469, i64 noundef %471) #9
  %473 = getelementptr inbounds %"struct.std::pair", ptr %472, i32 0, i32 0
  %474 = load i64, ptr %473, align 8, !tbaa !21
  %475 = load i32, ptr %26, align 4, !tbaa !5
  %476 = sext i32 %475 to i64
  %477 = getelementptr inbounds [800 x i64], ptr @up, i64 0, i64 %476
  %478 = load i64, ptr %477, align 8, !tbaa !9
  %479 = add nsw i64 %474, %478
  %480 = load i32, ptr @y, align 4, !tbaa !5
  %481 = sext i32 %480 to i64
  %482 = icmp ne i64 %479, %481
  br i1 %482, label %483, label %484

483:                                              ; preds = %466
  store i32 31, ptr %27, align 4
  br label %494

484:                                              ; preds = %466
  %485 = load i32, ptr %26, align 4, !tbaa !5
  %486 = sext i32 %485 to i64
  %487 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %486
  %488 = load i32, ptr %28, align 4, !tbaa !5
  %489 = sext i32 %488 to i64
  %490 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIxiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %487, i64 noundef %489) #9
  %491 = getelementptr inbounds %"struct.std::pair", ptr %490, i32 0, i32 1
  %492 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %24, ptr noundef nonnull align 4 dereferenceable(4) %491)
  %493 = load i32, ptr %492, align 4, !tbaa !5
  store i32 %493, ptr %24, align 4, !tbaa !5
  store i32 0, ptr %27, align 4
  br label %494

494:                                              ; preds = %484, %483, %419
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #9
  %495 = load i32, ptr %27, align 4
  switch i32 %495, label %514 [
    i32 0, label %496
    i32 31, label %497
  ]

496:                                              ; preds = %494
  br label %497

497:                                              ; preds = %496, %494, %363
  %498 = load i32, ptr %26, align 4, !tbaa !5
  %499 = add nsw i32 %498, 1
  store i32 %499, ptr %26, align 4, !tbaa !5
  br label %352, !llvm.loop !25

500:                                              ; preds = %356
  %501 = load i32, ptr %25, align 4, !tbaa !5
  %502 = icmp eq i32 %501, 10000000
  br i1 %502, label %503, label %505

503:                                              ; preds = %500
  %504 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  br label %510

505:                                              ; preds = %500
  %506 = load i32, ptr %24, align 4, !tbaa !5
  %507 = load i32, ptr %25, align 4, !tbaa !5
  %508 = sub nsw i32 %506, %507
  %509 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %508)
  br label %510

510:                                              ; preds = %505, %503
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #9
  br label %511

511:                                              ; preds = %510, %309
  br label %95, !llvm.loop !26

512:                                              ; preds = %95
  store i32 0, ptr %1, align 4
  store i32 1, ptr %27, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #9
  %513 = load i32, ptr %1, align 4
  ret i32 %513

514:                                              ; preds = %494
  unreachable
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIxiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(12)) #5 align 2

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIxiESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr, ptr) #7

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #5

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #8

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #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 = { 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 #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 nounwind willreturn memory(argmem: readwrite) }
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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = !{!22, !10, i64 0}
!22 = !{!"_ZTSSt4pairIxiE", !10, i64 0, !6, i64 8}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}


; 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<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type <{ i64, i32, [4 x i8] }>
%"struct.std::pair.0" = type { i32, i32 }

@n = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@l = external dso_local global i32, align 4
@r = external dso_local global i32, align 4
@x = external dso_local global i32, align 4
@y = external dso_local global i32, align 4
@rt = external dso_local local_unnamed_addr global i32, align 4
@type = external dso_local global i32, align 4
@group = external dso_local local_unnamed_addr global [500100 x i32], align 16
@up = external dso_local local_unnamed_addr global [800 x i64], align 16
@num = external dso_local global [500100 x i64], align 16
@a = external dso_local global [800 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca %"struct.std::pair", align 8
  %3 = alloca %"struct.std::pair.0", align 8
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @q)
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %11 = tail call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %10)
  %12 = tail call double @llvm.ceil.f64(double %11)
  %13 = fptosi double %12 to i32
  store i32 %13, ptr @rt, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  store i32 0, ptr %1, align 4, !tbaa !5
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph, label %._crit_edge

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %16 = add nuw i32 %spec.select, 1
  %17 = zext i32 %16 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %0
  %.083.lcssa = phi i64 [ 1, %0 ], [ %17, %._crit_edge.loopexit ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  br label %41

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.083110 = phi i32 [ %spec.select, %.lr.ph ], [ 0, %0 ]
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @x)
  %19 = load i32, ptr @x, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = load i32, ptr %1, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [500100 x i64], ptr @num, i64 0, i64 %22
  store i64 %20, ptr %23, align 8, !tbaa !9
  %24 = zext nneg i32 %.083110 to i64
  %25 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %24
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %26 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) @x, ptr noundef nonnull align 4 dereferenceable(4) %1)
  store i64 %26, ptr %3, align 8
  call void @_ZNSt4pairIxiEC2IiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 8 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(8) %3)
  call void @_ZNSt6vectorISt4pairIxiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull align 8 dereferenceable(12) %2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #8
  %27 = load i32, ptr %1, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %28
  store i32 %.083110, ptr %29, align 4, !tbaa !5
  %30 = call noundef i64 @_ZNKSt6vectorISt4pairIxiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #8
  %31 = load i32, ptr @rt, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = icmp eq i64 %30, %32
  %34 = zext i1 %33 to i32
  %spec.select = add nuw nsw i32 %.083110, %34
  %35 = load i32, ptr %1, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %1, align 4, !tbaa !5
  %37 = load i32, ptr @n, align 4, !tbaa !5
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !11

.preheader109:                                    ; preds = %41
  %39 = load i32, ptr @q, align 4, !tbaa !5
  %40 = add nsw i32 %39, -1
  store i32 %40, ptr @q, align 4, !tbaa !5
  %.not97157 = icmp eq i32 %39, 0
  br i1 %.not97157, label %._crit_edge159, label %.lr.ph158

.lr.ph158:                                        ; preds = %.preheader109
  %.sroa.250.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 8
  br label %45

41:                                               ; preds = %._crit_edge, %41
  %indvars.iv = phi i64 [ 0, %._crit_edge ], [ %indvars.iv.next, %41 ]
  %42 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %indvars.iv
  %43 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %42) #8
  %44 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %42) #8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIxiESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %43, ptr %44)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %.083.lcssa
  br i1 %exitcond.not, label %.preheader109, label %41, !llvm.loop !13

45:                                               ; preds = %.lr.ph158, %264
  %46 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @type)
  %47 = load i32, ptr @type, align 4, !tbaa !5
  %48 = icmp eq i32 %47, 1
  br i1 %48, label %49, label %189

49:                                               ; preds = %45
  %50 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @l, ptr noundef nonnull @r, ptr noundef nonnull @x)
  %51 = load i32, ptr @l, align 4, !tbaa !5
  %52 = add nsw i32 %51, -1
  store i32 %52, ptr @l, align 4, !tbaa !5
  %53 = load i32, ptr @r, align 4, !tbaa !5
  %54 = add nsw i32 %53, -1
  store i32 %54, ptr @r, align 4, !tbaa !5
  %55 = sext i32 %52 to i64
  %56 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = sext i32 %54 to i64
  %59 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = add nsw i32 %60, -1
  %.not102.not125 = icmp slt i32 %57, %61
  br i1 %.not102.not125, label %.lr.ph128, label %.._crit_edge129_crit_edge

.._crit_edge129_crit_edge:                        ; preds = %49
  %.pre185 = sext i32 %57 to i64
  br label %._crit_edge129

.lr.ph128:                                        ; preds = %49
  %62 = load i32, ptr @x, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = sext i32 %57 to i64
  %wide.trip.count169 = sext i32 %61 to i64
  %65 = sext i32 %60 to i64
  %66 = xor i64 %64, -1
  %67 = add nsw i64 %66, %65
  %min.iters.check = icmp ult i64 %67, 4
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph128
  %indvars.iv166.ph = phi i64 [ %64, %.lr.ph128 ], [ %ind.end, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph128
  %n.vec = and i64 %67, -4
  %ind.end = add nsw i64 %n.vec, %64
  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %63, i64 0
  %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %index, %64
  %68 = add nsw i64 %offset.idx, 1
  %69 = getelementptr inbounds [800 x i64], ptr @up, i64 0, i64 %68
  %70 = getelementptr inbounds i8, ptr %69, i64 16
  %wide.load = load <2 x i64>, ptr %69, align 8, !tbaa !9
  %wide.load190 = load <2 x i64>, ptr %70, align 8, !tbaa !9
  %71 = add nsw <2 x i64> %wide.load, %broadcast.splat
  %72 = add nsw <2 x i64> %wide.load190, %broadcast.splat
  store <2 x i64> %71, ptr %69, align 8, !tbaa !9
  store <2 x i64> %72, ptr %70, align 8, !tbaa !9
  %index.next = add nuw i64 %index, 4
  %73 = icmp eq i64 %index.next, %n.vec
  br i1 %73, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %67, %n.vec
  br i1 %cmp.n, label %._crit_edge129, label %scalar.ph.preheader

._crit_edge129:                                   ; preds = %scalar.ph, %middle.block, %.._crit_edge129_crit_edge
  %.pre-phi186 = phi i64 [ %.pre185, %.._crit_edge129_crit_edge ], [ %64, %middle.block ], [ %64, %scalar.ph ]
  %74 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %.pre-phi186
  call void @_ZNSt6vectorISt4pairIxiESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %74) #8
  %75 = load i32, ptr @r, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %79
  call void @_ZNSt6vectorISt4pairIxiESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %80) #8
  %81 = load i32, ptr @l, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = load i32, ptr @r, align 4
  %.not = icmp sgt i32 %81, %85
  br i1 %.not, label %._crit_edge133, label %.lr.ph132

.lr.ph132:                                        ; preds = %._crit_edge129
  %86 = load i32, ptr @x, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = sext i32 %85 to i64
  br label %93

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv166 = phi i64 [ %indvars.iv.next167, %scalar.ph ], [ %indvars.iv166.ph, %scalar.ph.preheader ]
  %indvars.iv.next167 = add nsw i64 %indvars.iv166, 1
  %89 = getelementptr inbounds [800 x i64], ptr @up, i64 0, i64 %indvars.iv.next167
  %90 = load i64, ptr %89, align 8, !tbaa !9
  %91 = add nsw i64 %90, %63
  store i64 %91, ptr %89, align 8, !tbaa !9
  %exitcond170.not = icmp eq i64 %indvars.iv.next167, %wide.trip.count169
  br i1 %exitcond170.not, label %._crit_edge129, label %scalar.ph, !llvm.loop !17

._crit_edge133:                                   ; preds = %93, %._crit_edge129
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %92 = icmp sgt i32 %81, -1
  br i1 %92, label %.lr.ph136, label %.critedge

93:                                               ; preds = %.lr.ph132, %93
  %indvars.iv171 = phi i64 [ %82, %.lr.ph132 ], [ %indvars.iv.next172, %93 ]
  %94 = getelementptr inbounds [500100 x i64], ptr @num, i64 0, i64 %indvars.iv171
  %95 = load i64, ptr %94, align 8, !tbaa !9
  %96 = add nsw i64 %95, %87
  store i64 %96, ptr %94, align 8, !tbaa !9
  %indvars.iv.next172 = add nsw i64 %indvars.iv171, 1
  %97 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %indvars.iv.next172
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = icmp eq i32 %98, %84
  %100 = icmp slt i64 %indvars.iv171, %88
  %101 = and i1 %99, %100
  br i1 %101, label %93, label %._crit_edge133, !llvm.loop !18

.lr.ph136:                                        ; preds = %._crit_edge133, %106
  %storemerge106134 = phi i32 [ %107, %106 ], [ %81, %._crit_edge133 ]
  %102 = zext nneg i32 %storemerge106134 to i64
  %103 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = icmp eq i32 %104, %84
  br i1 %105, label %106, label %.critedge

106:                                              ; preds = %.lr.ph136
  %107 = add nsw i32 %storemerge106134, -1
  %108 = icmp sgt i32 %storemerge106134, 0
  br i1 %108, label %.lr.ph136, label %.critedge, !llvm.loop !19

.critedge:                                        ; preds = %.lr.ph136, %106, %._crit_edge133
  %storemerge106.lcssa = phi i32 [ %81, %._crit_edge133 ], [ -1, %106 ], [ %storemerge106134, %.lr.ph136 ]
  %storemerge103141 = add nsw i32 %storemerge106.lcssa, 1
  store i32 %storemerge103141, ptr %4, align 4, !tbaa !5
  %109 = load i32, ptr @n, align 4, !tbaa !5
  %110 = icmp slt i32 %storemerge103141, %109
  br i1 %110, label %.lr.ph143, label %.critedge2

.lr.ph143:                                        ; preds = %.critedge
  %111 = sext i32 %84 to i64
  %112 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %111
  %113 = sext i32 %storemerge103141 to i64
  %114 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = icmp eq i32 %115, %84
  br i1 %116, label %.lr.ph187, label %.critedge2.loopexit

117:                                              ; preds = %.lr.ph187
  %118 = sext i32 %storemerge103 to i64
  %119 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = icmp eq i32 %120, %84
  br i1 %121, label %.lr.ph187, label %.critedge2.loopexit, !llvm.loop !20

.lr.ph187:                                        ; preds = %.lr.ph143, %117
  %122 = phi i64 [ %118, %117 ], [ %113, %.lr.ph143 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #8
  %123 = getelementptr inbounds [500100 x i64], ptr @num, i64 0, i64 %122
  %124 = call { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %123, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %.fca.0.extract47 = extractvalue { i64, i32 } %124, 0
  %.fca.1.extract48 = extractvalue { i64, i32 } %124, 1
  store i64 %.fca.0.extract47, ptr %5, align 8
  store i32 %.fca.1.extract48, ptr %.sroa.250.0..sroa_idx, align 8
  call void @_ZNSt6vectorISt4pairIxiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %112, ptr noundef nonnull align 8 dereferenceable(12) %5)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #8
  %storemerge103.in = load i32, ptr %4, align 4, !tbaa !5
  %storemerge103 = add nsw i32 %storemerge103.in, 1
  store i32 %storemerge103, ptr %4, align 4, !tbaa !5
  %125 = load i32, ptr @n, align 4, !tbaa !5
  %126 = icmp slt i32 %storemerge103, %125
  br i1 %126, label %117, label %.critedge2.loopexit, !llvm.loop !20

.critedge2.loopexit:                              ; preds = %117, %.lr.ph187, %.lr.ph143
  %127 = phi i32 [ %109, %.lr.ph143 ], [ %125, %.lr.ph187 ], [ %125, %117 ]
  %.pre = load i32, ptr @l, align 4, !tbaa !5
  %.phi.trans.insert = sext i32 %.pre to i64
  %.phi.trans.insert177 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %.phi.trans.insert
  %.pre178 = load i32, ptr %.phi.trans.insert177, align 4, !tbaa !5
  %.pre179 = load i32, ptr @r, align 4, !tbaa !5
  br label %.critedge2

.critedge2:                                       ; preds = %.critedge2.loopexit, %.critedge
  %128 = phi i32 [ %127, %.critedge2.loopexit ], [ %109, %.critedge ]
  %129 = phi i32 [ %.pre179, %.critedge2.loopexit ], [ %85, %.critedge ]
  %130 = phi i32 [ %.pre178, %.critedge2.loopexit ], [ %84, %.critedge ]
  %131 = sext i32 %129 to i64
  %132 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %.not104 = icmp eq i32 %130, %133
  br i1 %.not104, label %.critedge6, label %.lr.ph146

.lr.ph146:                                        ; preds = %.critedge2
  %134 = load i32, ptr @x, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  br label %137

.preheader:                                       ; preds = %137
  %136 = icmp sgt i32 %129, -1
  br i1 %136, label %.lr.ph148, label %.critedge4

137:                                              ; preds = %.lr.ph146, %137
  %indvars.iv174 = phi i64 [ %131, %.lr.ph146 ], [ %indvars.iv.next175, %137 ]
  %138 = getelementptr inbounds [500100 x i64], ptr @num, i64 0, i64 %indvars.iv174
  %139 = load i64, ptr %138, align 8, !tbaa !9
  %140 = add nsw i64 %139, %135
  store i64 %140, ptr %138, align 8, !tbaa !9
  %indvars.iv.next175 = add nsw i64 %indvars.iv174, -1
  %141 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %indvars.iv.next175
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = icmp eq i32 %142, %133
  br i1 %143, label %137, label %.preheader, !llvm.loop !21

.lr.ph148:                                        ; preds = %.preheader, %148
  %storemerge107147 = phi i32 [ %149, %148 ], [ %129, %.preheader ]
  %144 = zext nneg i32 %storemerge107147 to i64
  %145 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = icmp eq i32 %146, %133
  br i1 %147, label %148, label %.critedge4

148:                                              ; preds = %.lr.ph148
  %149 = add nsw i32 %storemerge107147, -1
  %150 = icmp sgt i32 %storemerge107147, 0
  br i1 %150, label %.lr.ph148, label %.critedge4, !llvm.loop !22

.critedge4:                                       ; preds = %.lr.ph148, %148, %.preheader
  %storemerge107.lcssa = phi i32 [ %129, %.preheader ], [ -1, %148 ], [ %storemerge107147, %.lr.ph148 ]
  %storemerge105153 = add nsw i32 %storemerge107.lcssa, 1
  store i32 %storemerge105153, ptr %4, align 4, !tbaa !5
  %151 = icmp slt i32 %storemerge105153, %128
  br i1 %151, label %.lr.ph155, label %.critedge6

.lr.ph155:                                        ; preds = %.critedge4
  %152 = sext i32 %133 to i64
  %153 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %152
  br label %154

154:                                              ; preds = %.lr.ph155, %159
  %storemerge105154 = phi i32 [ %storemerge105153, %.lr.ph155 ], [ %storemerge105, %159 ]
  %155 = sext i32 %storemerge105154 to i64
  %156 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %155
  %157 = load i32, ptr %156, align 4, !tbaa !5
  %158 = icmp eq i32 %157, %133
  br i1 %158, label %159, label %.critedge6.loopexit

159:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #8
  %160 = getelementptr inbounds [500100 x i64], ptr @num, i64 0, i64 %155
  %161 = call { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %160, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %.fca.0.extract = extractvalue { i64, i32 } %161, 0
  %.fca.1.extract = extractvalue { i64, i32 } %161, 1
  store i64 %.fca.0.extract, ptr %6, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  call void @_ZNSt6vectorISt4pairIxiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %153, ptr noundef nonnull align 8 dereferenceable(12) %6)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #8
  %storemerge105.in = load i32, ptr %4, align 4, !tbaa !5
  %storemerge105 = add nsw i32 %storemerge105.in, 1
  store i32 %storemerge105, ptr %4, align 4, !tbaa !5
  %162 = load i32, ptr @n, align 4, !tbaa !5
  %163 = icmp slt i32 %storemerge105, %162
  br i1 %163, label %154, label %.critedge6.loopexit, !llvm.loop !23

.critedge6.loopexit:                              ; preds = %154, %159
  %.pre180 = load i32, ptr @l, align 4, !tbaa !5
  %.phi.trans.insert181 = sext i32 %.pre180 to i64
  %.phi.trans.insert182 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %.phi.trans.insert181
  %.pre183 = load i32, ptr %.phi.trans.insert182, align 4, !tbaa !5
  br label %.critedge6

.critedge6:                                       ; preds = %.critedge6.loopexit, %.critedge4, %.critedge2
  %164 = phi i32 [ %.pre183, %.critedge6.loopexit ], [ %130, %.critedge4 ], [ %130, %.critedge2 ]
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %165
  %167 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %166) #8
  %168 = load i32, ptr @l, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %169
  %171 = load i32, ptr %170, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %172
  %174 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %173) #8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIxiESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %167, ptr %174)
  %175 = load i32, ptr @r, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %176
  %178 = load i32, ptr %177, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %179
  %181 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %180) #8
  %182 = load i32, ptr @r, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [500100 x i32], ptr @group, i64 0, i64 %183
  %185 = load i32, ptr %184, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %186
  %188 = call ptr @_ZNSt6vectorISt4pairIxiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %187) #8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIxiESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %181, ptr %188)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  br label %264

189:                                              ; preds = %45
  %190 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @y)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  store i32 10000000, ptr %8, align 4, !tbaa !5
  br label %194

191:                                              ; preds = %256
  %192 = load i32, ptr %8, align 4, !tbaa !5
  %193 = icmp eq i32 %192, 10000000
  br i1 %193, label %257, label %259

194:                                              ; preds = %189, %256
  %indvars.iv161 = phi i64 [ 0, %189 ], [ %indvars.iv.next162, %256 ]
  %195 = getelementptr inbounds [800 x %"class.std::vector"], ptr @a, i64 0, i64 %indvars.iv161
  %196 = call noundef i64 @_ZNKSt6vectorISt4pairIxiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %195) #8
  %197 = icmp eq i64 %196, 0
  br i1 %197, label %256, label %198

198:                                              ; preds = %194
  %199 = call noundef i64 @_ZNKSt6vectorISt4pairIxiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %195) #8
  %200 = trunc i64 %199 to i32
  %201 = add i32 %200, -1
  %202 = icmp sgt i32 %201, 0
  br i1 %202, label %.lr.ph115, label %._crit_edge116

.lr.ph115:                                        ; preds = %198
  %203 = getelementptr inbounds [800 x i64], ptr @up, i64 0, i64 %indvars.iv161
  br label %204

204:                                              ; preds = %.lr.ph115, %204
  %.0113 = phi i32 [ %201, %.lr.ph115 ], [ %.0., %204 ]
  %.078112 = phi i32 [ -1, %.lr.ph115 ], [ %..078, %204 ]
  %205 = add nsw i32 %.0113, %.078112
  %206 = lshr i32 %205, 1
  %207 = zext nneg i32 %206 to i64
  %208 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIxiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %195, i64 noundef %207) #8
  %209 = load i64, ptr %208, align 8, !tbaa !24
  %210 = load i64, ptr %203, align 8, !tbaa !9
  %211 = add nsw i64 %210, %209
  %212 = load i32, ptr @y, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %.not101 = icmp slt i64 %211, %213
  %..078 = select i1 %.not101, i32 %206, i32 %.078112
  %.0. = select i1 %.not101, i32 %.0113, i32 %206
  %214 = add nsw i32 %..078, 1
  %215 = icmp slt i32 %214, %.0.
  br i1 %215, label %204, label %._crit_edge116, !llvm.loop !26

._crit_edge116:                                   ; preds = %204, %198
  %.0.lcssa = phi i32 [ %201, %198 ], [ %.0., %204 ]
  %216 = sext i32 %.0.lcssa to i64
  %217 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIxiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %195, i64 noundef %216) #8
  %218 = load i64, ptr %217, align 8, !tbaa !24
  %219 = getelementptr inbounds [800 x i64], ptr @up, i64 0, i64 %indvars.iv161
  %220 = load i64, ptr %219, align 8, !tbaa !9
  %221 = add nsw i64 %220, %218
  %222 = load i32, ptr @y, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %.not99 = icmp eq i64 %221, %223
  br i1 %.not99, label %224, label %256

224:                                              ; preds = %._crit_edge116
  %225 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIxiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %195, i64 noundef %216) #8
  %226 = getelementptr inbounds i8, ptr %225, i64 8
  %227 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %226)
  %228 = load i32, ptr %227, align 4, !tbaa !5
  store i32 %228, ptr %8, align 4, !tbaa !5
  %229 = call noundef i64 @_ZNKSt6vectorISt4pairIxiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %195) #8
  %230 = trunc i64 %229 to i32
  %231 = icmp sgt i32 %230, 1
  br i1 %231, label %.lr.ph121, label %._crit_edge122

.lr.ph121:                                        ; preds = %224, %.lr.ph121
  %.2119 = phi i32 [ %..2, %.lr.ph121 ], [ %230, %224 ]
  %.280118 = phi i32 [ %.280., %.lr.ph121 ], [ 0, %224 ]
  %232 = add nuw nsw i32 %.2119, %.280118
  %233 = lshr i32 %232, 1
  %234 = zext nneg i32 %233 to i64
  %235 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIxiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %195, i64 noundef %234) #8
  %236 = load i64, ptr %235, align 8, !tbaa !24
  %237 = load i64, ptr %219, align 8, !tbaa !9
  %238 = add nsw i64 %237, %236
  %239 = load i32, ptr @y, align 4, !tbaa !5
  %240 = sext i32 %239 to i64
  %241 = icmp sgt i64 %238, %240
  %.280. = select i1 %241, i32 %.280118, i32 %233
  %..2 = select i1 %241, i32 %233, i32 %.2119
  %242 = add nuw nsw i32 %.280., 1
  %243 = icmp slt i32 %242, %..2
  br i1 %243, label %.lr.ph121, label %._crit_edge122, !llvm.loop !27

._crit_edge122:                                   ; preds = %.lr.ph121, %224
  %.280.lcssa = phi i32 [ 0, %224 ], [ %.280., %.lr.ph121 ]
  %244 = zext nneg i32 %.280.lcssa to i64
  %245 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIxiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %195, i64 noundef %244) #8
  %246 = load i64, ptr %245, align 8, !tbaa !24
  %247 = load i64, ptr %219, align 8, !tbaa !9
  %248 = add nsw i64 %247, %246
  %249 = load i32, ptr @y, align 4, !tbaa !5
  %250 = sext i32 %249 to i64
  %.not100 = icmp eq i64 %248, %250
  br i1 %.not100, label %251, label %256

251:                                              ; preds = %._crit_edge122
  %252 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIxiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %195, i64 noundef %244) #8
  %253 = getelementptr inbounds i8, ptr %252, i64 8
  %254 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %253)
  %255 = load i32, ptr %254, align 4, !tbaa !5
  store i32 %255, ptr %7, align 4, !tbaa !5
  br label %256

256:                                              ; preds = %251, %._crit_edge116, %._crit_edge122, %194
  %indvars.iv.next162 = add nuw nsw i64 %indvars.iv161, 1
  %exitcond165.not = icmp eq i64 %indvars.iv.next162, %.083.lcssa
  br i1 %exitcond165.not, label %191, label %194, !llvm.loop !28

257:                                              ; preds = %191
  %258 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  br label %263

259:                                              ; preds = %191
  %260 = load i32, ptr %7, align 4, !tbaa !5
  %261 = sub nsw i32 %260, %192
  %262 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %261)
  br label %263

263:                                              ; preds = %259, %257
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  br label %264

264:                                              ; preds = %263, %.critedge6
  %265 = load i32, ptr @q, align 4, !tbaa !5
  %266 = add nsw i32 %265, -1
  store i32 %266, ptr @q, align 4, !tbaa !5
  %.not97 = icmp eq i32 %265, 0
  br i1 %.not97, label %._crit_edge159, label %45, !llvm.loop !29

._crit_edge159:                                   ; preds = %264, %.preheader109
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIxiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #5 align 2

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIxiESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr, ptr) local_unnamed_addr #7

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

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

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

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

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


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