LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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 0x12744
testl %ebx, %ebx
je 0x8829
movl 0x81c(%r14), %ebp
leal -0x1(%rbx), %esi
leaq 0x8(%rsp), %rdi
callq 0x128f8
xorl %edx, %edx
divl %ebp
incl %eax
imull %ebp, %eax
jmp 0x882b
xorl %eax, %eax
shrq $0x20, %rbx
addl %eax, %ebx
leaq 0x8(%rsp), %rdi
callq 0x1274a
movl %ebx, %eax
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1274a
movq %rbx, %rdi
callq 0x3460
// File: /workspace/github_cpp_makefile_star2_O1/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 0x8911
movq %rdi, %r14
movl 0x820(%rdi), %eax
addl 0x4(%rdi), %eax
cmpl %r13d, %eax
jbe 0x8911
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 0x3150
movq %rsp, %r12
movq 0x8(%r14,%rbp,8), %rsi
testq %rsi, %rsi
je 0x8903
movq %r12, %rdi
callq 0x13394
movq %r12, %rdi
movl %ebx, %esi
callq 0x13cc2
cmpl %r13d, %eax
ja 0x88fb
subl %ebx, %eax
movb %bpl, (%r15,%rax)
movq %r12, %rdi
callq 0x13900
jmp 0x88e6
movq %r12, %rdi
callq 0x1339a
incq %rbp
cmpq $0x100, %rbp            # imm = 0x100
jne 0x88ca
jmp 0x8914
xorl %r15d, %r15d
movq %r15, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8928
movq %rax, %rbx
movq %rsp, %rdi
callq 0x1339a
movq %rbx, %rdi
callq 0x3460
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
movq 0x8(%rbx,%r15,8), %rsi
testq %rsi, %rsi
je 0x8975
movq %r14, %rdi
callq 0x13394
movq %r14, %rdi
callq 0x13fe6
addl %eax, %ebp
movq %r14, %rdi
callq 0x1339a
incq %r15
cmpq $0x100, %r15            # imm = 0x100
jne 0x8951
movl %ebp, %eax
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x1339a
movq %rbx, %rdi
callq 0x3460
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x89cf
movl %esi, %ebx
movq %rdi, %r15
callq 0x7e36
movq %rax, %r12
movq %rax, %r14
shrq $0x20, %r14
subl %r12d, %r14d
jae 0x89d3
xorl %ebx, %ebx
jmp 0x8a42
leal 0x1(%r14), %eax
movq %rax, (%rsp)
addl $0x2, %r14d
movq %r14, %rdi
callq 0x3030
movq %rax, %r13
leaq (,%r14,4), %rdi
callq 0x3030
movq %rax, %rbp
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
movl $0x1, %ecx
movq %rax, %r8
callq 0x7edc
movq (%rsp), %rax
movb $0x0, (%r13,%rax)
movl %ebx, (%rbp,%rax,4)
movl $0x30, %edi
callq 0x3260
movq %rax, %rbx
movq %rax, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movl %r14d, %ecx
movl $0x1, %r8d
callq 0xf0dc
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movl $0x30, %esi
movq %rbx, %rdi
callq 0x3270
movq %r14, %rdi
callq 0x3460
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
movl 0x4(%rdi), %eax
cvtsi2sd %rax, %xmm0
mulsd 0xe2e0(%rip), %xmm0     # 0x17010
movsd %xmm0, 0x8(%rsp)
movq 0x16293(%rip), %rbx     # 0x1efd0
leaq 0xe7f6(%rip), %rsi      # 0x1753a
movl $0x11, %edx
movq %rbx, %rdi
callq 0x32b0
movl 0x820(%r14), %esi
movq %rbx, %rdi
callq 0x3180
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3190
leaq 0xe7bb(%rip), %rsi      # 0x1754c
movl $0x11, %edx
movq %rbx, %rdi
callq 0x32b0
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x33c0
movq %rax, %r15
leaq 0xe74a(%rip), %rsi      # 0x17500
movl $0x3, %edx
movq %rax, %rdi
callq 0x32b0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3190
leaq 0xe76d(%rip), %rsi      # 0x1755e
movl $0x11, %edx
movq %rbx, %rdi
callq 0x32b0
movq 0x808(%r14), %rax
movl 0x804(%rax), %eax
movq 0x8(%r14,%rax,8), %rax
movl 0x10(%rax), %esi
shlq $0x2, %rsi
movq %rbx, %rdi
callq 0x3180
movq %rax, %r15
leaq 0xe747(%rip), %rsi      # 0x17570
movl $0x6, %edx
movq %rax, %rdi
callq 0x32b0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3190
cmpb $0x0, 0x818(%r14)
jne 0x8e71
cmpb $0x1, 0x819(%r14)
jne 0x8ee6
movq 0x16158(%rip), %r15     # 0x1efd0
leaq 0xe6f8(%rip), %rsi      # 0x17577
movl $0x11, %edx
movq %r15, %rdi
callq 0x32b0
movl 0x81c(%r14), %esi
movq %r15, %rdi
callq 0x3180
movq 0x810(%r14), %rax
cmpb $0x1, (%rax)
jne 0x8ebf
movq 0x16122(%rip), %rdi     # 0x1efd0
leaq 0xe6d4(%rip), %rsi      # 0x17589
movl $0xb, %edx
callq 0x32b0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x3190
// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
xorl %ebx, %ebx
cmpl %esi, 0x4(%rdi)
jbe 0x9dad
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r12
movl %ecx, 0x4(%rsp)
xorl %ebx, %ebx
leaq 0x8(%rsp), %r13
movq 0x8(%r14), %rsi
movq %r13, %rdi
callq 0x12744
movq %r13, %rdi
movl %ebp, %esi
callq 0x12eba
movl %eax, %r15d
movq %r13, %rdi
callq 0x1274a
testb %r15b, %r15b
jne 0x9d49
movl 0x4(%r12), %eax
cmpl %ebp, %eax
jbe 0x9d30
movq 0x808(%r12), %rcx
movl %ebp, %eax
xorl %edx, %edx
divl 0x1008(%rcx)
movl 0xc08(%rcx,%rax,4), %eax
leaq (%rcx,%rax,4), %rax
addq $0x804, %rax            # imm = 0x804
movl (%rax), %r15d
addq $0x4, %rax
cmpl %ebp, 0x4(%rcx,%r15,8)
jb 0x9cf3
movq 0x8(%r12,%r15,8), %rsi
movq %r13, %rdi
callq 0x13394
movq 0x808(%r12), %rax
subl (%rax,%r15,8), %ebp
movq %r13, %rdi
movl %ebp, %esi
callq 0x1368a
movl %eax, %ebp
movq %r13, %rdi
callq 0x1339a
jmp 0x9d3a
addl 0x820(%r12), %eax
movl %eax, %ebp
subl 0x820(%r12), %ebp
incl %ebx
jmp 0x9c9d
cmpb $0x0, 0x4(%rsp)
jne 0x9dad
movq 0x8(%r14), %rsi
leaq 0x8(%rsp), %rdi
callq 0x12744
movq 0x10(%r14), %rsi
leaq 0x80(%rsp), %rdi
callq 0x103ec
leaq 0x8(%rsp), %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x12750
decl %eax
leaq 0x80(%rsp), %rdi
movl %eax, %esi
callq 0x1044e
movl %eax, %r14d
leaq 0x80(%rsp), %rdi
callq 0x10434
leaq 0x8(%rsp), %rdi
callq 0x1274a
addl %r14d, %ebx
decl %ebx
movl %ebx, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9de4
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x10434
jmp 0x9de7
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1339a
jmp 0x9df1
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1274a
movq %rbx, %rdi
callq 0x3460
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x9f3a
movl %esi, %r14d
movq %rdi, 0x8(%rsp)
cmpl %esi, 0x4(%rdi)
jbe 0x9f3a
movq 0x8(%rsp), %rax
movq 0x808(%rax), %rcx
movl %r14d, %eax
xorl %edx, %edx
divl 0x1008(%rcx)
movl 0xc08(%rcx,%rax,4), %eax
leaq (%rcx,%rax,4), %rax
addq $0x804, %rax            # imm = 0x804
movl (%rax), %r15d
addq $0x4, %rax
cmpl %r14d, 0x4(%rcx,%r15,8)
jb 0x9e4e
leal -0x1(%r14), %r12d
movl (%rcx,%r15,8), %eax
movl %eax, (%rsp)
xorl %ebp, %ebp
leaq 0x10(%rsp), %r13
cmpl (%rsp), %r12d
jb 0x9f3a
movl %ebp, 0x4(%rsp)
movl %r15d, %ebx
movq 0x8(%rsp), %rbp
movq 0x8(%rbp,%rbx,8), %rsi
movq %r13, %rdi
callq 0x13394
movq 0x808(%rbp), %rax
subl (%rax,%rbx,8), %r12d
movq %r13, %rdi
movl %r12d, %esi
movq %rbp, %r12
callq 0x1368a
movl %eax, %ebp
movq 0x808(%r12), %rax
subl (%rax,%rbx,8), %r14d
movq %r13, %rdi
movl %r14d, %esi
callq 0x1368a
movl 0x820(%r12), %ecx
movq %r12, %rsi
movl %ebp, %r12d
subl %ecx, %r12d
setae %dl
movl %eax, %r14d
subl %ecx, %r14d
setae %bl
andb %dl, %bl
je 0x9f1e
movq 0x808(%rsi), %rcx
movl %r14d, %eax
xorl %edx, %edx
divl 0x1008(%rcx)
movl 0xc08(%rcx,%rax,4), %eax
leaq (%rcx,%rax,4), %rax
addq $0x804, %rax            # imm = 0x804
movl (%rax), %r15d
addq $0x4, %rax
cmpl %r14d, 0x4(%rcx,%r15,8)
jb 0x9f07
movl (%rcx,%r15,8), %eax
movl %eax, (%rsp)
jmp 0x9f24
movl %eax, %r14d
movl %ebp, %r12d
movl 0x4(%rsp), %ebp
incl %ebp
movq %r13, %rdi
callq 0x1339a
testb %bl, %bl
jne 0x9e6e
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 0x1339a
movq %rbx, %rdi
callq 0x3460
// File: /workspace/github_cpp_makefile_star2_O1/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 0xa337
pushq %rbx
movl %esi, %eax
movq %rdi, %rbx
movq (%rdi), %rdi
movq 0x8(%rbx), %rsi
testb %al, %al
je 0xa338
callq 0xa3ec
jmp 0xa33d
retq
callq 0xa42a
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
callq 0xa953
subq (%rbx), %rax
sarq $0x2, %rax
movq %rbx, %rdi
movq %rax, %rsi
popq %rbx
jmp 0xa468
// File: /workspace/github_cpp_makefile_star2_O1/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 0xafa7
movl $0x1, 0x4(%rbx)
leaq 0x8(%rbx), %rsi
movl $0x4, %edx
movq %r14, %rdi
callq 0x32e0
leaq 0xc(%rbx), %rsi
movl $0x4, %edx
movq %r14, %rdi
callq 0x32e0
movl 0xc(%rbx), %r13d
leaq (,%r13,8), %r12
movq %r12, %rdi
callq 0x3030
movq %rax, %r15
testq %r13, %r13
je 0xaf6b
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x3150
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x32e0
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0xb03a
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0xb03a
movq %r15, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x3300
movl %edx, 0x4(%rbx)
movl $0x48, %edi
callq 0x3260
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x12720
movq %r15, 0x10(%rbx)
movl (%r15), %eax
movl %eax, 0x8(%rbx)
movl 0x4(%r15), %r12d
movl %r12d, 0xc(%rbx)
movl $0x28, %edi
callq 0x3260
movq %rax, %r15
leal -0x1(%r12), %eax
bsrl %eax, %ecx
xorl $-0x20, %ecx
addl $0x21, %ecx
testl %eax, %eax
cmovel %eax, %ecx
movq %r15, %rdi
movq %r14, %rsi
movl %r12d, %edx
callq 0x10e0a
movq %r15, 0x18(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xb206
movq %rax, %rbx
movl $0x28, %esi
jmp 0xb029
movq %rax, %rbx
movl $0x48, %esi
movq %r15, %rdi
callq 0x3270
movq %rbx, %rdi
callq 0x3460
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movl 0xc(%rdi), %esi
leal -0x1(%rsi), %eax
bsrl %eax, %edx
xorl $-0x20, %edx
addl $0x21, %edx
testl %eax, %eax
cmovel %eax, %edx
leaq 0x8(%rsp), %rdi
callq 0x11092
movq 0x18(%rbx), %rsi
movabsq $0x2000000000, %rax     # imm = 0x2000000000
movq %rax, 0x18(%rsi)
movl $0x0, 0x20(%rsi)
cmpl $0x0, 0xc(%rbx)
je 0xb344
xorl %edi, %edi
movq 0x8(%rsp), %r8
incl 0x20(%rsi)
movl 0xc(%rsi), %eax
movl 0x1c(%rsi), %ecx
movl %eax, %edx
movl $0x0, %r9d
subl %ecx, %edx
jb 0xb293
movq (%rsi), %rax
movl 0x18(%rsi), %r10d
movl (%rax,%r10,4), %r9d
negb %cl
shll %cl, %r9d
shrl %cl, %r9d
movl %edx, %ecx
shll %cl, %r9d
leal 0x1(%r10), %eax
movl %eax, 0x18(%rsi)
movl $0x20, 0x1c(%rsi)
movl %edx, %eax
testl %eax, %eax
je 0xb2b7
movl 0x1c(%rsi), %ecx
subl %eax, %ecx
movl %ecx, 0x1c(%rsi)
movq (%rsi), %rdx
movl 0x18(%rsi), %r10d
movl (%rdx,%r10,4), %edx
shrl %cl, %edx
negb %al
movl %eax, %ecx
shll %cl, %edx
shrl %cl, %edx
orl %edx, %r9d
movl 0x14(%rsp), %ecx
movl %ecx, %eax
imull %r9d, %eax
movl %eax, %r10d
shrl $0x5, %r10d
movl %r10d, 0x20(%rsp)
andl $0x1f, %eax
movl $0x20, %r11d
subl %eax, %r11d
movl %r11d, 0x24(%rsp)
movl %r9d, 0x28(%rsp)
movl %ecx, %edx
subl %r11d, %edx
jb 0xb30f
movl %edi, %r9d
movl %edx, %ecx
shrl %cl, %r9d
movl %eax, %ecx
shll %cl, %r9d
shrl %cl, %r9d
movl %r10d, %eax
orl %r9d, (%r8,%rax,4)
incl 0x20(%rsp)
movl $0x20, 0x24(%rsp)
movl %edx, %ecx
testl %ecx, %ecx
je 0xb335
movl 0x20(%rsp), %edx
movl 0x24(%rsp), %eax
subl %ecx, %eax
negb %cl
movl %edi, %r9d
shll %cl, %r9d
shrl %cl, %r9d
movl %eax, %ecx
shll %cl, %r9d
movl %eax, 0x24(%rsp)
orl %r9d, (%r8,%rdx,4)
incl 0x28(%rsp)
incl %edi
cmpl 0xc(%rbx), %edi
jb 0xb256
movq $0x0, 0x20(%rbx)
leaq 0x8(%rsp), %rdi
callq 0x11156
movq %rax, 0x28(%rbx)
leaq 0x8(%rsp), %rdi
callq 0x11142
addq $0x30, %rsp
popq %rbx
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x11142
movq %rbx, %rdi
callq 0x3460
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xb454
movq %rsi, %r14
movq %rdi, %rbx
testb %cl, %cl
je 0xb45e
movl $0x1, 0x4(%rbx)
leaq 0x8(%rbx), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x3360
testq %rax, %rax
je 0xb454
leaq 0xc(%rbx), %r15
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %r14, %rcx
callq 0x3360
testq %rax, %rax
je 0xb454
movl (%r15), %r13d
leaq (,%r13,8), %r12
movq %r12, %rdi
callq 0x3030
movq %rax, %r15
testq %r13, %r13
je 0xb40e
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x3150
movl $0x1, %edx
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rcx
callq 0x3360
testq %rax, %rax
je 0xb454
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0xb03a
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0xb03a
movq %r15, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x3300
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movl %edx, 0x4(%rbx)
movl $0x48, %edi
callq 0x3260
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x12726
movq %r15, 0x10(%rbx)
movl (%r15), %eax
movl %eax, 0x8(%rbx)
movl 0x4(%r15), %r12d
movl %r12d, 0xc(%rbx)
movl $0x28, %edi
callq 0x3260
movq %rax, %r15
leal -0x1(%r12), %eax
bsrl %eax, %ecx
xorl $-0x20, %ecx
addl $0x21, %ecx
testl %eax, %eax
cmovel %eax, %ecx
movq %r15, %rdi
movq %r14, %rsi
movl %r12d, %edx
callq 0x10e84
movq %r15, 0x18(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xb206
movq %rax, %rbx
movl $0x28, %esi
jmp 0xb4e0
movq %rax, %rbx
movl $0x48, %esi
movq %r15, %rdi
callq 0x3270
movq %rbx, %rdi
callq 0x3460
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
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)
movq %rdx, %rdi
movl $0x1, %edx
callq 0xd0fa
movq %rax, %rbx
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xb03a
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0xb03a
testq %rbx, %rbx
je 0xb7ee
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3300
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x98, %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 0xc667
movl 0xc(%rbx), %esi
leal -0x1(%rsi), %eax
bsrl %eax, %edx
xorl $-0x20, %edx
addl $0x21, %edx
testl %eax, %eax
cmovel %eax, %edx
movq %rsp, %rdi
callq 0x11092
leaq 0x28(%rsp), %rdi
movl $0x10, %esi
movl $0x100000, %edx         # imm = 0x100000
callq 0x13026
cmpl $0x0, 0xc(%rbx)
je 0xb8eb
xorl %r12d, %r12d
leaq 0x28(%rsp), %r15
movl (%r14,%r12,8), %esi
movq %r15, %rdi
callq 0x13036
movl 0x4(%r14,%r12,8), %eax
xorl %edx, %edx
divl 0x4(%rbx)
movl 0xc(%rsp), %ecx
movl 0x1c(%rsp), %esi
movl %ecx, %edx
subl %esi, %edx
jb 0xb8b9
movl %eax, %edi
movl %edx, %ecx
shrl %cl, %edi
negb %sil
movl %esi, %ecx
shll %cl, %edi
shrl %cl, %edi
movq (%rsp), %rcx
movl 0x18(%rsp), %esi
orl %edi, (%rcx,%rsi,4)
incl 0x18(%rsp)
movl $0x20, 0x1c(%rsp)
movl %edx, %ecx
testl %ecx, %ecx
je 0xb8dc
movl 0x1c(%rsp), %edx
subl %ecx, %edx
movl %edx, 0x1c(%rsp)
negb %cl
shll %cl, %eax
shrl %cl, %eax
movl %edx, %ecx
shll %cl, %eax
movq (%rsp), %rcx
movl 0x18(%rsp), %edx
orl %eax, (%rcx,%rdx,4)
incl 0x20(%rsp)
incq %r12
movl 0xc(%rbx), %eax
cmpq %rax, %r12
jb 0xb86d
movl $0x48, %edi
callq 0x3260
movq %rax, %r14
movl 0x8(%rbx), %edx
leaq 0x28(%rsp), %rsi
movq %rax, %rdi
callq 0x1272c
movq %r14, 0x10(%rbx)
movq %rsp, %rdi
callq 0x11156
movq %rax, 0x18(%rbx)
movq %rbx, %rdi
callq 0xb206
leaq 0x28(%rsp), %rdi
callq 0x13030
movq %rsp, %rdi
callq 0x11142
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movl $0x48, %esi
movq %r14, %rdi
callq 0x3270
jmp 0xb95d
movq %rax, %rbx
jmp 0xb967
jmp 0xb95a
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x13030
movq %rsp, %rdi
callq 0x11142
movq %rbx, %rdi
callq 0x3460
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xbfe5
movq %r14, %rdi
callq 0x12732
movl $0x48, %esi
movq %r14, %rdi
callq 0x3270
movq $0x0, 0x10(%rbx)
movq 0x18(%rbx), %r14
testq %r14, %r14
je 0xc00b
movq %r14, %rdi
callq 0x10f96
movl $0x28, %esi
movq %r14, %rdi
callq 0x3270
movq $0x0, 0x18(%rbx)
movq 0x20(%rbx), %r14
testq %r14, %r14
je 0xc031
movq %r14, %rdi
callq 0x12732
movl $0x48, %esi
movq %r14, %rdi
callq 0x3270
movq $0x0, 0x20(%rbx)
movq 0x28(%rbx), %r14
testq %r14, %r14
je 0xc057
movq %r14, %rdi
callq 0x10f96
movl $0x28, %esi
movq %r14, %rdi
callq 0x3270
movq $0x0, 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xc1e8
leaq 0x8(%r14), %rsi
movl $0x4, %edx
movq %rbx, %rdi
callq 0x3310
leaq 0xc(%r14), %r15
movl $0x4, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3310
movq 0x10(%r14), %rsi
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x12744
xorl %ebp, %ebp
movq %r12, %rdi
xorl %esi, %esi
callq 0x128f8
movq 0x18(%r14), %rsi
movl 0xc(%rsi), %edx
movabsq $0x2000000000, %rcx     # imm = 0x2000000000
movq %rcx, 0x18(%rsi)
movl $0x1, 0x20(%rsi)
cmpl $0x20, %edx
jb 0xc107
movq (%rsi), %rcx
movl (%rcx), %ebp
movl %edx, %ecx
shll %cl, %ebp
leal -0x20(%rdx), %ecx
movabsq $0x2000000001, %rdx     # imm = 0x2000000001
movq %rdx, 0x18(%rsi)
movl %ecx, %edx
testl %edx, %edx
je 0xc128
movl 0x1c(%rsi), %ecx
subl %edx, %ecx
movl %ecx, 0x1c(%rsi)
movq (%rsi), %rdi
movl 0x18(%rsi), %esi
movl (%rdi,%rsi,4), %esi
shrl %cl, %esi
negb %dl
movl %edx, %ecx
shll %cl, %esi
shrl %cl, %esi
orl %esi, %ebp
movl %eax, 0x8(%rsp)
movl %ebp, 0xc(%rsp)
cmpl $0x0, (%r15)
je 0xc1cc
xorl %ebp, %ebp
leaq 0x8(%rsp), %r12
leaq 0x10(%rsp), %r13
movl $0x8, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3310
movq %r13, %rdi
callq 0x12a58
movl %eax, 0x8(%rsp)
movq 0x18(%r14), %rdi
incl 0x20(%rdi)
movl 0xc(%rdi), %eax
movl 0x1c(%rdi), %ecx
xorl %esi, %esi
movl %eax, %edx
subl %ecx, %edx
jb 0xc19c
movq (%rdi), %rax
movl 0x18(%rdi), %r8d
movl (%rax,%r8,4), %esi
negb %cl
shll %cl, %esi
shrl %cl, %esi
movl %edx, %ecx
shll %cl, %esi
leal 0x1(%r8), %eax
movl %eax, 0x18(%rdi)
movl $0x20, 0x1c(%rdi)
movl %edx, %eax
testl %eax, %eax
je 0xc1bd
movl 0x1c(%rdi), %ecx
subl %eax, %ecx
movl %ecx, 0x1c(%rdi)
movq (%rdi), %rdx
movl 0x18(%rdi), %edi
movl (%rdx,%rdi,4), %edx
shrl %cl, %edx
negb %al
movl %eax, %ecx
shll %cl, %edx
shrl %cl, %edx
orl %edx, %esi
movl %esi, 0xc(%rsp)
incl %ebp
cmpl (%r15), %ebp
jb 0xc146
leaq 0x10(%rsp), %rdi
callq 0x1274a
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0x11e30
movq 0x18(%r14), %rdi
movq %rbx, %rsi
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10fb0
jmp 0xc213
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x1274a
movq %rbx, %rdi
callq 0x3460
// File: /workspace/github_cpp_makefile_star2_O1/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 0xc3ae
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x1, (%rdi)
jne 0xc3c0
leaq 0x8(%r14), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x34a0
leaq 0xc(%r14), %r15
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x34a0
movq 0x10(%r14), %rsi
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x12744
xorl %ebp, %ebp
movq %r12, %rdi
xorl %esi, %esi
callq 0x128f8
movq 0x18(%r14), %rsi
movl 0xc(%rsi), %edx
movabsq $0x2000000000, %rcx     # imm = 0x2000000000
movq %rcx, 0x18(%rsi)
movl $0x1, 0x20(%rsi)
cmpl $0x20, %edx
jb 0xc2da
movq (%rsi), %rcx
movl (%rcx), %ebp
movl %edx, %ecx
shll %cl, %ebp
leal -0x20(%rdx), %ecx
movabsq $0x2000000001, %rdx     # imm = 0x2000000001
movq %rdx, 0x18(%rsi)
movl %ecx, %edx
testl %edx, %edx
je 0xc2fb
movl 0x1c(%rsi), %ecx
subl %edx, %ecx
movl %ecx, 0x1c(%rsi)
movq (%rsi), %rdi
movl 0x18(%rsi), %esi
movl (%rdi,%rsi,4), %esi
shrl %cl, %esi
negb %dl
movl %edx, %ecx
shll %cl, %esi
shrl %cl, %esi
orl %esi, %ebp
movl %eax, 0x8(%rsp)
movl %ebp, 0xc(%rsp)
cmpl $0x0, (%r15)
je 0xc3a4
xorl %ebp, %ebp
leaq 0x8(%rsp), %r12
leaq 0x10(%rsp), %r13
movl $0x8, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x34a0
movq %r13, %rdi
callq 0x12a58
movl %eax, 0x8(%rsp)
movq 0x18(%r14), %rdi
incl 0x20(%rdi)
movl 0xc(%rdi), %eax
movl 0x1c(%rdi), %ecx
xorl %esi, %esi
movl %eax, %edx
subl %ecx, %edx
jb 0xc374
movq (%rdi), %rax
movl 0x18(%rdi), %r8d
movl (%rax,%r8,4), %esi
negb %cl
shll %cl, %esi
shrl %cl, %esi
movl %edx, %ecx
shll %cl, %esi
leal 0x1(%r8), %eax
movl %eax, 0x18(%rdi)
movl $0x20, 0x1c(%rdi)
movl %edx, %eax
testl %eax, %eax
je 0xc395
movl 0x1c(%rdi), %ecx
subl %eax, %ecx
movl %ecx, 0x1c(%rdi)
movq (%rdi), %rdx
movl 0x18(%rdi), %edi
movl (%rdx,%rdi,4), %edx
shrl %cl, %edx
negb %al
movl %eax, %ecx
shll %cl, %edx
shrl %cl, %edx
orl %edx, %esi
movl %esi, 0xc(%rsp)
incl %ebp
cmpl (%r15), %ebp
jb 0xc319
leaq 0x10(%rsp), %rdi
callq 0x1274a
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0x11ede
movq 0x18(%r14), %rdi
movq %rbx, %rsi
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10fc6
jmp 0xc3eb
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x1274a
movq %rbx, %rdi
callq 0x3460
// File: /workspace/github_cpp_makefile_star2_O1/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 0x12738
movl %eax, %r14d
movq 0x18(%rbx), %rdi
callq 0x11028
leal (%r14,%rax), %ebp
addl $0x30, %ebp
cmpb $0x1, (%rbx)
jne 0xc433
movq 0x20(%rbx), %rdi
callq 0x12738
addl %eax, %ebp
movq 0x28(%rbx), %rdi
callq 0x11028
addl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x80, %rsp
movl 0x8(%rdi), %r14d
movl %r14d, %ebp
cmpl %esi, %r14d
jbe 0xc5bc
movl %esi, %ebx
movq %rdi, %r15
cmpb $0x1, (%rdi)
jne 0xc4cc
movq 0x20(%r15), %rsi
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x12744
xorl %r14d, %r14d
movq %r12, %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x12750
decl %eax
movq 0x28(%r15), %rdi
movl 0xc(%rdi), %r9d
movl %r9d, %ecx
imull %eax, %ecx
movl %ecx, %r8d
shrl $0x5, %r8d
andl $0x1f, %ecx
movl $0x20, %esi
movl $0x20, %r10d
subl %ecx, %r10d
movl %r9d, %edx
subl %r10d, %edx
jae 0xc56b
movl %r10d, %esi
movl %r9d, %edx
jmp 0xc583
movq 0x10(%r15), %rsi
leaq 0x8(%rsp), %rdi
callq 0x12744
movl %ebx, %eax
xorl %edx, %edx
divl 0x4(%r15)
movl %eax, %ecx
movl %edx, %ebp
xorl %esi, %esi
movq 0x28(%r15), %rdi
movl 0xc(%rdi), %r9d
imull %r9d, %ecx
movl %ecx, %r8d
shrl $0x5, %r8d
andl $0x1f, %ecx
movl $0x20, %edx
movl $0x20, %r10d
subl %ecx, %r10d
movl %r9d, %eax
subl %r10d, %eax
jae 0xc51c
movl %r10d, %edx
movl %r9d, %eax
jmp 0xc531
movq (%rdi), %rsi
movl %r8d, %r9d
movl (%rsi,%r9,4), %esi
shll %cl, %esi
shrl %cl, %esi
movl %eax, %ecx
shll %cl, %esi
incl %r8d
testl %eax, %eax
je 0xc54e
subl %eax, %edx
movq (%rdi), %rcx
movl %r8d, %edi
movl (%rcx,%rdi,4), %edi
movl %edx, %ecx
shrl %cl, %edi
negb %al
movl %eax, %ecx
shll %cl, %edi
shrl %cl, %edi
orl %edi, %esi
leaq 0x8(%rsp), %rdi
callq 0x128f8
movl %eax, %r14d
subl %ebp, %ebx
leaq 0x8(%rsp), %rdi
callq 0x1274a
movl %ebx, %ebp
jmp 0xc5bc
movq (%rdi), %r9
movl %r8d, %r10d
movl (%r9,%r10,4), %r14d
shll %cl, %r14d
shrl %cl, %r14d
movl %edx, %ecx
shll %cl, %r14d
incl %r8d
testl %edx, %edx
je 0xc5a4
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 %r14d, %edi
movl %edi, %r14d
leaq 0x8(%rsp), %rdi
movl %eax, %esi
callq 0x128f8
movl %eax, %ebp
leaq 0x8(%rsp), %rdi
callq 0x1274a
shlq $0x20, %r14
movl %ebp, %eax
orq %r14, %rax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc5d7
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1274a
movq %rbx, %rdi
callq 0x3460
// File: /workspace/github_cpp_makefile_star2_O1/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 0xcdc6
xorl %eax, %eax
movl %eax, 0x800(%rdi)
movl %eax, 0xc04(%rdi)
movl $0x1, %ecx
xorl %edx, %edx
movl (%rsi,%rdx,4), %r9d
subl $0x1, %r9d
setb %r10b
movl 0x800(%rdi), %r8d
testl %r8d, %r8d
sete %r11b
addl %r8d, %r9d
testb %r11b, %r10b
movl %r8d, %r10d
cmovnel %ecx, %r10d
cmovnel %eax, %r9d
movl %r10d, (%rdi,%rdx,8)
movl %r9d, 0x4(%rdi,%rdx,8)
cmpl $0x0, (%rsi,%rdx,4)
je 0xcd45
movl 0xc04(%rdi), %r9d
movl %edx, 0x804(%rdi,%r9,4)
incl 0xc04(%rdi)
addl (%rsi,%rdx,4), %r8d
movl %r8d, 0x800(%rdi)
incq %rdx
cmpq $0x100, %rdx            # imm = 0x100
jne 0xccf6
movl $0xff, %eax
addl 0x800(%rdi), %eax
movl %eax, %ecx
shrl $0x8, %ecx
cmpl $0x100, %eax            # imm = 0x100
movl $0x1, %eax
cmovael %ecx, %eax
movl %eax, 0x1008(%rdi)
movl 0xc04(%rdi), %eax
testq %rax, %rax
je 0xcdbf
xorl %ecx, %ecx
xorl %edx, %edx
xorl %esi, %esi
movl 0x804(%rdi,%rcx,4), %r8d
movl 0x4(%rdi,%r8,8), %r8d
cmpl %r8d, %edx
ja 0xcdb7
movl %esi, %r9d
movl %ecx, 0xc08(%rdi,%r9,4)
addl 0x1008(%rdi), %edx
incl %esi
jmp 0xcd9d
incq %rcx
cmpq %rax, %rcx
jne 0xcd90
movb $0x1, 0x100c(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3150
movb $0x0, 0x100c(%rbx)
testq %r14, %r14
je 0xce67
movq %rsp, %rdi
movl $0x400, %esi            # imm = 0x400
movl $0x1, %edx
movq %r14, %rcx
callq 0x3360
testq %rax, %rax
je 0xce67
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xccd8
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xcf1e
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r12d, %r12d
leaq 0x4(%rsp), %r15
movq (%r14,%r12,8), %rax
movq %rax, %rcx
shrq $0x20, %rcx
subl %eax, %ecx
incl %ecx
movl %ecx, 0x4(%rsp)
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x34a0
incq %r12
cmpq $0x100, %r12            # imm = 0x100
jne 0xcedf
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rdi, %rbx
leaq 0x12702(%rip), %rdx     # 0x1f6b0
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x9f63
movq (%r14), %rsi
leaq 0x28(%rsp), %rdi
movl $0x4, %edx
callq 0x32a0
movq 0x28(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x48(%rsp,%rax)
je 0xd025
movq 0x1200c(%rip), %rbx     # 0x1eff0
leaq 0xa6c2(%rip), %rsi      # 0x176ad
movl $0x24, %edx
movq %rbx, %rdi
callq 0x32b0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
movq 0x11fda(%rip), %rdi     # 0x1eff0
callq 0x3040
movq %rax, %rdi
callq 0x3190
jmp 0xd066
cmpl $0x0, 0x18(%rbx)
je 0xd05c
movl $0x4, %r15d
xorl %r12d, %r12d
leaq 0x28(%rsp), %r14
movq 0x10(%rbx), %rsi
addq %r15, %rsi
movl $0x4, %edx
movq %r14, %rdi
callq 0x3310
incq %r12
movl 0x18(%rbx), %eax
addq $0x8, %r15
cmpq %rax, %r12
jb 0xd039
leaq 0x28(%rsp), %rdi
callq 0x3330
movq 0x11f5b(%rip), %rax     # 0x1efc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x30(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x28(%rsp,%rcx)
callq 0x3200
leaq 0x120(%rsp), %rdi
callq 0x30e0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd0b3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3270
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
jmp 0xd0d6
jmp 0xd0c9
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3350
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd0f1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3270
movq %rbx, %rdi
callq 0x3460
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xd157
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0xd153
cmpl $0x2, 0xc(%rbx)
jne 0xd153
movl 0x18(%rbx), %eax
testq %rax, %rax
je 0xd135
xorl %ecx, %ecx
movl 0x4(%rdi,%rcx,8), %r8d
movl 0x4(%rsi,%r8,8), %r8d
subl %edx, %r8d
movl %r8d, (%rdi,%rcx,8)
incq %rcx
cmpq %rcx, %rax
jne 0xd11c
leaq (%rdi,%rax,8), %rsi
callq 0xc667
movq 0x10(%rbx), %rax
movq $0x0, 0x10(%rbx)
movl $0x0, 0xc(%rbx)
jmp 0xd155
xorl %eax, %eax
popq %rbx
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xd3f6
callq 0x3300
movq $0x0, 0x28(%rbx)
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0xd40c
callq 0x3300
movq $0x0, 0x30(%rbx)
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0xd422
callq 0x3300
movq $0x0, 0x38(%rbx)
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0xd438
callq 0x3300
movq $0x0, 0x40(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %esi, %esi
xorl %eax, %eax
leal (%rdi,%rsi), %r9d
movl %esi, %r10d
movl %eax, %ebx
cmpl %r9d, %eax
jne 0xdf2a
movl (%r8,%r10,4), %r9d
cmpl (%rdx,%rbx,4), %r9d
ja 0xdf2a
leal 0x1(%rsi), %r9d
movl (%r8,%r9,4), %ebp
leal 0x1(%rax), %r11d
cmpl (%rdx,%r11,4), %ebp
jae 0xdf45
movl (%rdx,%rbx,4), %r9d
xorl %r11d, %r11d
xorl %ebx, %ebx
cmpl (%r8,%r10,4), %r9d
setbe %r11b
seta %bl
addl %ebx, %esi
addl %r11d, %eax
jmp 0xdf00
cmpl $0x1, %r9d
adcl $0x1, %esi
xorl %edi, %edi
movl (%r8,%rdi,4), %r10d
movl %r10d, (%rdx,%rdi,4)
incq %rdi
cmpq %rdi, %rsi
jne 0xdf4e
cmpl %ecx, %r11d
jae 0xdf86
movl %r11d, %esi
leaq (%rdx,%rsi,4), %rsi
notl %eax
addl %ecx, %eax
movl %r9d, %ecx
xorl %edi, %edi
leal (%rcx,%rdi), %r8d
movl (%rsi,%rdi,4), %r9d
movl %r9d, (%rdx,%r8,4)
incq %rdi
cmpl %edi, %eax
jne 0xdf73
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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, 0x4(%rsp)
movl %edx, %r12d
movl $0xffffffff, (%r13,%r12,4) # imm = 0xFFFFFFFF
movl %ecx, (%rsp)
movl %ecx, %ebx
negl %ebx
movq 0x10(%rsi), %r14
movq 0x30(%rsi), %rax
movq %rax, 0x20(%rsp)
cmpq %rax, %r14
je 0xe071
movq 0x20(%rsi), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsi), %rax
movq %rax, 0x8(%rsp)
movq 0x30(%rdi), %rax
movq %rax, 0x18(%rsp)
movl (%r14), %esi
movl (%r13,%rsi,4), %ebp
movq %rdi, %r15
movl 0x4(%rsp), %edx
callq 0xe396
addl %ebp, %eax
cmpl (%r13,%r12,4), %eax
ja 0xe071
movq %r15, %rdi
jb 0xe026
cmpb $0x0, (%rsp)
je 0xe01c
movl 0x4(%r14), %ecx
incl %ecx
cmpl %ebx, %ecx
jb 0xe026
cmpb $0x0, (%rsp)
jne 0xe03d
movl 0x4(%r14), %ecx
incl %ecx
cmpl %ebx, %ecx
jbe 0xe03d
movl %eax, (%r13,%r12,4)
movl (%r14), %eax
movq 0x18(%rsp), %rcx
movl %eax, (%rcx,%r12,4)
movl 0x4(%r14), %ebx
incl %ebx
addq $0x8, %r14
cmpq 0x10(%rsp), %r14
jne 0xe066
movq 0x8(%rsp), %rax
movq 0x8(%rax), %r14
addq $0x8, %rax
movq %rax, 0x8(%rsp)
leaq 0x200(%r14), %rax
movq %rax, 0x10(%rsp)
cmpq 0x20(%rsp), %r14
jne 0xdfe4
shlq $0x20, %rbx
orq %r12, %rbx
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq