LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::reportSize(bool) const
usint
RLCSA::reportSize(bool print) const
{
  usint bytes = 0, temp = 0, bwt = 0;

  for(usint c = 0; c < CHARS; c++)
  {
    if(this->array[c])
    {
      bytes += this->array[c]->reportSize();
      bwt += this->array[c]->getCompressedSize();
    }
  }
  bytes += sizeof(*this) + this->alphabet->reportSize() + this->end_points->reportSize();
  if(print)
  {
    std::cout << "RLCSA:           " << (bytes / (double)MEGABYTE) << " MB" << std::endl;
    std::cout << "  BWT only:      " << (bwt / (double)MEGABYTE) << " MB" << std::endl;
  }

  if(this->support_locate || this->support_display)
  {
    temp = this->sa_samples->reportSize();
    if(print) { std::cout << "SA samples:      " << (temp / (double)MEGABYTE) << " MB" << std::endl; }
    bytes += temp;
  }

  if(print)
  {
    std::cout << "Total size:      " << (bytes / (double)MEGABYTE) << " MB" << std::endl;
    std::cout << std::endl;
  }

  return bytes;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
xorl %r12d, %r12d
xorl %r15d, %r15d
xorl %r13d, %r13d
cmpq $0x100, %r12            # imm = 0x100
je 0x75e2
movq 0x8(%r14,%r12,8), %rdi
testq %rdi, %rdi
je 0x75dd
callq 0xfcf8
addl %eax, %r15d
movq 0x8(%r14,%r12,8), %rdi
callq 0xf3a6
addl %eax, %r13d
incq %r12
jmp 0x75b5
movq 0x808(%r14), %rdi
callq 0xb5b8
movl %eax, %ebp
movq 0x828(%r14), %rdi
callq 0xf8cc
addl %ebp, %r15d
leal (%rax,%r15), %ebp
addl $0x830, %ebp            # imm = 0x830
testb %bl, %bl
je 0x7692
movq 0x159b8(%rip), %r15     # 0x1cfd0
leaq 0xbed4(%rip), %rsi      # 0x134f3
movq %r15, %rdi
callq 0x3200
movl %ebp, %ecx
cvtsi2sd %rcx, %xmm0
mulsd 0xb9da(%rip), %xmm0     # 0x13010
movq %rax, %rdi
callq 0x3390
leaq 0xbec0(%rip), %r12      # 0x13505
movq %rax, %rdi
movq %r12, %rsi
callq 0x3200
movq %rax, %rdi
callq 0x3100
leaq 0xbeaa(%rip), %rsi      # 0x13509
movq %r15, %rdi
callq 0x3200
movl %r13d, %ecx
cvtsi2sd %rcx, %xmm0
mulsd 0xb999(%rip), %xmm0     # 0x13010
movq %rax, %rdi
callq 0x3390
movq %rax, %rdi
movq %r12, %rsi
callq 0x3200
movq %rax, %rdi
callq 0x3100
cmpb $0x0, 0x818(%r14)
jne 0x76a6
cmpb $0x1, 0x819(%r14)
jne 0x76fe
movq 0x810(%r14), %rdi
callq 0xa9ea
movl %eax, %r14d
testb %bl, %bl
je 0x76fb
movq 0x15910(%rip), %rdi     # 0x1cfd0
leaq 0xbe54(%rip), %rsi      # 0x1351b
callq 0x3200
movl %r14d, %ecx
cvtsi2sd %rcx, %xmm0
mulsd 0xb934(%rip), %xmm0     # 0x13010
movq %rax, %rdi
callq 0x3390
leaq 0xbe1a(%rip), %rsi      # 0x13505
movq %rax, %rdi
callq 0x3200
movq %rax, %rdi
callq 0x3100
addl %r14d, %ebp
testb %bl, %bl
je 0x774e
movq 0x158c7(%rip), %rbx     # 0x1cfd0
leaq 0xbe1d(%rip), %rsi      # 0x1352d
movq %rbx, %rdi
callq 0x3200
movl %ebp, %ecx
cvtsi2sd %rcx, %xmm0
mulsd 0xb8e9(%rip), %xmm0     # 0x13010
movq %rax, %rdi
callq 0x3390
leaq 0xbdcf(%rip), %rsi      # 0x13505
movq %rax, %rdi
callq 0x3200
movq %rax, %rdi
callq 0x3100
movq %rbx, %rdi
callq 0x3100
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::printInfo() const
void
RLCSA::printInfo() const
{
  double megabytes = this->data_size / (double)MEGABYTE;

  std::cout << "Sequences:       " << this->number_of_sequences << std::endl;
  std::cout << "Original size:   " << megabytes << " MB" << std::endl;
  std::cout << "Block size:      " << (this->getBlockSize() * sizeof(usint)) << " bytes" << std::endl;
  if(this->support_locate || this->support_display)
  {
    std::cout << "Sample rate:     " << this->sample_rate;
    if(this->sa_samples->isWeighted()) { std::cout << " (weighted)"; }
    std::cout << std::endl;
  }
  std::cout << std::endl;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x4(%rdi), %eax
cvtsi2sd %rax, %xmm0
mulsd 0xb899(%rip), %xmm0     # 0x13010
movsd %xmm0, (%rsp)
movq 0x1584d(%rip), %r14     # 0x1cfd0
leaq 0xbdb5(%rip), %rsi      # 0x1353f
movq %r14, %rdi
callq 0x3200
movl 0x820(%rbx), %esi
movq %rax, %rdi
callq 0x3160
movq %rax, %rdi
callq 0x3100
leaq 0xbda2(%rip), %rsi      # 0x13551
movq %r14, %rdi
callq 0x3200
movq %rax, %rdi
movsd (%rsp), %xmm0
callq 0x3390
leaq 0xbd3a(%rip), %rsi      # 0x13505
movq %rax, %rdi
callq 0x3200
movq %rax, %rdi
callq 0x3100
leaq 0xbd81(%rip), %rsi      # 0x13563
movq %r14, %rdi
callq 0x3200
movq 0x808(%rbx), %rcx
movl 0x804(%rcx), %ecx
movq 0x8(%rbx,%rcx,8), %rcx
movl 0x10(%rcx), %esi
shlq $0x2, %rsi
movq %rax, %rdi
callq 0x3160
leaq 0xbd63(%rip), %rsi      # 0x13575
movq %rax, %rdi
callq 0x3200
movq %rax, %rdi
callq 0x3100
cmpb $0x0, 0x818(%rbx)
jne 0x7834
cmpb $0x1, 0x819(%rbx)
jne 0x7880
movq 0x15795(%rip), %rdi     # 0x1cfd0
leaq 0xbd3a(%rip), %rsi      # 0x1357c
callq 0x3200
movl 0x81c(%rbx), %esi
movq %rax, %rdi
callq 0x3160
movq 0x810(%rbx), %rax
cmpb $0x1, (%rax)
jne 0x7874
movq 0x15768(%rip), %rdi     # 0x1cfd0
leaq 0xbd1f(%rip), %rsi      # 0x1358e
callq 0x3200
movq 0x15755(%rip), %rdi     # 0x1cfd0
callq 0x3100
movq 0x15749(%rip), %rdi     # 0x1cfd0
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3100
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::lcp(unsigned int, CSA::LCPSamples const&, bool) const
usint
RLCSA::lcp(usint index, const LCPSamples& lcp_samples, bool steps) const
{
  if(index >= this->data_size) { return 0; }

  usint offset = 0;
  while(true)
  {
    if(lcp_samples.isSampled(index))
    {
      return (steps ? offset : lcp_samples.getSampleAt(index) + offset);
    }
    index = this->psi(index); this->convertToSAIndex(index);
    offset++;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
xorl %ebx, %ebx
cmpl %esi, 0x4(%rdi)
jbe 0x82e7
movl %ecx, %r15d
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r12
xorl %ebx, %ebx
movq %r14, %rdi
movl %ebp, %esi
callq 0x8ac8
testb %al, %al
jne 0x82d6
movq %r12, %rdi
movl %ebp, %esi
callq 0x887c
movl %eax, %ebp
subl 0x820(%r12), %ebp
incl %ebx
jmp 0x82b0
testb %r15b, %r15b
jne 0x82e7
movq %r14, %rdi
movl %ebp, %esi
callq 0x8b12
addl %eax, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::lcpDirect(unsigned int) const
usint
RLCSA::lcpDirect(usint index) const
{
  if(index >= this->data_size || index == 0)
  {
    return 0;
  }

  usint match = index - 1;
  usint value = 0;

  usint c = this->getCharacter(index);
  usint low = this->alphabet->cumulative(c);
  while(match >= low)
  {
    PsiVector::Iterator iter(*(this->array[c]));
    match = this->psiUnsafe(match, c, iter);
    index = this->psiUnsafe(index, c, iter);
    value++;

    if(match < this->number_of_sequences || index < this->number_of_sequences)
    {
      break;
    }
    this->convertToSAIndex(match); this->convertToSAIndex(index);

    c = this->getCharacter(index);
    low = this->alphabet->cumulative(c);
  }

  return value;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
xorl %ebp, %ebp
testl %esi, %esi
je 0x83e7
movq %rdi, %r13
movq %rsi, 0x8(%rsp)
cmpl %esi, 0x4(%rdi)
jbe 0x83e7
movq 0x8(%rsp), %rsi
leal -0x1(%rsi), %r14d
movq %r13, %rdi
callq 0x8958
movl %eax, %r15d
movq 0x808(%r13), %rax
movl %r15d, %ecx
movl (%rax,%rcx,8), %r12d
xorl %ebp, %ebp
cmpl %r12d, %r14d
jb 0x83e7
movl %r15d, %eax
movq 0x8(%r13,%rax,8), %rsi
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0xfd04
movq %r13, %rdi
movl %r14d, %esi
movl %r15d, %edx
movq %rbx, %rcx
callq 0x89ec
movl %r15d, %ebx
movl %eax, %r15d
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movl %ebx, %edx
leaq 0x10(%rsp), %rcx
callq 0x89ec
movl %ebx, %edi
movl 0x820(%r13), %ecx
movl %r15d, %r14d
subl %ecx, %r14d
setae %dl
movl %eax, %esi
subl %ecx, %esi
setae %bl
andb %dl, %bl
je 0x83c8
movq %r13, %rdi
movq %rsi, 0x8(%rsp)
callq 0x8958
movl %eax, %r15d
movq 0x808(%r13), %rax
movl %r15d, %ecx
movl (%rax,%rcx,8), %r12d
jmp 0x83d3
movq %rax, 0x8(%rsp)
movl %r15d, %r14d
movl %edi, %r15d
leaq 0x10(%rsp), %rdi
callq 0xfd0a
incl %ebp
testb %bl, %bl
jne 0x8342
movl %ebp, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xfd0a
movq %rbx, %rdi
callq 0x3410
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/./rlcsa.h
// Function: CSA::RLCSA::psi(unsigned int) const
inline usint psi(usint sa_index) const
    {
      if(sa_index >= this->data_size)
      {
        return this->data_size + this->number_of_sequences;
      }

      usint c = this->getCharacter(sa_index);
      return this->psiUnsafe(sa_index, c);
    }

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x4(%rdi), %eax
cmpl %esi, %eax
jbe 0x88a5
movl %esi, %ebp
movq %rbx, %rdi
callq 0x8958
movq %rbx, %rdi
movl %ebp, %esi
movl %eax, %edx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x8964
addl 0x820(%rbx), %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/./misc/utils.h
// Function: void CSA::removeDuplicates<unsigned int>(std::vector<unsigned int, std::allocator<unsigned int>>*, bool)
void
removeDuplicates(std::vector<T>* vec, bool parallel = true)
{
  if(vec == 0) { return; }
  if(parallel) { parallelSort(vec->begin(), vec->end()); }
  else         { sequentialSort(vec->begin(), vec->end()); }
  vec->resize(std::unique(vec->begin(), vec->end()) - vec->begin());
}

// Assembly:
testq %rdi, %rdi
je 0x8a34
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
movq 0x8(%rbx), %rsi
callq 0x8cb3
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
callq 0x9281
subq (%rbx), %rax
sarq $0x2, %rax
movq %rbx, %rdi
movq %rax, %rsi
popq %rbx
jmp 0x8c82
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/./bits/bitbuffer.h
// Function: CSA::ReadBuffer::readItemConst(unsigned int) const
inline usint readItemConst(usint item) const
    {
      usint b = item * this->item_bits;
      usint p = b / WORD_BITS;
      b = WORD_BITS - b % WORD_BITS;

      usint c = this->item_bits;
      usint value = 0;

      if(c >= b)
      {
        c -= b;
        value |= HIGHER(GET(this->data[p], b), c);
        p++; b = WORD_BITS;
      }
      if(c > 0)
      {
        b -= c;
        value |= GET(LOWER(this->data[p], b), c);
      }

      return value;
    }

// Assembly:
movl %esi, %ecx
movl 0xc(%rdi), %r9d
imull %r9d, %ecx
movl %ecx, %r8d
shrl $0x5, %r8d
andl $0x1f, %ecx
pushq $0x20
popq %rsi
movl %esi, %r10d
subl %ecx, %r10d
xorl %eax, %eax
movl %r9d, %edx
subl %r10d, %edx
jae 0x8bd1
movl %r10d, %esi
movl %r9d, %edx
jmp 0x8be6
movq (%rdi), %rax
movl %r8d, %r9d
movl (%rax,%r9,4), %eax
shll %cl, %eax
shrl %cl, %eax
movl %edx, %ecx
shll %cl, %eax
incl %r8d
testl %edx, %edx
je 0x8c03
subl %edx, %esi
movq (%rdi), %rcx
movl %r8d, %edi
movl (%rcx,%rdi,4), %edi
movl %esi, %ecx
shrl %cl, %edi
negb %dl
movl %edx, %ecx
shll %cl, %edi
shrl %cl, %edi
orl %edi, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/sasamples.cpp
// Function: CSA::SASamples::SASamples(std::basic_ifstream<char, std::char_traits<char>>&, unsigned int, bool)
SASamples::SASamples(std::ifstream& sample_file, usint sample_rate, bool _weighted) :
  weighted(_weighted)
{
  if(this->weighted)
  {
    this->rate = 1;
    sample_file.read((char*)&(this->size), sizeof(this->size));
    sample_file.read((char*)&(this->items), sizeof(this->items));

    pair_type* sample_pairs = new pair_type[this->items];
    sample_file.read((char*)sample_pairs, this->items * sizeof(pair_type));
    this->buildSamples(sample_pairs, false, 1);
    this->buildSamples(sample_pairs, true, 1);
    delete[] sample_pairs;
  }
  else
  {
    this->rate = sample_rate;
    this->indexes = new SAVector(sample_file);
    this->size = indexes->getSize();
    this->items = indexes->getNumberOfItems();
    this->samples = new ReadBuffer(sample_file, this->items, length(this->items - 1));
    this->buildInverseSamples();
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movb %cl, (%rdi)
testl %ecx, %ecx
je 0x9b89
movl $0x1, 0x4(%rbx)
leaq 0x8(%rbx), %rsi
pushq $0x4
popq %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0x3290
leaq 0xc(%rbx), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x3290
movl 0xc(%rbx), %r13d
leaq (,%r13,8), %r12
movq %r12, %rdi
callq 0x3030
movq %rax, %r15
testq %r13, %r13
je 0x9b4f
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x3130
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x3290
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x9c0c
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9c0c
movq %r15, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x32b0
movl %edx, 0x4(%rbx)
pushq $0x48
popq %rdi
callq 0x3220
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0xf8b4
movq %r15, 0x10(%rbx)
movl (%r15), %eax
movl %eax, 0x8(%rbx)
movl 0x4(%r15), %r12d
movl %r12d, 0xc(%rbx)
pushq $0x28
popq %rdi
callq 0x3220
movq %rax, %r15
leal -0x1(%r12), %edi
callq 0xab34
movq %r15, %rdi
movq %r14, %rsi
movl %r12d, %edx
movl %eax, %ecx
callq 0xe64c
movq %r15, 0x18(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x9d6e
movq %rax, %rbx
pushq $0x28
jmp 0x9bfa
movq %rax, %rbx
pushq $0x48
popq %rsi
movq %r15, %rdi
callq 0x3230
movq %rbx, %rdi
callq 0x3410
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/sasamples.cpp
// Function: CSA::SASamples::buildSamples(std::pair<unsigned int, unsigned int>*, bool, unsigned int)
void
SASamples::buildSamples(pair_type* sample_pairs, bool inverse, usint threads)
{
  if(inverse)
  {
    for(usint i = 0; i < this->items; i++)
    {
      std::swap(sample_pairs[i].first, sample_pairs[i].second);
    }
  }
  #ifdef MULTITHREAD_SUPPORT
  omp_set_num_threads(threads);
  #endif
  parallelSort(sample_pairs, sample_pairs + this->items);

  SAVector::Encoder encoder(INDEX_BLOCK_SIZE);
  WriteBuffer sample_buffer(this->items, length(this->size - 1));
  for(usint i = 0; i < this->items; i++)
  {
    encoder.setBit(sample_pairs[i].first);
    sample_buffer.writeItem(sample_pairs[i].second);
/*    if(sample_pairs[i].first >= this->size || sample_pairs[i].second >= this->size)
    {
      std::cout << "Sample " << i << ": " << sample_pairs[i] << std::endl;
    }*/
  }

  if(inverse)
  {
    this->inverse_indexes = new SAVector(encoder, this->size);
    this->inverse_samples = sample_buffer.getReadBuffer();
  }
  else
  {
    this->indexes = new SAVector(encoder, this->size);
    this->samples = sample_buffer.getReadBuffer();
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
testl %edx, %edx
je 0x9c49
xorl %eax, %eax
movl 0xc(%rbx), %ecx
cmpq %rcx, %rax
jae 0x9c4c
movq (%r14,%rax,8), %xmm0
pshufd $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
movq %xmm0, (%r14,%rax,8)
incq %rax
jmp 0x9c2b
movl 0xc(%rbx), %ecx
leaq (%r14,%rcx,8), %rsi
movq %r14, %rdi
callq 0x9555
leaq 0x28(%rsp), %rdi
pushq $0x10
popq %rsi
movl $0x100000, %edx         # imm = 0x100000
callq 0xfbb6
movl 0x8(%rbx), %edi
movl 0xc(%rbx), %r15d
decl %edi
callq 0xab34
movq %rsp, %rdi
movl %r15d, %esi
movl %eax, %edx
callq 0xe8b6
xorl %r13d, %r13d
leaq 0x28(%rsp), %r15
movq %rsp, %r12
movl 0xc(%rbx), %eax
cmpq %rax, %r13
jae 0x9cb6
movl (%r14,%r13,8), %esi
movq %r15, %rdi
callq 0xfbc4
movl 0x4(%r14,%r13,8), %esi
movq %r12, %rdi
callq 0xab42
incq %r13
jmp 0x9c90
testb %bpl, %bpl
je 0x9ce6
pushq $0x48
popq %rdi
callq 0x3220
movq %rax, %r14
movl 0x8(%rbx), %edx
leaq 0x28(%rsp), %rsi
movq %rax, %rdi
callq 0xf8c0
movq %r14, 0x20(%rbx)
movq %rsp, %rdi
callq 0xe972
pushq $0x28
jmp 0x9d0f
pushq $0x48
popq %rdi
callq 0x3220
movq %rax, %r14
movl 0x8(%rbx), %edx
leaq 0x28(%rsp), %rsi
movq %rax, %rdi
callq 0xf8c0
movq %r14, 0x10(%rbx)
movq %rsp, %rdi
callq 0xe972
pushq $0x18
popq %rcx
movq %rax, (%rbx,%rcx)
movq %rsp, %rdi
callq 0xe95e
leaq 0x28(%rsp), %rdi
callq 0xfbbe
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9d3a
movq %rax, %rbx
pushq $0x48
popq %rsi
movq %r14, %rdi
callq 0x3230
jmp 0x9d54
movq %rax, %rbx
jmp 0x9d5c
jmp 0x9d51
movq %rax, %rbx
movq %rsp, %rdi
callq 0xe95e
leaq 0x28(%rsp), %rdi
callq 0xfbbe
movq %rbx, %rdi
callq 0x3410
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/sasamples.cpp
// Function: CSA::SASamples::buildInverseSamples()
void
SASamples::buildInverseSamples()
{
  WriteBuffer inverse_buffer(this->items, length(this->items - 1));
  this->samples->goToItem(0);
  for(usint i = 0; i < this->items; i++)
  {
    inverse_buffer.goToItem(this->samples->readItem());
    inverse_buffer.writeItem(i);
  }

  this->inverse_indexes = 0;
  this->inverse_samples = inverse_buffer.getReadBuffer();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl 0xc(%rdi), %r15d
leal -0x1(%r15), %edi
callq 0xab34
movq %rsp, %r14
movq %r14, %rdi
movl %r15d, %esi
movl %eax, %edx
callq 0xe8b6
movq 0x18(%rbx), %rax
movabsq $0x2000000000, %rcx     # imm = 0x2000000000
movq %rcx, 0x18(%rax)
andl $0x0, 0x20(%rax)
xorl %ebp, %ebp
pushq $0x20
popq %r15
cmpl 0xc(%rbx), %ebp
jae 0x9df0
movq 0x18(%rbx), %rdi
callq 0xabd0
movl 0xc(%rsp), %ecx
imull %eax, %ecx
movl %ecx, %edx
shrl $0x5, %edx
movl %edx, 0x18(%rsp)
andl $0x1f, %ecx
movl %r15d, %edx
subl %ecx, %edx
movl %edx, 0x1c(%rsp)
movl %eax, 0x20(%rsp)
movq %r14, %rdi
movl %ebp, %esi
callq 0xab42
incl %ebp
jmp 0x9db4
andq $0x0, 0x20(%rbx)
movq %rsp, %rdi
callq 0xe972
movq %rax, 0x28(%rbx)
movq %rsp, %rdi
callq 0xe95e
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9e16
movq %rax, %rbx
movq %rsp, %rdi
callq 0xe95e
movq %rbx, %rdi
callq 0x3410
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/sasamples.cpp
// Function: CSA::SASamples::SASamples(_IO_FILE*, unsigned int, bool)
SASamples::SASamples(FILE* sample_file, usint sample_rate, bool _weighted) :
  weighted(_weighted)
{
  if(sample_file == 0) { return; }

  if(this->weighted)
  {
    this->rate = 1;
    if(!std::fread(&(this->size), sizeof(this->size), 1, sample_file)) { return; }
    if(!std::fread(&(this->items), sizeof(this->items), 1, sample_file)) { return; }

    pair_type* sample_pairs = new pair_type[this->items];
    if(!std::fread(sample_pairs, this->items * sizeof(pair_type), 1, sample_file)) { return; }
    this->buildSamples(sample_pairs, false, 1);
    this->buildSamples(sample_pairs, true, 1);
    delete[] sample_pairs;
  }
  else
  {
    this->rate = sample_rate;
    this->indexes = new SAVector(sample_file);
    this->size = indexes->getSize();
    this->items = indexes->getNumberOfItems();
    this->samples = new ReadBuffer(sample_file, this->items, length(this->items - 1));
    this->buildInverseSamples();
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movb %cl, (%rdi)
testq %rsi, %rsi
je 0x9ef2
movq %rsi, %r14
movq %rdi, %rbx
testb %cl, %cl
je 0x9efc
movl $0x1, 0x4(%rbx)
leaq 0x8(%rbx), %rdi
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x3330
testq %rax, %rax
je 0x9ef2
leaq 0xc(%rbx), %r15
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
movq %r15, %rdi
movq %r14, %rcx
callq 0x3330
testq %rax, %rax
je 0x9ef2
movl (%r15), %r13d
leaq (,%r13,8), %r12
movq %r12, %rdi
callq 0x3030
movq %rax, %r15
testq %r13, %r13
je 0x9eb0
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x3130
pushq $0x1
popq %rdx
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rcx
callq 0x3330
testq %rax, %rax
je 0x9ef2
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x9c0c
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9c0c
movq %r15, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x32b0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movl %edx, 0x4(%rbx)
pushq $0x48
popq %rdi
callq 0x3220
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0xf8ba
movq %r15, 0x10(%rbx)
movl (%r15), %eax
movl %eax, 0x8(%rbx)
movl 0x4(%r15), %r12d
movl %r12d, 0xc(%rbx)
pushq $0x28
popq %rdi
callq 0x3220
movq %rax, %r15
leal -0x1(%r12), %edi
callq 0xab34
movq %r15, %rdi
movq %r14, %rsi
movl %r12d, %edx
movl %eax, %ecx
callq 0xe6c2
movq %r15, 0x18(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x9d6e
movq %rax, %rbx
pushq $0x28
jmp 0x9f6d
movq %rax, %rbx
pushq $0x48
popq %rsi
movq %r15, %rdi
callq 0x3230
movq %rbx, %rdi
callq 0x3410
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/sasamples.cpp
// Function: CSA::SASamples::SASamples(std::pair<unsigned int, unsigned int>*, CSA::Sampler*, unsigned int)
SASamples::SASamples(short_pair* sa, Sampler* sampler, usint threads) :
  weighted(true),
  rate(1), size(sampler->getSize()), items(sampler->getItems())
{
  pair_type* sample_pairs = sampler->getSamples(sa, 1, threads); // FIXME multiple sequences?
  this->buildSamples(sample_pairs, false, threads);
  this->buildSamples(sample_pairs, true, threads);
  delete[] sample_pairs;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movb $0x1, (%rdi)
movl $0x1, 0x4(%rdi)
movl 0x8(%rdx), %eax
movl %eax, 0x8(%rdi)
movl 0x18(%rdx), %eax
movl %eax, 0xc(%rdi)
pushq $0x1
popq %rbp
movq %rdx, %rdi
movl %ebp, %edx
callq 0xb6f6
movq %rax, %rbx
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x9c0c
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x9c0c
testq %rbx, %rbx
je 0xa1f0
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x32b0
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/sasamples.cpp
// Function: CSA::SASamples::SASamples(std::pair<unsigned int, unsigned int>*, unsigned int, unsigned int, unsigned int)
SASamples::SASamples(pair_type* sample_pairs, usint data_size, usint sample_rate, usint threads) :
  weighted(false),
  rate(sample_rate), size(data_size), items((data_size + sample_rate - 1) / sample_rate)
{
  #ifdef MULTITHREAD_SUPPORT
  omp_set_num_threads(threads);
  #endif
  parallelSort(sample_pairs, sample_pairs + this->items);

  // Compress the samples.
  WriteBuffer sample_buffer(this->items, length(this->items - 1));
  SAVector::Encoder encoder(INDEX_BLOCK_SIZE);
  for(usint i = 0; i < this->items; i++)
  {
    encoder.setBit(sample_pairs[i].first);
    sample_buffer.writeItem(sample_pairs[i].second / this->rate);
  }

  this->indexes = new SAVector(encoder, this->size);
  this->samples = sample_buffer.getReadBuffer();
  this->buildInverseSamples();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa0, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movb $0x0, (%rdi)
movl %ecx, 0x4(%rdi)
movl %edx, 0x8(%rdi)
leal (%rdx,%rcx), %eax
decl %eax
xorl %edx, %edx
divl %ecx
movl %eax, 0xc(%rdi)
leaq (%rsi,%rax,8), %rsi
movq %r14, %rdi
callq 0x9555
movl 0xc(%rbx), %r15d
leal -0x1(%r15), %edi
callq 0xab34
leaq 0x8(%rsp), %rdi
movl %r15d, %esi
movl %eax, %edx
callq 0xe8b6
leaq 0x30(%rsp), %rdi
pushq $0x10
popq %rsi
movl $0x100000, %edx         # imm = 0x100000
callq 0xfbb6
xorl %r13d, %r13d
leaq 0x30(%rsp), %r15
leaq 0x8(%rsp), %r12
movl 0xc(%rbx), %eax
cmpq %rax, %r13
jae 0xa295
movl (%r14,%r13,8), %esi
movq %r15, %rdi
callq 0xfbc4
movl 0x4(%r14,%r13,8), %eax
xorl %edx, %edx
divl 0x4(%rbx)
movq %r12, %rdi
movl %eax, %esi
callq 0xab42
incq %r13
jmp 0xa268
pushq $0x48
popq %rdi
callq 0x3220
movq %rax, %r14
movl 0x8(%rbx), %edx
leaq 0x30(%rsp), %rsi
movq %rax, %rdi
callq 0xf8c0
movq %r14, 0x10(%rbx)
leaq 0x8(%rsp), %rdi
callq 0xe972
movq %rax, 0x18(%rbx)
movq %rbx, %rdi
callq 0x9d6e
leaq 0x30(%rsp), %rdi
callq 0xfbbe
leaq 0x8(%rsp), %rdi
callq 0xe95e
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
pushq $0x48
popq %rsi
movq %r14, %rdi
callq 0x3230
jmp 0xa309
movq %rax, %rbx
jmp 0xa313
jmp 0xa306
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xfbbe
leaq 0x8(%rsp), %rdi
callq 0xe95e
movq %rbx, %rdi
callq 0x3410
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/sasamples.cpp
// Function: CSA::SASamples::~SASamples()
SASamples::~SASamples()
{
  delete this->indexes; this->indexes = 0;
  delete this->samples; this->samples = 0;
  delete this->inverse_indexes; this->inverse_indexes = 0;
  delete this->inverse_samples; this->inverse_samples = 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %r14
testq %r14, %r14
je 0xa734
movq %r14, %rdi
callq 0xf8c6
pushq $0x48
popq %rsi
movq %r14, %rdi
callq 0x3230
andq $0x0, 0x10(%rbx)
movq 0x18(%rbx), %r14
testq %r14, %r14
je 0xa755
movq %r14, %rdi
callq 0xe7c4
pushq $0x28
popq %rsi
movq %r14, %rdi
callq 0x3230
andq $0x0, 0x18(%rbx)
movq 0x20(%rbx), %r14
testq %r14, %r14
je 0xa776
movq %r14, %rdi
callq 0xf8c6
pushq $0x48
popq %rsi
movq %r14, %rdi
callq 0x3230
andq $0x0, 0x20(%rbx)
movq 0x28(%rbx), %r14
testq %r14, %r14
je 0xa797
movq %r14, %rdi
callq 0xe7c4
pushq $0x28
popq %rsi
movq %r14, %rdi
callq 0x3230
andq $0x0, 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/sasamples.cpp
// Function: CSA::SASamples::writeTo(std::basic_ofstream<char, std::char_traits<char>>&) const
void
SASamples::writeTo(std::ofstream& sample_file) const
{
  if(this->weighted)
  {
    sample_file.write((char*)&(this->size), sizeof(this->size));
    sample_file.write((char*)&(this->items), sizeof(this->items));

    SAVector::Iterator iter(*(this->indexes));
    pair_type buffer(iter.select(0), this->samples->readItem(0));
    for(usint i = 0; i < this->items; i++)
    {
      sample_file.write((char*)&buffer, sizeof(buffer));
      buffer.first = iter.selectNext();
      buffer.second = this->samples->readItem();
    }
  }
  else
  {
    this->indexes->writeTo(sample_file);
    this->samples->writeBuffer(sample_file);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x1, (%rdi)
jne 0xa864
leaq 0x8(%r14), %rsi
pushq $0x4
popq %r12
movq %rbx, %rdi
movq %r12, %rdx
callq 0x32d0
leaq 0xc(%r14), %r15
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x32d0
movq 0x10(%r14), %rsi
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0xf8d8
movq %r12, %rdi
xorl %esi, %esi
callq 0xf976
movl %eax, %ebp
movq 0x18(%r14), %rdi
xorl %r13d, %r13d
xorl %esi, %esi
callq 0xab54
leaq 0x8(%rsp), %r12
movl %ebp, (%r12)
movl %eax, 0x4(%r12)
leaq 0x10(%rsp), %rbp
cmpl (%r15), %r13d
jae 0xa88d
movq %rbx, %rdi
movq %r12, %rsi
pushq $0x8
popq %rdx
callq 0x32d0
movq %rbp, %rdi
callq 0xf9d8
movl %eax, 0x8(%rsp)
movq 0x18(%r14), %rdi
callq 0xabd0
movl %eax, 0xc(%rsp)
incl %r13d
jmp 0xa833
movq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0xf204
movq 0x18(%r14), %rdi
movq %rbx, %rsi
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe7de
leaq 0x10(%rsp), %rdi
callq 0xf8de
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa8ad
jmp 0xa8ad
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xf8de
movq %rbx, %rdi
callq 0x3410
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/sasamples.cpp
// Function: CSA::SASamples::writeTo(_IO_FILE*) const
void
SASamples::writeTo(FILE* sample_file) const
{
  if(sample_file == 0) { return; }

  if(this->weighted)
  {
    std::fwrite(&(this->size), sizeof(this->size), 1, sample_file);
    std::fwrite(&(this->items), sizeof(this->items), 1, sample_file);

    SAVector::Iterator iter(*(this->indexes));
    pair_type buffer(iter.select(0), this->samples->readItem(0));
    for(usint i = 0; i < this->items; i++)
    {
      std::fwrite(&buffer, sizeof(buffer), 1, sample_file);
      buffer.first = iter.selectNext();
      buffer.second = this->samples->readItem();
    }
  }
  else
  {
    this->indexes->writeTo(sample_file);
    this->samples->writeBuffer(sample_file);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
testq %rsi, %rsi
je 0xa9be
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x1, (%rdi)
jne 0xa98b
leaq 0x8(%r14), %rdi
pushq $0x4
popq %r12
pushq $0x1
popq %r13
movq %r12, %rsi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x3440
leaq 0xc(%r14), %r15
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x3440
movq 0x10(%r14), %rsi
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0xf8d8
movq %r12, %rdi
xorl %esi, %esi
callq 0xf976
movl %eax, %r13d
movq 0x18(%r14), %rdi
xorl %ebp, %ebp
xorl %esi, %esi
callq 0xab54
leaq 0x8(%rsp), %r12
movl %r13d, (%r12)
movl %eax, 0x4(%r12)
leaq 0x10(%rsp), %r13
cmpl (%r15), %ebp
jae 0xa9b4
movq %r12, %rdi
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x3440
movq %r13, %rdi
callq 0xf9d8
movl %eax, 0x8(%rsp)
movq 0x18(%r14), %rdi
callq 0xabd0
movl %eax, 0xc(%rsp)
incl %ebp
jmp 0xa958
movq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0xf29e
movq 0x18(%r14), %rdi
movq %rbx, %rsi
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe7f4
leaq 0x10(%rsp), %rdi
callq 0xf8de
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa9d4
jmp 0xa9d4
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xf8de
movq %rbx, %rdi
callq 0x3410
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/sasamples.cpp
// Function: CSA::SASamples::reportSize() const
usint
SASamples::reportSize() const
{
  usint bytes = sizeof(*this);
  bytes += this->indexes->reportSize();
  bytes += this->samples->reportSize();
  if(this->weighted) { bytes += this->inverse_indexes->reportSize(); }
  bytes += this->inverse_samples->reportSize();
  return bytes;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
callq 0xf8cc
movl %eax, %r14d
movq 0x18(%rbx), %rdi
callq 0xe850
leal (%r14,%rax), %ebp
addl $0x30, %ebp
cmpb $0x1, (%rbx)
jne 0xaa1d
movq 0x20(%rbx), %rdi
callq 0xf8cc
addl %eax, %ebp
movq 0x28(%rbx), %rdi
callq 0xe850
addl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/sasamples.cpp
// Function: CSA::SASamples::inverseSA(unsigned int) const
pair_type
SASamples::inverseSA(usint value) const
{
  if(value >= this->size) { return pair_type(this->size, this->size); }

  pair_type result;
  if(this->weighted)
  {
    SAVector::Iterator iter(*(this->inverse_indexes));
    result.first = iter.rank(value) - 1;
    result.second = this->inverse_samples->readItemConst(result.first);
    result.first = iter.select(result.first);
  }
  else
  {
    SAVector::Iterator iter(*(this->indexes));
    result.first = value - (value % this->rate);
    result.second = iter.select(this->inverse_samples->readItemConst(value / this->rate));
  }

  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x78, %rsp
movl 0x8(%rdi), %r14d
movl %r14d, %ebp
cmpl %esi, %r14d
jbe 0xaad2
movl %esi, %ebx
movq %rdi, %r15
cmpb $0x1, (%rdi)
jne 0xaa95
movq 0x20(%r15), %rsi
movq %rsp, %r14
movq %r14, %rdi
callq 0xf8d8
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0xf8e4
movl %eax, %ebx
decl %ebx
movq 0x28(%r15), %rdi
movl %ebx, %esi
callq 0x8ba2
movl %eax, %r14d
movq %rsp, %rdi
movl %ebx, %esi
callq 0xf976
movl %eax, %ebp
movq %rsp, %rdi
callq 0xf8de
jmp 0xaad2
movq 0x10(%r15), %rsi
movq %rsp, %r14
movq %r14, %rdi
callq 0xf8d8
movq 0x28(%r15), %rdi
movl %ebx, %eax
xorl %edx, %edx
divl 0x4(%r15)
movl %edx, %ebp
movl %eax, %esi
callq 0x8ba2
movq %r14, %rdi
movl %eax, %esi
callq 0xf976
movl %eax, %r14d
subl %ebp, %ebx
movq %rsp, %rdi
callq 0xf8de
movl %ebx, %ebp
shlq $0x20, %r14
movl %ebp, %eax
orq %r14, %rax
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0xaae8
movq %rax, %rbx
movq %rsp, %rdi
callq 0xf8de
movq %rbx, %rdi
callq 0x3410
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/./bits/bitbuffer.h
// Function: CSA::WriteBuffer::writeBits(unsigned int, unsigned int)
inline void writeBits(usint value, usint count)
    {
      if(count >= this->bits)
      {
        count -= this->bits;
        this->data[this->pos] |= GET(LOWER(value, count), this->bits);
        this->pos++; this->bits = WORD_BITS;
      }
      if(count > 0)
      {
        this->bits -= count;
        this->data[this->pos] |= HIGHER(GET(value, count), this->bits);
      }
    }

// Assembly:
movl 0x1c(%rdi), %r8d
movl %edx, %eax
subl %r8d, %eax
jae 0xab85
movl %edx, %eax
jmp 0xabae
movl %esi, %edx
movl %eax, %ecx
shrl %cl, %edx
negb %r8b
movl %r8d, %ecx
shll %cl, %edx
shrl %cl, %edx
movq (%rdi), %rcx
movl 0x18(%rdi), %r8d
orl %edx, (%rcx,%r8,4)
incl 0x18(%rdi)
movl $0x20, 0x1c(%rdi)
pushq $0x20
popq %r8
testl %eax, %eax
je 0xabcf
subl %eax, %r8d
movl %r8d, 0x1c(%rdi)
negb %al
movl %eax, %ecx
shll %cl, %esi
shrl %cl, %esi
movl %r8d, %ecx
shll %cl, %esi
movq (%rdi), %rax
movl 0x18(%rdi), %ecx
orl %esi, (%rax,%rcx,4)
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/./bits/bitbuffer.h
// Function: CSA::ReadBuffer::readBits(unsigned int)
inline usint readBits(usint count)
    {
      usint value = 0;

      if(count >= this->bits)
      {
        count -= this->bits;
        value |= HIGHER(GET(this->data[this->pos], this->bits), count);
        this->pos++; this->bits = WORD_BITS;
      }
      if(count > 0)
      {
        this->bits -= count;
        value |= GET(LOWER(this->data[this->pos], this->bits), count);
      }

      return value;
    }

// Assembly:
movl 0x1c(%rdi), %ecx
xorl %eax, %eax
movl %esi, %edx
subl %ecx, %edx
jae 0xabeb
movl %esi, %edx
jmp 0xac0e
movq (%rdi), %rax
movl 0x18(%rdi), %esi
movl (%rax,%rsi,4), %eax
negb %cl
shll %cl, %eax
shrl %cl, %eax
movl %edx, %ecx
shll %cl, %eax
leal 0x1(%rsi), %ecx
movl %ecx, 0x18(%rdi)
movl $0x20, 0x1c(%rdi)
pushq $0x20
popq %rcx
testl %edx, %edx
je 0xac2c
subl %edx, %ecx
movl %ecx, 0x1c(%rdi)
movq (%rdi), %rsi
movl 0x18(%rdi), %edi
movl (%rsi,%rdi,4), %esi
shrl %cl, %esi
negb %dl
movl %edx, %ecx
shll %cl, %esi
shrl %cl, %esi
orl %esi, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/alphabet.cpp
// Function: CSA::Alphabet::initialize(unsigned int const*)
void
Alphabet::initialize(const usint* counts)
{
  if(counts == 0) { return; }

  this->size = 0; this->chars = 0;
  for(usint c = 0; c < CHARS; c++)
  {
    this->index_ranges[c] = ((counts[c] > 0 || this->size > 0) ?
                             pair_type(this->size, this->size + counts[c] - 1) :
                             EMPTY_PAIR);
    if(counts[c] > 0)
    {
      this->text_chars[this->chars] = c;
      this->chars++;
    }
    size += counts[c];
  }

  this->index_rate = std::max((this->size + CHARS - 1) / CHARS, (usint)1);
  usint current = 0;

  for(usint c = 0, i = 0; c < this->chars; c++)
  {
    pair_type range = this->index_ranges[this->text_chars[c]];
    while(current <= range.second)
    {
      this->index_pointers[i] = c;
      current += this->index_rate;
      i++;
    }
  }

  this->ok = true;
}

// Assembly:
testq %rsi, %rsi
je 0xb44d
pushq %rbp
pushq %rbx
andl $0x0, 0x800(%rdi)
andl $0x0, 0xc04(%rdi)
xorl %r8d, %r8d
movl $0x1, %ecx
xorl %edx, %edx
xorl %r9d, %r9d
movl %r8d, %eax
cmpq $0x100, %r9             # imm = 0x100
je 0xb3f3
movl (%rsi,%r9,4), %r10d
subl $0x1, %r10d
setb %r11b
testl %edx, %edx
sete %bl
leal (%r10,%rdx), %ebp
xorl %r10d, %r10d
testb %bl, %r11b
movl %edx, %r11d
cmovnel %ecx, %r11d
cmovnel %r10d, %ebp
movl %r11d, (%rdi,%r9,8)
movl %ebp, 0x4(%rdi,%r9,8)
cmpl $0x0, (%rsi,%r9,4)
je 0xb3e1
movl %r9d, 0x804(%rdi,%rax,4)
movl 0xc04(%rdi), %r8d
incl %r8d
movl %r8d, 0xc04(%rdi)
movl (%rsi,%r9,4), %r10d
addl %edx, %r10d
movl %r10d, 0x800(%rdi)
incq %r9
movl %r10d, %edx
jmp 0xb382
addl $0xff, %edx
movl %edx, %esi
shrl $0x8, %esi
cmpl $0x100, %edx            # imm = 0x100
cmovbl %ecx, %esi
movl %esi, 0x1008(%rdi)
xorl %ecx, %ecx
xorl %edx, %edx
xorl %esi, %esi
popq %rbx
popq %rbp
cmpq %rax, %rcx
je 0xb446
movl 0x804(%rdi,%rcx,4), %r8d
movl 0x4(%rdi,%r8,8), %r8d
cmpl %r8d, %esi
ja 0xb441
movl %edx, %r9d
movl %ecx, 0xc08(%rdi,%r9,4)
addl 0x1008(%rdi), %esi
incl %edx
jmp 0xb427
incq %rcx
jmp 0xb415
movb $0x1, 0x100c(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/alphabet.cpp
// Function: CSA::Alphabet::Alphabet(_IO_FILE*)
Alphabet::Alphabet(FILE* file) :
  ok(false)
{
  if(file == 0) { return; }
  usint counts[CHARS];
  if(!std::fread(counts, CHARS * sizeof(usint), 1, file)) { return; }
  this->initialize(counts);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rsi, %r14
movq %rdi, %rbx
movl $0x800, %edx            # imm = 0x800
xorl %esi, %esi
callq 0x3130
movb $0x0, 0x100c(%rbx)
testq %r14, %r14
je 0xb4eb
movq %rsp, %rdi
pushq $0x1
popq %rdx
movl $0x400, %esi            # imm = 0x400
movq %r14, %rcx
callq 0x3330
testq %rax, %rax
je 0xb4eb
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xb35c
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/alphabet.cpp
// Function: CSA::Alphabet::writeTo(_IO_FILE*) const
void
Alphabet::writeTo(FILE* file) const
{
  if(file == 0) { return; }
  for(usint c = 0; c < CHARS; c++)
  {
    usint temp = this->countOf(c);
    std::fwrite(&temp, sizeof(temp), 1, file);
  }
}

// Assembly:
testq %rsi, %rsi
je 0xb5b7
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %ebp, %ebp
leaq 0x4(%rsp), %r15
pushq $0x4
popq %r12
pushq $0x1
popq %r13
cmpq $0x100, %rbp            # imm = 0x100
je 0xb5a9
movq (%r14,%rbp,8), %rax
movq %rax, %rcx
shrq $0x20, %rcx
subl %eax, %ecx
incl %ecx
movl %ecx, 0x4(%rsp)
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x3440
incq %rbp
jmp 0xb577
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/sampler.cpp
// Function: CSA::Sampler::writeTo(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
void
Sampler::writeTo(const std::string& base_name) const
{
  std::string sample_name = base_name + SA_SAMPLES_EXTENSION;
  std::ofstream sample_file(sample_name.c_str(), std::ios_base::binary);
  if(!sample_file)
  {
    std::cerr << "Sampler: Error creating sample file!" << std::endl;
    return;
  }

  for(uint i = 0; i < this->number_of_samples; i++)
  {
    sample_file.write((char*)&(this->samples[i].second), sizeof(uint));
  }
  sample_file.close();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x220, %rsp            # imm = 0x220
movq %rdi, %rbx
leaq 0x12066(%rip), %rdx     # 0x1d690
movq %rsp, %r14
movq %r14, %rdi
callq 0x8410
movq (%r14), %rsi
leaq 0x20(%rsp), %rdi
pushq $0x4
popq %rdx
callq 0x3260
movq 0x20(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x40(%rsp,%rax)
je 0xb672
movq 0x11994(%rip), %rdi     # 0x1cff0
leaq 0x804f(%rip), %rsi      # 0x136b2
callq 0x3200
movq %rax, %rdi
callq 0x3100
jmp 0xb6ae
pushq $0x4
popq %r14
xorl %r12d, %r12d
leaq 0x20(%rsp), %r15
movq %r14, %r13
movl 0x18(%rbx), %eax
cmpq %rax, %r12
jae 0xb6a4
movq 0x10(%rbx), %rsi
addq %r13, %rsi
movq %r15, %rdi
movq %r14, %rdx
callq 0x32d0
incq %r12
addq $0x8, %r13
jmp 0xb681
leaq 0x20(%rsp), %rdi
callq 0x3300
leaq 0x20(%rsp), %rdi
callq 0x3320
movq %rsp, %rdi
callq 0x3478
addq $0x220, %rsp            # imm = 0x220
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
jmp 0xb6e5
jmp 0xb6d8
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x3320
movq %rsp, %rdi
callq 0x3478
movq %rbx, %rdi
callq 0x3410
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/sampler.cpp
// Function: CSA::Sampler::getSamples(std::pair<unsigned int, unsigned int>*, unsigned int, unsigned int)
pair_type*
Sampler::getSamples(short_pair* sa, uint number_of_sequences, usint threads)
{
  if(sa == 0 || this->samples == 0 || this->status != SAMPLED) { return 0; }

  for(uint i = 0; i < this->number_of_samples; i++)
  {
    this->samples[i].first = sa[this->samples[i].second].second - number_of_sequences;
  }
  #ifdef MULTITHREAD_SUPPORT
  omp_set_num_threads(threads);
  #endif
  parallelSort(samples, samples + this->number_of_samples);

  pair_type* result = this->samples; this->samples = 0;
  this->status = NOT_READY;
  return result;
}

// Assembly:
testq %rsi, %rsi
je 0xb732
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0xb72e
cmpl $0x2, 0xc(%rbx)
jne 0xb72e
movl 0x18(%rbx), %eax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0xb735
movl 0x4(%rdi,%rcx,8), %r8d
movl 0x4(%rsi,%r8,8), %r8d
subl %edx, %r8d
movl %r8d, (%rdi,%rcx,8)
incq %rcx
jmp 0xb713
xorl %eax, %eax
jmp 0xb74b
xorl %eax, %eax
retq
leaq (%rdi,%rax,8), %rsi
callq 0x9555
movq 0x10(%rbx), %rax
andq $0x0, 0x10(%rbx)
andl $0x0, 0xc(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/sampler.cpp
// Function: CSA::WeightedSampler::cleanUp()
void
WeightedSampler::cleanUp()
{
  delete[] this->path_weights; this->path_weights = 0;
  delete[] this->predecessors; this->predecessors = 0;
  delete[] this->edge_weights; this->edge_weights = 0;
  delete[] this->edge_totals; this->edge_totals = 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
testq %rdi, %rdi
je 0xb98e
callq 0x32b0
andq $0x0, 0x28(%rbx)
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0xb9a1
callq 0x32b0
andq $0x0, 0x30(%rbx)
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0xb9b4
callq 0x32b0
andq $0x0, 0x38(%rbx)
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0xb9c7
callq 0x32b0
andq $0x0, 0x40(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/sampler.cpp
// Function: CSA::WeightedSampler::buildPath(unsigned int, unsigned int*, unsigned int, unsigned int*, unsigned int)
void
WeightedSampler::buildPath(uint links, uint* path_a, uint length_a, uint* path_b, uint length_b)
{
  uint cur_a = 0, cur_b = 0;
  uint adj = length_a - links;

  while(true)
  {
    if(cur_a == cur_b + adj && path_b[cur_b] <= path_a[cur_a] && path_b[cur_b + 1] >= path_a[cur_a + 1])
    {
      break;
    }

    if(path_a[cur_a] <= path_b[cur_b]) { cur_a++; }
    else                               { cur_b++; }
  }

  // Combine the prefix of 'path_b' until 'cur_b - 1' with the suffix of 'path_a' from 'cur_a'.
  for(uint i = 0; i <= cur_b; i++) { path_a[i] = path_b[i]; }
  for(uint i = cur_b + 1, j = cur_a + 1; j < length_a; i++, j++) { path_a[i] = path_a[j]; }
}

// Assembly:
pushq %rbp
pushq %rbx
movl %ecx, %edi
subl %esi, %edi
xorl %eax, %eax
xorl %esi, %esi
leal (%rdi,%rax), %r11d
movl %eax, %r9d
movl %esi, %r10d
cmpl %r11d, %esi
jne 0xc088
movl (%r8,%r9,4), %r11d
movl (%rdx,%r10,4), %ebx
cmpl %ebx, %r11d
ja 0xc090
leal 0x1(%rax), %r9d
movl (%r8,%r9,4), %ebp
leal 0x1(%rsi), %r10d
cmpl (%rdx,%r10,4), %ebp
jb 0xc090
jmp 0xc0a9
movl (%rdx,%r10,4), %ebx
movl (%r8,%r9,4), %r11d
xorl %r9d, %r9d
xorl %r10d, %r10d
cmpl %r11d, %ebx
setbe %r9b
seta %r10b
addl %r10d, %eax
addl %r9d, %esi
jmp 0xc058
incl %eax
xorl %esi, %esi
cmpq %rsi, %rax
je 0xc0be
movl (%r8,%rsi,4), %edi
movl %edi, (%rdx,%rsi,4)
incq %rsi
jmp 0xc0ad
movl %ecx, %eax
cmpq %rax, %r10
jae 0xc0d7
movl (%rdx,%r10,4), %ecx
movl %r9d, %esi
movl %ecx, (%rdx,%rsi,4)
incl %r9d
incq %r10
jmp 0xc0c0
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/sampler.cpp
// Function: CSA::WeightedSampler::link(std::deque<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int>>>&, unsigned int, bool)
node_type
WeightedSampler::link(std::deque<node_type>& active_nodes, uint to, bool shortest)
{
  this->path_weights[to] = std::numeric_limits<sum_type>::max();
  node_type current(to, 0);
  if(shortest) { current.second = std::numeric_limits<uint>::max(); }

  for(std::deque<node_type>::iterator iter = active_nodes.begin(); iter != active_nodes.end(); ++iter)
  {
    sum_type weight = this->getPathWeight((*iter).first, to);
    if(weight > this->path_weights[to]) { return current; }
    if(weight < this->path_weights[to] ||
       (shortest && (*iter).second + 1 < current.second) ||
       (!shortest && (*iter).second + 1 > current.second))
    {
      this->path_weights[to] = weight;
      this->predecessors[to] = (*iter).first;
      current.second = (*iter).second + 1;
    }
  }

  return current;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x28(%rdi), %r13
movl %edx, 0xc(%rsp)
movl %edx, %r12d
orl $-0x1, (%r13,%r12,4)
movl %ecx, 0x8(%rsp)
movl %ecx, %r15d
negl %r15d
movq 0x10(%rsi), %rbx
movq 0x20(%rsi), %r14
movq 0x28(%rsi), %rax
movq %rax, 0x10(%rsp)
movq 0x30(%rsi), %rbp
movq %rdi, 0x20(%rsp)
movq 0x30(%rdi), %rax
movq %rax, 0x18(%rsp)
cmpq %rbp, %rbx
je 0xc199
movl (%rbx), %esi
movq 0x20(%rsp), %rdi
movl 0xc(%rsp), %edx
callq 0xc3de
cmpl (%r13,%r12,4), %eax
ja 0xc199
jae 0xc17f
movl %eax, (%r13,%r12,4)
movl (%rbx), %eax
movq 0x18(%rsp), %rcx
movl %eax, (%rcx,%r12,4)
movl 0x4(%rbx), %r15d
incl %r15d
addq $0x8, %rbx
cmpq %r14, %rbx
jne 0xc126
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rbx
addq $0x8, %rax
movq %rax, 0x10(%rsp)
leaq 0x200(%rbx), %r14
jmp 0xc126
movl 0x4(%rbx), %ecx
incl %ecx
cmpb $0x0, 0x8(%rsp)
je 0xc192
cmpl %r15d, %ecx
jb 0xc144
jmp 0xc15b
cmpl %r15d, %ecx
ja 0xc144
jmp 0xc15b
shlq $0x20, %r15
orq %r12, %r15
movq %r15, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/sampler.cpp
// Function: CSA::WeightedSampler::bridge(unsigned int, unsigned int, unsigned int)
bool
WeightedSampler::bridge(uint a, uint b, uint c)
{
/*
  Note that 'c' is always less than 'this->size', and 'b' will not be added to active nodes,
  unless it offers a strictly better path to 'this->size' than 'a'.
*/

  uint low = c + 1, high = this->nodes - 1, mid = low;
  while(low < high)
  {
    if(this->isStrictlyBetter(a, b, mid))
    {
      low = mid + 1;
      mid = std::min(low + (high - low) / 2, c + 2 * (mid - c));
    }
    else { high = mid; mid = low + (high - low) / 2; }
  }
  // 'high' will now be the first position for which 'a' is not strictly better than 'b'.

  return this->isStrictlyBetter(c, b, high);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r15
movq %rcx, (%rsp)
leal 0x1(%rcx), %r14d
movl 0x48(%rdi), %r12d
decl %r12d
movl %r14d, %r13d
cmpl %r12d, %r14d
jae 0xc25d
movq %r15, %rdi
movl %ebp, %esi
movl %ebx, %edx
movl %r13d, %ecx
callq 0xc1b2
testb %al, %al
jne 0xc237
movl %r13d, %r12d
movl %r13d, %eax
subl %r14d, %eax
shrl %eax
addl %r14d, %eax
movl %eax, %r13d
jmp 0xc20c
leal 0x1(%r13), %r14d
movl %r12d, %eax
subl %r14d, %eax
shrl %eax
addl %r13d, %eax
incl %eax
movq (%rsp), %rcx
subl %ecx, %r13d
leal (%rcx,%r13,2), %ecx
cmpl %eax, %ecx
cmovbl %ecx, %eax
movl %eax, %r13d
jmp 0xc20c
movq %r15, %rdi
movq (%rsp), %rsi
movl %ebx, %edx
movl %r12d, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xc1b2