LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: adamnovak[P]rlcsa/./bits/bitbuffer.h
// Function: CSA::WriteBuffer::writeBits(unsigned int, unsigned int)
inline void writeBits(usint value, usint count)
    {
      if(count >= this->bits)
      {
        count -= this->bits;
        this->data[this->pos] |= GET(LOWER(value, count), this->bits);
        this->pos++; this->bits = WORD_BITS;
      }
      if(count > 0)
      {
        this->bits -= count;
        this->data[this->pos] |= HIGHER(GET(value, count), this->bits);
      }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x18(%rbp)
movl -0x10(%rbp), %eax
cmpl 0x1c(%rcx), %eax
jb 0x15204
movq -0x18(%rbp), %rax
movl 0x1c(%rax), %edx
movl -0x10(%rbp), %ecx
subl %edx, %ecx
movl %ecx, -0x10(%rbp)
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %ecx
shrl %cl, %esi
movl $0x20, %ecx
subl 0x1c(%rax), %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
shrl %cl, %edx
movl %edx, %ecx
andl %ecx, %esi
movq (%rax), %rcx
movl 0x18(%rax), %edx
orl (%rcx,%rdx,4), %esi
movl %esi, (%rcx,%rdx,4)
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
movl $0x20, 0x1c(%rax)
cmpl $0x0, -0x10(%rbp)
jbe 0x15244
movq -0x18(%rbp), %rax
movl -0x10(%rbp), %edx
movl 0x1c(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x1c(%rax)
movl -0xc(%rbp), %edx
movl $0x20, %ecx
subl -0x10(%rbp), %ecx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
shrl %cl, %esi
movl %esi, %ecx
andl %ecx, %edx
movl 0x1c(%rax), %ecx
shll %cl, %edx
movq -0x18(%rbp), %rcx
movq (%rcx), %rax
movl 0x18(%rcx), %ecx
orl (%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: adamnovak[P]rlcsa/./bits/bitbuffer.h
// Function: CSA::ReadBuffer::readBits(unsigned int)
inline usint readBits(usint count)
    {
      usint value = 0;

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

      return value;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x18(%rbp)
movl $0x0, -0x10(%rbp)
movl -0xc(%rbp), %eax
cmpl 0x1c(%rcx), %eax
jb 0x152ea
movq -0x18(%rbp), %rax
movl 0x1c(%rax), %edx
movl -0xc(%rbp), %ecx
subl %edx, %ecx
movl %ecx, -0xc(%rbp)
movq (%rax), %rcx
movl 0x18(%rax), %edx
movl (%rcx,%rdx,4), %edx
movl $0x20, %ecx
subl 0x1c(%rax), %ecx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
shrl %cl, %esi
movl %esi, %ecx
andl %ecx, %edx
movl -0xc(%rbp), %ecx
shll %cl, %edx
movl %edx, %ecx
orl -0x10(%rbp), %ecx
movl %ecx, -0x10(%rbp)
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
movl $0x20, 0x1c(%rax)
cmpl $0x0, -0xc(%rbp)
jbe 0x15326
movq -0x18(%rbp), %rcx
movl -0xc(%rbp), %edx
movl 0x1c(%rcx), %eax
subl %edx, %eax
movl %eax, 0x1c(%rcx)
movq (%rcx), %rax
movl 0x18(%rcx), %edx
movl (%rax,%rdx,4), %eax
movl 0x1c(%rcx), %ecx
shrl %cl, %eax
movl $0x20, %ecx
subl -0xc(%rbp), %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
shrl %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
orl -0x10(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
popq %rbp
retq
nopl (%rax,%rax)
// File: adamnovak[P]rlcsa/alphabet.cpp
// Function: CSA::Alphabet::Alphabet(_IO_FILE*)
Alphabet::Alphabet(FILE* file) :
  ok(false)
{
  if(file == 0) { return; }
  usint counts[CHARS];
  if(!std::fread(counts, CHARS * sizeof(usint), 1, file)) { return; }
  this->initialize(counts);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x430, %rsp            # imm = 0x430
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x428(%rbp)
movq %rax, %rcx
addq $0x800, %rcx            # imm = 0x800
movq %rcx, -0x420(%rbp)
movq %rax, -0x418(%rbp)
movq -0x418(%rbp), %rdi
movq %rdi, -0x430(%rbp)
callq 0xe530
movq -0x430(%rbp), %rax
movq -0x420(%rbp), %rcx
addq $0x8, %rax
cmpq %rcx, %rax
movq %rax, -0x418(%rbp)
jne 0x170f6
movq -0x428(%rbp), %rax
movb $0x0, 0x100c(%rax)
cmpq $0x0, -0x10(%rbp)
jne 0x1713e
jmp 0x17173
leaq -0x410(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl $0x400, %esi            # imm = 0x400
movl $0x1, %edx
callq 0x3460
cmpq $0x0, %rax
jne 0x17160
jmp 0x17173
movq -0x428(%rbp), %rdi
leaq -0x410(%rbp), %rsi
callq 0x16e30
addq $0x430, %rsp            # imm = 0x430
popq %rbp
retq
nopl (%rax)
// File: adamnovak[P]rlcsa/alphabet.cpp
// Function: CSA::Alphabet::writeTo(_IO_FILE*) const
void
Alphabet::writeTo(FILE* file) const
{
  if(file == 0) { return; }
  for(usint c = 0; c < CHARS; c++)
  {
    usint temp = this->countOf(c);
    std::fwrite(&temp, sizeof(temp), 1, file);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x17201
jmp 0x17242
movl $0x0, -0x14(%rbp)
cmpl $0x100, -0x14(%rbp)     # imm = 0x100
jae 0x17242
movq -0x20(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0xd520
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rcx
leaq -0x18(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x3580
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x17208
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: adamnovak[P]rlcsa/sampler.cpp
// Function: CSA::Sampler::writeTo(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
void
Sampler::writeTo(const std::string& base_name) const
{
  std::string sample_name = base_name + SA_SAMPLES_EXTENSION;
  std::ofstream sample_file(sample_name.c_str(), std::ios_base::binary);
  if(!sample_file)
  {
    std::cerr << "Sampler: Error creating sample file!" << std::endl;
    return;
  }

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x270, %rsp            # imm = 0x270
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x258(%rbp)
movq -0x10(%rbp), %rsi
leaq 0x213f7(%rip), %rdx     # 0x38740
leaq -0x30(%rbp), %rdi
movq %rdi, -0x250(%rbp)
callq 0xd3c0
movq -0x250(%rbp), %rdi
callq 0x3130
movq %rax, %rsi
leaq -0x230(%rbp), %rdi
movl $0x4, %edx
callq 0x3330
jmp 0x1737b
movq -0x230(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x230(%rbp,%rax), %rdi
callq 0x3160
movb %al, -0x259(%rbp)
jmp 0x1739b
movb -0x259(%rbp), %al
testb $0x1, %al
jne 0x173a7
jmp 0x17421
movq 0x20c42(%rip), %rdi     # 0x37ff0
leaq 0x12397(%rip), %rsi     # 0x2974c
callq 0x32a0
movq %rax, -0x268(%rbp)
jmp 0x173c3
movq -0x268(%rbp), %rdi
movq 0x20bdf(%rip), %rsi     # 0x37fb0
callq 0x3300
jmp 0x173d8
movl $0x1, -0x240(%rbp)
jmp 0x17491
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
jmp 0x174af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
leaq -0x230(%rbp), %rdi
callq 0x3450
jmp 0x174af
movl $0x0, -0x244(%rbp)
movq -0x258(%rbp), %rcx
movl -0x244(%rbp), %eax
cmpl 0x18(%rcx), %eax
jae 0x17479
movq -0x258(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x244(%rbp), %ecx
leaq 0x4(%rax,%rcx,8), %rsi
leaq -0x230(%rbp), %rdi
movl $0x4, %edx
callq 0x33f0
jmp 0x17466
jmp 0x17468
movl -0x244(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x244(%rbp)
jmp 0x1742b
leaq -0x230(%rbp), %rdi
callq 0x3430
jmp 0x17487
movl $0x0, -0x240(%rbp)
leaq -0x230(%rbp), %rdi
callq 0x3450
leaq -0x30(%rbp), %rdi
callq 0x35d8
addq $0x270, %rsp            # imm = 0x270
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x35d8
movq -0x238(%rbp), %rdi
callq 0x3530
nopw %cs:(%rax,%rax)
// File: adamnovak[P]rlcsa/sampler.cpp
// Function: CSA::Sampler::getSamples(std::pair<unsigned int, unsigned int>*, unsigned int, unsigned int)
pair_type*
Sampler::getSamples(short_pair* sa, uint number_of_sequences, usint threads)
{
  if(sa == 0 || this->samples == 0 || this->status != SAMPLED) { return 0; }

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x1750a
movq -0x38(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x1750a
movq -0x38(%rbp), %rax
cmpl $0x2, 0xc(%rax)
je 0x17517
movq $0x0, -0x8(%rbp)
jmp 0x17597
movl $0x0, -0x24(%rbp)
movq -0x38(%rbp), %rcx
movl -0x24(%rbp), %eax
cmpl 0x18(%rcx), %eax
jae 0x17559
movq -0x38(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x10(%rax), %rdx
movl -0x24(%rbp), %esi
movl 0x4(%rdx,%rsi,8), %edx
movl 0x4(%rcx,%rdx,8), %edx
subl -0x1c(%rbp), %edx
movq 0x10(%rax), %rax
movl -0x24(%rbp), %ecx
movl %edx, (%rax,%rcx,8)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x1751e
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x10(%rax), %rsi
movl 0x18(%rax), %eax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x14f60
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0x30(%rbp)
movq $0x0, 0x10(%rax)
movl $0x0, 0xc(%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: adamnovak[P]rlcsa/sampler.cpp
// Function: CSA::WeightedSampler::WeightedSampler(unsigned int*, unsigned int, bool)
WeightedSampler::WeightedSampler(weight_type* weights, uint _size, bool _use_psi) :
  Sampler(_size),
  use_psi(_use_psi), adjustment(0),
  path_weights(0), predecessors(0),
  edge_weights(0), edge_totals(0),
  nodes(0), node_positions(0)
{
  if(weights == 0 || this->size == 0)
  {
    delete[] weights; return;
  }

  this->calculateEdges(weights);
  this->path_weights = new sum_type[this->nodes];
  this->predecessors = new uint[this->nodes];

  this->status = READY;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movb %cl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
andb $0x1, %al
movb %al, -0x15(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
movl -0x14(%rbp), %esi
callq 0x17260
movq -0x30(%rbp), %rax
leaq 0x20733(%rip), %rcx     # 0x37d18
addq $0x10, %rcx
movq %rcx, (%rax)
movb -0x15(%rbp), %cl
andb $0x1, %cl
movb %cl, 0x1c(%rax)
movl $0x0, 0x20(%rax)
movq $0x0, 0x28(%rax)
movq $0x0, 0x30(%rax)
movq $0x0, 0x38(%rax)
movq $0x0, 0x40(%rax)
movl $0x0, 0x48(%rax)
movq $0x0, 0x50(%rax)
cmpq $0x0, -0x10(%rbp)
je 0x1763c
movq -0x30(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x17655
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
je 0x17653
movq -0x38(%rbp), %rdi
callq 0x33e0
jmp 0x176af
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x176e0
jmp 0x17664
movq -0x30(%rbp), %rax
movl 0x48(%rax), %eax
movl %eax, %edi
shlq $0x2, %rdi
callq 0x3030
movq %rax, -0x40(%rbp)
jmp 0x1767c
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, 0x28(%rax)
movl 0x48(%rax), %eax
movl %eax, %edi
shlq $0x2, %rdi
callq 0x3030
movq %rax, -0x48(%rbp)
jmp 0x1769c
movq -0x30(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rcx, 0x30(%rax)
movl $0x1, 0xc(%rax)
addq $0x50, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x172a0
movq -0x20(%rbp), %rdi
callq 0x3530
nopw %cs:(%rax,%rax)
// File: adamnovak[P]rlcsa/sampler.cpp
// Function: CSA::WeightedSampler::cleanUp()
void
WeightedSampler::cleanUp()
{
  delete[] this->path_weights; this->path_weights = 0;
  delete[] this->predecessors; this->predecessors = 0;
  delete[] this->edge_weights; this->edge_weights = 0;
  delete[] this->edge_totals; this->edge_totals = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq 0x28(%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x17a6b
movq -0x10(%rbp), %rdi
callq 0x33e0
movq -0x18(%rbp), %rax
movq $0x0, 0x28(%rax)
movq 0x30(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x17a8e
movq -0x20(%rbp), %rdi
callq 0x33e0
movq -0x18(%rbp), %rax
movq $0x0, 0x30(%rax)
movq 0x38(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0x17ab1
movq -0x28(%rbp), %rdi
callq 0x33e0
movq -0x18(%rbp), %rax
movq $0x0, 0x38(%rax)
movq 0x40(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x17ad4
movq -0x30(%rbp), %rdi
callq 0x33e0
movq -0x18(%rbp), %rax
movq $0x0, 0x40(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: adamnovak[P]rlcsa/sampler.cpp
// Function: CSA::WeightedSampler::buildPath(unsigned int, unsigned int*, unsigned int, unsigned int*, unsigned int)
void
WeightedSampler::buildPath(uint links, uint* path_a, uint length_a, uint* path_b, uint length_b)
{
  uint cur_a = 0, cur_b = 0;
  uint adj = length_a - links;

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

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x1c(%rbp), %eax
subl -0xc(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x30(%rbp), %eax
movl -0x34(%rbp), %ecx
addl -0x38(%rbp), %ecx
cmpl %ecx, %eax
jne 0x187d6
movq -0x28(%rbp), %rax
movl -0x34(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movq -0x18(%rbp), %rcx
movl -0x30(%rbp), %edx
cmpl (%rcx,%rdx,4), %eax
ja 0x187d6
movq -0x28(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movq -0x18(%rbp), %rcx
movl -0x30(%rbp), %edx
addl $0x1, %edx
movl %edx, %edx
cmpl (%rcx,%rdx,4), %eax
jb 0x187d6
jmp 0x18802
movq -0x18(%rbp), %rax
movl -0x30(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movq -0x28(%rbp), %rcx
movl -0x34(%rbp), %edx
cmpl (%rcx,%rdx,4), %eax
ja 0x187f7
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x18800
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x18791
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x34(%rbp), %eax
ja 0x18830
movq -0x28(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl (%rax,%rcx,4), %edx
movq -0x18(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x18809
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jae 0x18872
movq -0x18(%rbp), %rax
movl -0x44(%rbp), %ecx
movl (%rax,%rcx,4), %edx
movq -0x18(%rbp), %rax
movl -0x40(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x18842
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: adamnovak[P]rlcsa/sampler.cpp
// Function: CSA::WeightedSampler::link(std::deque<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int>>>&, unsigned int, bool)
node_type
WeightedSampler::link(std::deque<node_type>& active_nodes, uint to, bool shortest)
{
  this->path_weights[to] = std::numeric_limits<sum_type>::max();
  node_type current(to, 0);
  if(shortest) { current.second = std::numeric_limits<uint>::max(); }

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

  return current;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movb %cl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
andb $0x1, %al
movb %al, -0x1d(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
callq 0x19410
movl %eax, %edx
movq -0x78(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x1c(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl $0x0, -0x24(%rbp)
leaq -0x8(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
leaq -0x24(%rbp), %rdx
callq 0xe9d0
testb $0x1, -0x1d(%rbp)
je 0x188e0
callq 0x19410
movl %eax, -0x4(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x19790
movq -0x18(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x197f0
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x197c0
testb $0x1, %al
jne 0x18910
jmp 0x189d8
leaq -0x48(%rbp), %rdi
callq 0x19820
movq -0x78(%rbp), %rdi
movl (%rax), %esi
movl -0x1c(%rbp), %edx
callq 0x18d80
movq -0x78(%rbp), %rcx
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movq 0x28(%rcx), %rcx
movl -0x1c(%rbp), %edx
cmpl (%rcx,%rdx,4), %eax
jbe 0x18942
jmp 0x189da
movq -0x78(%rbp), %rcx
movl -0x6c(%rbp), %eax
movq 0x28(%rcx), %rcx
movl -0x1c(%rbp), %edx
cmpl (%rcx,%rdx,4), %eax
jb 0x18989
testb $0x1, -0x1d(%rbp)
je 0x1896f
leaq -0x48(%rbp), %rdi
callq 0x19820
movl 0x4(%rax), %eax
addl $0x1, %eax
cmpl -0x4(%rbp), %eax
jb 0x18989
testb $0x1, -0x1d(%rbp)
jne 0x189c8
leaq -0x48(%rbp), %rdi
callq 0x19820
movl 0x4(%rax), %eax
addl $0x1, %eax
cmpl -0x4(%rbp), %eax
jbe 0x189c8
movq -0x78(%rbp), %rax
movl -0x6c(%rbp), %edx
movq 0x28(%rax), %rax
movl -0x1c(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
leaq -0x48(%rbp), %rdi
callq 0x19820
movq %rax, %rcx
movq -0x78(%rbp), %rax
movl (%rcx), %edx
movq 0x30(%rax), %rax
movl -0x1c(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
leaq -0x48(%rbp), %rdi
callq 0x19820
movl 0x4(%rax), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x189ca
leaq -0x48(%rbp), %rdi
callq 0x19840
jmp 0x188ed
jmp 0x189da
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: adamnovak[P]rlcsa/sampler.cpp
// Function: CSA::WeightedSampler::bridge(unsigned int, unsigned int, unsigned int)
bool
WeightedSampler::bridge(uint a, uint b, uint c)
{
/*
  Note that 'c' is always less than 'this->size', and 'b' will not be added to active nodes,
  unless it offers a strictly better path to 'this->size' than 'a'.
*/

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x18(%rbp)
movl 0x48(%rax), %eax
subl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jae 0x18aea
movq -0x30(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movl -0x20(%rbp), %ecx
callq 0x189f0
testb $0x1, %al
jne 0x18a95
jmp 0x18ad2
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl -0x1c(%rbp), %ecx
subl -0x18(%rbp), %ecx
shrl %ecx
addl %ecx, %eax
movl %eax, -0x24(%rbp)
movl -0x14(%rbp), %eax
movl -0x20(%rbp), %ecx
subl -0x14(%rbp), %ecx
shll %ecx
addl %ecx, %eax
movl %eax, -0x28(%rbp)
leaq -0x24(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x63a0
movl (%rax), %eax
movl %eax, -0x20(%rbp)
jmp 0x18ae8
movl -0x20(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x18(%rbp), %eax
movl -0x1c(%rbp), %ecx
subl -0x18(%rbp), %ecx
shrl %ecx
addl %ecx, %eax
movl %eax, -0x20(%rbp)
jmp 0x18a75
movq -0x30(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x10(%rbp), %edx
movl -0x1c(%rbp), %ecx
callq 0x189f0
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: adamnovak[P]rlcsa/sampler.cpp
// Function: CSA::WeightedSampler::isAsGood(unsigned int, unsigned int)
bool
WeightedSampler::isAsGood(uint a, uint b)
{
  sum_type a_val = this->path_weights[a], b_val = this->path_weights[b];

  if(this->use_psi)
  {
    a_val += this->getDistance(b, a) * this->edge_totals[b];
    b_val += this->edge_weights[a] - this->edge_weights[b];
    b_val += this->getDistance(a, this->nodes - 1) * (this->edge_totals[a] - this->edge_totals[b]);
  }
  else
  {
    a_val += this->getDistance(b, a) * this->edge_totals[this->nodes - 1];
    b_val += this->edge_weights[b] - this->edge_weights[a];
  }

  return (a_val <= b_val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq 0x28(%rax), %rcx
movl -0xc(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
movl %ecx, -0x14(%rbp)
movq 0x28(%rax), %rcx
movl -0x10(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
movl %ecx, -0x18(%rbp)
testb $0x1, 0x1c(%rax)
je 0x18bb9
movq -0x20(%rbp), %rdi
movl -0x10(%rbp), %esi
movl -0xc(%rbp), %edx
callq 0x18dc0
movq -0x20(%rbp), %rdi
movq 0x40(%rdi), %rcx
movl -0x10(%rbp), %edx
imull (%rcx,%rdx,4), %eax
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq 0x38(%rdi), %rax
movl -0xc(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movq 0x38(%rdi), %rcx
movl -0x10(%rbp), %edx
subl (%rcx,%rdx,4), %eax
addl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0xc(%rbp), %esi
movl 0x48(%rdi), %edx
subl $0x1, %edx
callq 0x18dc0
movq -0x20(%rbp), %rdx
movq 0x40(%rdx), %rcx
movl -0xc(%rbp), %esi
movl (%rcx,%rsi,4), %ecx
movq 0x40(%rdx), %rdx
movl -0x10(%rbp), %esi
subl (%rdx,%rsi,4), %ecx
imull %ecx, %eax
addl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
jmp 0x18bfc
movq -0x20(%rbp), %rdi
movl -0x10(%rbp), %esi
movl -0xc(%rbp), %edx
callq 0x18dc0
movq -0x20(%rbp), %rcx
movq 0x40(%rcx), %rdx
movl 0x48(%rcx), %esi
subl $0x1, %esi
movl %esi, %esi
imull (%rdx,%rsi,4), %eax
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq 0x38(%rcx), %rax
movl -0x10(%rbp), %edx
movl (%rax,%rdx,4), %eax
movq 0x38(%rcx), %rcx
movl -0xc(%rbp), %edx
subl (%rcx,%rdx,4), %eax
addl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
setbe %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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
movq %rsp, %rbp
subq $0x90, %rsp
movb %cl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
andb $0x1, %al
movb %al, -0x1d(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x88(%rbp)
movl $0x0, -0x24(%rbp)
callq 0x19410
movl %eax, -0x28(%rbp)
leaq -0x8(%rbp), %rdi
leaq -0x24(%rbp), %rsi
leaq -0x28(%rbp), %rdx
callq 0xe260
movb -0x1d(%rbp), %al
movb %al, -0x79(%rbp)
callq 0x19410
movb -0x79(%rbp), %dl
movl %eax, %ecx
xorl %eax, %eax
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x8(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x19790
movq -0x18(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x197f0
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x197c0
testb $0x1, %al
jne 0x18ca3
jmp 0x18d68
leaq -0x48(%rbp), %rdi
callq 0x19820
movq -0x88(%rbp), %rdi
movl (%rax), %esi
movl -0x1c(%rbp), %edx
callq 0x18d80
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cmpl -0x4(%rbp), %eax
jbe 0x18ccd
jmp 0x18d6a
movl -0x6c(%rbp), %eax
cmpl -0x4(%rbp), %eax
jb 0x18d09
testb $0x1, -0x1d(%rbp)
je 0x18cef
leaq -0x48(%rbp), %rdi
callq 0x19820
movl 0x4(%rax), %eax
addl $0x1, %eax
cmpl -0x8(%rbp), %eax
jb 0x18d09
testb $0x1, -0x1d(%rbp)
jne 0x18d58
leaq -0x48(%rbp), %rdi
callq 0x19820
movl 0x4(%rax), %eax
addl $0x1, %eax
cmpl -0x8(%rbp), %eax
jbe 0x18d58
leaq -0x48(%rbp), %rdi
callq 0x19820
movq %rax, %rcx
movq -0x88(%rbp), %rax
movl (%rcx), %edx
movq 0x30(%rax), %rax
movl -0x1c(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
leaq -0x48(%rbp), %rdi
callq 0x19820
movl 0x4(%rax), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
leaq -0x74(%rbp), %rdi
leaq -0x78(%rbp), %rsi
leaq -0x6c(%rbp), %rdx
callq 0xeb40
leaq -0x8(%rbp), %rdi
leaq -0x74(%rbp), %rsi
callq 0xdb70
jmp 0x18d5a
leaq -0x48(%rbp), %rdi
callq 0x19840
jmp 0x18c80
jmp 0x18d6a
movq -0x8(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
testb $0x1, 0x1c(%rax)
je 0x18e54
movq -0x20(%rbp), %rdi
movq 0x38(%rdi), %rax
movl -0x18(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movq 0x38(%rdi), %rcx
movl -0x14(%rbp), %edx
subl (%rcx,%rdx,4), %eax
movl %eax, -0x24(%rbp)
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
callq 0x18dc0
movq -0x20(%rbp), %rcx
movl %eax, %edx
movl -0x24(%rbp), %eax
movq 0x40(%rcx), %rsi
movl -0x14(%rbp), %edi
imull (%rsi,%rdi,4), %edx
subl %edx, %eax
addl 0x20(%rcx), %eax
movl %eax, -0x4(%rbp)
jmp 0x18e96
movq -0x20(%rbp), %rdi
movq 0x38(%rdi), %rax
movl -0x14(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movq 0x38(%rdi), %rcx
movl -0x18(%rbp), %edx
subl (%rcx,%rdx,4), %eax
movl %eax, -0x28(%rbp)
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
callq 0x18dc0
movq -0x20(%rbp), %rcx
movl %eax, %edx
movl -0x28(%rbp), %eax
movq 0x40(%rcx), %rsi
movl -0x18(%rbp), %edi
imull (%rsi,%rdi,4), %edx
subl %edx, %eax
addl 0x20(%rcx), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: adamnovak[P]rlcsa/sampler.cpp
// Function: CSA::SemiGreedySampler::SemiGreedySampler(unsigned int*, unsigned int)
SemiGreedySampler::SemiGreedySampler(weight_type* _weights, uint _size) :
  Sampler(_size),
  weights(0),
  sample_rate(0)
{
  if(_weights == 0 || this->size == 0)
  {
    delete[] weights; return;
  }

  this->weights = new std::pair<weight_type, uint>[this->size];
  for(uint i = 0; i < this->size; i++)
  {
    this->weights[i].first = _weights[i];
    this->weights[i].second = i;
  }
  delete[] _weights;
  this->status = READY;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
movl -0x14(%rbp), %esi
callq 0x17260
movq -0x30(%rbp), %rax
leaq 0x1ee1a(%rip), %rcx     # 0x37d38
addq $0x10, %rcx
movq %rcx, (%rax)
movq $0x0, 0x20(%rax)
movl $0x0, 0x28(%rax)
cmpq $0x0, -0x10(%rbp)
je 0x18f45
movq -0x30(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x18f65
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
je 0x18f60
movq -0x38(%rbp), %rdi
callq 0x33e0
jmp 0x19068
movq -0x30(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %edi
movq %rdi, -0x50(%rbp)
shlq $0x3, %rdi
movq %rdi, -0x48(%rbp)
callq 0x3030
movq %rax, -0x40(%rbp)
jmp 0x18f85
movq -0x50(%rbp), %rax
cmpq $0x0, %rax
je 0x18fcd
movq -0x40(%rbp), %rax
movq -0x50(%rbp), %rdx
shlq $0x3, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x60(%rbp)
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
movq %rdi, -0x68(%rbp)
callq 0xe530
jmp 0x18fb8
movq -0x60(%rbp), %rcx
movq -0x68(%rbp), %rax
addq $0x8, %rax
cmpq %rcx, %rax
movq %rax, -0x58(%rbp)
jne 0x18fa9
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, 0x20(%rax)
movl $0x0, -0x28(%rbp)
movq -0x30(%rbp), %rcx
movl -0x28(%rbp), %eax
cmpl 0x8(%rcx), %eax
jae 0x19046
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x28(%rbp), %edx
movl (%rcx,%rdx,4), %esi
movq 0x20(%rax), %rcx
movl -0x28(%rbp), %edx
movl %esi, (%rcx,%rdx,8)
movl -0x28(%rbp), %edx
movq 0x20(%rax), %rax
movl -0x28(%rbp), %ecx
movl %edx, 0x4(%rax,%rcx,8)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x18fe0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x1906e
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x3590
jmp 0x1906e
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
cmpq $0x0, %rax
je 0x1905d
movq -0x70(%rbp), %rdi
callq 0x33e0
movq -0x30(%rbp), %rax
movl $0x1, 0xc(%rax)
addq $0x70, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x172a0
movq -0x20(%rbp), %rdi
callq 0x3530
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movsd %xmm0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x1917c
movq -0x50(%rbp), %rax
cmpl $0x1, 0xc(%rax)
jne 0x1917c
xorps %xmm0, %xmm0
ucomisd -0x20(%rbp), %xmm0
ja 0x1917c
movsd -0x20(%rbp), %xmm0
movsd 0xfe92(%rip), %xmm1     # 0x29008
ucomisd %xmm1, %xmm0
jbe 0x19185
movb $0x0, -0x1(%rbp)
jmp 0x192d8
movq -0x50(%rbp), %rax
movl 0x8(%rax), %eax
addl -0x14(%rbp), %eax
subl $0x1, %eax
xorl %edx, %edx
divl -0x14(%rbp)
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq %rax, -0x60(%rbp)
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, -0x68(%rbp)
callq 0x3030
movq %rax, %rcx
movq -0x60(%rbp), %rax
movq %rcx, -0x58(%rbp)
cmpq $0x0, %rax
je 0x19215
movq -0x58(%rbp), %rax
movq -0x60(%rbp), %rdx
shlq $0x3, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x78(%rbp)
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
movq %rdi, -0x80(%rbp)
callq 0xe530
jmp 0x19200
movq -0x78(%rbp), %rcx
movq -0x80(%rbp), %rax
addq $0x8, %rax
cmpq %rcx, %rax
movq %rax, -0x70(%rbp)
jne 0x191f1
movq -0x50(%rbp), %rax
movq -0x58(%rbp), %rcx
movq %rcx, 0x10(%rax)
movsd -0x20(%rbp), %xmm0
movsd 0xfdda(%rip), %xmm1     # 0x29008
ucomisd %xmm1, %xmm0
jne 0x19260
jp 0x19260
movq -0x50(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x14(%rbp)
jmp 0x192a8
movq -0x68(%rbp), %rsi
movq -0x58(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x3590
jmp 0x192e6
movq -0x50(%rbp), %rax
movl 0x8(%rax), %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x40(%rbp)
movl -0x14(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd -0x20(%rbp), %xmm2
movsd 0xfd82(%rip), %xmm1     # 0x29008
subsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x62e0
cvttsd2si (%rax), %rax
movl %eax, -0x14(%rbp)
movq -0x50(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x192f0
movq -0x50(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x19350
movq -0x50(%rbp), %rdi
callq 0x190c0
movq -0x50(%rbp), %rax
movl $0x2, 0xc(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x80, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x3530
nop
// File: 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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl -0xc(%rbp), %ecx
movl %ecx, 0x28(%rax)
movl $0x0, -0x10(%rbp)
movq -0x18(%rbp), %rcx
movl -0x10(%rbp), %eax
cmpl 0x8(%rcx), %eax
jae 0x19346
movq -0x18(%rbp), %rax
movl -0x10(%rbp), %esi
movq 0x10(%rax), %rcx
movl 0x18(%rax), %edx
movl %esi, 0x4(%rcx,%rdx,8)
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
movq -0x18(%rbp), %rax
movl 0x28(%rax), %eax
addl -0x10(%rbp), %eax
movl %eax, -0x10(%rbp)
jmp 0x19310
popq %rbp
retq
nopl (%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl 0x18(%rax), %eax
cmpl -0xc(%rbp), %eax
jb 0x19374
jmp 0x19404
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdi
movq 0x20(%rax), %rsi
movl 0x8(%rax), %eax
shlq $0x3, %rax
addq %rax, %rsi
callq 0xeb70
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
subl $0x1, %eax
movl %eax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movl 0x18(%rax), %eax
cmpl -0xc(%rbp), %eax
jae 0x19404
movq -0x18(%rbp), %rcx
movq 0x20(%rcx), %rax
movl -0x10(%rbp), %edx
movl 0x4(%rax,%rdx,8), %eax
xorl %edx, %edx
divl 0x28(%rcx)
cmpl $0x0, %edx
je 0x193f7
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x10(%rbp), %ecx
cmpl $0x0, (%rax,%rcx,8)
jne 0x193d4
jmp 0x19404
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rcx
movl -0x10(%rbp), %edx
movl 0x4(%rcx,%rdx,8), %esi
movq 0x10(%rax), %rcx
movl 0x18(%rax), %edx
movl %esi, 0x4(%rcx,%rdx,8)
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
jmp 0x193f9
movl -0x10(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x1939c
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x1b7ab
movq -0x10(%rbp), %rdi
callq 0x33e0
movq -0x18(%rbp), %rax
movq $0x0, 0x8(%rax)
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x1b7ce
movq -0x20(%rbp), %rdi
callq 0x33e0
movq -0x18(%rbp), %rax
movq $0x0, 0x10(%rax)
movq $0x0, 0x18(%rax)
movq 0x20(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0x1b7f9
movq -0x28(%rbp), %rdi
callq 0x33e0
movq -0x18(%rbp), %rax
movq $0x0, 0x20(%rax)
movb $0x0, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nop
// File: 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 %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rsi, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xdaf0
testb $0x1, %al
jne 0x1be55
movq -0x40(%rbp), %rdi
movl -0xc(%rbp), %eax
movl %eax, -0x44(%rbp)
callq 0x1c3f0
movl %eax, %ecx
movl -0x44(%rbp), %eax
cmpl %ecx, %eax
jb 0x1be5f
movq $0x0, -0x8(%rbp)
jmp 0x1bed5
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0xdc40
movl %eax, %eax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x3030
movq %rax, -0x28(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0xc(%rbp), %eax
ja 0x1becd
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x34(%rbp), %ecx
movl (%rax,%rcx,4), %edx
movq -0x28(%rbp), %rax
movl -0x34(%rbp), %ecx
subl -0x10(%rbp), %ecx
movl %ecx, %ecx
movl %edx, (%rax,%rcx,4)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1be9d
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nop
// File: 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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl 0x28(%rax), %ecx
imulq $0x5, %rcx, %rcx
addq $0x30, %rcx
movl %ecx, -0x10(%rbp)
cmpq $0x0, 0x20(%rax)
je 0x1c267
movq -0x18(%rbp), %rax
movl 0x28(%rax), %eax
movl %eax, %ecx
addq $0x4, %rcx
movl -0x10(%rbp), %eax
addq %rcx, %rax
movl %eax, -0x10(%rbp)
testb $0x1, -0x9(%rbp)
je 0x1c3d8
movq 0x1bd58(%rip), %rdi     # 0x37fd0
movq %rdi, -0x20(%rbp)
leaq 0xd667(%rip), %rsi      # 0x298ea
callq 0x32a0
movq %rax, %rdi
movq -0x18(%rbp), %rax
movl 0x28(%rax), %eax
cvtsi2sd %rax, %xmm0
movsd 0xcd71(%rip), %xmm1     # 0x29010
mulsd %xmm1, %xmm0
callq 0x3570
movq %rax, %rdi
leaq 0xd2db(%rip), %rsi      # 0x2958d
callq 0x32a0
movq %rax, %rdi
movq 0x1bcef(%rip), %rsi     # 0x37fb0
callq 0x3300
movq -0x20(%rbp), %rdi
leaq 0xd62b(%rip), %rsi      # 0x298fc
callq 0x32a0
movq %rax, %rdi
movq -0x18(%rbp), %rax
movl 0x28(%rax), %eax
shlq $0x2, %rax
cvtsi2sd %rax, %xmm0
movsd 0xd0b7(%rip), %xmm1     # 0x293a8
divsd %xmm1, %xmm0
callq 0x3570
movq %rax, %rdi
leaq 0xd289(%rip), %rsi      # 0x2958d
callq 0x32a0
movq %rax, %rdi
movq 0x1bc9d(%rip), %rsi     # 0x37fb0
callq 0x3300
movq -0x18(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x1c378
movq 0x1bca6(%rip), %rdi     # 0x37fd0
leaq 0xd5dd(%rip), %rsi      # 0x2990e
callq 0x32a0
movq %rax, %rdi
movq -0x18(%rbp), %rax
movl 0x28(%rax), %eax
shlq $0x2, %rax
cvtsi2sd %rax, %xmm0
movsd 0xd057(%rip), %xmm1     # 0x293a8
divsd %xmm1, %xmm0
callq 0x3570
movq %rax, %rdi
leaq 0xd229(%rip), %rsi      # 0x2958d
callq 0x32a0
movq %rax, %rdi
movq 0x1bc3d(%rip), %rsi     # 0x37fb0
callq 0x3300
movq 0x1bc51(%rip), %rdi     # 0x37fd0
leaq 0xd22f(%rip), %rsi      # 0x295b5
callq 0x32a0
movq %rax, %rdi
movl -0x10(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd 0xd00a(%rip), %xmm1     # 0x293a8
divsd %xmm1, %xmm0
callq 0x3570
movq %rax, %rdi
leaq 0xd1dc(%rip), %rsi      # 0x2958d
callq 0x32a0
movq %rax, %rdi
movq 0x1bbf0(%rip), %rsi     # 0x37fb0
callq 0x3300
movq 0x1bc04(%rip), %rdi     # 0x37fd0
movq 0x1bbdd(%rip), %rsi     # 0x37fb0
callq 0x3300
movl -0x10(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x30(%rbp)
movb $0x1, 0x18(%rsi)
movq $0x0, 0x38(%rsi)
movq -0x10(%rbp), %rdi
movl $0x4, %edx
movq %rdx, -0x38(%rbp)
callq 0x33c0
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rsi
movq -0x10(%rbp), %rdi
addq $0x20, %rsi
callq 0x33c0
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rsi
movq -0x10(%rbp), %rdi
addq $0x1c, %rsi
callq 0x33c0
movq -0x30(%rbp), %rcx
movl 0x1c(%rcx), %eax
movl 0x20(%rcx), %ecx
imull %ecx, %eax
movl %eax, %edi
shlq $0x2, %rdi
callq 0x3030
movq -0x30(%rbp), %rcx
movq %rax, 0x10(%rcx)
movq -0x10(%rbp), %rdi
movq 0x10(%rcx), %rsi
movl 0x1c(%rcx), %eax
movl 0x20(%rcx), %ecx
imull %ecx, %eax
movl %eax, %edx
shlq $0x2, %rdx
callq 0x33c0
movl $0x28, %edi
callq 0x32c0
movq %rax, %rdi
movq -0x30(%rbp), %rax
movq %rdi, %rcx
movq %rcx, -0x28(%rbp)
movq 0x10(%rax), %rsi
movl 0x1c(%rax), %edx
callq 0x1e130
jmp 0x1c4f2
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl (%rax), %edi
callq 0x14da0
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x30(%rax)
movl $0x28, %edi
callq 0x32c0
movq %rax, %rdi
movq -0x30(%rbp), %rax
movq %rdi, %rcx
movq %rcx, -0x40(%rbp)
movq -0x10(%rbp), %rsi
movl 0x20(%rax), %edx
movl 0x30(%rax), %ecx
incl %edx
callq 0x1dfa0
jmp 0x1c539
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rax
movq %rax, 0x28(%rdi)
callq 0x1c590
addq $0x40, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x28, %esi
callq 0x32d0
jmp 0x1c586
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x28, %esi
callq 0x32d0
movq -0x18(%rbp), %rdi
callq 0x3530
nop
// File: 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
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq 0x38(%rax), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, %rax
je 0x1c5cc
movq -0x58(%rbp), %rdi
callq 0x1e230
movq -0x58(%rbp), %rdi
movl $0x28, %esi
callq 0x32d0
movq -0x60(%rbp), %rax
movl 0x20(%rax), %ecx
addl $0x4, %ecx
movl $0xcccccccd, %edx       # imm = 0xCCCCCCCD
imulq %rdx, %rcx
shrq $0x22, %rcx
movl %ecx, -0xc(%rbp)
movl (%rax), %esi
movl -0xc(%rbp), %ecx
movl %ecx, %edx
movl %esi, %eax
leal -0x1(%rax,%rdx), %eax
xorl %edx, %edx
movl %edx, -0x68(%rbp)
divl %ecx
movl -0x68(%rbp), %edx
movl %eax, %ecx
movq -0x60(%rbp), %rax
movl %ecx, 0x40(%rax)
movl (%rax), %edi
movl 0x40(%rax), %ecx
movl %ecx, %esi
movl %edi, %eax
leal -0x1(%rax,%rsi), %eax
divl %ecx
movl %eax, %ecx
movq -0x60(%rbp), %rax
incl %ecx
movl %ecx, -0xc(%rbp)
movl -0xc(%rbp), %ecx
movl %ecx, -0x64(%rbp)
movl 0x20(%rax), %edi
decl %edi
callq 0x14da0
movl -0x64(%rbp), %esi
movl %eax, %edx
leaq -0x38(%rbp), %rdi
callq 0x1e430
movq -0x60(%rbp), %rax
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
movq 0x28(%rax), %rdi
movl $0x1, %esi
callq 0x15070
jmp 0x1c660
jmp 0x1c662
movq -0x60(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x1d5c0
movb %al, -0x69(%rbp)
jmp 0x1c674
movb -0x69(%rbp), %al
testb $0x1, %al
jne 0x1c67d
jmp 0x1c6dc
movq -0x60(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x14ff0
movl %eax, -0x70(%rbp)
jmp 0x1c68f
movl -0x70(%rbp), %eax
movl %eax, -0x50(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x50(%rbp), %eax
jae 0x1c6d1
movl -0x40(%rbp), %esi
leaq -0x38(%rbp), %rdi
callq 0x14e80
jmp 0x1c6ab
movq -0x60(%rbp), %rax
movl 0x40(%rax), %eax
addl -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
jmp 0x1c695
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x1e570
jmp 0x1c71d
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x1c662
movq -0x60(%rbp), %rax
movl 0x20(%rax), %esi
decl %esi
leaq -0x38(%rbp), %rdi
callq 0x14e80
jmp 0x1c6f0
leaq -0x38(%rbp), %rdi
callq 0x1e5b0
movq %rax, -0x78(%rbp)
jmp 0x1c6ff
movq -0x60(%rbp), %rax
movq -0x78(%rbp), %rcx
movq %rcx, 0x38(%rax)
leaq -0x38(%rbp), %rdi
callq 0x1e570
addq $0x80, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x3530
nopw %cs:(%rax,%rax)