// File: /workspace/github_cpp_makefile_star2_O3/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, %rbx
movq %rdi, %r14
movl $0x18, %edi
callq 0x3260
movq %rax, %rbp
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq 0x8(%r14), %rsi
leaq 0x30(%rsp), %r15
movq %r15, %rdi
callq 0x18710
movq %r15, %rdi
movl %ebx, %esi
callq 0x18cf2
movq %rax, %r15
movq %rbx, %r12
shrq $0x20, %r12
cmpl %r15d, %ebx
jae 0x1483c
movq %rbp, %rdx
leal -0x1(%r15), %ebp
cmpl %r12d, %ebp
movl %r12d, %eax
cmovbl %ebp, %eax
shlq $0x20, %rax
movl %ebx, %esi
orq %rax, %rsi
movq %r14, %rdi
movq %rdx, %r13
callq 0x14e24
cmpl %r12d, %ebp
movq %r13, %rbp
jae 0x14a97
leaq 0x30(%rsp), %rdi
movl %r12d, %esi
callq 0x18b42
movq %rax, %r13
leaq 0x30(%rsp), %rdi
callq 0x18e80
shrq $0x20, %r15
movq %r13, %rcx
shrq $0x20, %rcx
movq %rcx, (%rsp)
decl %eax
cmpl %r12d, %eax
jbe 0x1489b
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
andq %rax, %rbx
movl %r13d, %esi
orq %rbx, %rsi
movq %r14, %rdi
movq %rbp, %rdx
callq 0x14e24
movq (%rsp), %rbx
cmpl %r15d, %ebx
jbe 0x14a97
decl %ebx
jmp 0x1489f
movq (%rsp), %rbx
movq 0x10(%r14), %rsi
leaq 0x20(%rsp), %rdi
callq 0x1ab50
movq %rbp, 0x8(%rsp)
movq 0x8(%r14), %rax
movq 0x10(%r14), %rcx
movl 0x4(%rcx), %ecx
addl 0x4(%rax), %ecx
xorl %edx, %edx
cmpl %r15d, %ebx
jae 0x148ce
movl %ecx, %ebp
jmp 0x14a1a
movq %rbx, (%rsp)
leal 0x1(%rbx), %r12d
xorl %edx, %edx
leaq 0x20(%rsp), %r13
movq %rcx, 0x10(%rsp)
movq %rdx, 0x18(%rsp)
leal 0x1(%r15), %edi
movl %r15d, %esi
movl %edi, %r15d
movl %esi, %ebp
movq %r13, %rdi
callq 0x1b1a4
testb %al, %al
je 0x149e1
movq 0x18(%r14), %rbx
movq %r13, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x1ab5e
decl %eax
movl 0xc(%rbx), %r8d
imull %r8d, %eax
movl %eax, %edi
shrl $0x5, %edi
andl $0x1f, %eax
movl $0x20, %ecx
subl %eax, %ecx
xorl %esi, %esi
movl %r8d, %edx
subl %ecx, %edx
jae 0x1493a
movl %r8d, %edx
jmp 0x14953
movq (%rbx), %rcx
movl %edi, %esi
movl (%rcx,%rsi,4), %esi
movl %eax, %ecx
shll %cl, %esi
shrl %cl, %esi
movl %edx, %ecx
shll %cl, %esi
incl %edi
movl $0x20, %ecx
testl %edx, %edx
je 0x1496d
subl %edx, %ecx
movq (%rbx), %rax
movl %edi, %edi
movl (%rax,%rdi,4), %eax
shrl %cl, %eax
negb %dl
movl %edx, %ecx
shll %cl, %eax
shrl %cl, %eax
orl %eax, %esi
movq 0x20(%r14), %r8
movl 0xc(%r8), %r10d
movl %r10d, %edx
imull %esi, %edx
movl %edx, %r9d
shrl $0x5, %r9d
andl $0x1f, %edx
movl $0x20, %ecx
subl %edx, %ecx
xorl %edi, %edi
movl %r10d, %eax
subl %ecx, %eax
jae 0x1499a
movl %r10d, %eax
jmp 0x149b5
movq (%r8), %rcx
movl %r9d, %edi
movl (%rcx,%rdi,4), %edi
movl %edx, %ecx
shll %cl, %edi
shrl %cl, %edi
movl %eax, %ecx
shll %cl, %edi
incl %r9d
movl $0x20, %ecx
testl %eax, %eax
je 0x149d1
subl %eax, %ecx
movq (%r8), %rdx
movl %r9d, %r8d
movl (%rdx,%r8,4), %edx
shrl %cl, %edx
negb %al
movl %eax, %ecx
shll %cl, %edx
shrl %cl, %edx
orl %edx, %edi
movq 0x8(%r14), %rax
addl 0x4(%rax), %esi
cmpl %edi, %r12d
jae 0x148ee
movq 0x18(%rsp), %rdx
movq 0x10(%rsp), %rsi
leal (%rdx,%rsi), %eax
cmpl %eax, %ebp
jne 0x149f8
incl %edx
movl %esi, %ebp
jmp 0x14a0e
movq %r14, %rdi
movq 0x8(%rsp), %rcx
callq 0x152a4
movl $0x1, %edx
testb %al, %al
jne 0x14a5c
movl %ebp, %ecx
cmpl (%rsp), %r15d
jbe 0x148dd
movq %r14, %rdi
movl %ebp, %esi
movq 0x8(%rsp), %rbp
movq %rbp, %rcx
callq 0x152a4
testb %al, %al
je 0x14a8d
movq (%rbp), %rdi
testq %rdi, %rdi
je 0x14a45
movq 0x10(%rbp), %rsi
subq %rdi, %rsi
callq 0x3270
movl $0x18, %esi
movq %rbp, %rdi
callq 0x3270
movq %r14, %rdi
callq 0x1563e
jmp 0x14a8a
movq 0x8(%rsp), %rbx
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x14a75
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x3270
movl $0x18, %esi
movq %rbx, %rdi
callq 0x3270
movq %r14, %rdi
callq 0x1563e
movq %rax, %rbp
leaq 0x20(%rsp), %rdi
callq 0x1ab5c
leaq 0x30(%rsp), %rdi
callq 0x18716
movq %rbp, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x14acb
jmp 0x14ac2
jmp 0x14ac2
jmp 0x14acb
jmp 0x14ac2
jmp 0x14ac2
movq %rax, %rbx
jmp 0x14ad8
jmp 0x14acb
jmp 0x14acb
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x1ab5c
leaq 0x30(%rsp), %rdi
callq 0x18716
movq %rbx, %rdi
callq 0x3460