// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::displayUnsafe(std::pair<unsigned int, unsigned int>, unsigned char*, bool, unsigned int*) const
void
RLCSA::displayUnsafe(pair_type range, uchar* data, bool get_ranks, usint* ranks) const
{
  pair_type res = this->sa_samples->inverseSA(range.first);
  usint i = res.first, pos = res.second;

  if(length(range) >= 1024)
  {
    PsiVector::Iterator** iters = this->getIterators();
    for(; i < range.first; i++)
    {
      pos = this->psi(pos, iters) - this->number_of_sequences;
    }
    for(; i <= range.second; i++)
    {
      usint c = this->getCharacter(pos);
      data[i - range.first] = c;
      if(get_ranks) { ranks[i - range.first] = pos + this->number_of_sequences; }
      pos = this->psiUnsafe(pos, c, *(iters[c])) - this->number_of_sequences;
    }
    this->deleteIterators(iters);
  }
  else
  {
    for(; i < range.first; i++)
    {
      pos = this->psi(pos) - this->number_of_sequences;
    }
    for(; i <= range.second; i++)
    {
      usint c = this->getCharacter(pos);
      data[i - range.first] = c;
      if(get_ranks) { ranks[i - range.first] = pos + this->number_of_sequences; }
      pos = this->psiUnsafe(pos, c) - this->number_of_sequences;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %r15
movl %ecx, 0xc(%rsp)
movq %rdx, 0x18(%rsp)
movq %rsi, %rbp
movq %rdi, %r12
movq %rsi, %r14
shrq $0x20, %r14
movq 0x810(%rdi), %rdi
callq 0xaa2e
movq %rax, %rbx
movq %rax, %r13
shrq $0x20, %r13
movl %r14d, %eax
subl %ebp, %eax
addl $0xfffffc01, %eax       # imm = 0xFFFFFC01
cmpl $0xfffffc00, %eax       # imm = 0xFFFFFC00
movq %rbx, 0x10(%rsp)
jae 0x6d15
movq %r15, 0x20(%rsp)
movq %r12, %rdi
callq 0x63ea
movq %rbx, %rcx
movq %rax, %rbx
movl %ecx, %r15d
cmpl %ebp, %r15d
jae 0x6c96
movq %r12, %rdi
movl %r13d, %esi
movq %rbx, %rdx
callq 0x89c0
movl %eax, %r13d
subl 0x820(%r12), %r13d
incl %r15d
jmp 0x6c73
movq 0x10(%rsp), %rax
cmpl %ebp, %eax
movl %ebp, %r15d
cmoval %eax, %r15d
negl %ebp
cmpl %r14d, %r15d
ja 0x6cff
movq %r12, %rdi
movl %r13d, %esi
callq 0x8958
leal (%r15,%rbp), %ecx
movq 0x18(%rsp), %rdx
movb %al, (%rdx,%rcx)
cmpb $0x0, 0xc(%rsp)
je 0x6cdc
movl 0x820(%r12), %edx
addl %r13d, %edx
movq 0x20(%rsp), %rsi
movl %edx, (%rsi,%rcx,4)
movl %eax, %ecx
movq (%rbx,%rcx,8), %rcx
movq %r12, %rdi
movl %r13d, %esi
movl %eax, %edx
callq 0x89ec
movl %eax, %r13d
subl 0x820(%r12), %r13d
incl %r15d
jmp 0x6ca6
movq %rbx, %rsi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x646a
cmpl %ebp, %ebx
jae 0x6d33
movq %r12, %rdi
movl %r13d, %esi
callq 0x887c
movl %eax, %r13d
subl 0x820(%r12), %r13d
incl %ebx
jmp 0x6d15
movq 0x10(%rsp), %rax
cmpl %ebp, %eax
movl %ebp, %ebx
cmoval %eax, %ebx
negl %ebp
cmpl %r14d, %ebx
ja 0x6d8e
movq %r12, %rdi
movl %r13d, %esi
callq 0x8958
leal (%rbx,%rbp), %ecx
movq 0x18(%rsp), %rdx
movb %al, (%rdx,%rcx)
cmpb $0x0, 0xc(%rsp)
je 0x6d72
movl 0x820(%r12), %edx
addl %r13d, %edx
movl %edx, (%r15,%rcx,4)
movq %r12, %rdi
movl %r13d, %esi
movl %eax, %edx
callq 0x8964
movl %eax, %r13d
subl 0x820(%r12), %r13d
incl %ebx
jmp 0x6d41
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop