LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/sampler.cpp
// Function: CSA::WeightedSampler::finalLink(std::deque<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int>>>&, unsigned int, bool)
pair_type
WeightedSampler::finalLink(std::deque<node_type>& active_nodes, uint to, bool shortest)
{
  pair_type result(0, std::numeric_limits<sum_type>::max());
  result.first = (shortest ? std::numeric_limits<uint>::max() : 0);

  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 > result.second) { return result; }
    if(weight < result.second ||
       (shortest && (*iter).second + 1 < result.first) ||
       (!shortest && (*iter).second + 1 > result.first))
    {
      this->predecessors[to] = (*iter).first;
      result = pair_type((*iter).second + 1, weight);
    }
  }

  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %ecx, 0xc(%rsp)
movl %ecx, %r12d
negl %r12d
movq 0x10(%rsi), %r13
movq 0x20(%rsi), %rax
movq %rax, 0x18(%rsp)
movq 0x28(%rsi), %rax
movq %rax, 0x10(%rsp)
movq 0x30(%rsi), %rbx
movq %rdi, 0x30(%rsp)
movq 0x30(%rdi), %rax
movq %rax, 0x28(%rsp)
movl %edx, %ebp
movl %edx, %eax
movq %rax, 0x20(%rsp)
pushq $-0x1
popq %r14
cmpq %rbx, %r13
je 0xc3c4
movl (%r13), %r15d
movq 0x30(%rsp), %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0xc3de
cmpl %r14d, %eax
ja 0xc3c4
jae 0xc3a9
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %rdx
movl %r15d, (%rcx,%rdx,4)
movl 0x4(%r13), %r12d
incl %r12d
movl %eax, %r14d
addq $0x8, %r13
cmpq 0x18(%rsp), %r13
jne 0xc347
movq 0x10(%rsp), %rax
movq 0x8(%rax), %r13
addq $0x8, %rax
movq %rax, 0x10(%rsp)
leaq 0x200(%r13), %rax
movq %rax, 0x18(%rsp)
jmp 0xc347
movl 0x4(%r13), %ecx
incl %ecx
cmpb $0x0, 0xc(%rsp)
je 0xc3bd
cmpl %r12d, %ecx
jb 0xc366
jmp 0xc37e
cmpl %r12d, %ecx
ja 0xc366
jmp 0xc37e
shlq $0x20, %r14
movl %r12d, %eax
orq %r14, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/sampler.cpp
// Function: CSA::WeightedSampler::getEdgeWeight(unsigned int, unsigned int)
sum_type
WeightedSampler::getEdgeWeight(uint from, uint to)
{
  if(this->use_psi)
  {
    return this->edge_weights[to] - this->edge_weights[from] -
           this->getDistance(from, to) * this->edge_totals[from] + this->adjustment;
  }
  else
  {
    return this->edge_weights[from] - this->edge_weights[to] -
           this->getDistance(from, to) * this->edge_totals[to] + this->adjustment;
  }
}

// Assembly:
movq 0x38(%rdi), %rcx
movq 0x50(%rdi), %r10
movq 0x40(%rdi), %r9
movl 0x20(%rdi), %r8d
cmpb $0x1, 0x1c(%rdi)
jne 0xc424
movl %edx, %edi
movl %esi, %edx
movq %rdx, %rsi
movq %rdi, %rax
jmp 0xc42e
movl %esi, %esi
movl %edx, %edx
movq %rdx, %rdi
movq %rsi, %rax
movl (%rcx,%rax,4), %eax
movl (%r10,%rsi,4), %esi
subl (%r10,%rdi,4), %esi
imull (%r9,%rdx,4), %esi
subl (%rcx,%rdx,4), %eax
addl %r8d, %eax
addl %esi, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/sampler.cpp
// Function: CSA::SemiGreedySampler::buildSamples(unsigned int, double)
bool
SemiGreedySampler::buildSamples(uint _sample_rate, double greediness)
{
  if(_sample_rate == 0 || this->status != READY || greediness < 0.0 || greediness > 1.0)
  {
    return false;
  }

  uint number = (this->size + _sample_rate - 1) / _sample_rate;
  this->samples = new pair_type[number];
  if(greediness == 1.0) { _sample_rate = this->size; }
  else
  {
    _sample_rate = std::min((double)(this->size), _sample_rate / (1.0 - greediness));
  }

  this->buildRegularSamples(_sample_rate);
  this->addGreedySamples(number);

  this->cleanUp();
  this->status = SAMPLED;
  return true;
}

// Assembly:
testl %esi, %esi
je 0xc676
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
xorl %eax, %eax
ucomisd 0x6a68(%rip), %xmm0     # 0x13008
ja 0xc669
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
ja 0xc669
movq %rdi, %rbx
cmpl $0x1, 0xc(%rdi)
jne 0xc669
movl %esi, %r15d
movsd %xmm0, 0x8(%rsp)
movl 0x8(%rbx), %r12d
leal (%r15,%r12), %ebp
decl %ebp
movl %ebp, %eax
xorl %edx, %edx
divl %esi
movl %eax, %r14d
leaq (,%r14,8), %rdi
callq 0x3030
cmpl %r15d, %ebp
jb 0xc603
leaq (%rax,%r14,8), %rcx
movq %rax, %rdx
andq $0x0, (%rdx)
addq $0x8, %rdx
cmpq %rcx, %rdx
jne 0xc5f6
movq %rax, 0x10(%rbx)
movsd 0x8(%rsp), %xmm3
ucomisd 0x69f3(%rip), %xmm3     # 0x13008
jne 0xc619
jnp 0xc642
movl %r12d, %eax
cvtsi2sd %rax, %xmm0
movl %r15d, %eax
cvtsi2sd %rax, %xmm1
movsd 0x69d7(%rip), %xmm2     # 0x13008
subsd %xmm3, %xmm2
divsd %xmm2, %xmm1
minsd %xmm0, %xmm1
cvttsd2si %xmm1, %r12
movq %rbx, %rdi
movl %r12d, %esi
callq 0xc67a
movq %rbx, %rdi
movl %r14d, %esi
callq 0xc6a2
movq %rbx, %rdi
callq 0xc552
movl $0x2, 0xc(%rbx)
movb $0x1, %al
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/sampler.cpp
// Function: CSA::SemiGreedySampler::buildRegularSamples(unsigned int)
void
SemiGreedySampler::buildRegularSamples(uint _sample_rate)
{
  this->sample_rate = _sample_rate;
  for(uint i = 0; i < this->size; i += this->sample_rate)
  {
    this->samples[this->number_of_samples].second = i;
    this->number_of_samples++;
  }
}

// Assembly:
movl %esi, 0x28(%rdi)
movl 0x8(%rdi), %eax
movq 0x10(%rdi), %rcx
movl 0x18(%rdi), %edx
xorl %r8d, %r8d
cmpl %eax, %r8d
jae 0xc6a1
movl %edx, %r9d
movl %r8d, 0x4(%rcx,%r9,8)
incl %edx
movl %edx, 0x18(%rdi)
addl %esi, %r8d
jmp 0xc68a
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/sampler.cpp
// Function: CSA::SemiGreedySampler::addGreedySamples(unsigned int)
void
SemiGreedySampler::addGreedySamples(uint total_samples)
{
  if(this->number_of_samples >= total_samples) { return; }

  std::sort(this->weights, this->weights + this->size);
  for(uint i = this->size - 1; this->number_of_samples < total_samples; i--)
  {
    if(this->weights[i].second % this->sample_rate != 0)
    {
      if(this->weights[i].first == 0) { break; }  // The further samples will be weight 0.
      this->samples[this->number_of_samples].second = this->weights[i].second;
      this->number_of_samples++;
    }
  }
}

// Assembly:
cmpl %esi, 0x18(%rdi)
jae 0xc708
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movq 0x20(%rdi), %rdi
movl 0x8(%r14), %eax
leaq (%rdi,%rax,8), %rsi
callq 0x9555
movl 0x8(%r14), %esi
movl 0x18(%r14), %edi
movq 0x20(%r14), %r8
movl 0x28(%r14), %r9d
movq 0x10(%r14), %r10
cmpl %ebx, %edi
jae 0xc701
decl %esi
movl 0x4(%r8,%rsi,8), %ecx
movl %ecx, %eax
xorl %edx, %edx
divl %r9d
testl %edx, %edx
je 0xc6d5
cmpl $0x0, (%r8,%rsi,8)
je 0xc701
movl %edi, %eax
movl %ecx, 0x4(%r10,%rax,8)
incl %edi
movl %edi, 0x18(%r14)
jmp 0xc6d5
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/suffixarray.cpp
// Function: CSA::SuffixArray::SuffixArray(unsigned char*, unsigned int, unsigned int)
SuffixArray::SuffixArray(uchar* _data, uint bytes, uint threads) :
  ok(false),
  data(_data), sa(0), original_sa(0), ranks(0), data_size(bytes),
  sequences(0)
{
  if(_data == 0 || bytes == 0)
  {
    std::cerr << "Error: No input data given for suffix array construction!" << std::endl;
    return;
  }

  for(uint i = 0; i < this->data_size; i++) { if(this->data[i] == '\0') { this->sequences++; } }
  if(this->data[this->data_size - 1] != '\0')
  {
    std::cerr << "Error: Input data must end with \\0!" << std::endl;
    return;
  }

  short_pair* pairs = simpleSuffixSort(this->data, this->data_size, this->sequences, threads);
  this->sa = new uint[this->data_size];
  for(uint i = 0; i < this->data_size; i++) { this->sa[i] = pairs[i].first; }
  delete[] pairs;

  this->original_sa = this->sa; this->sa += this->sequences;
  this->ok = true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb $0x0, (%rdi)
movq %rsi, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
andq $0x0, 0x20(%rdi)
movl %edx, 0x28(%rdi)
andl $0x0, 0x2c(%rdi)
testq %rsi, %rsi
sete %al
testl %edx, %edx
sete %dil
orb %al, %dil
je 0xd09c
movq 0xff5d(%rip), %rdi      # 0x1cff0
leaq 0x6734(%rip), %rsi      # 0x137ce
jmp 0xd0d4
leaq 0x10(%rbx), %r15
movl %edx, %edi
xorl %r8d, %r8d
xorl %eax, %eax
cmpq %r8, %rdi
je 0xd0bd
cmpb $0x0, (%rsi,%r8)
jne 0xd0b8
incl %eax
movl %eax, 0x2c(%rbx)
incq %r8
jmp 0xd0a7
leal -0x1(%rdx), %edi
cmpb $0x0, (%rsi,%rdi)
je 0xd0ec
movq 0xff23(%rip), %rdi      # 0x1cff0
leaq 0x6734(%rip), %rsi      # 0x13808
callq 0x3200
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3100
movq %rsi, %rdi
movl %edx, %esi
movl %eax, %edx
callq 0x114fb
movq %rax, %r14
movl 0x28(%rbx), %r12d
leaq (,%r12,4), %rdi
callq 0x3030
movq %rax, 0x10(%rbx)
xorl %ecx, %ecx
cmpq %rcx, %r12
je 0xd123
movl (%r14,%rcx,8), %edx
movl %edx, (%rax,%rcx,4)
incq %rcx
jmp 0xd112
testq %r14, %r14
je 0xd133
movq %r14, %rdi
callq 0x32b0
movq (%r15), %rax
movq %rax, 0x18(%rbx)
movl 0x2c(%rbx), %ecx
leaq (%rax,%rcx,4), %rax
movq %rax, 0x10(%rbx)
movb $0x1, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/suffixarray.cpp
// Function: CSA::SuffixArray::SuffixArray(unsigned char*, unsigned int*, unsigned int, unsigned int)
SuffixArray::SuffixArray(uchar* _data, usint* ra, uint bytes, uint threads) :
  ok(false),
  data(_data), sa(0), original_sa(0), ranks(ra), data_size(bytes),
  sequences(0)
{
  if(_data == 0 || ra == 0 || bytes == 0)
  {
    std::cerr << "Error: No input data given for suffix array construction!" << std::endl;
    return;
  }

  for(uint i = 0; i < this->data_size; i++) { if(this->data[i] == '\0') { this->sequences++; } }
  if(this->data[this->data_size - 1] != '\0')
  {
    std::cerr << "Error: Input data must end with \\0!" << std::endl;
    return;
  }

  pair_type* pairs = new pair_type[this->data_size];
  for(usint i = 0; i < this->data_size; i++) { pairs[i] = pair_type(this->ranks[i], i); }
  #ifdef MULTITHREAD_SUPPORT
  omp_set_num_threads(threads);
  #endif
  parallelSort(pairs, pairs + this->data_size);
  this->sa = new uint[this->data_size];
  for(uint i = 0; i < this->data_size; i++) { this->sa[i] = pairs[i].second; }
  delete[] pairs;

  this->original_sa = this->sa; this->sa += this->sequences;
  this->ok = true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movb $0x0, (%rdi)
movq %rsi, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movq %rdx, 0x20(%rdi)
movl %ecx, 0x28(%rdi)
andl $0x0, 0x2c(%rdi)
testq %rsi, %rsi
sete %al
testq %rdx, %rdx
sete %dl
orb %al, %dl
testl %ecx, %ecx
sete %al
orb %dl, %al
je 0xd1a0
movq 0xfe59(%rip), %rdi      # 0x1cff0
leaq 0x6630(%rip), %rsi      # 0x137ce
jmp 0xd1d5
movq %rdi, %rbx
movl %ecx, %r13d
xorl %eax, %eax
xorl %edx, %edx
cmpq %rax, %r13
je 0xd1bf
cmpb $0x0, (%rsi,%rax)
jne 0xd1ba
incl %edx
movl %edx, 0x2c(%rbx)
incq %rax
jmp 0xd1aa
decl %ecx
cmpb $0x0, (%rsi,%rcx)
je 0xd1f0
movq 0xfe22(%rip), %rdi      # 0x1cff0
leaq 0x6633(%rip), %rsi      # 0x13808
callq 0x3200
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3100
leaq (,%r13,8), %r12
movq %r12, %rdi
callq 0x3030
movq %rax, %r15
xorl %ebp, %ebp
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x3130
cmpq %rbp, %r13
je 0xd229
movl (%r14,%rbp,4), %eax
movl %eax, (%r15,%rbp,8)
movl %ebp, 0x4(%r15,%rbp,8)
incq %rbp
jmp 0xd212
leaq (%r15,%r13,8), %rsi
movq %r15, %rdi
callq 0x9555
movl 0x28(%rbx), %r14d
leaq (,%r14,4), %rdi
callq 0x3030
movq %rax, 0x10(%rbx)
xorl %ecx, %ecx
cmpq %rcx, %r14
je 0xd25e
movl 0x4(%r15,%rcx,8), %edx
movl %edx, (%rax,%rcx,4)
incq %rcx
jmp 0xd24c
movq %r15, %rdi
callq 0x32b0
movq 0x10(%rbx), %rax
movq %rax, 0x18(%rbx)
movl 0x2c(%rbx), %ecx
leaq (%rax,%rcx,4), %rax
movq %rax, 0x10(%rbx)
movb $0x1, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/suffixarray.cpp
// Function: CSA::SuffixArray::~SuffixArray()
SuffixArray::~SuffixArray()
{
  delete[] this->data; this->data = 0;
  delete[] this->original_sa; this->sa = 0; this->original_sa = 0;
  delete[] this->ranks; this->ranks = 0;
  this->ok = false;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0xd29e
callq 0x32b0
andq $0x0, 0x8(%rbx)
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0xd2b1
callq 0x32b0
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0xd2c6
callq 0x32b0
andq $0x0, 0x20(%rbx)
movb $0x0, (%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/suffixarray.cpp
// Function: CSA::SuffixArray::writeTo(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool) const
void
SuffixArray::writeTo(const std::string& base_name, bool write_data) const
{
  if(!this->ok) { return; }

  if(write_data)
  {
    std::ofstream data_file(base_name.c_str(), std::ios_base::binary);
    if(!data_file)
    {
      std::cerr << "Error: Cannot open data file " << base_name << "!" << std::endl;
      return;
    }
    data_file.write((char*)(this->data), this->data_size);
    data_file.close();
  }

  std::string sa_name = base_name + SA_EXTENSION;
  std::ofstream sa_file(sa_name.c_str(), std::ios_base::binary);
  if(!sa_file)
  {
    std::cerr << "Error: Cannot open suffix array file " << sa_name << "!" << std::endl;
    return;
  }
  sa_file.write((char*)&(this->sequences), sizeof(uint));
  sa_file.write((char*)(this->original_sa), this->data_size * sizeof(uint));
  sa_file.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
cmpb $0x1, (%rdi)
jne 0xd432
movq %rsi, %r14
movq %rdi, %rbx
testb %dl, %dl
je 0xd37e
movq (%r14), %rsi
leaq 0x28(%rsp), %r15
pushq $0x4
popq %rdx
movq %r15, %rdi
callq 0x3260
movq (%r15), %rax
movq -0x18(%rax), %rax
movl 0x48(%rsp,%rax), %ebp
testb $0x5, %bpl
je 0xd34f
movq 0xfcd1(%rip), %rdi      # 0x1cff0
leaq 0x6464(%rip), %rsi      # 0x1378a
callq 0x3200
movq %rax, %rdi
movq %r14, %rsi
callq 0x31f0
leaq 0x64ed(%rip), %rsi      # 0x1382a
movq %rax, %rdi
callq 0x3200
movq %rax, %rdi
callq 0x3100
jmp 0xd36a
movq 0x8(%rbx), %rsi
movl 0x28(%rbx), %edx
leaq 0x28(%rsp), %rdi
callq 0x32d0
leaq 0x28(%rsp), %rdi
callq 0x3300
leaq 0x28(%rsp), %rdi
callq 0x3320
testb $0x5, %bpl
jne 0xd432
leaq 0x1047b(%rip), %rdx     # 0x1d800
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x8410
movq (%r15), %rsi
leaq 0x28(%rsp), %rdi
pushq $0x4
popq %rdx
callq 0x3260
movq 0x28(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x48(%rsp,%rax)
je 0xd3ee
movq 0xfc34(%rip), %rdi      # 0x1cff0
leaq 0x63e5(%rip), %rsi      # 0x137a8
callq 0x3200
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x31f0
leaq 0x644e(%rip), %rsi      # 0x1382a
movq %rax, %rdi
callq 0x3200
movq %rax, %rdi
callq 0x3100
jmp 0xd41e
leaq 0x2c(%rbx), %rsi
leaq 0x28(%rsp), %rdi
pushq $0x4
popq %rdx
callq 0x32d0
movq 0x18(%rbx), %rsi
movl 0x28(%rbx), %edx
shlq $0x2, %rdx
leaq 0x28(%rsp), %rdi
callq 0x32d0
leaq 0x28(%rsp), %rdi
callq 0x3300
leaq 0x28(%rsp), %rdi
callq 0x3320
leaq 0x8(%rsp), %rdi
callq 0x3478
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0xd461
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3320
jmp 0xd46b
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3320
leaq 0x8(%rsp), %rdi
callq 0x3478
movq %rbx, %rdi
callq 0x3410
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/suffixarray.cpp
// Function: CSA::SuffixArray::count(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
pair_type
SuffixArray::count(const std::string& pattern) const
{
  pair_type range;
  for(uint i = 0; i < pattern.length(); i++)
  {
    if(pattern[i] == '\0')
    {
      std::cerr << "Error: Pattern must not contain \\0!" << std::endl;
      return EMPTY_PAIR;
    }
  }

  // Lower bound for the range.
  sint low = 0, high = this->getSize() - 1;
  uint last_high = high;
  while(low < high)
  {
    uint mid = low + (high - low) / 2;
    uint matched = this->match(pattern, mid);
    if(matched >= pattern.length()) { high = mid; }
    else if((uchar)(pattern[matched]) < this->data[this->sa[mid] + matched])
    {
      high = ((sint)mid) - 1; last_high = high;
    }
    else { low = mid + 1; }
  }
  if(this->match(pattern, low) == pattern.length()) { range.first = low; }
  else { return EMPTY_PAIR; }

  // Upper bound for the range.
  high = last_high;
  while(low < high)
  {
    uint mid = low + (high - low + 1) / 2;
    uint matched = this->match(pattern, mid);
    if(matched >= pattern.length()) { low = mid; }
    else                            { high = mid - 1; }
  }
  range.second = high;

  return range;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, 0x8(%rsp)
movq (%rsi), %r12
movq %rsi, 0x10(%rsp)
movq 0x8(%rsi), %r13
xorl %ecx, %ecx
movl %ecx, %eax
cmpq %rax, %r13
jbe 0xd4c6
leal 0x1(%rax), %ecx
cmpb $0x0, (%r12,%rax)
jne 0xd495
movq 0xfb43(%rip), %rdi      # 0x1cff0
leaq 0x6378(%rip), %rsi      # 0x1382c
callq 0x3200
movq %rax, %rdi
callq 0x3100
jmp 0xd5a0
movq 0x8(%rsp), %rax
movl 0x2c(%rax), %ebx
notl %ebx
addl 0x28(%rax), %ebx
movq 0x8(%rax), %rcx
movq %rcx, 0x20(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x18(%rsp)
xorl %ebp, %ebp
movl %ebx, %r14d
movl %r14d, %eax
subl %ebp, %eax
jle 0xd544
cltd
pushq $0x2
popq %rcx
idivl %ecx
movl %eax, %r15d
addl %ebp, %r15d
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl %r15d, %edx
callq 0xd5be
movl %eax, %eax
cmpq %rax, %r13
jbe 0xd53f
movb (%r12,%rax), %cl
movl %r15d, %edx
movq 0x18(%rsp), %rsi
movl (%rsi,%rdx,4), %edx
addl %eax, %edx
movq 0x20(%rsp), %rax
cmpb (%rax,%rdx), %cl
jb 0xd539
incl %r15d
movl %r15d, %ebp
jmp 0xd4ea
decl %r15d
movl %r15d, %ebx
movl %r15d, %r14d
jmp 0xd4ea
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl %ebp, %edx
callq 0xd5be
movl %eax, %eax
cmpq %rax, %r13
jne 0xd5a0
movl %ebp, %r14d
cmpl %ebx, %r14d
jge 0xd5a5
movl %ebx, %eax
subl %r14d, %eax
incl %eax
cltd
pushq $0x2
popq %rcx
idivl %ecx
movl %eax, %r15d
leal (%r15,%r14), %r12d
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl %r12d, %edx
callq 0xd5be
movl %eax, %eax
cmpq %rax, %r13
leal -0x1(%r15,%r14), %eax
cmoval %eax, %ebx
cmoval %r14d, %r12d
movl %r12d, %r14d
jmp 0xd55f
pushq $0x1
popq %rax
jmp 0xd5ae
shlq $0x20, %rbx
movl %ebp, %eax
orq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/suffixarray.cpp
// Function: CSA::SuffixArray::locate(std::pair<unsigned int, unsigned int>) const
uint*
SuffixArray::locate(pair_type range) const
{
  if(isEmpty(range) || range.second >= this->getSize()) { return 0; }

  uint* result = new uint[length(range)];
  for(usint i = range.first; i <= range.second; i++) { result[i - range.first] = this->sa[i]; }
  return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rsi, %r15
shrq $0x20, %r15
cmpl %r15d, %ebx
ja 0xd653
movq %rdi, %r14
movl 0x28(%rdi), %eax
subl 0x2c(%rdi), %eax
cmpl %r15d, %eax
jbe 0xd653
movl %r15d, %eax
subl %ebx, %eax
leaq 0x4(,%rax,4), %rax
movabsq $0x3fffffffc, %rdi      # imm = 0x3FFFFFFFC
andq %rax, %rdi
callq 0x3030
movq 0x10(%r14), %rcx
xorl %edx, %edx
leaq (%rbx,%rdx), %rsi
cmpl %r15d, %esi
ja 0xd655
movl %esi, %esi
movl (%rcx,%rsi,4), %esi
movl %esi, (%rax,%rdx,4)
incq %rdx
jmp 0xd63d
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/suffixarray.cpp
// Function: CSA::SuffixArray::getLCPArray(bool) const
uint*
SuffixArray::getLCPArray(bool getPLCP) const
{
  if(!(this->isOk())) { return 0; }

  uint* plcp = new uint[this->data_size];
  for(uint i = 0; i < this->data_size; i++) { plcp[i] = this->data_size; }

  // Fill in the irreducible PLCP values.
  for(uint i = 0; i < this->sequences; i++)
  {
    plcp[this->original_sa[i]] = 0;
  }
  for(uint i = this->sequences; i < this->data_size; i++)
  {
    uint j = this->original_sa[i - 1], k = this->original_sa[i];
    if(j == 0 || k == 0 || this->data[j - 1] != this->data[k - 1] || this->data[j - 1] == 0)
    {
      uint temp = 0;
      while(this->data[j + temp] == this->data[k + temp] && this->data[j + temp] != 0) { temp++; }
      plcp[k] = temp;
    }
  }

  // Fill in the rest of the values.
  for(uint i = 1; i < this->data_size; i++)
  {
    if(plcp[i] >= this->data_size) { plcp[i] = plcp[i - 1] - 1; }
  }
  if(getPLCP) { return plcp; }

  // Convert to LCP array.
  uint* lcp = new uint[this->getSize()];
  for(uint i = 0; i < this->getSize(); i++)
  {
    lcp[i] = plcp[this->sa[i]];
  }
  delete[] plcp;

  return lcp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpb $0x1, (%rdi)
jne 0xd6b0
movl %esi, %ebp
movq %rdi, %r14
movl 0x28(%rdi), %r12d
leaq (,%r12,4), %rdi
callq 0x3030
movq %rax, %rbx
xorl %eax, %eax
cmpq %rax, %r12
je 0xd6b8
movl %r12d, (%rbx,%rax,4)
incq %rax
jmp 0xd6a2
xorl %r15d, %r15d
jmp 0xd7a0
movl 0x2c(%r14), %eax
movq 0x18(%r14), %rcx
xorl %edx, %edx
cmpq %rdx, %rax
je 0xd6d3
movl (%rcx,%rdx,4), %esi
andl $0x0, (%rbx,%rsi,4)
incq %rdx
jmp 0xd6c2
movq 0x8(%r14), %rdx
movq %rax, %rsi
cmpq %r12, %rsi
jae 0xd745
leal -0x1(%rsi), %edi
movl (%rcx,%rdi,4), %r8d
movl (%rcx,%rsi,4), %r9d
movl %r9d, %edi
testl %r8d, %r8d
sete %r10b
testl %r9d, %r9d
sete %r9b
orb %r10b, %r9b
je 0xd729
xorl %r9d, %r9d
leal (%r8,%r9), %r10d
movb (%rdx,%r10), %r11b
leal 0x1(%r9), %r10d
testb %r11b, %r11b
je 0xd720
addl %edi, %r9d
cmpb (%rdx,%r9), %r11b
movl %r10d, %r9d
je 0xd703
decl %r10d
movl %r10d, (%rbx,%rdi,4)
jmp 0xd740
leal -0x1(%r8), %r9d
movb (%rdx,%r9), %r9b
testb %r9b, %r9b
je 0xd700
leal -0x1(%rdi), %r10d
cmpb (%rdx,%r10), %r9b
jne 0xd700
incq %rsi
jmp 0xd6da
pushq $0x1
popq %rcx
cmpq %r12, %rcx
jae 0xd761
cmpl %r12d, (%rbx,%rcx,4)
jb 0xd75c
movl -0x4(%rbx,%rcx,4), %edx
decl %edx
movl %edx, (%rbx,%rcx,4)
incq %rcx
jmp 0xd748
testb %bpl, %bpl
je 0xd76b
movq %rbx, %r15
jmp 0xd7a0
subl %eax, %r12d
leaq (,%r12,4), %rdi
callq 0x3030
movq %rax, %r15
movq 0x10(%r14), %rax
xorl %ecx, %ecx
cmpq %rcx, %r12
je 0xd798
movl (%rax,%rcx,4), %edx
movl (%rbx,%rdx,4), %edx
movl %edx, (%r15,%rcx,4)
incq %rcx
jmp 0xd784
movq %rbx, %rdi
callq 0x32b0
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/suffixarray.cpp
// Function: CSA::SuffixArray::reportSize(bool) const
usint
SuffixArray::reportSize(bool print) const
{
  usint bytes = sizeof(*this) + this->data_size * (1 + sizeof(uint));
  if(this->ranks != 0) { bytes += this->data_size + sizeof(usint); }
  if(print)
  {
    std::cout << "Data:            " << (this->data_size / (double)MEGABYTE) << " MB" << std::endl;
    std::cout << "Suffix array:    " << (this->data_size * sizeof(uint) / (double)MEGABYTE) << " MB" << std::endl;
    if(this->ranks != 0)
    {
      std::cout << "Rank array:      " << (this->data_size * sizeof(usint) / (double)MEGABYTE) << " MB" << std::endl;
    }
    std::cout << "Total size:      " << (bytes / (double)MEGABYTE) << " MB" << std::endl;
    std::cout << std::endl;
  }
  return bytes;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl 0x28(%rdi), %eax
leal (%rax,%rax,4), %ecx
addl $0x4, %eax
xorl %edx, %edx
cmpq $0x0, 0x20(%rdi)
cmovnel %eax, %edx
leal (%rdx,%rcx), %ebx
addl $0x30, %ebx
testl %esi, %esi
je 0xd8fa
movq %rdi, %r14
movq 0xf7f1(%rip), %r15      # 0x1cfd0
leaq 0x606a(%rip), %rsi      # 0x13850
movq %r15, %rdi
callq 0x3200
movl 0x28(%r14), %ecx
cvtsi2sd %rcx, %xmm0
mulsd 0x5811(%rip), %xmm0     # 0x13010
movq %rax, %rdi
callq 0x3390
leaq 0x5cf7(%rip), %r12      # 0x13505
movq %rax, %rdi
movq %r12, %rsi
callq 0x3200
movq %rax, %rdi
callq 0x3100
leaq 0x603a(%rip), %rsi      # 0x13862
movq %r15, %rdi
callq 0x3200
movl 0x28(%r14), %ecx
shlq $0x2, %rcx
cvtsi2sd %rcx, %xmm0
mulsd 0x57cb(%rip), %xmm0     # 0x13010
movq %rax, %rdi
callq 0x3390
movq %rax, %rdi
movq %r12, %rsi
callq 0x3200
movq %rax, %rdi
callq 0x3100
cmpq $0x0, 0x20(%r14)
je 0xd8ae
movq 0xf762(%rip), %rdi      # 0x1cfd0
leaq 0x5fff(%rip), %rsi      # 0x13874
callq 0x3200
movl 0x28(%r14), %ecx
shlq $0x2, %rcx
cvtsi2sd %rcx, %xmm0
mulsd 0x5781(%rip), %xmm0     # 0x13010
movq %rax, %rdi
callq 0x3390
leaq 0x5c67(%rip), %rsi      # 0x13505
movq %rax, %rdi
callq 0x3200
movq %rax, %rdi
callq 0x3100
movq 0xf71b(%rip), %r14      # 0x1cfd0
leaq 0x5c71(%rip), %rsi      # 0x1352d
movq %r14, %rdi
callq 0x3200
movl %ebx, %ecx
cvtsi2sd %rcx, %xmm0
mulsd 0x573d(%rip), %xmm0     # 0x13010
movq %rax, %rdi
callq 0x3390
leaq 0x5c23(%rip), %rsi      # 0x13505
movq %rax, %rdi
callq 0x3200
movq %rax, %rdi
callq 0x3100
movq %r14, %rdi
callq 0x3100
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/array.cpp
// Function: CSA::Array::Array(std::basic_ifstream<char, std::char_traits<char>>&)
Array::Array(std::ifstream& file) :
  delete_array(true), item_index(0)
{
  file.read((char*)&(this->items), sizeof(this->items));
  file.read((char*)&(this->number_of_blocks), sizeof(this->number_of_blocks));
  file.read((char*)&(this->block_size), sizeof(this->block_size));

  this->array = new usint[this->block_size * this->number_of_blocks];
  file.read((char*)(this->array), this->block_size * this->number_of_blocks * sizeof(usint));
  this->buffer = new ReadBuffer(this->array, this->block_size);

  this->integer_bits = length(this->items);
  this->samples = new ReadBuffer(file, this->number_of_blocks + 1, this->integer_bits);

  this->buildIndex();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movb $0x1, 0x18(%rdi)
andq $0x0, 0x38(%rdi)
pushq $0x4
popq %r15
movq %rsi, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x3290
leaq 0x20(%rbx), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x3290
leaq 0x1c(%rbx), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x3290
movl 0x20(%rbx), %r15d
imull 0x1c(%rbx), %r15d
shlq $0x2, %r15
movq %r15, %rdi
callq 0x3030
movq %rax, 0x10(%rbx)
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x3290
pushq $0x28
popq %rdi
callq 0x3220
movq %rax, %r15
movq 0x10(%rbx), %rsi
movl 0x1c(%rbx), %edx
movq %rax, %rdi
callq 0xe746
movq %r15, 0x8(%rbx)
movl (%rbx), %edi
callq 0xab34
movl %eax, %ebp
movl %eax, 0x30(%rbx)
pushq $0x28
popq %rdi
callq 0x3220
movq %rax, %r15
movl 0x20(%rbx), %edx
incl %edx
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %ecx
callq 0xe64c
movq %r15, 0x28(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xd9ea
jmp 0xd9d4
movq %rax, %rbx
pushq $0x28
popq %rsi
movq %r15, %rdi
callq 0x3230
movq %rbx, %rdi
callq 0x3410
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/array.cpp
// Function: CSA::Array::buildIndex()
void
Array::buildIndex()
{
  delete this->item_index;

  usint index_samples = (this->number_of_blocks + Array::INDEX_RATE - 1) / Array::INDEX_RATE;
  this->index_rate = (this->items + index_samples - 1) / index_samples;
  index_samples = (this->items + this->index_rate - 1) / this->index_rate + 1;
  WriteBuffer index_buffer(index_samples, length(this->number_of_blocks - 1));

  usint current = 0, pointer = 0;
  this->samples->goToItem(1);
  while(this->samples->hasNextItem())
  {
    usint limit = this->samples->readItem();
    while(current < limit)
    {
      index_buffer.writeItem(pointer);
      current += this->index_rate;
    }
    pointer++;
  }
  index_buffer.writeItem(this->number_of_blocks - 1);

  this->item_index = index_buffer.getReadBuffer();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movq 0x38(%rdi), %r14
testq %r14, %r14
je 0xda0a
movq %r14, %rdi
callq 0xe7c4
pushq $0x28
popq %rsi
movq %r14, %rdi
callq 0x3230
movl (%rbx), %esi
movl 0x20(%rbx), %edi
leal 0x4(%rdi), %eax
xorl %ebp, %ebp
pushq $0x5
popq %rcx
xorl %edx, %edx
divl %ecx
movl %eax, %ecx
leal (%rsi,%rcx), %eax
decl %eax
xorl %edx, %edx
divl %ecx
movl %eax, %ecx
movl %eax, 0x40(%rbx)
leal (%rsi,%rcx), %eax
decl %eax
xorl %edx, %edx
divl %ecx
leal 0x1(%rax), %r15d
decl %edi
callq 0xab34
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl %r15d, %esi
movl %eax, %edx
callq 0xe8b6
movq 0x28(%rbx), %rdi
movl 0xc(%rdi), %eax
movl %eax, %ecx
shrl $0x5, %ecx
movl %ecx, 0x18(%rdi)
andl $0x1f, %eax
pushq $0x20
popq %rcx
subl %eax, %ecx
movl %ecx, 0x1c(%rdi)
movl $0x1, 0x20(%rdi)
pushq $0x1
popq %rax
xorl %r12d, %r12d
cmpl 0x10(%rdi), %eax
jae 0xdab0
callq 0xabd0
movl %eax, %r15d
cmpl %r15d, %r12d
jae 0xdaa5
movq %r14, %rdi
movl %ebp, %esi
callq 0xab42
addl 0x40(%rbx), %r12d
jmp 0xda90
incl %ebp
movq 0x28(%rbx), %rdi
movl 0x20(%rdi), %eax
jmp 0xda83
movl 0x20(%rbx), %esi
decl %esi
leaq 0x8(%rsp), %rdi
callq 0xab42
leaq 0x8(%rsp), %rdi
callq 0xe972
movq %rax, 0x38(%rbx)
leaq 0x8(%rsp), %rdi
callq 0xe95e
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0xdae8
jmp 0xdae8
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xe95e
movq %rbx, %rdi
callq 0x3410
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/array.cpp
// Function: CSA::Array::Array(_IO_FILE*)
Array::Array(FILE* file) :
  delete_array(true), item_index(0)
{
  if(!std::fread(&(this->items), sizeof(this->items), 1, file)) { return; }
  if(!std::fread(&(this->number_of_blocks), sizeof(this->number_of_blocks), 1, file)) { return; }
  if(!std::fread(&(this->block_size), sizeof(this->block_size), 1, file)) { return; }

  this->array = new usint[this->block_size * this->number_of_blocks];
  if(!std::fread(this->array, this->block_size * sizeof(usint), this->number_of_blocks, file)) { return; }
  this->buffer = new ReadBuffer(this->array, this->block_size);

  this->integer_bits = length(this->items);
  this->samples = new ReadBuffer(file, this->number_of_blocks + 1, this->integer_bits);

  this->buildIndex();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movb $0x1, 0x18(%rdi)
andq $0x0, 0x38(%rdi)
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x3330
testq %rax, %rax
je 0xdbf3
leaq 0x20(%rbx), %rdi
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x3330
testq %rax, %rax
je 0xdbf3
leaq 0x1c(%rbx), %rdi
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x3330
testq %rax, %rax
je 0xdbf3
movl 0x1c(%rbx), %r15d
movl 0x20(%rbx), %r12d
movl %r12d, %edi
imull %r15d, %edi
shlq $0x2, %rdi
callq 0x3030
movq %rax, 0x10(%rbx)
shlq $0x2, %r15
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x3330
testq %rax, %rax
je 0xdbf3
pushq $0x28
popq %rdi
callq 0x3220
movq %rax, %r15
movq 0x10(%rbx), %rsi
movl 0x1c(%rbx), %edx
movq %rax, %rdi
callq 0xe746
movq %r15, 0x8(%rbx)
movl (%rbx), %edi
callq 0xab34
movl %eax, %ebp
movl %eax, 0x30(%rbx)
pushq $0x28
popq %rdi
callq 0x3220
movq %rax, %r15
movl 0x20(%rbx), %edx
incl %edx
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %ecx
callq 0xe6c2
movq %r15, 0x28(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xd9ea
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0xdbfe
movq %rax, %rbx
pushq $0x28
popq %rsi
movq %r15, %rdi
callq 0x3230
movq %rbx, %rdi
callq 0x3410
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/array.cpp
// Function: CSA::Array::~Array()
Array::~Array()
{
  if(this->delete_array) { delete[] this->array; }
  delete this->buffer;
  delete this->samples;
  delete this->item_index;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x1, 0x18(%rdi)
jne 0xddcd
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0xddcd
callq 0x32b0
movq 0x8(%rbx), %r14
testq %r14, %r14
je 0xddde
movq %r14, %rdi
callq 0xe7c4
pushq $0x28
popq %rsi
movq %r14, %rdi
callq 0x3230
movq 0x28(%rbx), %r14
testq %r14, %r14
je 0xddfa
movq %r14, %rdi
callq 0xe7c4
pushq $0x28
popq %rsi
movq %r14, %rdi
callq 0x3230
movq 0x38(%rbx), %rbx
testq %rbx, %rbx
je 0xde16
movq %rbx, %rdi
callq 0xe7c4
pushq $0x28
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3230
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/array.cpp
// Function: CSA::Array::writeTo(std::basic_ofstream<char, std::char_traits<char>>&) const
void
Array::writeTo(std::ofstream& file) const
{
  file.write((char*)&(this->items), sizeof(this->items));
  file.write((char*)&(this->number_of_blocks), sizeof(this->number_of_blocks));
  file.write((char*)&(this->block_size), sizeof(this->block_size));
  file.write((char*)(this->array), this->block_size * this->number_of_blocks * sizeof(usint));
  this->samples->writeBuffer(file);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x4
popq %r15
movq %rsi, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x32d0
leaq 0x20(%r14), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x32d0
leaq 0x1c(%r14), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x32d0
movq 0x10(%r14), %rsi
movl 0x20(%r14), %edx
imull 0x1c(%r14), %edx
shlq $0x2, %rdx
movq %rbx, %rdi
callq 0x32d0
movq 0x28(%r14), %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xe7de
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/array.cpp
// Function: CSA::Array::writeTo(_IO_FILE*) const
void
Array::writeTo(FILE* file) const
{
  if(file == 0) { return; }
  std::fwrite(&(this->items), sizeof(this->items), 1, file);
  std::fwrite(&(this->number_of_blocks), sizeof(this->number_of_blocks), 1, file);
  std::fwrite(&(this->block_size), sizeof(this->block_size), 1, file);
  std::fwrite(this->array, this->block_size * sizeof(usint), this->number_of_blocks, file);
  this->samples->writeTo(file);
}

// Assembly:
testq %rsi, %rsi
je 0xdf0a
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x4
popq %r15
pushq $0x1
popq %r12
movq %r15, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x3440
leaq 0x20(%r14), %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x3440
leaq 0x1c(%r14), %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x3440
movq 0x10(%r14), %rdi
movl 0x1c(%r14), %esi
shlq $0x2, %rsi
movl 0x20(%r14), %edx
movq %rbx, %rcx
callq 0x3440
movq 0x28(%r14), %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xe7f4
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/array.cpp
// Function: CSA::Array::reportSize() const
usint
Array::reportSize() const
{
  usint bytes = sizeof(*this);
  bytes += this->buffer->reportSize();
  bytes += this->block_size * this->number_of_blocks * sizeof(usint);
  bytes += this->samples->reportSize();
  bytes += this->item_index->reportSize();
  return bytes;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0xe850
movl 0x1c(%rbx), %ecx
imull 0x20(%rbx), %ecx
leal (%rax,%rcx,4), %ebp
movq 0x28(%rbx), %rdi
callq 0xe850
movl %eax, %r14d
addl %ebp, %r14d
movq 0x38(%rbx), %rdi
callq 0xe850
addl %r14d, %eax
addl $0x48, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/array.cpp
// Function: CSA::Array::Iterator::readItem(unsigned int)
usint
Array::Iterator::readItem(usint index)
{
  if(index >= this->parent.items) { return 0; }
  this->getSample(this->sampleForIndex(index));

  usint value = 0;
  while(this->sample + this->cur <= index)
  {
    value = this->buffer.readDeltaCode();
    this->cur++;
  }

  return value;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq (%rdi), %rcx
xorl %eax, %eax
cmpl %esi, (%rcx)
jbe 0xdff4
movl %esi, %ebx
movq %rdi, %r14
callq 0xdffa
movq %r14, %rdi
movl %eax, %esi
callq 0xe354
leaq 0x18(%r14), %r15
movl 0x10(%r14), %ecx
xorl %eax, %eax
addl 0xc(%r14), %ecx
cmpl %ebx, %ecx
ja 0xdff4
movq %r15, %rdi
callq 0xe3a2
movl 0x10(%r14), %ecx
incl %ecx
movl %ecx, 0x10(%r14)
jmp 0xdfd8
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/array.cpp
// Function: CSA::Array::Iterator::sampleForIndex(unsigned int)
usint
Array::Iterator::sampleForIndex(usint index)
{
  usint low = this->parent.item_index->readItemConst(index / this->parent.index_rate);
  usint high = this->parent.number_of_blocks - 1;

  this->samples.goToItem(low + 1);
  for(; low < high; low++)
  {
    if(this->samples.readItem() > index) { return low; }
  }

  return low;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r12
movq (%rdi), %rcx
movq 0x38(%rcx), %rdi
movl %esi, %eax
xorl %edx, %edx
divl 0x40(%rcx)
movl %eax, %esi
callq 0x8ba2
movl %eax, %r14d
movq (%r12), %rax
movl 0x20(%rax), %r13d
decl %r13d
leaq 0x40(%r12), %r15
leal 0x1(%r14), %eax
movl 0x4c(%r12), %ecx
imull %eax, %ecx
movl %ecx, %edx
shrl $0x5, %edx
movl %edx, 0x58(%r12)
andl $0x1f, %ecx
pushq $0x20
popq %rdx
subl %ecx, %edx
movl %edx, 0x5c(%r12)
movl %eax, 0x60(%r12)
cmpl %r13d, %r14d
movl %r14d, %ebp
cmovbel %r13d, %ebp
cmpl %r13d, %r14d
jae 0xe07d
movq %r15, %rdi
callq 0xabd0
cmpl %ebx, %eax
ja 0xe07a
incl %r14d
jmp 0xe064
movl %r14d, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/array.cpp
// Function: CSA::Array::Iterator::nextItem()
usint
Array::Iterator::nextItem()
{
  if(this->cur >= this->block_items)
  {
    this->getSample(this->block + 1);
  }

  this->cur++;
  return this->buffer.readDeltaCode();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x10(%rdi), %eax
cmpl 0x14(%rdi), %eax
jb 0xe0aa
movl 0x8(%rbx), %esi
incl %esi
movq %rbx, %rdi
callq 0xe354
movl 0x10(%rbx), %eax
incl %eax
movl %eax, 0x10(%rbx)
addq $0x18, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0xe3a2
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/array.cpp
// Function: CSA::ArrayEncoder::ArrayEncoder(unsigned int, unsigned int)
ArrayEncoder::ArrayEncoder(usint block_bytes, usint superblock_size) :
  items(0), blocks(1),
  block_size(BYTES_TO_WORDS(block_bytes)),
  superblock_bytes(superblock_size)
{
  this->array = new usint[this->superblock_bytes / sizeof(usint)];
  memset(this->array, 0, this->superblock_bytes);
  this->blocks_in_superblock = this->superblock_bytes / (sizeof(usint) * this->block_size);
  this->current_blocks = 1;

  this->samples = new usint[this->superblock_bytes / sizeof(usint)];
  this->samples_in_superblock = this->superblock_bytes / sizeof(usint);
  this->current_samples = 1;
  this->samples[0] = 0;

  this->buffer = new WriteBuffer(this->array, this->block_size);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movq %rdi, %r15
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, (%rdi)
movl %esi, %r12d
addq $0x3, %r12
movq %r12, %rax
shrq $0x2, %rax
movq %rax, 0x10(%rsp)
movl %eax, 0x8(%rdi)
movl %edx, 0xc(%rdi)
leaq 0x18(%rdi), %rax
movq %rax, 0x20(%rdi)
movq %rax, 0x8(%rsp)
movq %rax, 0x18(%rdi)
andq $0x0, 0x28(%rdi)
leaq 0x40(%rdi), %rax
movq %rax, 0x48(%rdi)
movq %rax, (%rsp)
movq %rax, 0x40(%rdi)
andq $0x0, 0x50(%rdi)
movl %edx, %ebx
andl $-0x4, %ebx
movq %rbx, %rdi
callq 0x3030
movq %rax, %r13
movq %rax, 0x30(%r15)
movl %ebp, %r14d
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x3130
andq $-0x4, %r12
movq %r14, %rax
xorl %edx, %edx
divq %r12
movl %eax, 0x38(%r15)
movl $0x1, 0x3c(%r15)
movq %rbx, %rdi
callq 0x3030
movq %rax, 0x58(%r15)
shrl $0x2, %ebp
movl %ebp, 0x60(%r15)
movl $0x1, 0x64(%r15)
andl $0x0, (%rax)
pushq $0x28
popq %rdi
callq 0x3220
movq %rax, %rbp
movq %rax, %rdi
movq %r13, %rsi
movq 0x10(%rsp), %rdx
callq 0xe90c
movq %rbp, 0x10(%r15)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
pushq $0x28
popq %rsi
movq %rbp, %rdi
callq 0x3230
jmp 0xe1bb
movq %rax, %rbx
movq (%rsp), %rdi
callq 0xe480
movq 0x8(%rsp), %rdi
callq 0xe480
movq %rbx, %rdi
callq 0x3410
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/array.cpp
// Function: CSA::ArrayEncoder::~ArrayEncoder()
ArrayEncoder::~ArrayEncoder()
{
  delete[] this->array;

  delete this->buffer;
  for(std::list<usint*>::iterator iter = this->array_blocks.begin(); iter != this->array_blocks.end(); iter++)
  {
    delete[] *iter;
  }

  delete[] this->samples;
  for(std::list<usint*>::iterator iter = this->sample_blocks.begin(); iter != this->sample_blocks.end(); iter++)
  {
    delete[] *iter;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
testq %rdi, %rdi
je 0xe1ec
callq 0x32b0
movq 0x10(%rbx), %r14
testq %r14, %r14
je 0xe1fd
movq %r14, %rdi
callq 0xe95e
pushq $0x28
popq %rsi
movq %r14, %rdi
callq 0x3230
leaq 0x18(%rbx), %r14
movq %r14, %r15
movq (%r15), %r15
cmpq %r14, %r15
je 0xe227
movq 0x10(%r15), %rdi
testq %rdi, %rdi
je 0xe20f
callq 0x32b0
jmp 0xe20f
movq 0x58(%rbx), %rdi
testq %rdi, %rdi
je 0xe235
callq 0x32b0
addq $0x40, %rbx
movq %rbx, %r15
movq (%r15), %r15
cmpq %rbx, %r15
je 0xe254
movq 0x10(%r15), %rdi
testq %rdi, %rdi
je 0xe23c
callq 0x32b0
jmp 0xe23c
movq %rbx, %rdi
callq 0xe480
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xe480
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/array.cpp
// Function: CSA::ArrayEncoder::writeItem(unsigned int)
void
ArrayEncoder::writeItem(usint value)
{
  this->items++;
  if(this->buffer->writeDeltaCode(value)) { return; }

  // Didn't fit into the block. A new block & sample required.
  this->blocks++;
  this->current_blocks++;
  this->current_samples++;

  // Do we need a new superblock for the block?
  if(this->current_blocks > this->blocks_in_superblock)
  {
    this->array_blocks.push_back(this->array);
    this->array = new usint[this->superblock_bytes / sizeof(usint)];
    memset(this->array, 0, this->superblock_bytes);
    this->current_blocks = 1;
  }
  this->buffer->moveBuffer(this->array + (this->block_size * (this->current_blocks - 1)));

  // Do we need a new superblock for the sample?
  if(this->current_samples > this->samples_in_superblock)
  {
    this->sample_blocks.push_back(this->samples);
    this->samples = new usint[this->superblock_bytes / sizeof(usint)];
    this->current_samples = 1;
  }
  this->samples[this->current_samples - 1] = this->items - 1;

  // Finally, write the item.
  this->buffer->writeDeltaCode(value);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
incl (%rdi)
movq 0x10(%rdi), %rdi
callq 0xe3de
testb %al, %al
je 0xe291
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
incl 0x4(%r14)
movl 0x3c(%r14), %r13d
leal 0x1(%r13), %eax
movl %eax, 0x3c(%r14)
incl 0x64(%r14)
cmpl 0x38(%r14), %eax
jbe 0xe2e8
leaq 0x18(%r14), %rdi
leaq 0x30(%r14), %rsi
callq 0xe44c
movl 0xc(%r14), %r12d
movl %r12d, %edi
andl $-0x4, %edi
callq 0x3030
movq %rax, %r15
movq %rax, 0x30(%r14)
xorl %r13d, %r13d
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x3130
movl $0x1, 0x3c(%r14)
jmp 0xe2ec
movq 0x30(%r14), %r15
movq 0x10(%r14), %rdi
imull 0x8(%r14), %r13d
leaq (%r15,%r13,4), %rsi
callq 0xea12
movl 0x64(%r14), %ecx
cmpl 0x60(%r14), %ecx
jbe 0xe331
leaq 0x40(%r14), %rdi
leaq 0x58(%r14), %rsi
callq 0xe44c
movl 0xc(%r14), %edi
andl $-0x4, %edi
callq 0x3030
movq %rax, 0x58(%r14)
movl $0x1, 0x64(%r14)
xorl %ecx, %ecx
jmp 0xe337
movq 0x58(%r14), %rax
decl %ecx
movl (%r14), %edx
decl %edx
movl %edx, (%rax,%rcx,4)
movq 0x10(%r14), %rdi
movl %ebx, %esi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xe3de
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/array.h
// Function: CSA::Array::Iterator::getSample(unsigned int)
inline void getSample(usint sample_number)
        {
          this->block = sample_number;
          this->sample = this->samples.readItem(sample_number);
          this->cur = 0;
          this->block_items = this->samples.readItem() - this->sample;
          this->buffer.moveBuffer(this->parent.array + (this->block * this->parent.block_size));
        }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, 0x8(%rdi)
leaq 0x40(%rdi), %r14
movq %r14, %rdi
callq 0xab54
movl %eax, 0xc(%rbx)
andl $0x0, 0x10(%rbx)
movq %r14, %rdi
callq 0xabd0
subl 0xc(%rbx), %eax
movl %eax, 0x14(%rbx)
leaq 0x18(%rbx), %rdi
movq (%rbx), %rax
movl 0x1c(%rax), %esi
imull 0x8(%rbx), %esi
shlq $0x2, %rsi
addq 0x10(%rax), %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe812
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/bitbuffer.h
// Function: CSA::ReadBuffer::readDeltaCode()
inline usint readDeltaCode()
    {
      usint len = 0;
      while(this->readBit() == 0) { len++; }

      usint temp = (((usint)1 << len) | this->readBits(len)) - 1;
      temp = ((usint)1 << temp) | this->readBits(temp);
      return temp;
    }

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $-0x1
popq %rbp
movq %rbx, %rdi
callq 0xe458
incl %ebp
testl %eax, %eax
je 0xe3ab
movq %rbx, %rdi
movl %ebp, %esi
callq 0xabdc
btsl %ebp, %eax
leal -0x1(%rax), %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0xabdc
btsl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/bitbuffer.h
// Function: CSA::WriteBuffer::writeDeltaCode(unsigned int)
inline bool writeDeltaCode(usint value)
    {
      usint len = length(value);
      usint llen = length(len);

      if(len + llen + llen - 2 > this->bitsLeft()) { return false; }

      // this->writeBits(0, llen - 1); // Now included in the next writeBits()
      this->writeBits(len, llen + llen - 1);
      this->writeBits(value, len - 1);
      return true;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movl %esi, %edi
callq 0xab34
movl %eax, %r15d
movl %eax, %edi
callq 0xab34
leal (%r15,%rax,2), %ebp
addl $-0x2, %ebp
movl 0x18(%r14), %r12d
notl %r12d
addl 0x8(%r14), %r12d
shll $0x5, %r12d
addl 0x1c(%r14), %r12d
cmpl %r12d, %ebp
ja 0xe43c
addl %eax, %eax
decl %eax
movq %r14, %rdi
movl %r15d, %esi
movl %eax, %edx
callq 0xab76
decl %r15d
movq %r14, %rdi
movl %ebx, %esi
movl %r15d, %edx
callq 0xab76
cmpl %r12d, %ebp
setbe %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/bitbuffer.h
// Function: CSA::ReadBuffer::readBit()
inline usint readBit()
    {
      this->bits--;
      usint bit = this->data[this->pos] & ((usint)1 << this->bits);

      if(this->bits == 0) { this->pos++; this->bits = WORD_BITS; }

      return bit;
    }

// Assembly:
movl 0x1c(%rdi), %ecx
decl %ecx
movl %ecx, 0x1c(%rdi)
movq (%rdi), %rax
movl 0x18(%rdi), %edx
movl (%rax,%rdx,4), %eax
jne 0xe477
incl %edx
movl %edx, 0x18(%rdi)
movl $0x20, 0x1c(%rdi)
pushq $0x1
popq %rdx
shll %cl, %edx
andl %edx, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/bitbuffer.cpp
// Function: CSA::ReadBuffer::ReadBuffer(std::basic_ifstream<char, std::char_traits<char>>&, unsigned int)
ReadBuffer::ReadBuffer(std::ifstream& file, usint words) :
  size(words),
  item_bits(1),
  items(0),
  free_buffer(true)
{
  usint* buffer = new usint[this->size];
  memset(buffer, 0, this->size * sizeof(usint));
  file.read((char*)buffer, this->size * sizeof(usint));
  this->data = buffer;
  this->reset();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl %edx, 0x8(%rdi)
movq $0x1, 0xc(%rdi)
movb $0x1, 0x14(%rdi)
movl %edx, %r15d
shlq $0x2, %r15
movq %r15, %rdi
callq 0x3030
movq %rax, %r12
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x3130
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x3290
movq %r12, (%r14)
movabsq $0x2000000000, %rax     # imm = 0x2000000000
movq %rax, 0x18(%r14)
andl $0x0, 0x20(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq