// File: /workspace/github_cpp_makefile_star2_O1/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 $0xb8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movl $0x18, %edi
callq 0x3260
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rax, (%rsp)
movq $0x0, 0x10(%rax)
movq 0x8(%r14), %rsi
leaq 0x40(%rsp), %r15
movq %r15, %rdi
callq 0x18444
movq %r15, %rdi
movl %ebx, %esi
callq 0x188e4
movq %rax, %r15
movq %rbx, %r12
shrq $0x20, %r12
cmpl %r15d, %ebx
jae 0x14566
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 (%rsp), %rdx
callq 0x14b92
cmpl %r12d, %ebp
jae 0x147e2
leaq 0x40(%rsp), %rdi
movl %r12d, %esi
callq 0x1886e
movq %rax, %r13
leaq 0x40(%rsp), %rdi
callq 0x18a6e
shrq $0x20, %r15
movq %r13, %rbp
shrq $0x20, %rbp
decl %eax
cmpl %r12d, %eax
jbe 0x145bc
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
andq %rax, %rbx
movl %r13d, %esi
orq %rbx, %rsi
movq %r14, %rdi
movq (%rsp), %rdx
callq 0x14b92
cmpl %r15d, %ebp
jbe 0x147e2
decl %ebp
movq 0x10(%r14), %rsi
leaq 0x30(%rsp), %rdi
callq 0x1a636
movq 0x8(%r14), %rax
movq 0x10(%r14), %rcx
movl 0x4(%rcx), %esi
addl 0x4(%rax), %esi
movq %rbp, 0x10(%rsp)
leal 0x1(%rbp), %r12d
xorl %edx, %edx
leaq 0x30(%rsp), %rbp
movq (%rsp), %rax
movq %rax, 0x8(%rsp)
cmpl 0x10(%rsp), %r15d
movq %r15, 0x28(%rsp)
ja 0x14787
movq %rdx, 0x18(%rsp)
movq %rsi, 0x20(%rsp)
movq %r15, %rcx
incl %r15d
movl %ecx, %ebx
movq %rbp, %rdi
movl %ebx, %esi
callq 0x1ac82
testb %al, %al
je 0x1470c
movq 0x18(%r14), %r13
movq %rbp, %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x1a644
decl %eax
movl 0xc(%r13), %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 0x1465c
movl %r8d, %edx
jmp 0x14676
movq (%r13), %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 0x14691
subl %edx, %ecx
movq (%r13), %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 0x146be
movl %r10d, %eax
jmp 0x146d9
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 0x146f5
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
cmovael %esi, %ebx
cmovael %edi, %r15d
jae 0x14613
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdx
leal (%rdx,%rsi), %eax
cmpl %eax, %ebx
jne 0x14723
incl %edx
movb $0x1, %al
jmp 0x1477f
movq %r14, %rdi
movq (%rsp), %rcx
callq 0x15056
testb %al, %al
je 0x14776
movq (%rsp), %r15
movq (%r15), %rdi
testq %rdi, %rdi
je 0x1474b
movq 0x10(%r15), %rsi
subq %rdi, %rsi
callq 0x3270
movl $0x18, %esi
movq %r15, %rdi
callq 0x3270
movq %r14, %rdi
callq 0x15416
movq %rax, 0x8(%rsp)
xorl %eax, %eax
movl %ebx, %r15d
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdx
jmp 0x1477f
movb $0x1, %al
movl %ebx, %esi
movl $0x1, %edx
testb %al, %al
jne 0x145f1
movq 0x28(%rsp), %rax
cmpl 0x10(%rsp), %eax
movq 0x8(%rsp), %rbx
jbe 0x147d6
movq %r14, %rdi
movq (%rsp), %rbx
movq %rbx, %rcx
callq 0x15056
testb %al, %al
je 0x147d6
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x147be
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x3270
movl $0x18, %esi
movq %rbx, %rdi
callq 0x3270
movq %r14, %rdi
callq 0x15416
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x1a642
jmp 0x147e6
movq (%rsp), %rbx
leaq 0x40(%rsp), %rdi
callq 0x1844a
movq %rbx, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x14818
jmp 0x1480f
jmp 0x1480f
jmp 0x1480f
jmp 0x1480f
movq %rax, %rbx
jmp 0x14825
jmp 0x14818
jmp 0x14818
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x1a642
leaq 0x40(%rsp), %rdi
callq 0x1844a
movq %rbx, %rdi
callq 0x3460
nop