; LLVM IR from wesley-a-leung/Resources :: Tests/C++/datastructures/trees/fenwicktrees/BitFenwickTreeFuzzTest.ll (Z5test2v)

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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::chrono::time_point" = type { %"class.std::chrono::duration" }
%"class.std::chrono::duration" = type { i64 }
%"class.std::mersenne_twister_engine" = type { [312 x i64], i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%struct.FenwickTree1D = type <{ i32, [4 x i8], %"class.std::vector", [8 x i8] }>
%"struct.std::plus" = type { i8 }
%struct.BitFenwickTree = type { i32, i32, %"class.std::vector.0", %"class.std::vector" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::minus" = type { i8 }
%"struct.std::less" = type { i8 }
%"struct.std::less_equal" = type { i8 }
%"struct.std::_Setprecision" = type { i32 }

@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [129 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [13 x i8], align 1
@__PRETTY_FUNCTION__._Z5test2v = external hidden unnamed_addr constant [13 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [60 x i8], align 1

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

; Function Attrs: nounwind
declare i64 @_ZNSt6chrono3_V212system_clock3nowEv() #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEC2Em(ptr noundef nonnull align 8 dereferenceable(2504), i64 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEclEv(ptr noundef nonnull align 8 dereferenceable(2504)) #2 align 2

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 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)) #3 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)) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13FenwickTree1DIiSt4plusIiEEC2ESt6vectorIiSaIiEEiS1_(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef, i32 noundef) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN14BitFenwickTreeC2Ei(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN14BitFenwickTree3setEib(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i1 noundef zeroext) #3 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN14BitFenwickTree6updateEib(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i1 noundef zeroext) #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN13FenwickTree1DIiSt4plusIiEE5queryISt5minusIiEEEiiiT_(ptr noundef nonnull align 8 dereferenceable(33), i32 noundef, i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN14BitFenwickTree5queryEii(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZSteqIiSaIiEEbRKSt6vectorIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #5

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #6

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local i32 @_ZSt12setprecisioni(i32 noundef) #4

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5test2v() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::chrono::time_point", align 8
  %2 = alloca %"class.std::mersenne_twister_engine", align 8
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca %"class.std::allocator", align 1
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca ptr, align 8
  %16 = alloca %struct.FenwickTree1D, align 8
  %17 = alloca %"class.std::vector", align 8
  %18 = alloca %"struct.std::plus", align 1
  %19 = alloca %struct.BitFenwickTree, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca %"class.std::vector", align 8
  %23 = alloca %"class.std::vector", 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
  %31 = alloca %"struct.std::minus", align 1
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca %"struct.std::less", align 1
  %37 = alloca i32, align 4
  %38 = alloca %"struct.std::less", align 1
  %39 = alloca i32, align 4
  %40 = alloca i32, align 4
  %41 = alloca i32, align 4
  %42 = alloca %"struct.std::less_equal", align 1
  %43 = alloca i32, align 4
  %44 = alloca %"struct.std::less_equal", align 1
  %45 = alloca ptr, align 8
  %46 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %47 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %48 = alloca ptr, align 8
  %49 = alloca %"class.std::chrono::time_point", align 8
  %50 = alloca double, align 8
  %51 = alloca %"class.std::chrono::duration", align 8
  %52 = alloca %"struct.std::_Setprecision", align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #7
  %53 = call i64 @_ZNSt6chrono3_V212system_clock3nowEv() #7
  %54 = getelementptr inbounds %"class.std::chrono::time_point", ptr %1, i32 0, i32 0
  %55 = getelementptr inbounds %"class.std::chrono::duration", ptr %54, i32 0, i32 0
  store i64 %53, ptr %55, align 8
  call void @llvm.lifetime.start.p0(i64 2504, ptr %2) #7
  call void @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEC2Em(ptr noundef nonnull align 8 dereferenceable(2504) %2, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 50000, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  store i64 0, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %375, %0
  %57 = load i32, ptr %5, align 4, !tbaa !5
  %58 = icmp slt i32 %57, 50000
  br i1 %58, label %60, label %59

59:                                               ; preds = %56
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %385

60:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %61 = call noundef i64 @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEclEv(ptr noundef nonnull align 8 dereferenceable(2504) %2)
  %62 = urem i64 %61, 1001
  %63 = trunc i64 %62 to i32
  store i32 %63, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #7
  %64 = load i32, ptr %7, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #7
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #7
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %65, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %66 unwind label %76

66:                                               ; preds = %60
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  store ptr %8, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %67 = load ptr, ptr %12, align 8, !tbaa !11
  %68 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %67) #7
  %69 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %68, ptr %69, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %70 = load ptr, ptr %12, align 8, !tbaa !11
  %71 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %70) #7
  %72 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %71, ptr %72, align 8
  br label %73

73:                                               ; preds = %87, %66
  %74 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #7
  br i1 %74, label %80, label %75

75:                                               ; preds = %73
  store i32 5, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %93

76:                                               ; preds = %60
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %10, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %11, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #7
  br label %384

80:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %81 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  store ptr %81, ptr %15, align 8, !tbaa !11
  %82 = invoke noundef i64 @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEclEv(ptr noundef nonnull align 8 dereferenceable(2504) %2)
          to label %83 unwind label %89

83:                                               ; preds = %80
  %84 = urem i64 %82, 2
  %85 = trunc i64 %84 to i32
  %86 = load ptr, ptr %15, align 8, !tbaa !11
  store i32 %85, ptr %86, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %87

87:                                               ; preds = %83
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  br label %73

89:                                               ; preds = %80
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %10, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %383

93:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 40, ptr %16) #7
  invoke void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %94 unwind label %103

94:                                               ; preds = %93
  invoke void @_ZN13FenwickTree1DIiSt4plusIiEEC2ESt6vectorIiSaIiEEiS1_(ptr noundef nonnull align 8 dereferenceable(33) %16, ptr noundef %17, i32 noundef 0)
          to label %95 unwind label %107

95:                                               ; preds = %94
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #7
  call void @llvm.lifetime.start.p0(i64 56, ptr %19) #7
  %96 = load i32, ptr %7, align 4, !tbaa !5
  invoke void @_ZN14BitFenwickTreeC2Ei(ptr noundef nonnull align 8 dereferenceable(56) %19, i32 noundef %96)
          to label %97 unwind label %111

97:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %123, %97
  %99 = load i32, ptr %20, align 4, !tbaa !5
  %100 = load i32, ptr %7, align 4, !tbaa !5
  %101 = icmp slt i32 %99, %100
  br i1 %101, label %115, label %102

102:                                              ; preds = %98
  store i32 7, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %130

103:                                              ; preds = %93
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %10, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %11, align 4
  br label %382

107:                                              ; preds = %94
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %10, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %11, align 4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #7
  br label %382

111:                                              ; preds = %95
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %10, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %11, align 4
  br label %381

115:                                              ; preds = %98
  %116 = load i32, ptr %20, align 4, !tbaa !5
  %117 = load i32, ptr %20, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %118) #7
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = icmp ne i32 %120, 0
  invoke void @_ZN14BitFenwickTree3setEib(ptr noundef nonnull align 8 dereferenceable(56) %19, i32 noundef %116, i1 noundef zeroext %121)
          to label %122 unwind label %126

122:                                              ; preds = %115
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %20, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %20, align 4, !tbaa !5
  br label %98, !llvm.loop !13

126:                                              ; preds = %115
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %10, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %380

130:                                              ; preds = %102
  invoke void @_ZN14BitFenwickTree5buildEv(ptr noundef nonnull align 8 dereferenceable(56) %19)
          to label %131 unwind label %148

131:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %132 = load i32, ptr %7, align 4, !tbaa !5
  %133 = icmp eq i32 %132, 0
  br i1 %133, label %134, label %135

134:                                              ; preds = %131
  br label %140

135:                                              ; preds = %131
  %136 = invoke noundef i64 @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEclEv(ptr noundef nonnull align 8 dereferenceable(2504) %2)
          to label %137 unwind label %152

137:                                              ; preds = %135
  %138 = urem i64 %136, 5
  %139 = sub i64 1000, %138
  br label %140

140:                                              ; preds = %137, %134
  %141 = phi i64 [ 0, %134 ], [ %139, %137 ]
  %142 = trunc i64 %141 to i32
  store i32 %142, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #7
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #7
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 0, ptr %24, align 4, !tbaa !5
  br label %143

143:                                              ; preds = %340, %140
  %144 = load i32, ptr %24, align 4, !tbaa !5
  %145 = load i32, ptr %21, align 4, !tbaa !5
  %146 = icmp slt i32 %144, %145
  br i1 %146, label %156, label %147

147:                                              ; preds = %143
  store i32 10, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %344

148:                                              ; preds = %130
  %149 = landingpad { ptr, i32 }
          cleanup
  %150 = extractvalue { ptr, i32 } %149, 0
  store ptr %150, ptr %10, align 8
  %151 = extractvalue { ptr, i32 } %149, 1
  store i32 %151, ptr %11, align 4
  br label %380

152:                                              ; preds = %135
  %153 = landingpad { ptr, i32 }
          cleanup
  %154 = extractvalue { ptr, i32 } %153, 0
  store ptr %154, ptr %10, align 8
  %155 = extractvalue { ptr, i32 } %153, 1
  store i32 %155, ptr %11, align 4
  br label %379

156:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  %157 = invoke noundef i64 @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEclEv(ptr noundef nonnull align 8 dereferenceable(2504) %2)
          to label %158 unwind label %190

158:                                              ; preds = %156
  %159 = urem i64 %157, 4
  %160 = trunc i64 %159 to i32
  store i32 %160, ptr %25, align 4, !tbaa !5
  %161 = load i32, ptr %25, align 4, !tbaa !5
  %162 = icmp eq i32 %161, 0
  br i1 %162, label %163, label %203

163:                                              ; preds = %158
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  %164 = invoke noundef i64 @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEclEv(ptr noundef nonnull align 8 dereferenceable(2504) %2)
          to label %165 unwind label %194

165:                                              ; preds = %163
  %166 = load i32, ptr %7, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = urem i64 %164, %167
  %169 = trunc i64 %168 to i32
  store i32 %169, ptr %26, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  %170 = invoke noundef i64 @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEclEv(ptr noundef nonnull align 8 dereferenceable(2504) %2)
          to label %171 unwind label %198

171:                                              ; preds = %165
  %172 = urem i64 %170, 2
  %173 = trunc i64 %172 to i32
  store i32 %173, ptr %27, align 4, !tbaa !5
  %174 = load i32, ptr %26, align 4, !tbaa !5
  %175 = load i32, ptr %27, align 4, !tbaa !5
  %176 = load i32, ptr %26, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %177) #7
  %179 = load i32, ptr %178, align 4, !tbaa !5
  %180 = sub nsw i32 %175, %179
  invoke void @_ZN13FenwickTree1DIiSt4plusIiEE6updateEii(ptr noundef nonnull align 8 dereferenceable(33) %16, i32 noundef %174, i32 noundef %180)
          to label %181 unwind label %198

181:                                              ; preds = %171
  %182 = load i32, ptr %27, align 4, !tbaa !5
  %183 = load i32, ptr %26, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %184) #7
  store i32 %182, ptr %185, align 4, !tbaa !5
  %186 = load i32, ptr %26, align 4, !tbaa !5
  %187 = load i32, ptr %27, align 4, !tbaa !5
  %188 = icmp ne i32 %187, 0
  invoke void @_ZN14BitFenwickTree6updateEib(ptr noundef nonnull align 8 dereferenceable(56) %19, i32 noundef %186, i1 noundef zeroext %188)
          to label %189 unwind label %198

189:                                              ; preds = %181
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %339

190:                                              ; preds = %156
  %191 = landingpad { ptr, i32 }
          cleanup
  %192 = extractvalue { ptr, i32 } %191, 0
  store ptr %192, ptr %10, align 8
  %193 = extractvalue { ptr, i32 } %191, 1
  store i32 %193, ptr %11, align 4
  br label %343

194:                                              ; preds = %163
  %195 = landingpad { ptr, i32 }
          cleanup
  %196 = extractvalue { ptr, i32 } %195, 0
  store ptr %196, ptr %10, align 8
  %197 = extractvalue { ptr, i32 } %195, 1
  store i32 %197, ptr %11, align 4
  br label %202

198:                                              ; preds = %181, %171, %165
  %199 = landingpad { ptr, i32 }
          cleanup
  %200 = extractvalue { ptr, i32 } %199, 0
  store ptr %200, ptr %10, align 8
  %201 = extractvalue { ptr, i32 } %199, 1
  store i32 %201, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  br label %202

202:                                              ; preds = %198, %194
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %343

203:                                              ; preds = %158
  %204 = load i32, ptr %25, align 4, !tbaa !5
  %205 = icmp eq i32 %204, 1
  br i1 %205, label %206, label %252

206:                                              ; preds = %203
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  %207 = invoke noundef i64 @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEclEv(ptr noundef nonnull align 8 dereferenceable(2504) %2)
          to label %208 unwind label %223

208:                                              ; preds = %206
  %209 = load i32, ptr %7, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = urem i64 %207, %210
  %212 = trunc i64 %211 to i32
  store i32 %212, ptr %28, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  %213 = invoke noundef i64 @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEclEv(ptr noundef nonnull align 8 dereferenceable(2504) %2)
          to label %214 unwind label %227

214:                                              ; preds = %208
  %215 = load i32, ptr %7, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = urem i64 %213, %216
  %218 = trunc i64 %217 to i32
  store i32 %218, ptr %29, align 4, !tbaa !5
  %219 = load i32, ptr %28, align 4, !tbaa !5
  %220 = load i32, ptr %29, align 4, !tbaa !5
  %221 = icmp sgt i32 %219, %220
  br i1 %221, label %222, label %231

222:                                              ; preds = %214
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %28, ptr noundef nonnull align 4 dereferenceable(4) %29) #7
  br label %231

223:                                              ; preds = %206
  %224 = landingpad { ptr, i32 }
          cleanup
  %225 = extractvalue { ptr, i32 } %224, 0
  store ptr %225, ptr %10, align 8
  %226 = extractvalue { ptr, i32 } %224, 1
  store i32 %226, ptr %11, align 4
  br label %251

227:                                              ; preds = %208
  %228 = landingpad { ptr, i32 }
          cleanup
  %229 = extractvalue { ptr, i32 } %228, 0
  store ptr %229, ptr %10, align 8
  %230 = extractvalue { ptr, i32 } %228, 1
  store i32 %230, ptr %11, align 4
  br label %250

231:                                              ; preds = %222, %214
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  %232 = load i32, ptr %28, align 4, !tbaa !5
  %233 = load i32, ptr %29, align 4, !tbaa !5
  %234 = invoke noundef i32 @_ZN13FenwickTree1DIiSt4plusIiEE5queryISt5minusIiEEEiiiT_(ptr noundef nonnull align 8 dereferenceable(33) %16, i32 noundef %232, i32 noundef %233)
          to label %235 unwind label %242

235:                                              ; preds = %231
  store i32 %234, ptr %30, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 4 dereferenceable(4) %30)
          to label %236 unwind label %242

236:                                              ; preds = %235
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #7
  %237 = load i32, ptr %28, align 4, !tbaa !5
  %238 = load i32, ptr %29, align 4, !tbaa !5
  %239 = invoke noundef i32 @_ZN14BitFenwickTree5queryEii(ptr noundef nonnull align 8 dereferenceable(56) %19, i32 noundef %237, i32 noundef %238)
          to label %240 unwind label %246

240:                                              ; preds = %236
  store i32 %239, ptr %32, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 4 dereferenceable(4) %32)
          to label %241 unwind label %246

241:                                              ; preds = %240
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  br label %338

242:                                              ; preds = %235, %231
  %243 = landingpad { ptr, i32 }
          cleanup
  %244 = extractvalue { ptr, i32 } %243, 0
  store ptr %244, ptr %10, align 8
  %245 = extractvalue { ptr, i32 } %243, 1
  store i32 %245, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  br label %250

246:                                              ; preds = %240, %236
  %247 = landingpad { ptr, i32 }
          cleanup
  %248 = extractvalue { ptr, i32 } %247, 0
  store ptr %248, ptr %10, align 8
  %249 = extractvalue { ptr, i32 } %247, 1
  store i32 %249, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #7
  br label %250

250:                                              ; preds = %246, %242, %227
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  br label %251

251:                                              ; preds = %250, %223
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  br label %343

252:                                              ; preds = %203
  %253 = load i32, ptr %25, align 4, !tbaa !5
  %254 = icmp eq i32 %253, 2
  br i1 %254, label %255, label %294

255:                                              ; preds = %252
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #7
  %256 = load i32, ptr %7, align 4, !tbaa !5
  %257 = sub nsw i32 %256, 1
  %258 = invoke noundef i32 @_ZN13FenwickTree1DIiSt4plusIiEE5queryEi(ptr noundef nonnull align 8 dereferenceable(33) %16, i32 noundef %257)
          to label %259 unwind label %276

259:                                              ; preds = %255
  %260 = mul nsw i32 %258, 2
  %261 = add nsw i32 %260, 1
  store i32 %261, ptr %33, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #7
  %262 = invoke noundef i64 @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEclEv(ptr noundef nonnull align 8 dereferenceable(2504) %2)
          to label %263 unwind label %280

263:                                              ; preds = %259
  %264 = load i32, ptr %33, align 4, !tbaa !5
  %265 = sext i32 %264 to i64
  %266 = urem i64 %262, %265
  %267 = trunc i64 %266 to i32
  store i32 %267, ptr %34, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #7
  %268 = load i32, ptr %34, align 4, !tbaa !5
  %269 = invoke noundef i32 @_ZN13FenwickTree1DIiSt4plusIiEE7bsearchISt4lessIiEEEiiT_(ptr noundef nonnull align 8 dereferenceable(33) %16, i32 noundef %268)
          to label %270 unwind label %284

270:                                              ; preds = %263
  store i32 %269, ptr %35, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 4 dereferenceable(4) %35)
          to label %271 unwind label %284

271:                                              ; preds = %270
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #7
  %272 = load i32, ptr %34, align 4, !tbaa !5
  %273 = invoke noundef i32 @_ZN14BitFenwickTree7bsearchISt4lessIiEEEiiT_(ptr noundef nonnull align 8 dereferenceable(56) %19, i32 noundef %272)
          to label %274 unwind label %288

274:                                              ; preds = %271
  store i32 %273, ptr %37, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 4 dereferenceable(4) %37)
          to label %275 unwind label %288

275:                                              ; preds = %274
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #7
  br label %337

276:                                              ; preds = %255
  %277 = landingpad { ptr, i32 }
          cleanup
  %278 = extractvalue { ptr, i32 } %277, 0
  store ptr %278, ptr %10, align 8
  %279 = extractvalue { ptr, i32 } %277, 1
  store i32 %279, ptr %11, align 4
  br label %293

280:                                              ; preds = %259
  %281 = landingpad { ptr, i32 }
          cleanup
  %282 = extractvalue { ptr, i32 } %281, 0
  store ptr %282, ptr %10, align 8
  %283 = extractvalue { ptr, i32 } %281, 1
  store i32 %283, ptr %11, align 4
  br label %292

284:                                              ; preds = %270, %263
  %285 = landingpad { ptr, i32 }
          cleanup
  %286 = extractvalue { ptr, i32 } %285, 0
  store ptr %286, ptr %10, align 8
  %287 = extractvalue { ptr, i32 } %285, 1
  store i32 %287, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #7
  br label %292

288:                                              ; preds = %274, %271
  %289 = landingpad { ptr, i32 }
          cleanup
  %290 = extractvalue { ptr, i32 } %289, 0
  store ptr %290, ptr %10, align 8
  %291 = extractvalue { ptr, i32 } %289, 1
  store i32 %291, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #7
  br label %292

292:                                              ; preds = %288, %284, %280
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #7
  br label %293

293:                                              ; preds = %292, %276
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #7
  br label %343

294:                                              ; preds = %252
  %295 = load i32, ptr %25, align 4, !tbaa !5
  %296 = icmp eq i32 %295, 3
  br i1 %296, label %297, label %336

297:                                              ; preds = %294
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #7
  %298 = load i32, ptr %7, align 4, !tbaa !5
  %299 = sub nsw i32 %298, 1
  %300 = invoke noundef i32 @_ZN13FenwickTree1DIiSt4plusIiEE5queryEi(ptr noundef nonnull align 8 dereferenceable(33) %16, i32 noundef %299)
          to label %301 unwind label %318

301:                                              ; preds = %297
  %302 = mul nsw i32 %300, 2
  %303 = add nsw i32 %302, 1
  store i32 %303, ptr %39, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #7
  %304 = invoke noundef i64 @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEclEv(ptr noundef nonnull align 8 dereferenceable(2504) %2)
          to label %305 unwind label %322

305:                                              ; preds = %301
  %306 = load i32, ptr %39, align 4, !tbaa !5
  %307 = sext i32 %306 to i64
  %308 = urem i64 %304, %307
  %309 = trunc i64 %308 to i32
  store i32 %309, ptr %40, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #7
  %310 = load i32, ptr %40, align 4, !tbaa !5
  %311 = invoke noundef i32 @_ZN13FenwickTree1DIiSt4plusIiEE7bsearchISt10less_equalIiEEEiiT_(ptr noundef nonnull align 8 dereferenceable(33) %16, i32 noundef %310)
          to label %312 unwind label %326

312:                                              ; preds = %305
  store i32 %311, ptr %41, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 4 dereferenceable(4) %41)
          to label %313 unwind label %326

313:                                              ; preds = %312
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #7
  %314 = load i32, ptr %40, align 4, !tbaa !5
  %315 = invoke noundef i32 @_ZN14BitFenwickTree7bsearchISt10less_equalIiEEEiiT_(ptr noundef nonnull align 8 dereferenceable(56) %19, i32 noundef %314)
          to label %316 unwind label %330

316:                                              ; preds = %313
  store i32 %315, ptr %43, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 4 dereferenceable(4) %43)
          to label %317 unwind label %330

317:                                              ; preds = %316
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #7
  br label %336

318:                                              ; preds = %297
  %319 = landingpad { ptr, i32 }
          cleanup
  %320 = extractvalue { ptr, i32 } %319, 0
  store ptr %320, ptr %10, align 8
  %321 = extractvalue { ptr, i32 } %319, 1
  store i32 %321, ptr %11, align 4
  br label %335

322:                                              ; preds = %301
  %323 = landingpad { ptr, i32 }
          cleanup
  %324 = extractvalue { ptr, i32 } %323, 0
  store ptr %324, ptr %10, align 8
  %325 = extractvalue { ptr, i32 } %323, 1
  store i32 %325, ptr %11, align 4
  br label %334

326:                                              ; preds = %312, %305
  %327 = landingpad { ptr, i32 }
          cleanup
  %328 = extractvalue { ptr, i32 } %327, 0
  store ptr %328, ptr %10, align 8
  %329 = extractvalue { ptr, i32 } %327, 1
  store i32 %329, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #7
  br label %334

330:                                              ; preds = %316, %313
  %331 = landingpad { ptr, i32 }
          cleanup
  %332 = extractvalue { ptr, i32 } %331, 0
  store ptr %332, ptr %10, align 8
  %333 = extractvalue { ptr, i32 } %331, 1
  store i32 %333, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #7
  br label %334

334:                                              ; preds = %330, %326, %322
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #7
  br label %335

335:                                              ; preds = %334, %318
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #7
  br label %343

336:                                              ; preds = %317, %294
  br label %337

337:                                              ; preds = %336, %275
  br label %338

338:                                              ; preds = %337, %241
  br label %339

339:                                              ; preds = %338, %189
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %340

340:                                              ; preds = %339
  %341 = load i32, ptr %24, align 4, !tbaa !5
  %342 = add nsw i32 %341, 1
  store i32 %342, ptr %24, align 4, !tbaa !5
  br label %143, !llvm.loop !15

343:                                              ; preds = %335, %293, %251, %202, %190
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %378

344:                                              ; preds = %147
  %345 = invoke noundef zeroext i1 @_ZSteqIiSaIiEEbRKSt6vectorIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 8 dereferenceable(24) %23)
          to label %346 unwind label %349

346:                                              ; preds = %344
  br i1 %345, label %347, label %348

347:                                              ; preds = %346
  br label %354

348:                                              ; preds = %346
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 86, ptr noundef @__PRETTY_FUNCTION__._Z5test2v) #8
  unreachable

349:                                              ; preds = %344
  %350 = landingpad { ptr, i32 }
          cleanup
  %351 = extractvalue { ptr, i32 } %350, 0
  store ptr %351, ptr %10, align 8
  %352 = extractvalue { ptr, i32 } %350, 1
  store i32 %352, ptr %11, align 4
  br label %378

353:                                              ; No predecessors!
  br label %354

354:                                              ; preds = %353, %347
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #7
  store ptr %22, ptr %45, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #7
  %355 = load ptr, ptr %45, align 8, !tbaa !11
  %356 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %355) #7
  %357 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %46, i32 0, i32 0
  store ptr %356, ptr %357, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #7
  %358 = load ptr, ptr %45, align 8, !tbaa !11
  %359 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %358) #7
  %360 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %47, i32 0, i32 0
  store ptr %359, ptr %360, align 8
  br label %361

361:                                              ; preds = %372, %354
  %362 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull align 8 dereferenceable(8) %47) #7
  br i1 %362, label %364, label %363

363:                                              ; preds = %361
  store i32 13, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #7
  br label %374

364:                                              ; preds = %361
  call void @llvm.lifetime.start.p0(i64 8, ptr %48) #7
  %365 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %46) #7
  store ptr %365, ptr %48, align 8, !tbaa !11
  %366 = load i64, ptr %4, align 8, !tbaa !9
  %367 = mul nsw i64 31, %366
  %368 = load ptr, ptr %48, align 8, !tbaa !11
  %369 = load i32, ptr %368, align 4, !tbaa !5
  %370 = sext i32 %369 to i64
  %371 = add nsw i64 %367, %370
  store i64 %371, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #7
  br label %372

372:                                              ; preds = %364
  %373 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %46) #7
  br label %361

374:                                              ; preds = %363
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @_ZN14BitFenwickTreeD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %19) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr %19) #7
  call void @_ZN13FenwickTree1DIiSt4plusIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(33) %16) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr %16) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %375

375:                                              ; preds = %374
  %376 = load i32, ptr %5, align 4, !tbaa !5
  %377 = add nsw i32 %376, 1
  store i32 %377, ptr %5, align 4, !tbaa !5
  br label %56, !llvm.loop !16

378:                                              ; preds = %349, %343
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #7
  br label %379

379:                                              ; preds = %378, %152
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %380

380:                                              ; preds = %379, %148, %126
  call void @_ZN14BitFenwickTreeD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %19) #7
  br label %381

381:                                              ; preds = %380, %111
  call void @llvm.lifetime.end.p0(i64 56, ptr %19) #7
  call void @_ZN13FenwickTree1DIiSt4plusIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(33) %16) #7
  br label %382

382:                                              ; preds = %381, %107, %103
  call void @llvm.lifetime.end.p0(i64 40, ptr %16) #7
  br label %383

383:                                              ; preds = %382, %89
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  br label %384

384:                                              ; preds = %383, %76
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 2504, ptr %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #7
  br label %411

385:                                              ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %49) #7
  %386 = call i64 @_ZNSt6chrono3_V212system_clock3nowEv() #7
  %387 = getelementptr inbounds %"class.std::chrono::time_point", ptr %49, i32 0, i32 0
  %388 = getelementptr inbounds %"class.std::chrono::duration", ptr %387, i32 0, i32 0
  store i64 %386, ptr %388, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %50) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %51) #7
  %389 = call i64 @_ZNSt6chronomiINS_3_V212system_clockENS_8durationIlSt5ratioILl1ELl1000000000EEEES6_EENSt11common_typeIJT0_T1_EE4typeERKNS_10time_pointIT_S8_EERKNSC_ISD_S9_EE(ptr noundef nonnull align 8 dereferenceable(8) %49, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %390 = getelementptr inbounds %"class.std::chrono::duration", ptr %51, i32 0, i32 0
  store i64 %389, ptr %390, align 8
  %391 = call noundef i64 @_ZNKSt6chrono8durationIlSt5ratioILl1ELl1000000000EEE5countEv(ptr noundef nonnull align 8 dereferenceable(8) %51)
  %392 = sitofp i64 %391 to double
  %393 = fdiv double %392, 1.000000e+09
  call void @llvm.lifetime.end.p0(i64 8, ptr %51) #7
  store double %393, ptr %50, align 8, !tbaa !17
  %394 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.6)
  %395 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %394, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %396 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
  %397 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) %396, ptr noundef @_ZSt5fixedRSt8ios_base)
  %398 = call i32 @_ZSt12setprecisioni(i32 noundef 3)
  %399 = getelementptr inbounds %"struct.std::_Setprecision", ptr %52, i32 0, i32 0
  store i32 %398, ptr %399, align 4
  %400 = getelementptr inbounds %"struct.std::_Setprecision", ptr %52, i32 0, i32 0
  %401 = load i32, ptr %400, align 4
  %402 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %397, i32 %401)
  %403 = load double, ptr %50, align 8, !tbaa !17
  %404 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %402, double noundef %403)
  %405 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %404, ptr noundef @.str.4)
  %406 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %405, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %407 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.5)
  %408 = load i64, ptr %4, align 8, !tbaa !9
  %409 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %407, i64 noundef %408)
  %410 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %409, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %50) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 2504, ptr %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #7
  ret void

411:                                              ; preds = %384
  %412 = load ptr, ptr %10, align 8
  %413 = load i32, ptr %11, align 4
  %414 = insertvalue { ptr, i32 } poison, ptr %412, 0
  %415 = insertvalue { ptr, i32 } %414, i32 %413, 1
  resume { ptr, i32 } %415
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN13FenwickTree1DIiSt4plusIiEE5queryEi(ptr noundef nonnull align 8 dereferenceable(33), i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN13FenwickTree1DIiSt4plusIiEE7bsearchISt4lessIiEEEiiT_(ptr noundef nonnull align 8 dereferenceable(33), i32 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN14BitFenwickTree7bsearchISt4lessIiEEEiiT_(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN13FenwickTree1DIiSt4plusIiEE7bsearchISt10less_equalIiEEEiiT_(ptr noundef nonnull align 8 dereferenceable(33), i32 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN14BitFenwickTree7bsearchISt10less_equalIiEEEiiT_(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #3 align 2

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


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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::chrono::time_point" = type { %"class.std::chrono::duration" }
%"class.std::chrono::duration" = type { i64 }
%"class.std::mersenne_twister_engine" = type { [312 x i64], i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%struct.FenwickTree1D = type <{ i32, [4 x i8], %"class.std::vector", [8 x i8] }>
%struct.BitFenwickTree = type { i32, i32, %"class.std::vector.0", %"class.std::vector" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [129 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [13 x i8], align 1
@__PRETTY_FUNCTION__._Z5test2v = external hidden unnamed_addr constant [13 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [60 x i8], align 1

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

; Function Attrs: nounwind
declare i64 @_ZNSt6chrono3_V212system_clock3nowEv() local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEC2Em(ptr noundef nonnull align 8 dereferenceable(2504), i64 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEclEv(ptr noundef nonnull align 8 dereferenceable(2504)) local_unnamed_addr #2 align 2

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 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 #3 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 #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13FenwickTree1DIiSt4plusIiEEC2ESt6vectorIiSaIiEEiS1_(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef, i32 noundef) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN14BitFenwickTreeC2Ei(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN14BitFenwickTree3setEib(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i1 noundef zeroext) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN14BitFenwickTree5buildEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN14BitFenwickTree6updateEib(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i1 noundef zeroext) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN13FenwickTree1DIiSt4plusIiEE5queryISt5minusIiEEEiiiT_(ptr noundef nonnull align 8 dereferenceable(33), i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN14BitFenwickTree5queryEii(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZSteqIiSaIiEEbRKSt6vectorIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #6

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8), i32) local_unnamed_addr #5

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local i32 @_ZSt12setprecisioni(i32 noundef) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5test2v() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::chrono::time_point", align 8
  %2 = alloca %"class.std::mersenne_twister_engine", align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %struct.FenwickTree1D, align 8
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca %struct.BitFenwickTree, align 8
  %10 = alloca %"class.std::vector", align 8
  %11 = alloca %"class.std::vector", align 8
  %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 %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %22 = alloca %"class.std::chrono::time_point", align 8
  %23 = alloca %"class.std::chrono::duration", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  %24 = tail call i64 @_ZNSt6chrono3_V212system_clock3nowEv() #8
  store i64 %24, ptr %1, align 8
  call void @llvm.lifetime.start.p0(i64 2504, ptr nonnull %2) #8
  call void @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEC2Em(ptr noundef nonnull align 8 dereferenceable(2504) %2, i64 noundef 0)
  br label %43

25:                                               ; preds = %._crit_edge112
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #8
  %26 = call i64 @_ZNSt6chrono3_V212system_clock3nowEv() #8
  store i64 %26, ptr %22, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %23) #8
  %27 = call i64 @_ZNSt6chronomiINS_3_V212system_clockENS_8durationIlSt5ratioILl1ELl1000000000EEEES6_EENSt11common_typeIJT0_T1_EE4typeERKNS_10time_pointIT_S8_EERKNSC_ISD_S9_EE(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %1)
  store i64 %27, ptr %23, align 8
  %28 = call noundef i64 @_ZNKSt6chrono8durationIlSt5ratioILl1ELl1000000000EEE5countEv(ptr noundef nonnull align 8 dereferenceable(8) %23)
  %29 = sitofp i64 %28 to double
  %30 = fdiv double %29, 1.000000e+09
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %23) #8
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.6)
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.3)
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef nonnull @_ZSt5fixedRSt8ios_base)
  %35 = call i32 @_ZSt12setprecisioni(i32 noundef 3)
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %34, i32 %35)
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %36, double noundef %30)
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef nonnull @.str.4)
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.5)
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %40, i64 noundef %.1.lcssa)
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %41, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #8
  call void @llvm.lifetime.end.p0(i64 2504, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  ret void

43:                                               ; preds = %0, %._crit_edge112
  %.0114 = phi i64 [ 0, %0 ], [ %.1.lcssa, %._crit_edge112 ]
  %.045113 = phi i32 [ 0, %0 ], [ %194, %._crit_edge112 ]
  %44 = call noundef i64 @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEclEv(ptr noundef nonnull align 8 dereferenceable(2504) %2)
  %45 = urem i64 %44, 1001
  %46 = trunc nuw nsw i64 %45 to i32
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #8
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #8
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %45, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %47 unwind label %51

47:                                               ; preds = %43
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %48 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  store ptr %48, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  %49 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  store ptr %49, ptr %6, align 8
  %50 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  br i1 %50, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %55, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #8
  invoke void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %62 unwind label %64

51:                                               ; preds = %43
  %52 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #8
  br label %207

.lr.ph:                                           ; preds = %47, %55
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  %54 = invoke noundef i64 @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEclEv(ptr noundef nonnull align 8 dereferenceable(2504) %2)
          to label %55 unwind label %60

55:                                               ; preds = %.lr.ph
  %56 = trunc i64 %54 to i32
  %57 = and i32 %56, 1
  store i32 %57, ptr %53, align 4, !tbaa !5
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  %59 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  br i1 %59, label %.lr.ph, label %._crit_edge

60:                                               ; preds = %.lr.ph
  %61 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  br label %206

62:                                               ; preds = %._crit_edge
  invoke void @_ZN13FenwickTree1DIiSt4plusIiEEC2ESt6vectorIiSaIiEEiS1_(ptr noundef nonnull align 8 dereferenceable(33) %7, ptr noundef nonnull %8, i32 noundef 0)
          to label %63 unwind label %66

63:                                               ; preds = %62
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #8
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %9) #8
  invoke void @_ZN14BitFenwickTreeC2Ei(ptr noundef nonnull align 8 dereferenceable(56) %9, i32 noundef %46)
          to label %.preheader unwind label %68

.preheader:                                       ; preds = %63
  %.not = icmp eq i64 %45, 0
  br i1 %.not, label %._crit_edge104.thread, label %.lr.ph103.preheader

._crit_edge104.thread:                            ; preds = %.preheader
  call void @_ZN14BitFenwickTree5buildEv(ptr noundef nonnull align 8 dereferenceable(56) %9)
  br label %79

.lr.ph103.preheader:                              ; preds = %.preheader
  %umax = call i32 @llvm.umax.i32(i32 %46, i32 1)
  %wide.trip.count = zext nneg i32 %umax to i64
  br label %.lr.ph103

._crit_edge104:                                   ; preds = %.lr.ph103
  call void @_ZN14BitFenwickTree5buildEv(ptr noundef nonnull align 8 dereferenceable(56) %9)
  br i1 %.not, label %79, label %74

64:                                               ; preds = %._crit_edge
  %65 = landingpad { ptr, i32 }
          cleanup
  br label %205

66:                                               ; preds = %62
  %67 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #8
  br label %205

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

.lr.ph103:                                        ; preds = %.lr.ph103.preheader, %.lr.ph103
  %indvars.iv = phi i64 [ 0, %.lr.ph103.preheader ], [ %indvars.iv.next, %.lr.ph103 ]
  %70 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv) #8
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = icmp ne i32 %71, 0
  %73 = trunc nuw nsw i64 %indvars.iv to i32
  call void @_ZN14BitFenwickTree3setEib(ptr noundef nonnull align 8 dereferenceable(56) %9, i32 noundef %73, i1 noundef zeroext %72)
  %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_edge104, label %.lr.ph103, !llvm.loop !9

74:                                               ; preds = %._crit_edge104
  %75 = invoke noundef i64 @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEclEv(ptr noundef nonnull align 8 dereferenceable(2504) %2)
          to label %76 unwind label %84

76:                                               ; preds = %74
  %77 = urem i64 %75, 5
  %78 = sub nuw nsw i64 1000, %77
  br label %79

79:                                               ; preds = %._crit_edge104.thread, %._crit_edge104, %76
  %80 = phi i64 [ %78, %76 ], [ 0, %._crit_edge104 ], [ 0, %._crit_edge104.thread ]
  %81 = trunc nuw nsw i64 %80 to i32
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #8
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #8
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #8
  %.not115 = icmp eq i64 %80, 0
  br i1 %.not115, label %._crit_edge108, label %.lr.ph107

.lr.ph107:                                        ; preds = %79
  %82 = add nsw i32 %46, -1
  br label %86

._crit_edge108:                                   ; preds = %184, %79
  %83 = invoke noundef zeroext i1 @_ZSteqIiSaIiEEbRKSt6vectorIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %11)
          to label %186 unwind label %188

84:                                               ; preds = %74
  %85 = landingpad { ptr, i32 }
          cleanup
  br label %203

86:                                               ; preds = %.lr.ph107, %184
  %.061105 = phi i32 [ 0, %.lr.ph107 ], [ %185, %184 ]
  %87 = invoke noundef i64 @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEclEv(ptr noundef nonnull align 8 dereferenceable(2504) %2)
          to label %88 unwind label %105

88:                                               ; preds = %86
  %89 = trunc i64 %87 to i32
  %90 = and i32 %89, 3
  switch i32 %90, label %default.unreachable [
    i32 0, label %91
    i32 1, label %111
    i32 2, label %144
    i32 3, label %164
  ]

91:                                               ; preds = %88
  %92 = invoke noundef i64 @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEclEv(ptr noundef nonnull align 8 dereferenceable(2504) %2)
          to label %93 unwind label %107

93:                                               ; preds = %91
  %94 = invoke noundef i64 @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEclEv(ptr noundef nonnull align 8 dereferenceable(2504) %2)
          to label %95 unwind label %109

95:                                               ; preds = %93
  %96 = urem i64 %92, %45
  %97 = trunc nuw nsw i64 %96 to i32
  %98 = trunc i64 %94 to i32
  %99 = and i32 %98, 1
  %100 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %96) #8
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = sub nsw i32 %99, %101
  call void @_ZN13FenwickTree1DIiSt4plusIiEE6updateEii(ptr noundef nonnull align 8 dereferenceable(33) %7, i32 noundef %97, i32 noundef %102)
  %103 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %96) #8
  store i32 %99, ptr %103, align 4, !tbaa !5
  %104 = icmp ne i32 %99, 0
  call void @_ZN14BitFenwickTree6updateEib(ptr noundef nonnull align 8 dereferenceable(56) %9, i32 noundef %97, i1 noundef zeroext %104)
  br label %184

105:                                              ; preds = %86
  %106 = landingpad { ptr, i32 }
          cleanup
  br label %202

107:                                              ; preds = %91
  %108 = landingpad { ptr, i32 }
          cleanup
  br label %202

109:                                              ; preds = %93
  %110 = landingpad { ptr, i32 }
          cleanup
  br label %202

111:                                              ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #8
  %112 = invoke noundef i64 @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEclEv(ptr noundef nonnull align 8 dereferenceable(2504) %2)
          to label %113 unwind label %123

113:                                              ; preds = %111
  %114 = urem i64 %112, %45
  %115 = trunc nuw nsw i64 %114 to i32
  store i32 %115, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #8
  %116 = invoke noundef i64 @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEclEv(ptr noundef nonnull align 8 dereferenceable(2504) %2)
          to label %117 unwind label %125

117:                                              ; preds = %113
  %118 = urem i64 %116, %45
  %119 = trunc nuw nsw i64 %118 to i32
  store i32 %119, ptr %13, align 4, !tbaa !5
  %120 = load i32, ptr %12, align 4, !tbaa !5
  %121 = icmp sgt i32 %120, %119
  br i1 %121, label %122, label %127

122:                                              ; preds = %117
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %13) #8
  %.pre = load i32, ptr %12, align 4, !tbaa !5
  %.pre119 = load i32, ptr %13, align 4, !tbaa !5
  br label %127

123:                                              ; preds = %111
  %124 = landingpad { ptr, i32 }
          cleanup
  br label %143

125:                                              ; preds = %113
  %126 = landingpad { ptr, i32 }
          cleanup
  br label %142

127:                                              ; preds = %122, %117
  %128 = phi i32 [ %.pre119, %122 ], [ %119, %117 ]
  %129 = phi i32 [ %.pre, %122 ], [ %120, %117 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #8
  %130 = invoke noundef i32 @_ZN13FenwickTree1DIiSt4plusIiEE5queryISt5minusIiEEEiiiT_(ptr noundef nonnull align 8 dereferenceable(33) %7, i32 noundef %129, i32 noundef %128)
          to label %131 unwind label %138

131:                                              ; preds = %127
  store i32 %130, ptr %14, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %132 unwind label %138

132:                                              ; preds = %131
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #8
  %133 = load i32, ptr %12, align 4, !tbaa !5
  %134 = load i32, ptr %13, align 4, !tbaa !5
  %135 = invoke noundef i32 @_ZN14BitFenwickTree5queryEii(ptr noundef nonnull align 8 dereferenceable(56) %9, i32 noundef %133, i32 noundef %134)
          to label %136 unwind label %140

136:                                              ; preds = %132
  store i32 %135, ptr %15, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %137 unwind label %140

137:                                              ; preds = %136
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #8
  br label %184

138:                                              ; preds = %131, %127
  %139 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #8
  br label %142

140:                                              ; preds = %136, %132
  %141 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #8
  br label %142

142:                                              ; preds = %140, %138, %125
  %.pn67 = phi { ptr, i32 } [ %141, %140 ], [ %139, %138 ], [ %126, %125 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #8
  br label %143

143:                                              ; preds = %142, %123
  %.pn67.pn = phi { ptr, i32 } [ %.pn67, %142 ], [ %124, %123 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #8
  br label %202

144:                                              ; preds = %88
  %145 = call noundef i32 @_ZN13FenwickTree1DIiSt4plusIiEE5queryEi(ptr noundef nonnull align 8 dereferenceable(33) %7, i32 noundef %82)
  %146 = invoke noundef i64 @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEclEv(ptr noundef nonnull align 8 dereferenceable(2504) %2)
          to label %147 unwind label %158

147:                                              ; preds = %144
  %148 = shl nsw i32 %145, 1
  %149 = or disjoint i32 %148, 1
  %150 = sext i32 %149 to i64
  %151 = urem i64 %146, %150
  %152 = trunc i64 %151 to i32
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #8
  %153 = invoke noundef i32 @_ZN13FenwickTree1DIiSt4plusIiEE7bsearchISt4lessIiEEEiiT_(ptr noundef nonnull align 8 dereferenceable(33) %7, i32 noundef %152)
          to label %154 unwind label %160

154:                                              ; preds = %147
  store i32 %153, ptr %16, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %155 unwind label %160

155:                                              ; preds = %154
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %17) #8
  %156 = call noundef i32 @_ZN14BitFenwickTree7bsearchISt4lessIiEEEiiT_(ptr noundef nonnull align 8 dereferenceable(56) %9, i32 noundef %152)
  store i32 %156, ptr %17, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 4 dereferenceable(4) %17)
          to label %157 unwind label %162

157:                                              ; preds = %155
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #8
  br label %184

158:                                              ; preds = %144
  %159 = landingpad { ptr, i32 }
          cleanup
  br label %202

160:                                              ; preds = %154, %147
  %161 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #8
  br label %202

162:                                              ; preds = %155
  %163 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #8
  br label %202

default.unreachable:                              ; preds = %88
  unreachable

164:                                              ; preds = %88
  %165 = call noundef i32 @_ZN13FenwickTree1DIiSt4plusIiEE5queryEi(ptr noundef nonnull align 8 dereferenceable(33) %7, i32 noundef %82)
  %166 = invoke noundef i64 @_ZNSt23mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEclEv(ptr noundef nonnull align 8 dereferenceable(2504) %2)
          to label %167 unwind label %178

167:                                              ; preds = %164
  %168 = shl nsw i32 %165, 1
  %169 = or disjoint i32 %168, 1
  %170 = sext i32 %169 to i64
  %171 = urem i64 %166, %170
  %172 = trunc i64 %171 to i32
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %18) #8
  %173 = invoke noundef i32 @_ZN13FenwickTree1DIiSt4plusIiEE7bsearchISt10less_equalIiEEEiiT_(ptr noundef nonnull align 8 dereferenceable(33) %7, i32 noundef %172)
          to label %174 unwind label %180

174:                                              ; preds = %167
  store i32 %173, ptr %18, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 4 dereferenceable(4) %18)
          to label %175 unwind label %180

175:                                              ; preds = %174
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %19) #8
  %176 = call noundef i32 @_ZN14BitFenwickTree7bsearchISt10less_equalIiEEEiiT_(ptr noundef nonnull align 8 dereferenceable(56) %9, i32 noundef %172)
  store i32 %176, ptr %19, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 4 dereferenceable(4) %19)
          to label %177 unwind label %182

177:                                              ; preds = %175
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %19) #8
  br label %184

178:                                              ; preds = %164
  %179 = landingpad { ptr, i32 }
          cleanup
  br label %202

180:                                              ; preds = %174, %167
  %181 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #8
  br label %202

182:                                              ; preds = %175
  %183 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %19) #8
  br label %202

184:                                              ; preds = %137, %177, %157, %95
  %185 = add nuw nsw i32 %.061105, 1
  %exitcond117.not = icmp eq i32 %185, %81
  br i1 %exitcond117.not, label %._crit_edge108, label %86, !llvm.loop !11

186:                                              ; preds = %._crit_edge108
  br i1 %83, label %190, label %187

187:                                              ; preds = %186
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 86, ptr noundef nonnull @__PRETTY_FUNCTION__._Z5test2v) #9
  unreachable

188:                                              ; preds = %._crit_edge108
  %189 = landingpad { ptr, i32 }
          cleanup
  br label %202

190:                                              ; preds = %186
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %20) #8
  %191 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #8
  store ptr %191, ptr %20, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %21) #8
  %192 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #8
  store ptr %192, ptr %21, align 8
  %193 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #8
  br i1 %193, label %.lr.ph111, label %._crit_edge112

._crit_edge112:                                   ; preds = %.lr.ph111, %190
  %.1.lcssa = phi i64 [ %.0114, %190 ], [ %199, %.lr.ph111 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #8
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #8
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #8
  call void @_ZN14BitFenwickTreeD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %9) #8
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %9) #8
  call void @_ZN13FenwickTree1DIiSt4plusIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(33) %7) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #8
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #8
  %194 = add nuw nsw i32 %.045113, 1
  %exitcond118.not = icmp eq i32 %194, 50000
  br i1 %exitcond118.not, label %25, label %43, !llvm.loop !12

.lr.ph111:                                        ; preds = %190, %.lr.ph111
  %.1109 = phi i64 [ %199, %.lr.ph111 ], [ %.0114, %190 ]
  %195 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #8
  %196 = mul nsw i64 %.1109, 31
  %197 = load i32, ptr %195, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = add nsw i64 %196, %198
  %200 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #8
  %201 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #8
  br i1 %201, label %.lr.ph111, label %._crit_edge112

202:                                              ; preds = %105, %143, %109, %107, %162, %160, %158, %182, %180, %178, %188
  %.pn70.pn.pn = phi { ptr, i32 } [ %189, %188 ], [ %.pn67.pn, %143 ], [ %106, %105 ], [ %110, %109 ], [ %108, %107 ], [ %163, %162 ], [ %161, %160 ], [ %159, %158 ], [ %183, %182 ], [ %181, %180 ], [ %179, %178 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #8
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #8
  br label %203

203:                                              ; preds = %202, %84
  %.pn70.pn.pn.pn = phi { ptr, i32 } [ %.pn70.pn.pn, %202 ], [ %85, %84 ]
  call void @_ZN14BitFenwickTreeD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %9) #8
  br label %204

204:                                              ; preds = %203, %68
  %.pn70.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn70.pn.pn.pn, %203 ], [ %69, %68 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %9) #8
  call void @_ZN13FenwickTree1DIiSt4plusIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(33) %7) #8
  br label %205

205:                                              ; preds = %204, %66, %64
  %.pn70.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn70.pn.pn.pn.pn, %204 ], [ %67, %66 ], [ %65, %64 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #8
  br label %206

206:                                              ; preds = %205, %60
  %.pn77 = phi { ptr, i32 } [ %61, %60 ], [ %.pn70.pn.pn.pn.pn.pn, %205 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  br label %207

207:                                              ; preds = %206, %51
  %.pn77.pn = phi { ptr, i32 } [ %.pn77, %206 ], [ %52, %51 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 2504, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  resume { ptr, i32 } %.pn77.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN13FenwickTree1DIiSt4plusIiEE5queryEi(ptr noundef nonnull align 8 dereferenceable(33), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN13FenwickTree1DIiSt4plusIiEE7bsearchISt4lessIiEEEiiT_(ptr noundef nonnull align 8 dereferenceable(33), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN14BitFenwickTree7bsearchISt4lessIiEEEiiT_(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN13FenwickTree1DIiSt4plusIiEE7bsearchISt10less_equalIiEEEiiT_(ptr noundef nonnull align 8 dereferenceable(33), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN14BitFenwickTree7bsearchISt10less_equalIiEEEiiT_(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #7

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


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