// File: adamnovak[P]rlcsa/./docarray.h
// Function: bool CSA::DocArray::addBlocks<unsigned int>(unsigned int, unsigned int, std::vector<unsigned int, std::allocator<unsigned int>>&) const
bool
    addBlocks(usint first, usint number, std::vector<T>& result) const
    {
      if(first >= this->getNumberOfNodes() || number == 0) { return false; }

      SuccinctVector::Iterator iter(*(this->block_borders));
      usint from = iter.select(first);
      usint to = (number == 1 ? iter.selectNext() : iter.select(first + number));

      for(usint i = from; i < to; i++)
      {
        usint val = this->blocks->readItemConst(i);
        if(val >= this->maxInteger()) { return true; }  // Block contains all documents.
        if(val < this->getNumberOfDocuments()) // Value is a document id.
        {
          this->addItem(val, result);
        }
        else  // Value is a rule id.
        {
          val -= this->getNumberOfDocuments();
          SuccinctVector::Iterator rule_iter(*(this->rule_borders));
          usint rfrom = rule_iter.select(val);
          usint rto = rule_iter.selectNext();

          if(this->usesRLE())
          {
            usint run_start = 0;
            bool want_run_length = false;
            for(usint j = rfrom; j < rto; j++)
            {
              val = this->rules->readItemConst(j);
              if(val >= this->getNumberOfDocuments()) { return true; }  // Rule covers all documents.
              else if(want_run_length) { this->addRun(run_start, val, result); want_run_length = false; }
              else { run_start = val; want_run_length = true; }
            }
          }
          else
          {
            for(usint j = rfrom; j < rto; j++)
            {
              val = this->rules->readItemConst(j);
              if(val >= this->getNumberOfDocuments()) { return true; }  // Rule covers all documents.
              else { this->addItem(val, result); }
            }
          }
        }
      }

      return false;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x90(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x84(%rbp)
callq 0x7970
movl %eax, %ecx
movl -0x84(%rbp), %eax
cmpl %ecx, %eax
jae 0x264e4
cmpl $0x0, -0x18(%rbp)
jne 0x264ed
movb $0x0, -0x1(%rbp)
jmp 0x2685d
movq -0x90(%rbp), %rax
movq 0x38(%rax), %rsi
leaq -0x30(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x2c7d0
movq -0xa0(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x2c910
movl %eax, -0x94(%rbp)
jmp 0x2651f
movl -0x94(%rbp), %eax
movl %eax, -0x34(%rbp)
cmpl $0x1, -0x18(%rbp)
jne 0x2654d
leaq -0x30(%rbp), %rdi
callq 0x2cbd0
movl %eax, -0xa4(%rbp)
jmp 0x2653f
movl -0xa4(%rbp), %eax
movl %eax, -0xa8(%rbp)
jmp 0x26574
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %eax
addl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x2c910
movl %eax, -0xac(%rbp)
jmp 0x26566
movl -0xac(%rbp), %eax
movl %eax, -0xa8(%rbp)
jmp 0x26574
movl -0xa8(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x48(%rbp), %eax
jae 0x2683c
movq -0x90(%rbp), %rax
movq 0x40(%rax), %rdi
movl -0x4c(%rbp), %esi
callq 0x11b90
movq -0x90(%rbp), %rdi
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
movl %eax, -0xb4(%rbp)
callq 0x237e0
movl %eax, -0xb0(%rbp)
jmp 0x265c2
movl -0xb4(%rbp), %eax
movl -0xb0(%rbp), %ecx
cmpl %ecx, %eax
jb 0x265f3
movb $0x1, -0x1(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x26847
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x26852
movq -0x90(%rbp), %rdi
movl -0x50(%rbp), %eax
movl %eax, -0xbc(%rbp)
callq 0x237c0
movl %eax, -0xb8(%rbp)
jmp 0x26610
movl -0xbc(%rbp), %eax
movl -0xb8(%rbp), %ecx
cmpl %ecx, %eax
jae 0x2663a
movq -0x90(%rbp), %rdi
movl -0x50(%rbp), %esi
movq -0x20(%rbp), %rdx
callq 0x268e0
jmp 0x26635
jmp 0x2682c
movq -0x90(%rbp), %rdi
callq 0x237c0
movl %eax, -0xc0(%rbp)
jmp 0x2664e
movq -0x90(%rbp), %rax
movl -0xc0(%rbp), %edx
movl -0x50(%rbp), %ecx
subl %edx, %ecx
movl %ecx, -0x50(%rbp)
movq 0x28(%rax), %rsi
leaq -0x68(%rbp), %rdi
callq 0x2c7d0
jmp 0x26672
movl -0x50(%rbp), %esi
leaq -0x68(%rbp), %rdi
callq 0x2c910
movl %eax, -0xc4(%rbp)
jmp 0x26686
movl -0xc4(%rbp), %eax
movl %eax, -0x6c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x2cbd0
movl %eax, -0xc8(%rbp)
jmp 0x266a0
movq -0x90(%rbp), %rdi
movl -0xc8(%rbp), %eax
movl %eax, -0x70(%rbp)
callq 0x23b20
testb $0x1, %al
jne 0x266be
jmp 0x2678d
movl $0x0, -0x74(%rbp)
movb $0x0, -0x75(%rbp)
movl -0x6c(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
cmpl -0x70(%rbp), %eax
jae 0x26788
movq -0x90(%rbp), %rax
movq 0x30(%rax), %rdi
movl -0x7c(%rbp), %esi
callq 0x11b90
movq -0x90(%rbp), %rdi
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
movl %eax, -0xd0(%rbp)
callq 0x237c0
movl %eax, -0xcc(%rbp)
jmp 0x2670e
movl -0xd0(%rbp), %eax
movl -0xcc(%rbp), %ecx
cmpl %ecx, %eax
jb 0x26748
movb $0x1, -0x1(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x26818
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x2c7f0
jmp 0x26852
testb $0x1, -0x75(%rbp)
je 0x2676c
movq -0x90(%rbp), %rdi
movl -0x74(%rbp), %esi
movl -0x50(%rbp), %edx
movq -0x20(%rbp), %rcx
callq 0x26910
jmp 0x26766
movb $0x0, -0x75(%rbp)
jmp 0x26776
movl -0x50(%rbp), %eax
movl %eax, -0x74(%rbp)
movb $0x1, -0x75(%rbp)
jmp 0x26778
jmp 0x2677a
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x266cf
jmp 0x26811
movl -0x6c(%rbp), %eax
movl %eax, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x70(%rbp), %eax
jae 0x2680f
movq -0x90(%rbp), %rax
movq 0x30(%rax), %rdi
movl -0x80(%rbp), %esi
callq 0x11b90
movq -0x90(%rbp), %rdi
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
movl %eax, -0xd8(%rbp)
callq 0x237c0
movl %eax, -0xd4(%rbp)
jmp 0x267ce
movl -0xd8(%rbp), %eax
movl -0xd4(%rbp), %ecx
cmpl %ecx, %eax
jb 0x267eb
movb $0x1, -0x1(%rbp)
movl $0x1, -0x54(%rbp)
jmp 0x26818
movq -0x90(%rbp), %rdi
movl -0x50(%rbp), %esi
movq -0x20(%rbp), %rdx
callq 0x268e0
jmp 0x26800
jmp 0x26802
jmp 0x26804
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0x26793
jmp 0x26811
movl $0x0, -0x54(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x2c7f0
movl -0x54(%rbp), %eax
testl %eax, %eax
jne 0x26847
jmp 0x2682a
jmp 0x2682c
jmp 0x2682e
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x26583
movb $0x0, -0x1(%rbp)
movl $0x1, -0x54(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x2c7f0
jmp 0x2685d
leaq -0x30(%rbp), %rdi
callq 0x2c7f0
jmp 0x2686b
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xe0, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x3570
nopw %cs:(%rax,%rax)
nop