// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/./docarray.h
// Function: std::vector<unsigned int, std::allocator<unsigned int>>* CSA::DocArray::documentListing<unsigned int>(std::pair<unsigned int, unsigned int>) const
std::vector<T>*
    documentListing(pair_type range) const
    {
      std::vector<T>* result = new std::vector<T>;
      DeltaVector::Iterator block_iter(*(this->leaf_ranges));

      // Process the part of the range before the first full block.
      pair_type first_block = block_iter.valueAfter(range.first);
      if(first_block.first > range.first)
      {
        usint temp = std::min(range.second, first_block.first - 1);
        this->processRange(pair_type(range.first, temp), *result);
        if(range.second <= temp) { return result; }
      }
      range.first = first_block.second;

      // Process the part of the range after the last full block.
      pair_type last_block = block_iter.valueBefore(range.second);
      pair_type next_block = block_iter.nextValue();
      if(range.second < next_block.first - 1)
      {
        this->processRange(pair_type(last_block.first, range.second), *result);
        if(first_block.second >= last_block.second) { return result; }
        last_block.second--;
      }
      range.second = last_block.second;

      // Process the full blocks.
      SuccinctVector::Iterator child_iter(*(this->first_children));
      usint prev_block = this->getNumberOfNodes(), run = 0;
      for(usint i = range.first; i <= range.second; )
      {
        usint next_leaf = i + 1;
        while(child_iter.isSet(i))  // Current block is the leftmost child of its parent.
        {
          pair_type parent = this->parentOf(i, child_iter);
          if(parent.second <= range.second + 1) // Range contains the subtree of the parent.
          {
            i = parent.first; next_leaf = parent.second;
          }
          else { break; }
        }
        if(i == prev_block + run) { run++; }
        else
        {
          if(this->addBlocks(prev_block, run, *result)) { delete result; return this->allDocuments<T>(); }
          prev_block = i; run = 1;
        }
        i = next_leaf;
      }
      if(this->addBlocks(prev_block, run, *result)) { delete result; return this->allDocuments<T>(); }

      return result;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %r12
movq %rdi, %r14
pushq $0x18
popq %rdi
callq 0x3230
movq %rax, %rbp
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
andq $0x0, 0x10(%rax)
movq 0x8(%r14), %rsi
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
callq 0x13c5c
movq %rbx, %rdi
movl %r12d, %esi
callq 0x13e04
movq %rax, %r15
movq %r12, %r13
shrq $0x20, %r13
cmpl %r15d, %r12d
jae 0x10eed
leal -0x1(%r15), %ebx
cmpl %r13d, %ebx
movl %r13d, %eax
cmovbl %ebx, %eax
shlq $0x20, %rax
movl %r12d, %esi
orq %rax, %rsi
movq %r14, %rdi
movq %rbp, %rdx
callq 0x112f6
cmpl %r13d, %ebx
jae 0x1105d
leaq 0x30(%rsp), %rdi
movl %r13d, %esi
callq 0x13d90
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x13e7e
shrq $0x20, %r15
movq %rbx, %rcx
shrq $0x20, %rcx
movq %rcx, 0x10(%rsp)
decl %eax
cmpl %r13d, %eax
jbe 0x10f4d
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
andq %rax, %r12
movl %ebx, %esi
orq %r12, %rsi
movq %r14, %rdi
movq %rbp, %rdx
callq 0x112f6
movq 0x10(%rsp), %rbx
cmpl %r15d, %ebx
jbe 0x1105d
decl %ebx
jmp 0x10f52
movq 0x10(%rsp), %rbx
movq %rbp, 0x18(%rsp)
movq 0x10(%r14), %rsi
leaq 0x20(%rsp), %rdi
callq 0x14ae6
movq 0x8(%r14), %rax
movq 0x10(%r14), %rcx
movl 0x4(%rcx), %ecx
addl 0x4(%rax), %ecx
movq %rcx, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
leal 0x1(%rbx), %r12d
xorl %ebp, %ebp
leaq 0x20(%rsp), %r13
movl %r15d, %eax
cmpl 0x10(%rsp), %r15d
ja 0x1101a
leal 0x1(%rax), %ecx
movl %ecx, %r15d
movl %eax, %ebx
movq %r13, %rdi
movl %eax, %esi
callq 0x14e36
testb %al, %al
je 0x10fc5
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rdx
callq 0x11782
movq %rax, %rcx
shrq $0x20, %rcx
cmpl %ecx, %r12d
jae 0x10f99
movq 0x8(%rsp), %rax
addl %ebp, %eax
cmpl %eax, %ebx
jne 0x10fd4
incl %ebp
jmp 0x10f88
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movl %ebp, %edx
movq 0x18(%rsp), %rcx
callq 0x117c8
movl %ebx, %ecx
movq %rcx, 0x8(%rsp)
pushq $0x1
popq %rcx
movl %ecx, %ebp
testb %al, %al
je 0x10f88
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0xd8ea
pushq $0x18
popq %rsi
movq %rbx, %rdi
callq 0x3240
movq %r14, %rdi
callq 0x119ac
jmp 0x11050
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movl %ebp, %edx
movq 0x18(%rsp), %rbp
movq %rbp, %rcx
callq 0x117c8
testb %al, %al
je 0x11053
movq %rbp, %rdi
callq 0xd8ea
pushq $0x18
popq %rsi
movq %rbp, %rdi
callq 0x3240
movq %r14, %rdi
callq 0x119ac
movq %rax, %rbp
leaq 0x20(%rsp), %rdi
callq 0x14aee
leaq 0x30(%rsp), %rdi
callq 0x13c62
movq %rbp, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11091
jmp 0x1108a
jmp 0x11091
jmp 0x1108a
jmp 0x1108a
jmp 0x11091
jmp 0x1108a
movq %rax, %rbx
jmp 0x1109e
jmp 0x11091
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x14aee
leaq 0x30(%rsp), %rdi
callq 0x13c62
movq %rbx, %rdi
callq 0x3430