; LLVM IR from ShahjalalShohag/code-library :: Miscellaneous (Parallel Binary Search)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.BIT = type { i32, %"class.std::vector.0" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@a = external dso_local global [300009 x %"class.std::vector"], align 16
@amount = external dso_local global [300009 x i32], align 16
@want = external dso_local global [300009 x i32], align 16
@st = external dso_local global [300009 x i32], align 16
@en = external dso_local global [300009 x i32], align 16
@l = external dso_local global [300009 x i32], align 16
@r = external dso_local global [300009 x i32], align 16
@ans = external dso_local global [300009 x i32], align 16
@mid = external dso_local global [300009 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [3 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 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 i32, align 4
  %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 i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca %struct.BIT, align 8
  %29 = alloca ptr, align 8
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca ptr, align 8
  %34 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %35 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %36 = alloca i32, align 4
  %37 = alloca i64, align 8
  %38 = alloca ptr, align 8
  %39 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %40 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %41 = alloca i32, align 4
  %42 = alloca i32, align 4
  %43 = alloca i32, align 4
  %44 = alloca i32, align 4
  %45 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %46 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3)
  %47 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %47, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  %48 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %48, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %49 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %6)
  %50 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %50, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %51 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %51, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %64, %0
  %53 = load i32, ptr %8, align 4, !tbaa !5
  %54 = load i32, ptr %5, align 4, !tbaa !5
  %55 = icmp sle i32 %53, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %67

57:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %58 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %10)
  %59 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %59, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  %60 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %60, ptr %9, align 4, !tbaa !5
  %61 = load i32, ptr %9, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [300009 x %"class.std::vector"], ptr @a, i64 0, i64 %62
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %63, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %64

64:                                               ; preds = %57
  %65 = load i32, ptr %8, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %8, align 4, !tbaa !5
  br label %52, !llvm.loop !9

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

68:                                               ; preds = %80, %67
  %69 = load i32, ptr %12, align 4, !tbaa !5
  %70 = load i32, ptr %2, align 4, !tbaa !5
  %71 = icmp sle i32 %69, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %83

73:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %74 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %13)
  %75 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %75, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  %76 = load i32, ptr %14, align 4, !tbaa !5
  %77 = load i32, ptr %12, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [300009 x i32], ptr @want, i64 0, i64 %78
  store i32 %76, ptr %79, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %73
  %81 = load i32, ptr %12, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %12, align 4, !tbaa !5
  br label %68, !llvm.loop !11

83:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %84 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %16)
  %85 = load i32, ptr %16, align 4, !tbaa !5
  store i32 %85, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  %86 = load i32, ptr %17, align 4, !tbaa !5
  store i32 %86, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 1, ptr %18, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %111, %83
  %88 = load i32, ptr %18, align 4, !tbaa !5
  %89 = load i32, ptr %15, align 4, !tbaa !5
  %90 = icmp sle i32 %88, %89
  br i1 %90, label %92, label %91

91:                                               ; preds = %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %114

92:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %93 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %19)
  %94 = load i32, ptr %19, align 4, !tbaa !5
  store i32 %94, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  %95 = load i32, ptr %20, align 4, !tbaa !5
  %96 = load i32, ptr %18, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [300009 x i32], ptr @st, i64 0, i64 %97
  store i32 %95, ptr %98, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %99 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %21)
  %100 = load i32, ptr %21, align 4, !tbaa !5
  store i32 %100, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  %101 = load i32, ptr %22, align 4, !tbaa !5
  %102 = load i32, ptr %18, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [300009 x i32], ptr @en, i64 0, i64 %103
  store i32 %101, ptr %104, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %105 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %23)
  %106 = load i32, ptr %23, align 4, !tbaa !5
  store i32 %106, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  %107 = load i32, ptr %24, align 4, !tbaa !5
  %108 = load i32, ptr %18, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [300009 x i32], ptr @amount, i64 0, i64 %109
  store i32 %107, ptr %110, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %92
  %112 = load i32, ptr %18, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %18, align 4, !tbaa !5
  br label %87, !llvm.loop !12

114:                                              ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  store i32 1, ptr %25, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %128, %114
  %116 = load i32, ptr %25, align 4, !tbaa !5
  %117 = load i32, ptr %2, align 4, !tbaa !5
  %118 = icmp sle i32 %116, %117
  br i1 %118, label %120, label %119

119:                                              ; preds = %115
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  br label %131

120:                                              ; preds = %115
  %121 = load i32, ptr %25, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [300009 x i32], ptr @l, i64 0, i64 %122
  store i32 1, ptr %123, align 4, !tbaa !5
  %124 = load i32, ptr %15, align 4, !tbaa !5
  %125 = load i32, ptr %25, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [300009 x i32], ptr @r, i64 0, i64 %126
  store i32 %124, ptr %127, align 4, !tbaa !5
  br label %128

128:                                              ; preds = %120
  %129 = load i32, ptr %25, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %25, align 4, !tbaa !5
  br label %115, !llvm.loop !13

131:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  store i32 1, ptr %26, align 4, !tbaa !5
  br label %132

132:                                              ; preds = %150, %131
  %133 = load i32, ptr %26, align 4, !tbaa !5
  %134 = load i32, ptr %2, align 4, !tbaa !5
  %135 = icmp sle i32 %133, %134
  br i1 %135, label %137, label %136

136:                                              ; preds = %132
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  br label %153

137:                                              ; preds = %132
  %138 = load i32, ptr %26, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [300009 x i32], ptr @l, i64 0, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = load i32, ptr %26, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [300009 x i32], ptr @r, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = add nsw i32 %141, %145
  %147 = ashr i32 %146, 1
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [300009 x %"class.std::vector"], ptr @mid, i64 0, i64 %148
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %149, ptr noundef nonnull align 4 dereferenceable(4) %26)
  br label %150

150:                                              ; preds = %137
  %151 = load i32, ptr %26, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %26, align 4, !tbaa !5
  br label %132, !llvm.loop !14

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

154:                                              ; preds = %163, %153
  %155 = load i32, ptr %27, align 4, !tbaa !5
  %156 = load i32, ptr %2, align 4, !tbaa !5
  %157 = icmp sle i32 %155, %156
  br i1 %157, label %159, label %158

158:                                              ; preds = %154
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  br label %166

159:                                              ; preds = %154
  %160 = load i32, ptr %27, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [300009 x i32], ptr @ans, i64 0, i64 %161
  store i32 -1, ptr %162, align 4, !tbaa !5
  br label %163

163:                                              ; preds = %159
  %164 = load i32, ptr %27, align 4, !tbaa !5
  %165 = add nsw i32 %164, 1
  store i32 %165, ptr %27, align 4, !tbaa !5
  br label %154, !llvm.loop !15

166:                                              ; preds = %158
  br label %167

167:                                              ; preds = %377, %166
  br label %168

168:                                              ; preds = %167
  call void @llvm.lifetime.start.p0(i64 32, ptr %28) #6
  call void @_ZN3BITIxEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %28) #6
  %169 = load i32, ptr %5, align 4, !tbaa !5
  %170 = add nsw i32 %169, 1
  invoke void @_ZN3BITIxE4initEi(ptr noundef nonnull align 8 dereferenceable(32) %28, i32 noundef %170)
          to label %171 unwind label %177

171:                                              ; preds = %168
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #6
  store i32 1, ptr %31, align 4, !tbaa !5
  br label %172

172:                                              ; preds = %315, %171
  %173 = load i32, ptr %31, align 4, !tbaa !5
  %174 = load i32, ptr %15, align 4, !tbaa !5
  %175 = icmp sle i32 %173, %174
  br i1 %175, label %181, label %176

176:                                              ; preds = %172
  store i32 22, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #6
  br label %319

177:                                              ; preds = %168
  %178 = landingpad { ptr, i32 }
          cleanup
  %179 = extractvalue { ptr, i32 } %178, 0
  store ptr %179, ptr %29, align 8
  %180 = extractvalue { ptr, i32 } %178, 1
  store i32 %180, ptr %30, align 4
  br label %378

181:                                              ; preds = %172
  %182 = load i32, ptr %31, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [300009 x i32], ptr @st, i64 0, i64 %183
  %185 = load i32, ptr %184, align 4, !tbaa !5
  %186 = load i32, ptr %31, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [300009 x i32], ptr @en, i64 0, i64 %187
  %189 = load i32, ptr %188, align 4, !tbaa !5
  %190 = icmp sle i32 %185, %189
  br i1 %190, label %191, label %210

191:                                              ; preds = %181
  %192 = load i32, ptr %31, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [300009 x i32], ptr @st, i64 0, i64 %193
  %195 = load i32, ptr %194, align 4, !tbaa !5
  %196 = load i32, ptr %31, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [300009 x i32], ptr @en, i64 0, i64 %197
  %199 = load i32, ptr %198, align 4, !tbaa !5
  %200 = load i32, ptr %31, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [300009 x i32], ptr @amount, i64 0, i64 %201
  %203 = load i32, ptr %202, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  invoke void @_ZN3BITIxE3updEiix(ptr noundef nonnull align 8 dereferenceable(32) %28, i32 noundef %195, i32 noundef %199, i64 noundef %204)
          to label %205 unwind label %206

205:                                              ; preds = %191
  br label %232

206:                                              ; preds = %220, %210, %191
  %207 = landingpad { ptr, i32 }
          cleanup
  %208 = extractvalue { ptr, i32 } %207, 0
  store ptr %208, ptr %29, align 8
  %209 = extractvalue { ptr, i32 } %207, 1
  store i32 %209, ptr %30, align 4
  br label %318

210:                                              ; preds = %181
  %211 = load i32, ptr %31, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [300009 x i32], ptr @en, i64 0, i64 %212
  %214 = load i32, ptr %213, align 4, !tbaa !5
  %215 = load i32, ptr %31, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [300009 x i32], ptr @amount, i64 0, i64 %216
  %218 = load i32, ptr %217, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  invoke void @_ZN3BITIxE3updEiix(ptr noundef nonnull align 8 dereferenceable(32) %28, i32 noundef 1, i32 noundef %214, i64 noundef %219)
          to label %220 unwind label %206

220:                                              ; preds = %210
  %221 = load i32, ptr %31, align 4, !tbaa !5
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [300009 x i32], ptr @st, i64 0, i64 %222
  %224 = load i32, ptr %223, align 4, !tbaa !5
  %225 = load i32, ptr %5, align 4, !tbaa !5
  %226 = load i32, ptr %31, align 4, !tbaa !5
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [300009 x i32], ptr @amount, i64 0, i64 %227
  %229 = load i32, ptr %228, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  invoke void @_ZN3BITIxE3updEiix(ptr noundef nonnull align 8 dereferenceable(32) %28, i32 noundef %224, i32 noundef %225, i64 noundef %230)
          to label %231 unwind label %206

231:                                              ; preds = %220
  br label %232

232:                                              ; preds = %231, %205
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #6
  %233 = load i32, ptr %31, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [300009 x %"class.std::vector"], ptr @mid, i64 0, i64 %234
  store ptr %235, ptr %33, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #6
  %236 = load ptr, ptr %33, align 8, !tbaa !16
  %237 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %236) #6
  %238 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %34, i32 0, i32 0
  store ptr %237, ptr %238, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #6
  %239 = load ptr, ptr %33, align 8, !tbaa !16
  %240 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %239) #6
  %241 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %35, i32 0, i32 0
  store ptr %240, ptr %241, align 8
  br label %242

242:                                              ; preds = %312, %232
  %243 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef nonnull align 8 dereferenceable(8) %35) #6
  br i1 %243, label %245, label %244

244:                                              ; preds = %242
  store i32 25, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #6
  br label %314

245:                                              ; preds = %242
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #6
  %246 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %34) #6
  %247 = load i32, ptr %246, align 4, !tbaa !5
  store i32 %247, ptr %36, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #6
  store i64 0, ptr %37, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #6
  %248 = load i32, ptr %36, align 4, !tbaa !5
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [300009 x %"class.std::vector"], ptr @a, i64 0, i64 %249
  store ptr %250, ptr %38, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #6
  %251 = load ptr, ptr %38, align 8, !tbaa !16
  %252 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %251) #6
  %253 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %39, i32 0, i32 0
  store ptr %252, ptr %253, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #6
  %254 = load ptr, ptr %38, align 8, !tbaa !16
  %255 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %254) #6
  %256 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %40, i32 0, i32 0
  store ptr %255, ptr %256, align 8
  br label %257

257:                                              ; preds = %284, %245
  %258 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef nonnull align 8 dereferenceable(8) %40) #6
  br i1 %258, label %260, label %259

259:                                              ; preds = %257
  store i32 27, ptr %32, align 4
  br label %286

260:                                              ; preds = %257
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #6
  %261 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %39) #6
  %262 = load i32, ptr %261, align 4, !tbaa !5
  store i32 %262, ptr %41, align 4, !tbaa !5
  %263 = load i32, ptr %41, align 4, !tbaa !5
  %264 = invoke noundef i64 @_ZN3BITIxE5queryEi(ptr noundef nonnull align 8 dereferenceable(32) %28, i32 noundef %263)
          to label %265 unwind label %276

265:                                              ; preds = %260
  %266 = load i64, ptr %37, align 8, !tbaa !18
  %267 = add nsw i64 %266, %264
  store i64 %267, ptr %37, align 8, !tbaa !18
  %268 = load i64, ptr %37, align 8, !tbaa !18
  %269 = load i32, ptr %36, align 4, !tbaa !5
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds [300009 x i32], ptr @want, i64 0, i64 %270
  %272 = load i32, ptr %271, align 4, !tbaa !5
  %273 = sext i32 %272 to i64
  %274 = icmp sge i64 %268, %273
  br i1 %274, label %275, label %280

275:                                              ; preds = %265
  store i32 27, ptr %32, align 4
  br label %281

276:                                              ; preds = %260
  %277 = landingpad { ptr, i32 }
          cleanup
  %278 = extractvalue { ptr, i32 } %277, 0
  store ptr %278, ptr %29, align 8
  %279 = extractvalue { ptr, i32 } %277, 1
  store i32 %279, ptr %30, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #6
  br label %318

280:                                              ; preds = %265
  store i32 0, ptr %32, align 4
  br label %281

281:                                              ; preds = %280, %275
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #6
  %282 = load i32, ptr %32, align 4
  switch i32 %282, label %286 [
    i32 0, label %283
  ]

283:                                              ; preds = %281
  br label %284

284:                                              ; preds = %283
  %285 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %39) #6
  br label %257

286:                                              ; preds = %281, %259
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #6
  br label %287

287:                                              ; preds = %286
  %288 = load i64, ptr %37, align 8, !tbaa !18
  %289 = load i32, ptr %36, align 4, !tbaa !5
  %290 = sext i32 %289 to i64
  %291 = getelementptr inbounds [300009 x i32], ptr @want, i64 0, i64 %290
  %292 = load i32, ptr %291, align 4, !tbaa !5
  %293 = sext i32 %292 to i64
  %294 = icmp sge i64 %288, %293
  br i1 %294, label %295, label %305

295:                                              ; preds = %287
  %296 = load i32, ptr %31, align 4, !tbaa !5
  %297 = sub nsw i32 %296, 1
  %298 = load i32, ptr %36, align 4, !tbaa !5
  %299 = sext i32 %298 to i64
  %300 = getelementptr inbounds [300009 x i32], ptr @r, i64 0, i64 %299
  store i32 %297, ptr %300, align 4, !tbaa !5
  %301 = load i32, ptr %31, align 4, !tbaa !5
  %302 = load i32, ptr %36, align 4, !tbaa !5
  %303 = sext i32 %302 to i64
  %304 = getelementptr inbounds [300009 x i32], ptr @ans, i64 0, i64 %303
  store i32 %301, ptr %304, align 4, !tbaa !5
  br label %311

305:                                              ; preds = %287
  %306 = load i32, ptr %31, align 4, !tbaa !5
  %307 = add nsw i32 %306, 1
  %308 = load i32, ptr %36, align 4, !tbaa !5
  %309 = sext i32 %308 to i64
  %310 = getelementptr inbounds [300009 x i32], ptr @l, i64 0, i64 %309
  store i32 %307, ptr %310, align 4, !tbaa !5
  br label %311

311:                                              ; preds = %305, %295
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #6
  br label %312

312:                                              ; preds = %311
  %313 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %34) #6
  br label %242

314:                                              ; preds = %244
  br label %315

315:                                              ; preds = %314
  %316 = load i32, ptr %31, align 4, !tbaa !5
  %317 = add nsw i32 %316, 1
  store i32 %317, ptr %31, align 4, !tbaa !5
  br label %172, !llvm.loop !20

318:                                              ; preds = %276, %206
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #6
  br label %378

319:                                              ; preds = %176
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #6
  store i32 1, ptr %42, align 4, !tbaa !5
  br label %320

320:                                              ; preds = %329, %319
  %321 = load i32, ptr %42, align 4, !tbaa !5
  %322 = load i32, ptr %15, align 4, !tbaa !5
  %323 = icmp sle i32 %321, %322
  br i1 %323, label %325, label %324

324:                                              ; preds = %320
  store i32 29, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #6
  br label %332

325:                                              ; preds = %320
  %326 = load i32, ptr %42, align 4, !tbaa !5
  %327 = sext i32 %326 to i64
  %328 = getelementptr inbounds [300009 x %"class.std::vector"], ptr @mid, i64 0, i64 %327
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %328) #6
  br label %329

329:                                              ; preds = %325
  %330 = load i32, ptr %42, align 4, !tbaa !5
  %331 = add nsw i32 %330, 1
  store i32 %331, ptr %42, align 4, !tbaa !5
  br label %320, !llvm.loop !21

332:                                              ; preds = %324
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #6
  store i32 1, ptr %43, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #6
  store i32 1, ptr %44, align 4, !tbaa !5
  br label %333

333:                                              ; preds = %367, %332
  %334 = load i32, ptr %44, align 4, !tbaa !5
  %335 = load i32, ptr %2, align 4, !tbaa !5
  %336 = icmp sle i32 %334, %335
  br i1 %336, label %338, label %337

337:                                              ; preds = %333
  store i32 32, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #6
  br label %370

338:                                              ; preds = %333
  %339 = load i32, ptr %44, align 4, !tbaa !5
  %340 = sext i32 %339 to i64
  %341 = getelementptr inbounds [300009 x i32], ptr @l, i64 0, i64 %340
  %342 = load i32, ptr %341, align 4, !tbaa !5
  %343 = load i32, ptr %44, align 4, !tbaa !5
  %344 = sext i32 %343 to i64
  %345 = getelementptr inbounds [300009 x i32], ptr @r, i64 0, i64 %344
  %346 = load i32, ptr %345, align 4, !tbaa !5
  %347 = icmp sle i32 %342, %346
  br i1 %347, label %348, label %366

348:                                              ; preds = %338
  %349 = load i32, ptr %44, align 4, !tbaa !5
  %350 = sext i32 %349 to i64
  %351 = getelementptr inbounds [300009 x i32], ptr @l, i64 0, i64 %350
  %352 = load i32, ptr %351, align 4, !tbaa !5
  %353 = load i32, ptr %44, align 4, !tbaa !5
  %354 = sext i32 %353 to i64
  %355 = getelementptr inbounds [300009 x i32], ptr @r, i64 0, i64 %354
  %356 = load i32, ptr %355, align 4, !tbaa !5
  %357 = add nsw i32 %352, %356
  %358 = ashr i32 %357, 1
  %359 = sext i32 %358 to i64
  %360 = getelementptr inbounds [300009 x %"class.std::vector"], ptr @mid, i64 0, i64 %359
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %360, ptr noundef nonnull align 4 dereferenceable(4) %44)
          to label %361 unwind label %362

361:                                              ; preds = %348
  store i32 0, ptr %43, align 4, !tbaa !5
  br label %366

362:                                              ; preds = %348
  %363 = landingpad { ptr, i32 }
          cleanup
  %364 = extractvalue { ptr, i32 } %363, 0
  store ptr %364, ptr %29, align 8
  %365 = extractvalue { ptr, i32 } %363, 1
  store i32 %365, ptr %30, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #6
  br label %378

366:                                              ; preds = %361, %338
  br label %367

367:                                              ; preds = %366
  %368 = load i32, ptr %44, align 4, !tbaa !5
  %369 = add nsw i32 %368, 1
  store i32 %369, ptr %44, align 4, !tbaa !5
  br label %333, !llvm.loop !22

370:                                              ; preds = %337
  %371 = load i32, ptr %43, align 4, !tbaa !5
  %372 = icmp ne i32 %371, 0
  br i1 %372, label %373, label %374

373:                                              ; preds = %370
  store i32 21, ptr %32, align 4
  br label %375

374:                                              ; preds = %370
  store i32 0, ptr %32, align 4
  br label %375

375:                                              ; preds = %374, %373
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #6
  call void @_ZN3BITIxED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %28) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %28) #6
  %376 = load i32, ptr %32, align 4
  switch i32 %376, label %410 [
    i32 0, label %377
    i32 21, label %379
  ]

377:                                              ; preds = %375
  br label %167, !llvm.loop !23

378:                                              ; preds = %362, %318, %177
  call void @_ZN3BITIxED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %28) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %405

379:                                              ; preds = %375
  call void @llvm.lifetime.start.p0(i64 4, ptr %45) #6
  store i32 1, ptr %45, align 4, !tbaa !5
  br label %380

380:                                              ; preds = %400, %379
  %381 = load i32, ptr %45, align 4, !tbaa !5
  %382 = load i32, ptr %2, align 4, !tbaa !5
  %383 = icmp sle i32 %381, %382
  br i1 %383, label %385, label %384

384:                                              ; preds = %380
  store i32 35, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #6
  br label %403

385:                                              ; preds = %380
  %386 = load i32, ptr %45, align 4, !tbaa !5
  %387 = sext i32 %386 to i64
  %388 = getelementptr inbounds [300009 x i32], ptr @ans, i64 0, i64 %387
  %389 = load i32, ptr %388, align 4, !tbaa !5
  %390 = icmp eq i32 %389, -1
  br i1 %390, label %391, label %393

391:                                              ; preds = %385
  %392 = call i32 @puts(ptr noundef @.str.4)
  br label %399

393:                                              ; preds = %385
  %394 = load i32, ptr %45, align 4, !tbaa !5
  %395 = sext i32 %394 to i64
  %396 = getelementptr inbounds [300009 x i32], ptr @ans, i64 0, i64 %395
  %397 = load i32, ptr %396, align 4, !tbaa !5
  %398 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %397)
  br label %399

399:                                              ; preds = %393, %391
  br label %400

400:                                              ; preds = %399
  %401 = load i32, ptr %45, align 4, !tbaa !5
  %402 = add nsw i32 %401, 1
  store i32 %402, ptr %45, align 4, !tbaa !5
  br label %380, !llvm.loop !24

403:                                              ; preds = %384
  store i32 0, ptr %1, align 4
  store i32 1, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %404 = load i32, ptr %1, align 4
  ret i32 %404

405:                                              ; preds = %378
  %406 = load ptr, ptr %29, align 8
  %407 = load i32, ptr %30, align 4
  %408 = insertvalue { ptr, i32 } poison, ptr %406, 0
  %409 = insertvalue { ptr, i32 } %408, i32 %407, 1
  resume { ptr, i32 } %409

410:                                              ; preds = %375
  unreachable
}

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3BITIxEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3BITIxE4initEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3BITIxE3updEiix(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef, i64 noundef) #3 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN3BITIxE5queryEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #5 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3BITIxED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

declare i32 @puts(ptr noundef) #2

