// File: /workspace/github_cpp_makefile_star2_O3/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 $0x98, %rsp
movq %r8, 0x10(%rsp)
movl %ecx, 0x4(%rsp)
movq %rdx, 0x18(%rsp)
movq %rsi, %rbx
movq %rdi, %r12
movq %rsi, %r14
shrq $0x20, %r14
movq 0x810(%rdi), %rdi
callq 0xc578
movq %rax, %r15
movq %rax, %r13
shrq $0x20, %r13
movq %r14, %rax
movq %r14, 0x8(%rsp)
subl %ebx, %eax
addl $0xfffffc01, %eax       # imm = 0xFFFFFC01
cmpl $0xfffffc00, %eax       # imm = 0xFFFFFC00
jae 0x8117
movq %r12, %rdi
callq 0x732a
movq %rax, %rbp
cmpl %ebx, %r15d
jae 0x80f3
movq 0x808(%r12), %rcx
movl %r13d, %eax
xorl %edx, %edx
divl 0x1008(%rcx)
movl 0xc08(%rcx,%rax,4), %eax
leaq (%rcx,%rax,4), %rax
addq $0x804, %rax            # imm = 0x804
movl (%rax), %edx
addq $0x4, %rax
cmpl %r13d, 0x4(%rcx,%rdx,8)
jb 0x803a
movq (%rbp,%rdx,8), %rdi
subl (%rcx,%rdx,8), %r13d
movl %r13d, %esi
callq 0x13a48
movl %eax, %r13d
subl 0x820(%r12), %r13d
incl %r15d
cmpl %ebx, %r15d
jne 0x8016
movl %ebx, %r15d
jmp 0x80f3
movq 0x808(%r12), %rcx
movl %r13d, %eax
xorl %edx, %edx
divl 0x1008(%rcx)
movl 0xc08(%rcx,%rax,4), %eax
leaq (%rcx,%rax,4), %rdx
addq $0x804, %rdx            # imm = 0x804
movl (%rdx), %eax
addq $0x4, %rdx
cmpl %r13d, 0x4(%rcx,%rax,8)
jb 0x8098
movl %r15d, %ecx
subl %ebx, %ecx
movq 0x18(%rsp), %rdx
movb %al, (%rdx,%rcx)
cmpb $0x0, 0x4(%rsp)
je 0x80cc
movl 0x820(%r12), %edx
addl %r13d, %edx
movq 0x10(%rsp), %rsi
movl %edx, (%rsi,%rcx,4)
movq (%rbp,%rax,8), %rdi
movq 0x808(%r12), %rcx
subl (%rcx,%rax,8), %r13d
movl %r13d, %esi
callq 0x13a48
movl %eax, %r13d
subl 0x820(%r12), %r13d
incl %r15d
cmpl 0x8(%rsp), %r15d
jbe 0x8073
movq %rbp, %rsi
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x73a2
cmpl %ebx, %r15d
jae 0x81b9
leaq 0x20(%rsp), %rbp
movl 0x4(%r12), %ecx
cmpl %r13d, %ecx
jbe 0x819a
movq 0x808(%r12), %rcx
movl %r13d, %eax
xorl %edx, %edx
divl 0x1008(%rcx)
movl 0xc08(%rcx,%rax,4), %eax
leaq (%rcx,%rax,4), %rax
addq $0x804, %rax            # imm = 0x804
movl (%rax), %r14d
addq $0x4, %rax
cmpl %r13d, 0x4(%rcx,%r14,8)
jb 0x8153
movq 0x8(%r12,%r14,8), %rsi
movq %rbp, %rdi
callq 0x1375c
movq 0x808(%r12), %rax
subl (%rax,%r14,8), %r13d
movq %rbp, %rdi
movl %r13d, %esi
callq 0x13a48
movl %eax, %r13d
movq %rbp, %rdi
callq 0x13762
movl 0x820(%r12), %eax
jmp 0x81a7
movl 0x820(%r12), %eax
addl %eax, %ecx
movl %ecx, %r13d
subl %eax, %r13d
incl %r15d
cmpl %ebx, %r15d
jne 0x8125
movl %ebx, %r15d
cmpl 0x8(%rsp), %r15d
ja 0x8268
leaq 0x20(%rsp), %rbp
movq 0x808(%r12), %rcx
movl %r13d, %eax
xorl %edx, %edx
divl 0x1008(%rcx)
movl 0xc08(%rcx,%rax,4), %eax
leaq (%rcx,%rax,4), %rax
addq $0x804, %rax            # imm = 0x804
movl (%rax), %r14d
addq $0x4, %rax
cmpl %r13d, 0x4(%rcx,%r14,8)
jb 0x81ed
movl %r15d, %eax
subl %ebx, %eax
movq 0x18(%rsp), %rcx
movb %r14b, (%rcx,%rax)
cmpb $0x0, 0x4(%rsp)
je 0x8223
movl 0x820(%r12), %ecx
addl %r13d, %ecx
movq 0x10(%rsp), %rdx
movl %ecx, (%rdx,%rax,4)
movq 0x8(%r12,%r14,8), %rsi
movq %rbp, %rdi
callq 0x1375c
movq 0x808(%r12), %rax
subl (%rax,%r14,8), %r13d
movq %rbp, %rdi
movl %r13d, %esi
callq 0x13a48
movl %eax, %r13d
movq %rbp, %rdi
callq 0x13762
subl 0x820(%r12), %r13d
incl %r15d
cmpl 0x8(%rsp), %r15d
jbe 0x81c9
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x827c
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x13762
movq %rbx, %rdi
callq 0x3460
nop