LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::directInverseLocate(unsigned int) const
usint
RLCSA::directInverseLocate(usint location) const
{
  // Get the SA value and SA index (in that order) of the last SA sample
  // before the given text location.
  pair_type last_sample = this->sa_samples->inverseSA(location);
  
  // TODO: catch the (size, size) sentinel.
  while(last_sample.first < location) {
    // We're not at the desired text location, so we must be before it.
    
    // Advance the text location (SA value) by 1
    last_sample.first += 1;
    
    // Advance the SA index to that corresponding to the next character. Note
    // that psi returns BWT coordinates, so we have to convert back to SA
    // coordinates.
    last_sample.second = (this->psi(last_sample.second) - 
      this->number_of_sequences);
      
  }
  
  if(last_sample.first != location) {
    // We managed to start on the wrong side of what we're trying to locate;
    // inverseSA lied to us.
    throw "Somehow skipped desired inverse locate position";
  }
  
  // Return the answer (SA index) in BWT coordinates. It will probably be
  // immediately converted back to SA coordinates, but it's worth it for
  // consistency with the directLocate function, which takes in BWT coordinates.
  return last_sample.second + this->number_of_sequences;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movq 0x810(%rdi), %rdi
callq 0xc578
movq %rax, %r14
movq %rax, %r15
shrq $0x20, %r15
cmpl %ebp, %r14d
jae 0x7b00
movq %rsp, %r12
movl 0x4(%rbx), %ecx
cmpl %r15d, %ecx
jbe 0x7ae4
movq 0x808(%rbx), %rcx
movl %r15d, %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), %r13d
addq $0x4, %rax
cmpl %r15d, 0x4(%rcx,%r13,8)
jb 0x7aa0
movq 0x8(%rbx,%r13,8), %rsi
movq %r12, %rdi
callq 0x1375c
movq 0x808(%rbx), %rax
subl (%rax,%r13,8), %r15d
movq %r12, %rdi
movl %r15d, %esi
callq 0x13a48
movl %eax, %r15d
movq %r12, %rdi
callq 0x13762
movl 0x820(%rbx), %eax
jmp 0x7aef
movl 0x820(%rbx), %eax
addl %eax, %ecx
movl %ecx, %r15d
subl %eax, %r15d
incl %r14d
cmpl %ebp, %r14d
jne 0x7a75
jmp 0x7b02
jne 0x7b1b
addl 0x820(%rbx), %r15d
movl %r15d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x8, %edi
callq 0x3130
leaq 0x109df(%rip), %rcx     # 0x1850b
movq %rcx, (%rax)
movq 0x18482(%rip), %rsi     # 0x1ffb8
movq %rax, %rdi
xorl %edx, %edx
callq 0x3410
movq %rax, %rbx
movq %rsp, %rdi
callq 0x13762
movq %rbx, %rdi
callq 0x3460
nop
// File: /workspace/github_cpp_makefile_star2_O3/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::display(unsigned int, bool) const
uchar*
RLCSA::display(usint sequence, bool include_end_marker) const
{
  if(!(this->support_display)) { return 0; }

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

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

  return data;
}

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

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

  return result;
}

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

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

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

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

  return data;
}

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

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

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

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

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

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

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

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

  return data;
}

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

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

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

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

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

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

  return max_len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
xorl %ebx, %ebx
testl %edx, %edx
je 0x8588
movq %rcx, %r14
testq %rcx, %rcx
je 0x8588
movl %esi, %r12d
movq %rdi, %r15
cmpl %esi, 0x4(%rdi)
jbe 0x8588
movl %edx, 0x4(%rsp)
movl %edx, %eax
movq %rax, 0x8(%rsp)
xorl %ebx, %ebx
leaq 0x10(%rsp), %r13
movq 0x808(%r15), %rcx
movl %r12d, %eax
xorl %edx, %edx
divl 0x1008(%rcx)
movl 0xc08(%rcx,%rax,4), %eax
leaq (%rcx,%rax,4), %rdx
addq $0x804, %rdx            # imm = 0x804
movl (%rdx), %eax
addq $0x4, %rdx
cmpl %r12d, 0x4(%rcx,%rax,8)
jb 0x8526
movb %al, (%r14,%rbx)
movzbl %al, %ebp
shll $0x3, %ebp
movq 0x8(%r15,%rbp), %rsi
movq %r13, %rdi
callq 0x1375c
movq 0x808(%r15), %rax
subl (%rax,%rbp), %r12d
movq %r13, %rdi
movl %r12d, %esi
callq 0x13a48
movl %eax, %r12d
movq %r13, %rdi
callq 0x13762
subl 0x820(%r15), %r12d
jb 0x8586
incq %rbx
cmpq 0x8(%rsp), %rbx
jne 0x8502
movl 0x4(%rsp), %eax
movl %eax, %ebx
jmp 0x8588
incl %ebx
movl %ebx, %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 0x13762
movq %rbx, %rdi
callq 0x3460
nop
// File: /workspace/github_cpp_makefile_star2_O3/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::locateRange(std::pair<unsigned int, unsigned int>) const
std::vector<usint>*
RLCSA::locateRange(pair_type range) const
{
  std::vector<usint>* results = new std::vector<usint>;
  if(!(this->support_locate)) { return results; }

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

  return results;
}

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

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rsi, %rax
shrq $0x20, %rax
movl %eax, %ebp
subl %r15d, %ebp
jb 0x86df
movq %rdi, %r12
cmpl %eax, 0x4(%rdi)
jbe 0x86df
movq %rdx, %rbx
leal 0x1(%rbp), %r13d
leaq (,%r13,4), %rdi
callq 0x3030
movq %rax, %r14
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x74ce
incl %ebp
je 0x86c9
movq %r14, %r15
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x86b5
movl (%r15), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x86c0
movq %rbx, %rdi
movq %r15, %rdx
callq 0xaa8a
addq $0x4, %r15
decq %r13
jne 0x869c
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3300
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::locateRanges(std::vector<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int>>>&) const
std::vector<usint>*
RLCSA::locateRanges(std::vector<pair_type>& ranges) const
{
  std::vector<usint>* results = new std::vector<usint>;
  if(!(this->support_locate)) { return results; }

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

  return results;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movl $0x18, %edi
callq 0x3260
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
cmpb $0x1, 0x818(%r15)
jne 0x8749
movq (%r14), %r12
cmpq 0x8(%r14), %r12
je 0x873f
movq (%r12), %rsi
movq %r15, %rdi
movq %rbx, %rdx
callq 0x864a
addq $0x8, %r12
jmp 0x8724
movq %rbx, %rdi
xorl %esi, %esi
callq 0xa428
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::getSequenceForPosition(unsigned int*, unsigned int) const
usint*
RLCSA::getSequenceForPosition(usint* values, usint len) const
{
  if(values == 0) { return 0; }

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

  return values;
}

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

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

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x78, %rsp
movl %esi, %ebx
movq %rdi, %r15
movq 0x828(%rdi), %rsi
movq %rsp, %rdi
callq 0x12ac0
testl %ebx, %ebx
je 0x8897
leal -0x1(%rbx), %esi
movq %rsp, %rdi
xorl %edx, %edx
callq 0x12acc
movl %eax, %r14d
testl %eax, %eax
je 0x889e
movl 0x81c(%r15), %ebp
leal -0x1(%r14), %esi
movq %rsp, %rdi
callq 0x12c6e
xorl %edx, %edx
divl %ebp
notl %eax
imull %ebp, %eax
addl %ebx, %eax
movl %r14d, %r14d
movl %eax, %ebx
jmp 0x88a1
xorl %r14d, %r14d
xorl %ebx, %ebx
jmp 0x88a1
xorl %r14d, %r14d
movq %rsp, %rdi
callq 0x12ac6
shlq $0x20, %rbx
orq %r14, %rbx
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x12ac6
movq %rbx, %rdi
callq 0x3460
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x12ac0
testl %ebx, %ebx
je 0x8917
movl 0x81c(%r14), %ebp
leal -0x1(%rbx), %esi
leaq 0x8(%rsp), %rdi
callq 0x12c6e
xorl %edx, %edx
divl %ebp
incl %eax
imull %ebp, %eax
jmp 0x8919
xorl %eax, %eax
shrq $0x20, %rbx
addl %eax, %ebx
leaq 0x8(%rsp), %rdi
callq 0x12ac6
movl %ebx, %eax
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x12ac6
movq %rbx, %rdi
callq 0x3460
// File: /workspace/github_cpp_makefile_star2_O3/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 0x89ff
movq %rdi, %r14
movl 0x820(%rdi), %eax
addl 0x4(%rdi), %eax
cmpl %r13d, %eax
jbe 0x89ff
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 0x89f1
movq %r12, %rdi
callq 0x1375c
movq %r12, %rdi
movl %ebx, %esi
callq 0x141c8
cmpl %r13d, %eax
ja 0x89e9
subl %ebx, %eax
movb %bpl, (%r15,%rax)
movq %r12, %rdi
callq 0x13cb8
jmp 0x89d4
movq %r12, %rdi
callq 0x13762
incq %rbp
cmpq $0x100, %rbp            # imm = 0x100
jne 0x89b8
jmp 0x8a02
xorl %r15d, %r15d
movq %r15, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8a16
movq %rax, %rbx
movq %rsp, %rdi
callq 0x13762
movq %rbx, %rdi
callq 0x3460
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x8a63
movq %r14, %rdi
callq 0x1375c
movq %r14, %rdi
callq 0x14520
addl %eax, %ebp
movq %r14, %rdi
callq 0x13762
incq %r15
cmpq $0x100, %r15            # imm = 0x100
jne 0x8a3f
movl %ebp, %eax
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x13762
movq %rbx, %rdi
callq 0x3460
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x8abd
movl %esi, %ebx
movq %rdi, %r15
callq 0x7f00
movq %rax, %r12
movq %rax, %r14
shrq $0x20, %r14
subl %r12d, %r14d
jae 0x8ac1
xorl %ebx, %ebx
jmp 0x8b30
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 0x7fa6
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 0xf2ba
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_O3/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 0xf1f2(%rip), %xmm0     # 0x18010
movsd %xmm0, 0x8(%rsp)
movq 0x171a5(%rip), %rbx     # 0x1ffd0
leaq 0xf755(%rip), %rsi      # 0x18587
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 0xf71a(%rip), %rsi      # 0x18599
movl $0x11, %edx
movq %rbx, %rdi
callq 0x32b0
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x33c0
movq %rax, %r15
leaq 0xf6a9(%rip), %rsi      # 0x1854d
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 0xf6cc(%rip), %rsi      # 0x185ab
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 0xf6a6(%rip), %rsi      # 0x185bd
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 0x8f5f
cmpb $0x1, 0x819(%r14)
jne 0x8fd4
movq 0x1706a(%rip), %r15     # 0x1ffd0
leaq 0xf657(%rip), %rsi      # 0x185c4
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 0x8fad
movq 0x17034(%rip), %rdi     # 0x1ffd0
leaq 0xf633(%rip), %rsi      # 0x185d6
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_O3/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 0x9f0d
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 0x12ac0
movq %r13, %rdi
movl %ebp, %esi
callq 0x13386
movl %eax, %r15d
movq %r13, %rdi
callq 0x12ac6
testb %r15b, %r15b
jne 0x9ea9
movl 0x4(%r12), %ecx
cmpl %ebp, %ecx
jbe 0x9e94
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 0x9e4f
movq 0x8(%r12,%r15,8), %rsi
movq %r13, %rdi
callq 0x1375c
movq 0x808(%r12), %rax
subl (%rax,%r15,8), %ebp
movq %r13, %rdi
movl %ebp, %esi
callq 0x13a48
movl %eax, %ebp
movq %r13, %rdi
callq 0x13762
movl 0x820(%r12), %eax
jmp 0x9ea0
movl 0x820(%r12), %eax
addl %eax, %ecx
movl %ecx, %ebp
subl %eax, %ebp
incl %ebx
jmp 0x9df9
cmpb $0x0, 0x4(%rsp)
jne 0x9f0d
movq 0x8(%r14), %rsi
leaq 0x8(%rsp), %rdi
callq 0x12ac0
movq 0x10(%r14), %rsi
leaq 0x80(%rsp), %rdi
callq 0x106d8
leaq 0x8(%rsp), %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x12acc
decl %eax
leaq 0x80(%rsp), %rdi
movl %eax, %esi
callq 0x1073a
movl %eax, %r14d
leaq 0x80(%rsp), %rdi
callq 0x10720
leaq 0x8(%rsp), %rdi
callq 0x12ac6
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 0x9f44
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x10720
jmp 0x9f47
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x13762
jmp 0x9f51
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x12ac6
movq %rbx, %rdi
callq 0x3460
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0xa07c
movl %esi, %r14d
movq %rdi, %rbx
cmpl %esi, 0x4(%rdi)
jbe 0xa07c
movq 0x808(%rbx), %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), %r13d
addq $0x4, %rax
cmpl %r14d, 0x4(%rcx,%r13,8)
jb 0x9fa7
leal -0x1(%r14), %r15d
xorl %ebp, %ebp
cmpl (%rcx,%r13,8), %r15d
jb 0xa07c
xorl %ebp, %ebp
leaq 0x10(%rsp), %r12
movq %rbx, 0x8(%rsp)
movl %r13d, %r13d
movq 0x8(%rbx,%r13,8), %rsi
movq %r12, %rdi
callq 0x1375c
movq 0x808(%rbx), %rax
subl (%rax,%r13,8), %r15d
movq %r12, %rdi
movl %r15d, %esi
callq 0x13a48
movl %eax, %r15d
movq 0x808(%rbx), %rax
subl (%rax,%r13,8), %r14d
movq %r12, %rdi
movl %r14d, %esi
callq 0x13a48
movl %eax, %r14d
incl %ebp
movl 0x820(%rbx), %eax
subl %eax, %r15d
jb 0xa072
subl %eax, %r14d
jb 0xa072
movq 0x808(%rbx), %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), %r13d
addq $0x4, %rax
cmpl %r14d, 0x4(%rcx,%r13,8)
jb 0xa048
movl (%rcx,%r13,8), %ebx
movq %r12, %rdi
callq 0x13762
cmpl %ebx, %r15d
movq 0x8(%rsp), %rbx
jae 0x9fd1
jmp 0xa07c
leaq 0x10(%rsp), %rdi
callq 0x13762
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 0x13762
movq %rbx, %rdi
callq 0x3460
// File: /workspace/github_cpp_makefile_star2_O3/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 0xa445
pushq %rbx
movl %esi, %eax
movq %rdi, %rbx
movq (%rdi), %rdi
movq 0x8(%rbx), %rsi
testb %al, %al
je 0xa446
callq 0xa53f
jmp 0xa44b
retq
callq 0xa57d
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movq %rax, %rsi
cmpq %rcx, %rax
je 0xa49a
leaq 0x4(%rax), %rsi
cmpq %rcx, %rsi
je 0xa491
movl -0x4(%rsi), %edx
leaq 0x4(%rsi), %rdi
cmpl (%rsi), %edx
movq %rdi, %rsi
jne 0xa45e
leaq -0x8(%rdi), %rsi
cmpq %rcx, %rdi
je 0xa496
movl %edx, %r8d
movl (%rdi), %edx
cmpl %edx, %r8d
je 0xa48b
movl %edx, 0x4(%rsi)
addq $0x4, %rsi
addq $0x4, %rdi
jmp 0xa475
movq %rcx, %rsi
jmp 0xa49a
addq $0x4, %rsi
subq %rax, %rsi
sarq $0x2, %rsi
movq %rbx, %rdi
popq %rbx
jmp 0xa5bc
// File: /workspace/github_cpp_makefile_star2_O3/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 0xb07f
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 0xb043
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 0xb112
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0xb112
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 0x12a9c
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 0x1112e
movq %r15, 0x18(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xb2f2
movq %rax, %rbx
movl $0x28, %esi
jmp 0xb101
movq %rax, %rbx
movl $0x48, %esi
movq %r15, %rdi
callq 0x3270
movq %rbx, %rdi
callq 0x3460
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x113b2
movq 0x18(%rbx), %rdi
movabsq $0x2000000000, %rax     # imm = 0x2000000000
movq %rax, 0x18(%rdi)
movl $0x0, 0x20(%rdi)
cmpl $0x0, 0xc(%rbx)
je 0xb433
xorl %r8d, %r8d
movq 0x8(%rsp), %r9
incl 0x20(%rdi)
movl 0xc(%rdi), %edx
movl 0x1c(%rdi), %ecx
movl %edx, %eax
subl %ecx, %eax
jae 0xb359
movl %edx, %eax
xorl %r10d, %r10d
jmp 0xb382
movq (%rdi), %rdx
movl 0x18(%rdi), %esi
movl (%rdx,%rsi,4), %r10d
negb %cl
shll %cl, %r10d
shrl %cl, %r10d
movl %eax, %ecx
shll %cl, %r10d
leal 0x1(%rsi), %ecx
movl %ecx, 0x18(%rdi)
movl $0x20, 0x1c(%rdi)
movl $0x20, %ecx
testl %eax, %eax
je 0xb3a1
subl %eax, %ecx
movl %ecx, 0x1c(%rdi)
movq (%rdi), %rdx
movl 0x18(%rdi), %esi
movl (%rdx,%rsi,4), %edx
shrl %cl, %edx
negb %al
movl %eax, %ecx
shll %cl, %edx
shrl %cl, %edx
orl %edx, %r10d
movl 0x14(%rsp), %ecx
movl %ecx, %esi
imull %r10d, %esi
movl %esi, %r11d
shrl $0x5, %r11d
movl %r11d, 0x20(%rsp)
andl $0x1f, %esi
movl $0x20, %edx
subl %esi, %edx
movl %edx, 0x24(%rsp)
movl %r10d, 0x28(%rsp)
movl %ecx, %eax
subl %edx, %eax
jae 0xb3d4
movl %ecx, %eax
jmp 0xb402
movl %r8d, %edx
movl %eax, %ecx
shrl %cl, %edx
movl %esi, %ecx
shll %cl, %edx
shrl %cl, %edx
movl %r11d, %ecx
orl %edx, (%r9,%rcx,4)
movl 0x20(%rsp), %r11d
incl %r11d
movl %r11d, 0x20(%rsp)
movl $0x20, 0x24(%rsp)
movl $0x20, %edx
testl %eax, %eax
je 0xb422
subl %eax, %edx
movl %edx, 0x24(%rsp)
negb %al
movl %r8d, %esi
movl %eax, %ecx
shll %cl, %esi
shrl %cl, %esi
movl %edx, %ecx
shll %cl, %esi
movl %r11d, %eax
orl %esi, (%r9,%rax,4)
incl 0x28(%rsp)
incl %r8d
cmpl 0xc(%rbx), %r8d
jb 0xb343
movq $0x0, 0x20(%rbx)
leaq 0x8(%rsp), %rdi
callq 0x11476
movq %rax, 0x28(%rbx)
leaq 0x8(%rsp), %rdi
callq 0x11462
addq $0x30, %rsp
popq %rbx
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x11462
movq %rbx, %rdi
callq 0x3460
// File: /workspace/github_cpp_makefile_star2_O3/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 0xb542
movq %rsi, %r14
movq %rdi, %rbx
testb %cl, %cl
je 0xb54c
movl $0x1, 0x4(%rbx)
leaq 0x8(%rbx), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x3360
testq %rax, %rax
je 0xb542
leaq 0xc(%rbx), %r15
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %r14, %rcx
callq 0x3360
testq %rax, %rax
je 0xb542
movl (%r15), %r13d
leaq (,%r13,8), %r12
movq %r12, %rdi
callq 0x3030
movq %rax, %r15
testq %r13, %r13
je 0xb4fc
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 0xb542
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0xb112
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0xb112
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 0x12aa2
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 0x111a8
movq %r15, 0x18(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xb2f2
movq %rax, %rbx
movl $0x28, %esi
jmp 0xb5ce
movq %rax, %rbx
movl $0x48, %esi
movq %r15, %rdi
callq 0x3270
movq %rbx, %rdi
callq 0x3460
// File: /workspace/github_cpp_makefile_star2_O3/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 0xd21a
movq %rax, %rbx
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xb112
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0xb112
testq %rbx, %rbx
je 0xb908
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_O3/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 0xc79b
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 0x113b2
leaq 0x28(%rsp), %rdi
movl $0x10, %esi
movl $0x100000, %edx         # imm = 0x100000
callq 0x134f2
cmpl $0x0, 0xc(%rbx)
je 0xba0e
xorl %r12d, %r12d
leaq 0x28(%rsp), %r15
movl (%r14,%r12,8), %esi
movq %r15, %rdi
callq 0x13502
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
jae 0xb9af
movl %ecx, %edx
jmp 0xb9da
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 $0x20, %esi
testl %edx, %edx
je 0xb9fb
subl %edx, %esi
movl %esi, 0x1c(%rsp)
negb %dl
movl %edx, %ecx
shll %cl, %eax
shrl %cl, %eax
movl %esi, %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 0xb987
movl $0x48, %edi
callq 0x3260
movq %rax, %r14
movl 0x8(%rbx), %edx
leaq 0x28(%rsp), %rsi
movq %rax, %rdi
callq 0x12aa8
movq %r14, 0x10(%rbx)
movq %rsp, %rdi
callq 0x11476
movq %rax, 0x18(%rbx)
movq %rbx, %rdi
callq 0xb2f2
leaq 0x28(%rsp), %rdi
callq 0x134fc
movq %rsp, %rdi
callq 0x11462
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movl $0x48, %esi
movq %r14, %rdi
callq 0x3270
jmp 0xba80
movq %rax, %rbx
jmp 0xba8a
jmp 0xba7d
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x134fc
movq %rsp, %rdi
callq 0x11462
movq %rbx, %rdi
callq 0x3460
// File: /workspace/github_cpp_makefile_star2_O3/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 0xc100
movq %r14, %rdi
callq 0x12aae
movl $0x48, %esi
movq %r14, %rdi
callq 0x3270
movq $0x0, 0x10(%rbx)
movq 0x18(%rbx), %r14
testq %r14, %r14
je 0xc126
movq %r14, %rdi
callq 0x112b6
movl $0x28, %esi
movq %r14, %rdi
callq 0x3270
movq $0x0, 0x18(%rbx)
movq 0x20(%rbx), %r14
testq %r14, %r14
je 0xc14c
movq %r14, %rdi
callq 0x12aae
movl $0x48, %esi
movq %r14, %rdi
callq 0x3270
movq $0x0, 0x20(%rbx)
movq 0x28(%rbx), %r14
testq %r14, %r14
je 0xc172
movq %r14, %rdi
callq 0x112b6
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_O3/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 0xc214
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 0x12ac0
xorl %r13d, %r13d
movq %r12, %rdi
xorl %esi, %esi
callq 0x12c6e
movq 0x18(%r14), %rdx
movl 0xc(%rdx), %ecx
movabsq $0x2000000000, %rsi     # imm = 0x2000000000
movq %rsi, 0x18(%rdx)
movl $0x1, 0x20(%rdx)
cmpl $0x20, %ecx
jae 0xc23d
xorl %esi, %esi
jmp 0xc25e
movq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0x12196
movq 0x18(%r14), %rdi
movq %rbx, %rsi
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x112d0
leal -0x20(%rcx), %edi
movq (%rdx), %rsi
movl (%rsi), %r13d
shll %cl, %r13d
movabsq $0x2000000001, %rcx     # imm = 0x2000000001
movq %rcx, 0x18(%rdx)
movl $0x1, %esi
movl %edi, %ecx
testl %ecx, %ecx
je 0xc27c
movl $0x20, %edi
subl %ecx, %edi
movl %edi, 0x1c(%rdx)
movq (%rdx), %rdx
movl (%rdx,%rsi,4), %edx
negl %ecx
shrl %cl, %edx
orl %r13d, %edx
movl %edx, %r13d
movl %eax, 0x8(%rsp)
movl %r13d, 0xc(%rsp)
cmpl $0x0, (%r15)
je 0xc322
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 0x12dce
movl %eax, 0x8(%rsp)
movq 0x18(%r14), %rsi
incl 0x20(%rsi)
movl 0xc(%rsi), %edi
movl 0x1c(%rsi), %ecx
xorl %edx, %edx
movl %edi, %eax
subl %ecx, %eax
jae 0xc2d0
movl %edi, %eax
jmp 0xc2f5
movq (%rsi), %rdx
movl 0x18(%rsi), %edi
movl (%rdx,%rdi,4), %edx
negb %cl
shll %cl, %edx
shrl %cl, %edx
movl %eax, %ecx
shll %cl, %edx
leal 0x1(%rdi), %ecx
movl %ecx, 0x18(%rsi)
movl $0x20, 0x1c(%rsi)
movl $0x20, %ecx
testl %eax, %eax
je 0xc313
subl %eax, %ecx
movl %ecx, 0x1c(%rsi)
movq (%rsi), %rdi
movl 0x18(%rsi), %esi
movl (%rdi,%rsi,4), %esi
shrl %cl, %esi
negb %al
movl %eax, %ecx
shll %cl, %esi
shrl %cl, %esi
orl %esi, %edx
movl %edx, 0xc(%rsp)
incl %ebp
cmpl (%r15), %ebp
jb 0xc29b
leaq 0x10(%rsp), %rdi
callq 0x12ac6
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc340
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x12ac6
movq %rbx, %rdi
callq 0x3460
nop