declare i32 @printf(ptr noundef, ...) #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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = !{!17, !17, i64 0}
!17 = !{!"any pointer", !7, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"long long", !7, i64 0}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.BIT = type { i32, %"class.std::vector.0" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@a = external dso_local global [300009 x %"class.std::vector"], align 16
@amount = external dso_local local_unnamed_addr global [300009 x i32], align 16
@want = external dso_local local_unnamed_addr global [300009 x i32], align 16
@st = external dso_local local_unnamed_addr global [300009 x i32], align 16
@en = external dso_local local_unnamed_addr global [300009 x i32], align 16
@l = external dso_local local_unnamed_addr global [300009 x i32], align 16
@r = external dso_local local_unnamed_addr global [300009 x i32], align 16
@ans = external dso_local local_unnamed_addr global [300009 x i32], align 16
@mid = external dso_local global [300009 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [3 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 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 %struct.BIT, align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %18 = load i32, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  %20 = load i32, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 1, ptr %3, align 4, !tbaa !5
  %.not124 = icmp slt i32 %20, 1
  br i1 %.not124, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %.not102125 = icmp slt i32 %18, 1
  br i1 %.not102125, label %._crit_edge129, label %.lr.ph128.preheader

.lr.ph128.preheader:                              ; preds = %._crit_edge
  %21 = add nuw i32 %18, 1
  %wide.trip.count = zext i32 %21 to i64
  br label %.lr.ph128

.lr.ph:                                           ; preds = %0, %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %4)
  %23 = load i32, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [300009 x %"class.std::vector"], ptr @a, i64 0, i64 %24
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %3, align 4, !tbaa !5
  %.not.not = icmp slt i32 %26, %20
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge129:                                   ; preds = %.lr.ph128, %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %6)
  %29 = load i32, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  %.not103130 = icmp slt i32 %29, 1
  br i1 %.not103130, label %.preheader122, label %.lr.ph133.preheader

.lr.ph133.preheader:                              ; preds = %._crit_edge129
  %30 = add nuw i32 %29, 1
  %wide.trip.count178 = zext i32 %30 to i64
  br label %.lr.ph133

.lr.ph128:                                        ; preds = %.lr.ph128.preheader, %.lr.ph128
  %indvars.iv = phi i64 [ 1, %.lr.ph128.preheader ], [ %indvars.iv.next, %.lr.ph128 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %5)
  %32 = load i32, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  %33 = getelementptr inbounds [300009 x i32], ptr @want, i64 0, i64 %indvars.iv
  store i32 %32, ptr %33, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge129, label %.lr.ph128, !llvm.loop !11

.preheader122:                                    ; preds = %.lr.ph133, %._crit_edge129
  br i1 %.not102125, label %._crit_edge137.thread, label %.lr.ph136.preheader

._crit_edge137.thread:                            ; preds = %.preheader122
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  br label %._crit_edge142.thread

.lr.ph136.preheader:                              ; preds = %.preheader122
  %34 = add nuw i32 %18, 1
  %wide.trip.count183 = zext i32 %34 to i64
  %35 = zext nneg i32 %18 to i64
  %min.iters.check = icmp ult i32 %18, 8
  br i1 %min.iters.check, label %.lr.ph136.preheader208, label %vector.ph

.lr.ph136.preheader208:                           ; preds = %middle.block, %.lr.ph136.preheader
  %indvars.iv180.ph = phi i64 [ 1, %.lr.ph136.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph136

vector.ph:                                        ; preds = %.lr.ph136.preheader
  %n.vec = and i64 %35, 2147483640
  %ind.end = or disjoint i64 %n.vec, 1
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %29, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 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 = or disjoint i64 %index, 1
  %36 = getelementptr inbounds [300009 x i32], ptr @l, i64 0, i64 %offset.idx
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %36, align 4, !tbaa !5
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %37, align 4, !tbaa !5
  %38 = getelementptr inbounds [300009 x i32], ptr @r, i64 0, i64 %offset.idx
  %39 = getelementptr inbounds i8, ptr %38, i64 16
  store <4 x i32> %broadcast.splat, ptr %38, align 4, !tbaa !5
  store <4 x i32> %broadcast.splat, ptr %39, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %40 = icmp eq i64 %index.next, %n.vec
  br i1 %40, label %middle.block, label %vector.body, !llvm.loop !12

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %35
  br i1 %cmp.n, label %._crit_edge137, label %.lr.ph136.preheader208

.lr.ph133:                                        ; preds = %.lr.ph133.preheader, %.lr.ph133
  %indvars.iv175 = phi i64 [ 1, %.lr.ph133.preheader ], [ %indvars.iv.next176, %.lr.ph133 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  %41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %7)
  %42 = load i32, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  %43 = getelementptr inbounds [300009 x i32], ptr @st, i64 0, i64 %indvars.iv175
  store i32 %42, ptr %43, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  %44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %8)
  %45 = load i32, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  %46 = getelementptr inbounds [300009 x i32], ptr @en, i64 0, i64 %indvars.iv175
  store i32 %45, ptr %46, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %47 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %9)
  %48 = load i32, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  %49 = getelementptr inbounds [300009 x i32], ptr @amount, i64 0, i64 %indvars.iv175
  store i32 %48, ptr %49, align 4, !tbaa !5
  %indvars.iv.next176 = add nuw nsw i64 %indvars.iv175, 1
  %exitcond179.not = icmp eq i64 %indvars.iv.next176, %wide.trip.count178
  br i1 %exitcond179.not, label %.preheader122, label %.lr.ph133, !llvm.loop !15

._crit_edge137:                                   ; preds = %.lr.ph136, %middle.block
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  store i32 1, ptr %10, align 4, !tbaa !5
  br i1 %.not102125, label %._crit_edge142.thread, label %.lr.ph141

.lr.ph136:                                        ; preds = %.lr.ph136.preheader208, %.lr.ph136
  %indvars.iv180 = phi i64 [ %indvars.iv.next181, %.lr.ph136 ], [ %indvars.iv180.ph, %.lr.ph136.preheader208 ]
  %50 = getelementptr inbounds [300009 x i32], ptr @l, i64 0, i64 %indvars.iv180
  store i32 1, ptr %50, align 4, !tbaa !5
  %51 = getelementptr inbounds [300009 x i32], ptr @r, i64 0, i64 %indvars.iv180
  store i32 %29, ptr %51, align 4, !tbaa !5
  %indvars.iv.next181 = add nuw nsw i64 %indvars.iv180, 1
  %exitcond184.not = icmp eq i64 %indvars.iv.next181, %wide.trip.count183
  br i1 %exitcond184.not, label %._crit_edge137, label %.lr.ph136, !llvm.loop !16

._crit_edge142.thread:                            ; preds = %._crit_edge137.thread, %._crit_edge137
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  br label %.preheader121

._crit_edge142:                                   ; preds = %.lr.ph141
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  br i1 %.not102125, label %.preheader121, label %.lr.ph146.preheader

.lr.ph146.preheader:                              ; preds = %._crit_edge142
  %52 = zext nneg i32 %18 to i64
  %53 = shl nuw nsw i64 %52, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @ans, i64 4), i8 -1, i64 %53, i1 false), !tbaa !5
  br label %.preheader121

.lr.ph141:                                        ; preds = %._crit_edge137, %.lr.ph141
  %storemerge105139 = phi i32 [ %64, %.lr.ph141 ], [ 1, %._crit_edge137 ]
  %54 = sext i32 %storemerge105139 to i64
  %55 = getelementptr inbounds [300009 x i32], ptr @l, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = getelementptr inbounds [300009 x i32], ptr @r, i64 0, i64 %54
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = add nsw i32 %58, %56
  %60 = ashr i32 %59, 1
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [300009 x %"class.std::vector"], ptr @mid, i64 0, i64 %61
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %62, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %63 = load i32, ptr %10, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %10, align 4, !tbaa !5
  %.not106.not = icmp slt i32 %63, %18
  br i1 %.not106.not, label %.lr.ph141, label %._crit_edge142, !llvm.loop !17

.preheader121:                                    ; preds = %._crit_edge142.thread, %.lr.ph146.preheader, %._crit_edge142
  %65 = add nsw i32 %20, 1
  %66 = add i32 %29, 1
  %wide.trip.count191 = zext i32 %66 to i64
  %wide.trip.count196 = zext i32 %66 to i64
  br label %67

67:                                               ; preds = %.preheader121, %._crit_edge168
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #7
  call void @_ZN3BITIxEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  invoke void @_ZN3BITIxE4initEi(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef %65)
          to label %.preheader120 unwind label %68

.preheader120:                                    ; preds = %67
  br i1 %.not103130, label %._crit_edge162, label %.lr.ph158

.preheader119:                                    ; preds = %._crit_edge155
  br i1 %.not103130, label %._crit_edge162, label %.lr.ph161

68:                                               ; preds = %67
  %69 = landingpad { ptr, i32 }
          cleanup
  br label %140

.lr.ph158:                                        ; preds = %.preheader120, %._crit_edge155
  %indvars.iv188 = phi i64 [ %92, %._crit_edge155 ], [ 1, %.preheader120 ]
  %70 = getelementptr inbounds [300009 x i32], ptr @st, i64 0, i64 %indvars.iv188
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = getelementptr inbounds [300009 x i32], ptr @en, i64 0, i64 %indvars.iv188
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %.not115 = icmp sgt i32 %71, %73
  %74 = getelementptr inbounds [300009 x i32], ptr @amount, i64 0, i64 %indvars.iv188
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  br i1 %.not115, label %79, label %.invoke

77:                                               ; preds = %.invoke, %79
  %78 = landingpad { ptr, i32 }
          cleanup
  br label %140

79:                                               ; preds = %.lr.ph158
  invoke void @_ZN3BITIxE3updEiix(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef 1, i32 noundef %73, i64 noundef %76)
          to label %80 unwind label %77

80:                                               ; preds = %79
  %81 = load i32, ptr %70, align 4, !tbaa !5
  %82 = load i32, ptr %74, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  br label %.invoke

.invoke:                                          ; preds = %.lr.ph158, %80
  %84 = phi i32 [ %81, %80 ], [ %71, %.lr.ph158 ]
  %85 = phi i32 [ %20, %80 ], [ %73, %.lr.ph158 ]
  %86 = phi i64 [ %83, %80 ], [ %76, %.lr.ph158 ]
  invoke void @_ZN3BITIxE3updEiix(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef %84, i32 noundef %85, i64 noundef %86)
          to label %87 unwind label %77

87:                                               ; preds = %.invoke
  %88 = getelementptr inbounds [300009 x %"class.std::vector"], ptr @mid, i64 0, i64 %indvars.iv188
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  %89 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %88) #7
  store ptr %89, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #7
  %90 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %88) #7
  store ptr %90, ptr %13, align 8
  %91 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  %92 = add nuw nsw i64 %indvars.iv188, 1
  br i1 %91, label %.lr.ph154, label %._crit_edge155

.lr.ph154:                                        ; preds = %87
  %93 = trunc i64 %indvars.iv188 to i32
  %94 = add i32 %93, -1
  br label %95

._crit_edge155:                                   ; preds = %119, %87
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  %exitcond192.not = icmp eq i64 %92, %wide.trip.count191
  br i1 %exitcond192.not, label %.preheader119, label %.lr.ph158, !llvm.loop !18

95:                                               ; preds = %.lr.ph154, %119
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [300009 x %"class.std::vector"], ptr @a, i64 0, i64 %98
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #7
  %100 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %99) #7
  store ptr %100, ptr %14, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #7
  %101 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %99) #7
  store ptr %101, ptr %15, align 8
  %102 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  br i1 %102, label %.lr.ph149, label %._crit_edge150

.lr.ph149:                                        ; preds = %95
  %103 = getelementptr inbounds [300009 x i32], ptr @want, i64 0, i64 %98
  br label %104

104:                                              ; preds = %.lr.ph149, %111
  %.081147 = phi i64 [ 0, %.lr.ph149 ], [ %108, %111 ]
  %105 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #7
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = call noundef i64 @_ZN3BITIxE5queryEi(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef %106)
  %108 = add nsw i64 %107, %.081147
  %109 = load i32, ptr %103, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %.not117 = icmp slt i64 %108, %110
  br i1 %.not117, label %111, label %._crit_edge150

111:                                              ; preds = %104
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #7
  %113 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  br i1 %113, label %104, label %._crit_edge150

._crit_edge150:                                   ; preds = %104, %111, %95
  %.182 = phi i64 [ 0, %95 ], [ %108, %111 ], [ %108, %104 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  %114 = getelementptr inbounds [300009 x i32], ptr @want, i64 0, i64 %98
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %.not118 = icmp slt i64 %.182, %116
  br i1 %.not118, label %119, label %117

117:                                              ; preds = %._crit_edge150
  %118 = getelementptr inbounds [300009 x i32], ptr @r, i64 0, i64 %98
  store i32 %94, ptr %118, align 4, !tbaa !5
  br label %119

119:                                              ; preds = %._crit_edge150, %117
  %l.sink = phi ptr [ @ans, %117 ], [ @l, %._crit_edge150 ]
  %.sink.in = phi i64 [ %indvars.iv188, %117 ], [ %92, %._crit_edge150 ]
  %.sink = trunc i64 %.sink.in to i32
  %120 = getelementptr inbounds [300009 x i32], ptr %l.sink, i64 0, i64 %98
  store i32 %.sink, ptr %120, align 4, !tbaa !5
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %122 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  br i1 %122, label %95, label %._crit_edge155

._crit_edge162:                                   ; preds = %.lr.ph161, %.preheader120, %.preheader119
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #7
  store i32 1, ptr %16, align 4, !tbaa !5
  br i1 %.not102125, label %.preheader.thread, label %.lr.ph167

.preheader.thread:                                ; preds = %._crit_edge162
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #7
  call void @_ZN3BITIxED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #7
  br label %._crit_edge173

.lr.ph161:                                        ; preds = %.preheader119, %.lr.ph161
  %indvars.iv193 = phi i64 [ %indvars.iv.next194, %.lr.ph161 ], [ 1, %.preheader119 ]
  %123 = getelementptr inbounds [300009 x %"class.std::vector"], ptr @mid, i64 0, i64 %indvars.iv193
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %123) #7
  %indvars.iv.next194 = add nuw nsw i64 %indvars.iv193, 1
  %exitcond197.not = icmp eq i64 %indvars.iv.next194, %wide.trip.count196
  br i1 %exitcond197.not, label %._crit_edge162, label %.lr.ph161, !llvm.loop !19

._crit_edge168:                                   ; preds = %137
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #7
  %.not112 = icmp eq i32 %.1, 0
  call void @_ZN3BITIxED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #7
  br i1 %.not112, label %67, label %.preheader

.preheader:                                       ; preds = %._crit_edge168
  br i1 %.not102125, label %._crit_edge173, label %.lr.ph172.preheader

.lr.ph172.preheader:                              ; preds = %.preheader
  %124 = add nuw i32 %18, 1
  %wide.trip.count201 = zext i32 %124 to i64
  br label %.lr.ph172

.lr.ph167:                                        ; preds = %._crit_edge162, %137
  %.078165 = phi i32 [ %.1, %137 ], [ 1, %._crit_edge162 ]
  %storemerge110164 = phi i32 [ %139, %137 ], [ 1, %._crit_edge162 ]
  %125 = sext i32 %storemerge110164 to i64
  %126 = getelementptr inbounds [300009 x i32], ptr @l, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = getelementptr inbounds [300009 x i32], ptr @r, i64 0, i64 %125
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %.not114 = icmp sgt i32 %127, %129
  br i1 %.not114, label %137, label %130

130:                                              ; preds = %.lr.ph167
  %131 = add nsw i32 %129, %127
  %132 = ashr i32 %131, 1
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [300009 x %"class.std::vector"], ptr @mid, i64 0, i64 %133
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %134, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %._crit_edge203 unwind label %135

._crit_edge203:                                   ; preds = %130
  %.pre = load i32, ptr %16, align 4, !tbaa !5
  br label %137

135:                                              ; preds = %130
  %136 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #7
  br label %140

137:                                              ; preds = %._crit_edge203, %.lr.ph167
  %138 = phi i32 [ %storemerge110164, %.lr.ph167 ], [ %.pre, %._crit_edge203 ]
  %.1 = phi i32 [ %.078165, %.lr.ph167 ], [ 0, %._crit_edge203 ]
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %16, align 4, !tbaa !5
  %.not111.not = icmp slt i32 %138, %18
  br i1 %.not111.not, label %.lr.ph167, label %._crit_edge168, !llvm.loop !20

140:                                              ; preds = %135, %77, %68
  %.pn = phi { ptr, i32 } [ %78, %77 ], [ %136, %135 ], [ %69, %68 ]
  call void @_ZN3BITIxED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #7
  resume { ptr, i32 } %.pn

._crit_edge173:                                   ; preds = %148, %.preheader.thread, %.preheader
  ret i32 0

.lr.ph172:                                        ; preds = %.lr.ph172.preheader, %148
  %indvars.iv198 = phi i64 [ 1, %.lr.ph172.preheader ], [ %indvars.iv.next199, %148 ]
  %141 = getelementptr inbounds [300009 x i32], ptr @ans, i64 0, i64 %indvars.iv198
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = icmp eq i32 %142, -1
  br i1 %143, label %144, label %146

144:                                              ; preds = %.lr.ph172
  %145 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.4)
  br label %148

146:                                              ; preds = %.lr.ph172
  %147 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %142)
  br label %148

148:                                              ; preds = %144, %146
  %indvars.iv.next199 = add nuw nsw i64 %indvars.iv198, 1
  %exitcond202.not = icmp eq i64 %indvars.iv.next199, %wide.trip.count201
  br i1 %exitcond202.not, label %._crit_edge173, label %.lr.ph172, !llvm.loop !21
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3BITIxEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3BITIxE4initEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3BITIxE3updEiix(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef, i64 noundef) local_unnamed_addr #3 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN3BITIxE5queryEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #5 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3BITIxED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

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

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

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

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

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass