LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::RLCSA(unsigned char*, unsigned int, unsigned int, unsigned int, unsigned int, CSA::Sampler*, bool)
RLCSA::RLCSA(uchar* data, usint bytes, usint block_size, usint sa_sample_rate, usint threads, Sampler* sampler, bool delete_data) :
  ok(false),
  alphabet(0),
  sa_samples(0), support_locate(false), support_display(false),
  sample_rate(sa_sample_rate),
  end_points(0)
{
  for(usint c = 0; c < CHARS; c++) { this->array[c] = 0; }

  if(!data || bytes == 0)
  {
    std::cerr << "RLCSA: No input data given!" << std::endl;
    if(delete_data) { delete[] data; }
    return;
  }
  if(block_size < 2 * sizeof(usint) || block_size % sizeof(usint) != 0)
  {
    std::cerr << "RLCSA: Block size must be a multiple of " << sizeof(usint) << " bytes!" << std::endl;
    if(delete_data) { delete[] data; }
    return;
  }
  if(sampler != 0 && sampler->getStatus() != Sampler::SAMPLED)
  {
    std::cerr << "RLCSA: No samples given!" << std::endl;
    if(delete_data) { delete[] data; }
    return;
  }

  this->buildRLCSA(data, 0, bytes, block_size, threads, sampler, false, delete_data);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %ecx, %eax
movl %edx, %ecx
movq %rsi, %rbx
movb 0x48(%rsp), %bpl
movq 0x40(%rsp), %rdx
movb $0x0, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x808(%rdi)
andw $0x0, 0x818(%rdi)
movl %r8d, 0x81c(%rdi)
andq $0x0, 0x828(%rdi)
pushq $0x1
popq %rsi
cmpq $0x101, %rsi            # imm = 0x101
je 0x5799
andq $0x0, (%rdi,%rsi,8)
incq %rsi
jmp 0x5786
testq %rbx, %rbx
sete %sil
testl %ecx, %ecx
sete %r8b
orb %sil, %r8b
je 0x57df
testq %rbx, %rbx
sete %r14b
movq 0x17837(%rip), %rdi     # 0x1cff0
leaq 0xdbbc(%rip), %rsi      # 0x1337c
callq 0x3200
movq %rax, %rdi
callq 0x3100
xorb $0x1, %bpl
orb %r14b, %bpl
je 0x5866
jmp 0x5876
cmpl $0x8, %eax
setae %sil
testb $0x3, %al
sete %r8b
testb %r8b, %sil
je 0x581c
testq %rdx, %rdx
je 0x57fc
cmpl $0x2, 0xc(%rdx)
jne 0x5846
movzbl %bpl, %esi
andl $0x0, 0x8(%rsp)
movl %esi, 0x10(%rsp)
movq %rdx, (%rsp)
movq %rbx, %rsi
xorl %edx, %edx
movl %eax, %r8d
callq 0x5066
jmp 0x5876
movq 0x177cd(%rip), %rdi     # 0x1cff0
leaq 0xdb6e(%rip), %rsi      # 0x13398
callq 0x3200
pushq $0x4
popq %rsi
movq %rax, %rdi
callq 0x3160
leaq 0xdb80(%rip), %rsi      # 0x133c1
movq %rax, %rdi
jmp 0x5854
movq 0x177a3(%rip), %rdi     # 0x1cff0
leaq 0xdb75(%rip), %rsi      # 0x133c9
callq 0x3200
movq %rax, %rdi
callq 0x3100
testb %bpl, %bpl
je 0x5876
movq %rbx, %rdi
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x32b0
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::strip()
void
RLCSA::strip()
{
  for(usint c = 0; c < CHARS; c++)
  {
    if(this->array[c] != 0) { this->array[c]->strip(); }
  }
  if(this->sa_samples != 0) { this->sa_samples->strip(); }
  this->end_points->strip();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
cmpq $0x100, %r14            # imm = 0x100
je 0x5b27
movq 0x8(%rbx,%r14,8), %rdi
testq %rdi, %rdi
je 0x5b22
callq 0xf3b2
incq %r14
jmp 0x5b0a
movq 0x810(%rbx), %rdi
testq %rdi, %rdi
je 0x5b38
callq 0xaafc
movq 0x828(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xf3b2
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::mergeEndPoints(CSA::RLCSA&, CSA::RLCSA&)
void
RLCSA::mergeEndPoints(RLCSA& index, RLCSA& increment)
{
  DeltaEncoder* endings = new DeltaEncoder(RLCSA::ENDPOINT_BLOCK_SIZE);

  DeltaVector::Iterator index_iter(*(index.end_points));
  DeltaVector::Iterator increment_iter(*(increment.end_points));

  endings->setBit(index_iter.select(0));
  for(usint i = 1; i < index.number_of_sequences; i++)
  {
    endings->setBit(index_iter.selectNext());
  }
  usint sum = index.end_points->getSize();
  delete index.end_points; index.end_points = 0;

  endings->setBit(sum + increment_iter.select(0));
  for(usint i = 1; i < increment.number_of_sequences; i++)
  {
    endings->setBit(sum + increment_iter.selectNext());
  }
  sum += increment.end_points->getSize();
  delete increment.end_points; increment.end_points = 0;

  this->end_points = new DeltaVector(*endings, sum);
  delete endings;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
pushq $0x70
popq %rdi
callq 0x3220
movq %rax, %rbx
pushq $0x10
popq %rsi
movq %rax, %rdi
movl $0x100000, %edx         # imm = 0x100000
callq 0xfbb6
movq 0x828(%r12), %rsi
leaq 0x80(%rsp), %rdi
callq 0xf8d8
movq 0x828(%r15), %rsi
leaq 0x8(%rsp), %rdi
callq 0xf8d8
leaq 0x80(%rsp), %rdi
xorl %esi, %esi
callq 0xf976
movq %rbx, %rdi
movl %eax, %esi
callq 0xfbc4
pushq $0x1
popq %rbp
leaq 0x80(%rsp), %r13
cmpl 0x820(%r12), %ebp
jae 0x5beb
movq %r13, %rdi
callq 0xf9d8
movq %rbx, %rdi
movl %eax, %esi
callq 0xfbc4
incl %ebp
jmp 0x5bcb
movq %r14, (%rsp)
movq 0x828(%r12), %r13
movl (%r13), %r14d
movq %r13, %rdi
callq 0xf8c6
pushq $0x48
popq %rsi
movq %r13, %rdi
callq 0x3230
andq $0x0, 0x828(%r12)
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0xf976
addl %r14d, %eax
movq %rbx, %rdi
movl %eax, %esi
callq 0xfbc4
pushq $0x1
popq %rbp
leaq 0x8(%rsp), %r12
cmpl 0x820(%r15), %ebp
jae 0x5c5a
movq %r12, %rdi
callq 0xf9d8
addl %r14d, %eax
movq %rbx, %rdi
movl %eax, %esi
callq 0xfbc4
incl %ebp
jmp 0x5c38
movq 0x828(%r15), %r12
movl (%r12), %ebp
movq %r12, %rdi
callq 0xf8c6
pushq $0x48
popq %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x3230
andq $0x0, 0x828(%r15)
movq %r13, %rdi
callq 0x3220
movq %rax, %r15
addl %r14d, %ebp
movq %rax, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0xf8c0
movq (%rsp), %rax
movq %r15, 0x828(%rax)
movq %rbx, %rdi
callq 0xfbbe
pushq $0x70
popq %rsi
movq %rbx, %rdi
callq 0x3230
leaq 0x8(%rsp), %rdi
callq 0xf8de
leaq 0x80(%rsp), %rdi
callq 0xf8de
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
pushq $0x48
popq %rsi
movq %r15, %rdi
callq 0x3230
jmp 0x5d14
movq %rax, %r14
jmp 0x5d1e
movq %rax, %r14
pushq $0x70
popq %rsi
movq %rbx, %rdi
callq 0x3230
jmp 0x5d2b
jmp 0x5d11
jmp 0x5d11
jmp 0x5d11
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0xf8de
leaq 0x80(%rsp), %rdi
callq 0xf8de
movq %r14, %rdi
callq 0x3410
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::mergeSamples(CSA::RLCSA&, CSA::RLCSA&, unsigned int*)
void
RLCSA::mergeSamples(RLCSA& index, RLCSA& increment, usint* positions)
{
  if(index.sa_samples == 0 || increment.sa_samples == 0) { return; }

  positions += increment.number_of_sequences;
  this->sa_samples = new SASamples(*(index.sa_samples), *(increment.sa_samples), positions, increment.data_size, this->number_of_sequences);

  this->support_locate = this->sa_samples->supportsLocate();
  this->support_display = this->sa_samples->supportsDisplay();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x810(%rsi), %r15
testq %r15, %r15
je 0x5db0
movq %rdx, %r12
movq 0x810(%rdx), %r13
testq %r13, %r13
je 0x5db0
movq %rdi, %rbx
movl 0x820(%r12), %eax
leaq (%rcx,%rax,4), %rbp
pushq $0x30
popq %rdi
callq 0x3220
movq %rax, %r14
movl 0x4(%r12), %r8d
movl 0x820(%rbx), %r9d
movq %rax, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0xa326
movq %r14, 0x810(%rbx)
cmpq $0x0, 0x18(%r14)
setne 0x818(%rbx)
cmpq $0x0, 0x28(%r14)
setne 0x819(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
pushq $0x30
popq %rsi
movq %r14, %rdi
callq 0x3230
movq %rbx, %rdi
callq 0x3410
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::~RLCSA()
RLCSA::~RLCSA()
{
  for(usint c = 0; c < CHARS; c++) { delete this->array[c]; this->array[c] = 0; }
  delete this->alphabet; this->alphabet = 0;
  delete this->sa_samples; this->sa_samples = 0;
  delete this->end_points; this->end_points = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r12d, %r12d
pushq $0x48
popq %r14
cmpq $0x100, %r12            # imm = 0x100
je 0x5e19
movq 0x8(%rbx,%r12,8), %r15
testq %r15, %r15
je 0x5e03
movq %r15, %rdi
callq 0xfcf2
movq %r15, %rdi
movq %r14, %rsi
callq 0x3230
andq $0x0, 0x8(%rbx,%r12,8)
incq %r12
jmp 0x5de8
movq 0x808(%rbx), %rdi
movl $0x1010, %esi           # imm = 0x1010
callq 0x3230
andq $0x0, 0x808(%rbx)
movq 0x810(%rbx), %r14
testq %r14, %r14
je 0x5e46
movq %r14, %rdi
callq 0xa71c
pushq $0x30
popq %rsi
movq %r14, %rdi
callq 0x3230
andq $0x0, 0x810(%rbx)
movq 0x828(%rbx), %r14
testq %r14, %r14
je 0x5e6d
movq %r14, %rdi
callq 0xf8c6
pushq $0x48
popq %rsi
movq %r14, %rdi
callq 0x3230
andq $0x0, 0x828(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::count(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
pair_type
RLCSA::count(const std::string& pattern) const
{
  if(pattern.length() == 0) { return this->getSARange(); }

  std::string::const_reverse_iterator iter = pattern.rbegin();
  pair_type index_range = this->getCharRange((uchar)*iter);
  
  if(isEmpty(index_range)) { return index_range; }

  for(++iter; iter != pattern.rend(); ++iter)
  {
    index_range = this->LF(index_range, (uchar)*iter);
    
    if(isEmpty(index_range)) { return EMPTY_PAIR; }
  }
  
  this->convertToSARange(index_range);

  return index_range;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rsi), %r12
testq %r12, %r12
je 0x61fb
movq %rsi, %r14
movq (%rsi), %r13
movzbl -0x1(%r13,%r12), %esi
movq %rbx, %rdi
callq 0x6234
movq %rax, %rcx
shrq $0x20, %rcx
movq %rax, %r15
cmpl %ecx, %eax
ja 0x621c
addq %r13, %r12
decq %r12
pushq $0x1
popq %r15
cmpq (%r14), %r12
je 0x6208
shlq $0x20, %rcx
movl %eax, %esi
orq %rcx, %rsi
movzbl -0x1(%r12), %edx
decq %r12
movq %rbx, %rdi
callq 0x6264
movq %rax, %rcx
shrq $0x20, %rcx
cmpl %ecx, %eax
jbe 0x61cf
jmp 0x621c
movl 0x4(%rbx), %r15d
decl %r15d
shlq $0x20, %r15
jmp 0x621c
movl 0x820(%rbx), %edx
subl %edx, %eax
subl %edx, %ecx
shlq $0x20, %rcx
orq %rcx, %rax
movq %rax, %r15
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::getCharRange(unsigned int) const
pair_type
RLCSA::getCharRange(usint c) const
{
  if(c >= CHARS) { return EMPTY_PAIR; }
  pair_type index_range = this->alphabet->getRange(c);
  this->convertToBWTRange(index_range);
  return index_range;
}

// Assembly:
cmpl $0xff, %esi
jbe 0x6240
pushq $0x1
popq %rax
retq
movq 0x808(%rdi), %rax
movl %esi, %ecx
movq (%rax,%rcx,8), %rcx
movl 0x820(%rdi), %edx
leal (%rdx,%rcx), %eax
shrq $0x20, %rcx
addl %edx, %ecx
shlq $0x20, %rcx
orq %rcx, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::LF(std::pair<unsigned int, unsigned int>, unsigned int) const
pair_type
RLCSA::LF(pair_type range, usint c) const
{
  if(c >= CHARS || this->array[c] == 0) { return EMPTY_PAIR; }
  PsiVector::Iterator iter(*(this->array[c]));

  usint start = this->alphabet->cumulative(c) + this->number_of_sequences - 1;
  range.first = start + iter.rank(range.first, true);
  range.second = start + iter.rank(range.second);

  return range;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x78, %rsp
pushq $0x1
popq %rbx
cmpl $0xff, %edx
ja 0x62e8
movq %rsi, %r14
movq %rdi, %r15
movl %edx, %r12d
movq 0x8(%rdi,%r12,8), %rsi
testq %rsi, %rsi
je 0x62e8
movq %rsp, %rbx
movq %rbx, %rdi
callq 0xfd04
movq 0x808(%r15), %rax
movl (%rax,%r12,8), %r12d
movl 0x820(%r15), %r15d
pushq $0x1
popq %rdx
movq %rbx, %rdi
movl %r14d, %esi
callq 0xfd10
movl %eax, %ebx
shrq $0x20, %r14
movq %rsp, %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0xfd10
movl %eax, %r14d
leal (%r12,%r15), %eax
decl %eax
addl %eax, %ebx
addl %eax, %r14d
movq %rsp, %rdi
callq 0xfd0a
shlq $0x20, %r14
orq %r14, %rbx
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0xfd0a
movq %rbx, %rdi
callq 0x3410
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::reportPositions(unsigned char*, unsigned int, unsigned int*) const
void
RLCSA::reportPositions(uchar* data, usint length, usint* positions) const
{
  if(data == 0 || length == 0 || positions == 0) { return; }

  PsiVector::Iterator** iters = this->getIterators();

  usint current = this->number_of_sequences - 1;
  positions[length] = current; // "immediately after current"
  for(sint i = (sint)(length - 1); i >= 0; i--)
  {
    usint c = (usint)data[i];
    if(this->array[c] != 0)
    {
      current = this->LF(current, c, *(iters[c]));
    }
    else
    {
      if(c < this->alphabet->getFirstChar()) // No previous characters either.
      {
        current = this->number_of_sequences - 1;
      }
      else
      {
        current = this->alphabet->cumulative(c) - 1 + this->number_of_sequences;
      }
    }
    positions[i] = current; // "immediately after current"
  }

  this->deleteIterators(iters);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
testq %rsi, %rsi
sete %al
testl %edx, %edx
sete %cl
orb %al, %cl
testq %rbx, %rbx
sete %al
orb %cl, %al
je 0x6358
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
callq 0x63ea
movq %rax, %r12
movl 0x820(%r15), %eax
decl %eax
movl %ebp, %r13d
movl %eax, (%rbx,%r13,4)
decq %r13
testl %r13d, %r13d
js 0x63d3
movl %r13d, %ebp
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
movzbl (%r14,%rbp), %edx
cmpq $0x0, 0x8(%r15,%rdx,8)
je 0x63a6
movq (%r12,%rdx,8), %rcx
movq %r15, %rdi
movl %eax, %esi
callq 0x8758
jmp 0x63ce
movq 0x808(%r15), %rax
cmpl %edx, 0x804(%rax)
jbe 0x63c0
movl 0x820(%r15), %eax
decl %eax
jmp 0x63ce
movl (%rax,%rdx,8), %eax
movl 0x820(%r15), %ecx
addl %ecx, %eax
decl %eax
movl %eax, (%rbx,%rbp,4)
jmp 0x6378
movq %r12, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x646a
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::getIterators() const
PsiVector::Iterator**
RLCSA::getIterators() const
{
  PsiVector::Iterator** iters = new PsiVector::Iterator*[CHARS];
  for(usint i = 0; i < CHARS; i++)
  {
    if(this->array[i] == 0) { iters[i] = 0; }
    else                    { iters[i] = new PsiVector::Iterator(*(this->array[i])); }
  }
  return iters;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x800, %edi            # imm = 0x800
callq 0x3030
movq %rax, %r14
xorl %ebp, %ebp
pushq $0x78
popq %r15
cmpq $0x100, %rbp            # imm = 0x100
je 0x6442
movq 0x8(%rbx,%rbp,8), %r13
testq %r13, %r13
je 0x6436
movq %r15, %rdi
callq 0x3220
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
callq 0xfd04
jmp 0x6439
xorl %r12d, %r12d
movq %r12, (%r14,%rbp,8)
incq %rbp
jmp 0x640b
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
pushq $0x78
popq %rsi
movq %r12, %rdi
callq 0x3230
movq %rbx, %rdi
callq 0x3410
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::locate(std::pair<unsigned int, unsigned int>, bool, bool) const
usint*
RLCSA::locate(pair_type range, bool direct, bool steps) const
{
  if(!(this->support_locate) || isEmpty(range) || range.second >= this->data_size) { return 0; }

  usint* data = new usint[length(range)];
  if(direct) { this->directLocate(range, data, steps); }
  else       { this->locateUnsafe(range, data, steps); }

  return data;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpb $0x1, 0x818(%rdi)
jne 0x6527
movq %rsi, %rbx
movq %rsi, %rax
shrq $0x20, %rax
xorl %r15d, %r15d
cmpl %eax, %ebx
ja 0x652a
movq %rdi, %r14
cmpl %eax, 0x4(%rdi)
jbe 0x652a
movl %ecx, %ebp
movl %edx, %r12d
subl %ebx, %eax
leaq 0x4(,%rax,4), %rax
movabsq $0x3fffffffc, %rdi      # imm = 0x3FFFFFFFC
andq %rax, %rdi
callq 0x3030
movq %rax, %r15
movzbl %bpl, %ecx
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
testb %r12b, %r12b
je 0x6536
callq 0x653e
jmp 0x652a
xorl %r15d, %r15d
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x6596
jmp 0x652a
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::directLocate(std::pair<unsigned int, unsigned int>, unsigned int*, bool) const
void
RLCSA::directLocate(pair_type range, usint* data, bool steps) const
{
  // range is in SA coordinates, so first we need to convert to BWT coordinates.
  this->convertToBWTRange(range);
  for(usint i = 0, j = range.first; j <= range.second; i++, j++)
  {
    data[i] = this->directLocate(j, steps);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movl 0x820(%rdi), %eax
leal (%rax,%rsi), %r15d
movq %rsi, %r12
shrq $0x20, %r12
addl %eax, %r12d
xorl %r13d, %r13d
movzbl %cl, %ebp
leal (%r15,%r13), %esi
cmpl %r12d, %esi
ja 0x6587
movq %r14, %rdi
movl %ebp, %edx
callq 0x675c
movl %r13d, %ecx
movl %eax, (%rbx,%rcx,4)
incl %r13d
jmp 0x6569
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::locateUnsafe(std::pair<unsigned int, unsigned int>, unsigned int*, bool) const
void
RLCSA::locateUnsafe(pair_type range, usint* data, bool steps) const
{
  this->convertToBWTRange(range);
  usint items = length(range);
  usint* offsets = new usint[items];
  bool* finished = new bool[items];  // FIXME This could be more space efficient...

  PsiVector::Iterator** iters = this->getIterators();

  for(usint i = 0, j = range.first; i < items; i++, j++)
  {
    data[i] = j;
    offsets[i] = 0;
    finished[i] = false;
  }

  bool found = false;
  while(!found)
  {
    found = true;
    pair_type run = EMPTY_PAIR;
    for(usint i = 0; i < items; i++)
    {
      if(finished[i])
      {
        continue; // The run might continue after this.
      }
      else if(isEmpty(run))
      {
        run = pair_type(i, i);
      }
      else if(data[i] - data[run.first] == i - run.first)
      {
        run.second = i;
      }
      else
      {
        found &= this->processRun(run, data, offsets, finished, iters, steps);
        run = pair_type(i, i);
      }
    }
    if(!isEmpty(run)) { found &= this->processRun(run, data, offsets, finished, iters, steps); }
  }

  this->deleteIterators(iters);
  delete[] offsets;
  delete[] finished;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, 0x1c(%rsp)
movq %rdx, %rbx
movq %rdi, %r12
movq %rsi, %r15
shrq $0x20, %r15
movl 0x820(%rdi), %r14d
addl %esi, %r14d
subl %esi, %r15d
incl %r15d
leaq (,%r15,4), %rdi
callq 0x3030
movq %rax, 0x8(%rsp)
movq %r15, %rdi
callq 0x3030
movq %rax, %r13
movq %r12, 0x20(%rsp)
movq %r12, %rdi
callq 0x63ea
movq %rax, 0x10(%rsp)
xorl %eax, %eax
cmpq %rax, %r15
je 0x6616
leaq (%r14,%rax), %rcx
movl %ecx, (%rbx,%rax,4)
movq 0x8(%rsp), %rcx
andl $0x0, (%rcx,%rax,4)
movb $0x0, (%r13,%rax)
incq %rax
jmp 0x65f6
xorl %ebp, %ebp
movzbl 0x1c(%rsp), %r14d
testb $0x1, %bpl
jne 0x66bd
movb $0x1, %bpl
xorl %r12d, %r12d
pushq $0x1
popq %rcx
xorl %esi, %esi
movl %ecx, %eax
cmpq %r12, %r15
je 0x6689
cmpb $0x0, (%r13,%r12)
jne 0x6684
cmpl %esi, %ecx
ja 0x667e
movl (%rbx,%r12,4), %edx
subl (%rbx,%rax,4), %edx
movl %r12d, %edi
subl %ecx, %edi
cmpl %edx, %edi
je 0x6681
shlq $0x20, %rsi
orq %rax, %rsi
movl %r14d, (%rsp)
movq 0x20(%rsp), %rdi
movq %rbx, %rdx
movq 0x8(%rsp), %rcx
movq %r13, %r8
movq 0x10(%rsp), %r9
callq 0x6882
andb %al, %bpl
movl %r12d, %ecx
movl %r12d, %esi
incq %r12
jmp 0x6633
cmpl %esi, %ecx
ja 0x661e
shlq $0x20, %rsi
orq %rsi, %rax
movl %r14d, (%rsp)
movq 0x20(%rsp), %rdi
movq %rax, %rsi
movq %rbx, %rdx
movq 0x8(%rsp), %rcx
movq %r13, %r8
movq 0x10(%rsp), %r9
callq 0x6882
andb %al, %bpl
jmp 0x661e
movq 0x10(%rsp), %rsi
callq 0x646a
movq 0x8(%rsp), %rdi
callq 0x32b0
movq %r13, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x32b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::locate(std::pair<unsigned int, unsigned int>, unsigned int*, bool, bool) const
usint*
RLCSA::locate(pair_type range, usint* data, bool direct, bool steps) const
{
  if(!(this->support_locate) || isEmpty(range) || range.second >= this->data_size || data == 0) { return 0; }

  if(direct) { this->directLocate(range, data, steps); }
  else       { this->locateUnsafe(range, data, steps); }

  return data;
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
movq %rsi, %rdx
shrq $0x20, %rdx
cmpl %edx, %esi
setbe %al
andb 0x818(%rdi), %al
cmpb $0x1, %al
jne 0x6720
xorl %eax, %eax
testq %rbx, %rbx
je 0x6733
cmpl %edx, 0x4(%rdi)
jbe 0x6733
testb %cl, %cl
je 0x6724
movzbl %r8b, %ecx
movq %rbx, %rdx
callq 0x653e
jmp 0x6730
xorl %eax, %eax
jmp 0x6733
movzbl %r8b, %ecx
movq %rbx, %rdx
callq 0x6596
movq %rbx, %rax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::directLocate(unsigned int, bool) const
usint
RLCSA::directLocate(usint index, bool steps) const
{
  // Note that index is in BWT coordinates initially.
  
  // This keeps track of how far along the sequence we had to go to find an SA
  // sample.
  usint offset = 0;
  while(true)
  {
    // First try in BWT space, so we can account for the text end characters.
    if(this->hasImplicitSample(index))
    {
      // If we took an implicit sample at this index in the BWT (due to us being
      // in the range occupied by sequence start characters), we know where it
      // falls in the original sequences: at the endpoint of the appropriate
      // text.
      if(steps) { return offset; }
      else      { return this->getImplicitSample(index) - offset; }
    }
    // Pop index into SA space, where the SA samples live
    index -= this->number_of_sequences;
    if(this->sa_samples->isSampled(index))
    {
      // If we took a real SA sample here, we know where it falls in the
      // original sequences.
      return (steps ? offset : this->sa_samples->getSampleAt(index) - offset);
    }
    
    // If we get here, we couldn't map this position. Proceed forwards (towards
    // the end of the sequence), in hopes of hitting either a sample or the
    // sequence end character. Note that psi maps from SA position to the *BWT*
    // position of the subsequent character, popping index back into BWT space.
    index = this->psi(index);
    offset++;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %eax
movq %rdi, %r14
xorl %ebx, %ebx
movl %eax, %r15d
subl 0x820(%r14), %r15d
jb 0x679a
movq 0x810(%r14), %rdi
movl %r15d, %esi
callq 0x87ca
testb %al, %al
jne 0x67ab
movq %r14, %rdi
movl %r15d, %esi
callq 0x887c
incl %ebx
jmp 0x676c
testb %bpl, %bpl
jne 0x67c3
movq %r14, %rdi
movl %eax, %esi
callq 0x877c
jmp 0x67bf
testb %bpl, %bpl
jne 0x67c3
movq 0x810(%r14), %rdi
movl %r15d, %esi
callq 0x8814
subl %ebx, %eax
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::directInverseLocate(unsigned int) const
usint
RLCSA::directInverseLocate(usint location) const
{
  // Get the SA value and SA index (in that order) of the last SA sample
  // before the given text location.
  pair_type last_sample = this->sa_samples->inverseSA(location);
  
  // TODO: catch the (size, size) sentinel.
  while(last_sample.first < location) {
    // We're not at the desired text location, so we must be before it.
    
    // Advance the text location (SA value) by 1
    last_sample.first += 1;
    
    // Advance the SA index to that corresponding to the next character. Note
    // that psi returns BWT coordinates, so we have to convert back to SA
    // coordinates.
    last_sample.second = (this->psi(last_sample.second) - 
      this->number_of_sequences);
      
  }
  
  if(last_sample.first != location) {
    // We managed to start on the wrong side of what we're trying to locate;
    // inverseSA lied to us.
    throw "Somehow skipped desired inverse locate position";
  }
  
  // Return the answer (SA index) in BWT coordinates. It will probably be
  // immediately converted back to SA coordinates, but it's worth it for
  // consistency with the directLocate function, which takes in BWT coordinates.
  return last_sample.second + this->number_of_sequences;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movq 0x810(%rdi), %rdi
callq 0xaa2e
movq %rax, %r14
shrq $0x20, %rax
movl %r14d, %r15d
cmpl %ebp, %r15d
jae 0x682e
incl %r15d
movq %rbx, %rdi
movl %eax, %esi
callq 0x887c
subl 0x820(%rbx), %eax
jmp 0x6814
cmpl %ebp, %r14d
ja 0x6844
addl 0x820(%rbx), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x8
popq %rdi
callq 0x3110
leaq 0xcc70(%rip), %rcx      # 0x134c3
movq %rcx, (%rax)
movq 0x16763(%rip), %rsi     # 0x1cfc0
movq %rax, %rdi
xorl %edx, %edx
callq 0x33d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::display(unsigned int, bool) const
uchar*
RLCSA::display(usint sequence, bool include_end_marker) const
{
  if(!(this->support_display)) { return 0; }

  pair_type seq_range = this->getSequenceRange(sequence);
  if(isEmpty(seq_range)) { return 0; }

  uchar* data = new uchar[length(seq_range) + include_end_marker];
  this->displayUnsafe(seq_range, data);
  if(include_end_marker) { data[length(seq_range)] = 0; }

  return data;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
cmpb $0x1, 0x819(%rdi)
jne 0x6b1b
movl %edx, %ebx
movq %rdi, %r14
callq 0x6b60
movq %rax, %r15
movq %rax, %r12
shrq $0x20, %r12
subl %r15d, %r12d
jae 0x6b2a
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movzbl %bl, %r13d
leal (%r12,%r13), %edi
incl %edi
callq 0x3030
movq %rax, %rbx
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x6c06
testb %r13b, %r13b
je 0x6b1d
incl %r12d
movl %r12d, %eax
movb $0x0, (%rbx,%rax)
jmp 0x6b1d
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::getSequenceRange(unsigned int) const
pair_type
RLCSA::getSequenceRange(usint number) const
{
  if(number >= this->number_of_sequences) { return EMPTY_PAIR; }

  pair_type result;
  DeltaVector::Iterator iter(*(this->end_points));
  if(number == 0)
  {
    result.first = 0;
    result.second = iter.select(number);
  }
  else
  {
    result.first = nextMultipleOf(this->sample_rate, iter.select(number - 1));
    result.second = iter.selectNext();
  }

  return result;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
cmpl %esi, 0x820(%rdi)
jbe 0x6bbc
movl %esi, %ebx
movq %rdi, %r14
movq 0x828(%rdi), %rsi
leaq 0x8(%rsp), %rdi
callq 0xf8d8
testl %ebx, %ebx
je 0x6bc1
movl 0x81c(%r14), %ebp
decl %ebx
leaq 0x8(%rsp), %rdi
movl %ebx, %esi
callq 0xf976
xorl %edx, %edx
divl %ebp
movl %eax, %ebx
leaq 0x8(%rsp), %rdi
callq 0xf9d8
movl %eax, %r14d
incl %ebx
imull %ebp, %ebx
jmp 0x6bd2
pushq $0x1
popq %rax
jmp 0x6be5
xorl %ebx, %ebx
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0xf976
movl %eax, %r14d
leaq 0x8(%rsp), %rdi
callq 0xf8de
shlq $0x20, %r14
movl %ebx, %eax
orq %r14, %rax
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xf8de
movq %rbx, %rdi
callq 0x3410
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::display(unsigned int, std::pair<unsigned int, unsigned int>) const
uchar*
RLCSA::display(usint sequence, pair_type range) const
{
  if(!(this->support_display) || isEmpty(range)) { return 0; }

  pair_type seq_range = this->getSequenceRange(sequence);
  if(isEmpty(seq_range)) { return 0; }

  range.first += seq_range.first; range.second += seq_range.first;
  if(range.second > seq_range.second) { return 0; }

  uchar* data = new uchar[length(range)];
  this->displayUnsafe(range, data);

  return data;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movq %rdx, %r14
shrq $0x20, %r14
cmpl %r14d, %r15d
setbe %al
andb 0x819(%rdi), %al
cmpb $0x1, %al
jne 0x6dd8
movq %rdi, %rbx
callq 0x6b60
movq %rax, %rcx
shrq $0x20, %rcx
cmpl %ecx, %eax
ja 0x6dd8
addl %eax, %r14d
cmpl %ecx, %r14d
jbe 0x6de4
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
addq %r15, %rax
movq %r14, %rcx
shlq $0x20, %rcx
movl %eax, %r15d
orq %rcx, %r15
subl %eax, %r14d
incl %r14d
movq %r14, %rdi
callq 0x3030
movq %rax, %r14
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x6c06
jmp 0x6ddb
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::display(unsigned int, std::pair<unsigned int, unsigned int>, unsigned char*) const
uchar*
RLCSA::display(usint sequence, pair_type range, uchar* data) const
{
  if(!(this->support_display) || isEmpty(range) || data == 0) { return 0; }

  pair_type seq_range = this->getSequenceRange(sequence);
  if(isEmpty(seq_range)) { return 0; }

  range.first += seq_range.first; range.second += seq_range.first;
  if(range.second > seq_range.second) { return 0; }

  this->displayUnsafe(range, data);
  return data;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpb $0x1, 0x819(%rdi)
jne 0x6e63
movq %rcx, %rbx
movq %rdx, %r15
movq %rdx, %r12
shrq $0x20, %r12
cmpl %r12d, %r15d
seta %al
testq %rcx, %rcx
sete %cl
orb %al, %cl
jne 0x6e63
movq %rdi, %r14
callq 0x6b60
movq %rax, %rcx
shrq $0x20, %rcx
cmpl %ecx, %eax
ja 0x6e63
addl %eax, %r12d
cmpl %ecx, %r12d
jbe 0x6e74
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
addl %r15d, %eax
shlq $0x20, %r12
orq %r12, %rax
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x6c06
jmp 0x6e65
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::display(unsigned int, unsigned int, unsigned int, unsigned int&) const
uchar*
RLCSA::display(usint position, usint len, usint context, usint& result_length) const
{
  if(!(this->support_display)) { return 0; }

  pair_type range = this->getSequenceRangeForPosition(position);
  if(isEmpty(range)) { return 0; }

  range.first = position - std::min(context, position - range.first);
  range.second = std::min(range.second, position + len + context - 1);
  result_length = length(range);
  if(isEmpty(range)) { return 0; }

  uchar* data = new uchar[length(range)];
  this->displayUnsafe(range, data);

  return data;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpb $0x1, 0x819(%rdi)
jne 0x6eec
movq %r8, %r14
movl %ecx, %r15d
movl %edx, %r12d
movl %esi, %ebp
movq %rdi, %rbx
callq 0x6f24
movq %rax, %rcx
shrq $0x20, %rcx
cmpl %ecx, %eax
ja 0x6eec
movl %ebp, %edx
subl %eax, %edx
cmpl %r15d, %edx
cmovael %r15d, %edx
movl %ebp, %eax
subl %edx, %eax
addl %ebp, %r12d
leal (%r15,%r12), %edx
decl %edx
cmpl %ecx, %edx
cmovbl %edx, %ecx
movl %ecx, %edx
subl %eax, %edx
leal 0x1(%rdx), %edx
movl %edx, (%r14)
jae 0x6efb
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
shlq $0x20, %rcx
movl %eax, %r15d
orq %rcx, %r15
movl %edx, %edi
callq 0x3030
movq %rax, %r14
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x6c06
jmp 0x6eef
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::displayPrefix(unsigned int, unsigned int, unsigned char*) const
usint
RLCSA::displayPrefix(usint sequence, usint len, uchar* data) const
{
  if(!(this->support_display) || len == 0 || data == 0) { return 0; }

  pair_type seq_range = this->getSequenceRange(sequence);
  if(isEmpty(seq_range)) { return 0; }

  pair_type range(seq_range.first, std::min(seq_range.second, seq_range.first + len - 1));

  this->displayUnsafe(range, data);
  return length(range);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %ebp, %ebp
testq %rcx, %rcx
je 0x6faa
movl %edx, %r12d
testl %edx, %edx
je 0x6faa
movq %rdi, %r14
cmpb $0x0, 0x819(%rdi)
je 0x6faa
movq %rcx, %rbx
movq %r14, %rdi
callq 0x6b60
movq %rax, %r15
movq %rax, %r13
shrq $0x20, %r13
cmpl %r13d, %r15d
ja 0x6faa
leal (%r12,%r15), %eax
decl %eax
cmpl %r13d, %eax
cmovbl %eax, %r13d
movq %r13, %rax
shlq $0x20, %rax
movl %r15d, %esi
orq %rax, %rsi
movq %r14, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x6c06
subl %r15d, %r13d
incl %r13d
movl %r13d, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::displayFromPosition(unsigned int, unsigned int, unsigned char*) const
usint
RLCSA::displayFromPosition(usint index, usint max_len, uchar* data) const
{
  if(max_len == 0 || data == 0 || index >= this->data_size) { return 0; }

  for(usint i = 0; i < max_len; i++)
  {
    data[i] = this->getCharacter(index);
    index = this->psiUnsafe(index, data[i]);
    if(index < this->number_of_sequences) { return i + 1; }
    index -= this->number_of_sequences;
  }

  return max_len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
xorl %ebx, %ebx
testl %edx, %edx
je 0x7018
movq %rcx, %r14
testq %rcx, %rcx
je 0x7018
movl %esi, %ebp
movq %rdi, %r15
cmpl %esi, 0x4(%rdi)
jbe 0x7018
movl %edx, %r12d
xorl %ebx, %ebx
cmpq %rbx, %r12
je 0x7011
movq %r15, %rdi
movl %ebp, %esi
callq 0x8958
movb %al, (%r14,%rbx)
movzbl %al, %edx
movq %r15, %rdi
movl %ebp, %esi
callq 0x8964
movl %eax, %ebp
subl 0x820(%r15), %ebp
jb 0x7016
incq %rbx
jmp 0x6fe1
movl %r12d, %ebx
jmp 0x7018
incl %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::locateRange(std::pair<unsigned int, unsigned int>) const
std::vector<usint>*
RLCSA::locateRange(pair_type range) const
{
  std::vector<usint>* results = new std::vector<usint>;
  if(!(this->support_locate)) { return results; }

  this->locateRange(range, *results);
  removeDuplicates(results, false);

  return results;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
pushq $0x18
popq %rdi
callq 0x3220
movq %rax, %rbx
andq $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
cmpb $0x1, 0x818(%r15)
jne 0x70a9
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x70b2
movq %rbx, %rdi
xorl %esi, %esi
callq 0x8a00
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::locateRange(std::pair<unsigned int, unsigned int>, std::vector<unsigned int, std::allocator<unsigned int>>&) const
void
RLCSA::locateRange(pair_type range, std::vector<usint>& vec) const
{
  if(isEmpty(range) || range.second >= this->data_size) { return; }

  usint* data = new usint[length(range)];
  this->locateUnsafe(range, data, false);
  for(usint i = 0; i < length(range); i++) { vec.push_back(data[i]); }
  delete[] data;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rsi, %r14
shrq $0x20, %r14
cmpl %r14d, %r15d
ja 0x7118
movq %rdi, %r12
cmpl %r14d, 0x4(%rdi)
jbe 0x7118
movq %rdx, %rbx
subl %r15d, %r14d
incl %r14d
shlq $0x2, %r14
movq %r14, %rdi
callq 0x3030
movq %rax, %r13
xorl %ebp, %ebp
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x6596
cmpq %rbp, %r14
je 0x7127
movq %r13, %rsi
addq %rbp, %rsi
movq %rbx, %rdi
callq 0x8a36
addq $0x4, %rbp
jmp 0x70ff
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x32b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::locateRanges(std::vector<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int>>>&) const
std::vector<usint>*
RLCSA::locateRanges(std::vector<pair_type>& ranges) const
{
  std::vector<usint>* results = new std::vector<usint>;
  if(!(this->support_locate)) { return results; }

  for(std::vector<pair_type>::iterator iter = ranges.begin(); iter != ranges.end(); ++iter)
  {
    this->locateRange(*iter, *results);
  }
  removeDuplicates(results, false);

  return results;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
pushq $0x18
popq %rdi
callq 0x3220
movq %rax, %rbx
andq $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
cmpb $0x1, 0x818(%r15)
jne 0x7194
movq (%r14), %r12
cmpq 0x8(%r14), %r12
je 0x718a
movq (%r12), %rsi
movq %r15, %rdi
movq %rbx, %rdx
callq 0x70b2
addq $0x8, %r12
jmp 0x716f
movq %rbx, %rdi
xorl %esi, %esi
callq 0x8a00
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::getSequenceForPosition(unsigned int*, unsigned int) const
usint*
RLCSA::getSequenceForPosition(usint* values, usint len) const
{
  if(values == 0) { return 0; }

  DeltaVector::Iterator iter(*(this->end_points));
  for(usint i = 0; i < len; i++)
  {
    if(values[i] > 0) { values[i] = iter.rank(values[i] - 1); }
  }

  return values;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq %rsi, %rbx
testq %rsi, %rsi
je 0x725b
movl %edx, %ebp
movq 0x828(%rdi), %rsi
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0xf8d8
movl %ebp, %r15d
xorl %r12d, %r12d
cmpq %r12, %r15
je 0x7251
movl (%rbx,%r12,4), %esi
testl %esi, %esi
je 0x724c
decl %esi
movq %r14, %rdi
xorl %edx, %edx
callq 0xf8e4
movl %eax, (%rbx,%r12,4)
incq %r12
jmp 0x722f
leaq 0x8(%rsp), %rdi
callq 0xf8de
movq %rbx, %rax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xf8de
movq %rbx, %rdi
callq 0x3410
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::getRelativePosition(unsigned int) const
pair_type
RLCSA::getRelativePosition(usint value) const
{
  // Get an iterator so we can use the vector of sequence endpoints.
  DeltaVector::Iterator iter(*(this->end_points));
  
  // Start out saying we're in text 0 at index whatever our index in the whole
  // string of texts is.
  pair_type result(0, value);

  // Adjust the text number to whatever text hadn't yet ended at the position
  // before the one we're interested in.
  if(value > 0) { result.first = iter.rank(value - 1); }
  if(result.first > 0)
  {
    // If we're not still in the 0th text, re-base our index in the text to
    // count from the first multiple of the SA sample rate after the end of the
    // text before this text (since we have declared text coordinates start on
    // SA sample multiples).
    result.second -= nextMultipleOf(this->sample_rate, iter.select(result.first - 1));
  }

  // Return the fixed-up relative position.
  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x78, %rsp
movl %esi, %ebx
movq %rdi, %r15
movq 0x828(%rdi), %rsi
movq %rsp, %rdi
callq 0xf8d8
testl %ebx, %ebx
je 0x72df
leal -0x1(%rbx), %esi
movq %rsp, %rdi
xorl %edx, %edx
callq 0xf8e4
movl %eax, %r14d
testl %eax, %eax
je 0x72e6
movl 0x81c(%r15), %ebp
leal -0x1(%r14), %esi
movq %rsp, %rdi
callq 0xf976
xorl %edx, %edx
divl %ebp
notl %eax
imull %ebp, %eax
addl %ebx, %eax
movl %r14d, %r14d
movl %eax, %ebx
jmp 0x72e9
xorl %r14d, %r14d
xorl %ebx, %ebx
jmp 0x72e9
xorl %r14d, %r14d
movq %rsp, %rdi
callq 0xf8de
shlq $0x20, %rbx
orq %r14, %rbx
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0xf8de
movq %rbx, %rdi
callq 0x3410
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::getAbsolutePosition(std::pair<unsigned int, unsigned int>) const
usint
RLCSA::getAbsolutePosition(pair_type position) const
{
  // Get an iterator so we can use the vector of sequence endpoints.
  DeltaVector::Iterator iter(*(this->end_points));
  
  // Where is this position as an absolute position? Start off at the beginning.
  usint value = 0;
  
  if(position.first > 0) {
    // Only the 0th text starts at 0. Find the absolute endpoint of the previous
    // text, and then start at the next multiple of the sample rate after that.
    // That is where this text is going to start.
    value = nextMultipleOf(this->sample_rate, iter.select(position.first - 1));
  }
  
  // Advance the start of the text by the index into the text.
  value += position.second;
  
  // Return the resulting absolute position.
  return value;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x828(%rdi), %rsi
leaq 0x8(%rsp), %rdi
callq 0xf8d8
testl %ebx, %ebx
je 0x735f
movl 0x81c(%r14), %ebp
leal -0x1(%rbx), %esi
leaq 0x8(%rsp), %rdi
callq 0xf976
xorl %edx, %edx
divl %ebp
incl %eax
imull %ebp, %eax
jmp 0x7361
xorl %eax, %eax
shrq $0x20, %rbx
addl %eax, %ebx
leaq 0x8(%rsp), %rdi
callq 0xf8de
movl %ebx, %eax
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xf8de
movq %rbx, %rdi
callq 0x3410
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::readBWT(std::pair<unsigned int, unsigned int>) const
uchar*
RLCSA::readBWT(pair_type range) const
{
  if(isEmpty(range) || range.second >= this->data_size + this->number_of_sequences) { return 0; }

  usint n = length(range);

  uchar* bwt = new uchar[n];
  memset(bwt, 0, n);

  for(usint c = 0; c < CHARS; c++)
  {
    if(this->array[c] != 0)
    {
      PsiVector::Iterator iter(*(this->array[c]));
      usint pos = iter.valueAfter(range.first).first;
      while(pos <= range.second)
      {
        bwt[pos - range.first] = c;
        pos = iter.selectNext();
      }
    }
  }

  return bwt;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %rbx
movq %rsi, %r13
shrq $0x20, %r13
cmpl %r13d, %ebx
ja 0x7447
movq %rdi, %r14
movl 0x820(%rdi), %eax
addl 0x4(%rdi), %eax
cmpl %r13d, %eax
jbe 0x7447
movl %r13d, %r12d
subl %ebx, %r12d
incl %r12d
movq %r12, %rdi
callq 0x3030
movq %rax, %r15
xorl %ebp, %ebp
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x3130
movq %rsp, %r12
cmpq $0x100, %rbp            # imm = 0x100
je 0x744a
movq 0x8(%r14,%rbp,8), %rsi
testq %rsi, %rsi
je 0x7442
movq %r12, %rdi
callq 0xfd04
movq %r12, %rdi
movl %ebx, %esi
callq 0xff92
cmpl %r13d, %eax
ja 0x743a
subl %ebx, %eax
movb %bpl, (%r15,%rax)
movq %r12, %rdi
callq 0xfe84
jmp 0x7425
movq %r12, %rdi
callq 0xfd0a
incq %rbp
jmp 0x7400
xorl %r15d, %r15d
movq %r15, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x745e
movq %rax, %rbx
movq %rsp, %rdi
callq 0xfd0a
movq %rbx, %rdi
callq 0x3410
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::countRuns() const
usint
RLCSA::countRuns() const
{
  usint runs = 0;
  for(usint c = 0; c < CHARS; c++)
  {
    if(this->array[c] != 0)
    {
      PsiVector::Iterator iter(*(this->array[c]));
      runs += iter.countRuns();
    }
  }

  return runs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
xorl %r15d, %r15d
movq %rsp, %r14
xorl %ebp, %ebp
cmpq $0x100, %r15            # imm = 0x100
je 0x74b9
movq 0x8(%rbx,%r15,8), %rsi
testq %rsi, %rsi
je 0x74b4
movq %r14, %rdi
callq 0xfd04
movq %r14, %rdi
callq 0x10102
addl %eax, %ebp
movq %r14, %rdi
callq 0xfd0a
incq %r15
jmp 0x7487
movl %ebp, %eax
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0xfd0a
movq %rbx, %rdi
callq 0x3410
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::getSuffixArrayForSequence(unsigned int) const
SuffixArray*
RLCSA::getSuffixArrayForSequence(usint number) const
{
  if(!this->supportsDisplay()) { return 0; }

  pair_type seq_range = this->getSequenceRange(number);
  if(isEmpty(seq_range)) { return 0; }

  uchar* data = new uchar[length(seq_range) + 1];
  usint* ranks = new usint[length(seq_range) + 1];
  this->displayUnsafe(seq_range, data, true, ranks);
  data[length(seq_range)] = 0; ranks[length(seq_range)] = number;

  return new SuffixArray(data, ranks, length(seq_range) + 1, 1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpb $0x1, 0x819(%rdi)
jne 0x7507
movl %esi, %ebp
movq %rdi, %r14
callq 0x6b60
movq %rax, %r15
movq %rax, %rbx
shrq $0x20, %rbx
subl %r15d, %ebx
jae 0x750c
xorl %r14d, %r14d
jmp 0x7574
leal 0x1(%rbx), %eax
movq %rax, (%rsp)
addl $0x2, %ebx
movq %rbx, %rdi
callq 0x3030
movq %rax, %r12
leaq (,%rbx,4), %rdi
callq 0x3030
movq %rax, %r13
pushq $0x1
popq %rcx
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movl %ecx, %r15d
movq %rax, %r8
callq 0x6c06
movq (%rsp), %rax
movb $0x0, (%r12,%rax)
movl %ebp, (%r13,%rax,4)
pushq $0x30
popq %rdi
callq 0x3220
movq %rax, %r14
movq %rax, %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %ecx
movl %r15d, %r8d
callq 0xd152
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
pushq $0x30
popq %rsi
movq %r14, %rdi
callq 0x3230
movq %rbx, %rdi
callq 0x3410