LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/rlevector.cpp
// Function: CSA::RLEVector::Iterator::valueLoop(unsigned int)
void
RLEVector::Iterator::valueLoop(usint value)
{
  this->getSample(this->sampleForValue(value));
  this->run = 0;

  if(this->val >= value) { return; }
  while(this->cur < this->block_items)
  {
    this->val += this->buffer.readDeltaCode();
    this->cur++;
    this->run = this->buffer.readDeltaCode() - 1;
    if(this->val >= value) { break; }

    this->cur += this->run;
    this->val += this->run;
    if(this->val >= value)
    {
      this->run = this->val - value;
      this->val = value;
      this->cur -= this->run;
      break;
    }
    this->run = 0;
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
callq 0xf4ec
movq %rbx, %rdi
movl %eax, %esi
callq 0xfc34
andl $0x0, 0x1c(%rbx)
cmpl %ebp, 0x18(%rbx)
jae 0xfdf7
leaq 0x28(%rbx), %r14
movl 0x14(%rbx), %eax
cmpl 0x20(%rbx), %eax
jae 0xfdf7
movq %r14, %rdi
callq 0xe3a2
movq 0x14(%rbx), %xmm0
movd %eax, %xmm1
movdqa 0x3b0a(%rip), %xmm2     # 0x138c0
punpckldq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
paddd %xmm0, %xmm2
movq %xmm2, 0x14(%rbx)
movq %r14, %rdi
callq 0xe3a2
decl %eax
movl %eax, 0x1c(%rbx)
movl 0x18(%rbx), %ecx
cmpl %ebp, %ecx
jae 0xfdf7
addl %eax, %ecx
addl 0x14(%rbx), %eax
movl %eax, 0x14(%rbx)
movl %ecx, 0x18(%rbx)
subl %ebp, %ecx
jae 0xfdec
andl $0x0, 0x1c(%rbx)
jmp 0xfd98
movl %ecx, 0x1c(%rbx)
movl %ebp, 0x18(%rbx)
subl %ecx, %eax
movl %eax, 0x14(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/rlevector.cpp
// Function: CSA::RLEVector::Iterator::select(unsigned int)
usint
RLEVector::Iterator::select(usint index)
{
  const RLEVector& par = (const RLEVector&)(this->parent);

  if(index >= par.items) { return par.size; }
  this->getSample(this->sampleForIndex(index));
  this->run = 0;

  usint lim = index - this->sample.first;
  while(this->cur < lim)
  {
    this->val += this->buffer.readDeltaCode();
    usint temp = this->buffer.readDeltaCode();
    this->val += temp - 1;
    this->cur += temp;
  }
  if(this->cur > lim)
  {
    this->run = this->cur - lim;
    this->cur -= this->run;
    this->val -= this->run;
  }

  return this->val;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %r12
cmpl %esi, 0x4(%r12)
jbe 0xfe73
movl %esi, %ebx
movq %rdi, %r14
callq 0xf44c
movq %r14, %rdi
movl %eax, %esi
callq 0xfc34
andl $0x0, 0x1c(%r14)
subl 0xc(%r14), %ebx
leaq 0x28(%r14), %r15
leaq 0x18(%r14), %r12
movl 0x14(%r14), %eax
subl %ebx, %eax
jae 0xfe65
movq %r15, %rdi
callq 0xe3a2
addl %eax, 0x18(%r14)
movq %r15, %rdi
callq 0xe3a2
movl 0x18(%r14), %ecx
addl %eax, %ecx
decl %ecx
movl %ecx, 0x18(%r14)
addl 0x14(%r14), %eax
movl %eax, 0x14(%r14)
jmp 0xfe37
jbe 0xfe73
movl %eax, 0x1c(%r14)
movl %ebx, 0x14(%r14)
subl %eax, 0x18(%r14)
movl (%r12), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/rlevector.cpp
// Function: CSA::RLEVector::Iterator::selectNext()
usint
RLEVector::Iterator::selectNext()
{
  if(this->cur >= this->block_items)
  {
    this->getSample(this->block + 1);
    this->run = 0;
    return this->val;
  }

  this->cur++;
  if(this->run > 0)
  {
    this->val++;
    this->run--;
  }
  else
  {
    this->val += this->buffer.readDeltaCode();
    this->run = this->buffer.readDeltaCode() - 1;
  }

  return this->val;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x14(%rdi), %eax
cmpl 0x20(%rdi), %eax
jae 0xfea4
incl %eax
movl %eax, 0x14(%rbx)
movl 0x1c(%rbx), %eax
testl %eax, %eax
je 0xfeb7
incl 0x18(%rbx)
jmp 0xfece
movl 0x8(%rbx), %esi
incl %esi
movq %rbx, %rdi
callq 0xfc34
andl $0x0, 0x1c(%rbx)
jmp 0xfed3
leaq 0x28(%rbx), %r14
movq %r14, %rdi
callq 0xe3a2
addl %eax, 0x18(%rbx)
movq %r14, %rdi
callq 0xe3a2
decl %eax
movl %eax, 0x1c(%rbx)
movl 0x18(%rbx), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/rlevector.cpp
// Function: CSA::RLEVector::Iterator::valueBefore(unsigned int)
pair_type
RLEVector::Iterator::valueBefore(usint value)
{
  const RLEVector& par = (const RLEVector&)(this->parent);

  if(value >= par.size) { return pair_type(par.size, par.items); }

  this->getSample(this->sampleForValue(value));
  if(this->val > value) { return pair_type(par.size, par.items); }
  this->run = 0;

  while(this->cur < this->block_items && this->val < value)
  {
    usint temp = this->buffer.readDeltaCode(value - this->val);
    if(temp == 0) { break; }
    this->val += temp;

    temp = this->buffer.readDeltaCode();
    this->cur += temp;
    this->val += temp - 1;
  }
  if(this->val > value)
  {
    this->run = this->val - value;
    this->val = value;
    this->cur -= this->run;
  }

  return pair_type(this->val, this->sample.first + this->cur);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq (%rdi), %r15
movl (%r15), %eax
cmpl %esi, %eax
jbe 0xff0c
movl %esi, %ebx
movq %rdi, %r14
callq 0xf4ec
movq %r14, %rdi
movl %eax, %esi
callq 0xfc34
movl 0x18(%r14), %edx
cmpl %ebx, %edx
jbe 0xff12
movl (%r15), %eax
movl 0x4(%r15), %ecx
jmp 0xff83
andl $0x0, 0x1c(%r14)
leaq 0x28(%r14), %r15
movl 0x14(%r14), %ecx
cmpl 0x20(%r14), %ecx
jae 0xff65
movl %ebx, %esi
subl %edx, %esi
jbe 0xff65
movq %r15, %rdi
callq 0xfcb2
movl 0x18(%r14), %edx
testl %eax, %eax
je 0xff61
addl %eax, %edx
movl %edx, 0x18(%r14)
movq %r15, %rdi
callq 0xe3a2
movl %eax, %ecx
addl 0x14(%r14), %ecx
movl %ecx, 0x14(%r14)
movl 0x18(%r14), %edx
addl %eax, %edx
decl %edx
movl %edx, 0x18(%r14)
jmp 0xff1f
movl 0x14(%r14), %ecx
movl %edx, %eax
subl %ebx, %eax
jbe 0xff7b
movl %eax, 0x1c(%r14)
movl %ebx, 0x18(%r14)
subl %eax, %ecx
movl %ecx, 0x14(%r14)
jmp 0xff7d
movl %edx, %ebx
addl 0xc(%r14), %ecx
movl %ebx, %eax
shlq $0x20, %rcx
movl %eax, %eax
orq %rcx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/rlevector.cpp
// Function: CSA::RLEVector::Iterator::valueAfter(unsigned int)
pair_type
RLEVector::Iterator::valueAfter(usint value)
{
  const RLEVector& par = (const RLEVector&)(this->parent);

  if(value >= par.size) { return pair_type(par.size, par.items); }

  this->valueLoop(value);

  if(this->val < value)
  {
    this->getSample(this->block + 1);
    this->run = 0;
  }

  return pair_type(this->val, this->sample.first + this->cur);
}

// Assembly:
movq (%rdi), %rcx
movl (%rcx), %eax
cmpl %esi, %eax
jbe 0xffd1
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0xfd70
movl 0x18(%rbx), %eax
cmpl %ebp, %eax
jae 0xffc3
movl 0x8(%rbx), %esi
incl %esi
movq %rbx, %rdi
callq 0xfc34
andl $0x0, 0x1c(%rbx)
movl 0x18(%rbx), %eax
movl 0x14(%rbx), %ecx
addl 0xc(%rbx), %ecx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xffd4
movl 0x4(%rcx), %ecx
shlq $0x20, %rcx
movl %eax, %eax
orq %rcx, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/rlevector.cpp
// Function: CSA::RLEVector::Iterator::nextValue()
pair_type
RLEVector::Iterator::nextValue()
{
  if(this->cur >= this->block_items)
  {
    this->getSample(this->block + 1);
    this->run = 0;
    return pair_type(this->val, this->sample.first);
  }

  this->cur++;
  if(this->run > 0)
  {
    this->val++;
    this->run--;
  }
  else
  {
    this->val += this->buffer.readDeltaCode();
    this->run = this->buffer.readDeltaCode() - 1;
  }

  return pair_type(this->val, this->sample.first + this->cur);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x14(%rdi), %eax
cmpl 0x20(%rdi), %eax
jae 0xfffe
incl %eax
movl %eax, 0x14(%rbx)
movl 0x1c(%rbx), %ecx
testl %ecx, %ecx
je 0x10014
incl 0x18(%rbx)
jmp 0x10030
movl 0x8(%rbx), %esi
incl %esi
movq %rbx, %rdi
callq 0xfc34
andl $0x0, 0x1c(%rbx)
movl 0xc(%rbx), %eax
jmp 0x10038
leaq 0x28(%rbx), %r14
movq %r14, %rdi
callq 0xe3a2
addl %eax, 0x18(%rbx)
movq %r14, %rdi
callq 0xe3a2
movl %eax, %ecx
movl 0x14(%rbx), %eax
decl %ecx
movl %ecx, 0x1c(%rbx)
addl 0xc(%rbx), %eax
movl 0x18(%rbx), %ecx
shlq $0x20, %rax
orq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/rlevector.cpp
// Function: CSA::RLEVector::Iterator::selectRun(unsigned int, unsigned int)
pair_type
RLEVector::Iterator::selectRun(usint index, usint max_length)
{
  usint value = this->select(index);

  usint len = std::min(max_length, this->run);
  this->run -= len; this->cur += len; this->val += len;

  return pair_type(value, len);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rdi, %r14
callq 0xfdfc
movl 0x1c(%r14), %ecx
cmpl %ebx, %ecx
cmovbl %ecx, %ebx
subl %ebx, %ecx
movl %ecx, 0x1c(%r14)
movq 0x14(%r14), %xmm0
movd %ebx, %xmm1
pshufd $0x50, %xmm1, %xmm1     # xmm1 = xmm1[0,0,1,1]
paddd %xmm0, %xmm1
movq %xmm1, 0x14(%r14)
shlq $0x20, %rbx
movl %eax, %eax
orq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/rlevector.cpp
// Function: CSA::RLEVector::Iterator::selectNextRun(unsigned int)
pair_type
RLEVector::Iterator::selectNextRun(usint max_length)
{
  usint value = this->selectNext();

  usint len = std::min(max_length, this->run);
  this->run -= len; this->cur += len; this->val += len;

  return pair_type(value, len);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
callq 0xfe84
movl 0x1c(%r14), %ecx
cmpl %ebx, %ecx
cmovbl %ecx, %ebx
subl %ebx, %ecx
movl %ecx, 0x1c(%r14)
movq 0x14(%r14), %xmm0
movd %ebx, %xmm1
pshufd $0x50, %xmm1, %xmm1     # xmm1 = xmm1[0,0,1,1]
paddd %xmm0, %xmm1
movq %xmm1, 0x14(%r14)
shlq $0x20, %rbx
movl %eax, %eax
orq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/rlevector.cpp
// Function: CSA::RLEVector::Iterator::isSet(unsigned int)
bool
RLEVector::Iterator::isSet(usint value)
{
  const RLEVector& par = (const RLEVector&)(this->parent);

  if(value >= par.size) { return false; }

  this->valueLoop(value);

  return (this->val == value);
}

// Assembly:
movq (%rdi), %rax
cmpl %esi, (%rax)
jbe 0x100fe
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
callq 0xfd70
cmpl %ebx, 0x18(%r14)
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/rlevector.cpp
// Function: CSA::RLEVector::Iterator::countRuns()
usint
RLEVector::Iterator::countRuns()
{
  const RLEVector& par = (const RLEVector&)(this->parent);

  if(par.items == 0) { return 0; }

  usint runs = 1;
  pair_type res = this->selectRun(0, par.items);
  usint last = res.first + res.second;

  while(last < par.size)
  {
    res = this->selectNextRun(par.items);
    if(res.first < par.size && res.first > last + 1) { runs++; }
    last = res.first + res.second;
  }

  return runs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %r14
movl 0x4(%r14), %edx
testl %edx, %edx
je 0x10169
movq %rdi, %rbx
xorl %esi, %esi
callq 0x1004a
movq %rax, %r15
shrq $0x20, %r15
addl %eax, %r15d
movl (%r14), %ecx
pushq $0x1
popq %rbp
cmpl %ecx, %r15d
jae 0x1016b
movl 0x4(%r14), %esi
movq %rbx, %rdi
callq 0x10092
movq %rax, %rdx
shrq $0x20, %rdx
movl (%r14), %ecx
cmpl %eax, %ecx
seta %sil
incl %r15d
cmpl %eax, %r15d
setb %dil
andb %sil, %dil
movzbl %dil, %esi
addl %esi, %ebp
addl %eax, %edx
movl %edx, %r15d
jmp 0x1012e
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/rlevector.cpp
// Function: CSA::RLEEncoder::setRun(unsigned int, unsigned int)
void
RLEEncoder::setRun(usint start, usint len)
{
  if(this->items == 0)
  {
    this->setFirstBit(start);
    if(len > 1)
    {
      this->RLEncode(1, len - 1);
    }
    return;
  }
  if(start < this->size || len == 0) { return; }

  // Write as much into the buffer as possible.
  usint diff = start + 1 - this->size;
  usint free_bits = this->buffer->bitsLeft();
  usint code_bits = this->buffer->deltaCodeLength(diff);
  if(free_bits > code_bits) // At least a part of the run fits into the block.
  {
    free_bits -= code_bits;
    usint run_bits = this->buffer->deltaCodeLength(len);
    if(run_bits <= free_bits)
    {
      this->RLEncode(diff, len);
      return;
    }

    // Encode as much as possible and let the rest spill.
    usint llen = 1;
    while(llen + 2 * length(llen + 1) - 1 <= free_bits) { llen++; }
    llen = ((usint)1 << llen) - 1;

    this->RLEncode(diff, llen);
    len -= llen;

    // A new sample will be added.
    this->size++;
    this->items++;
  }
  else
  {
    this->size = start + 1;
    this->items++;
  }

  // Didn't fit into the block. A new sample & block required.
  this->addNewBlock();
  if(len > 1)
  {
    this->RLEncode(1, len - 1);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movl %esi, %r15d
movq %rdi, %r14
cmpl $0x0, 0x4(%rdi)
je 0x10255
movl (%r14), %eax
cmpl %r15d, %eax
seta %cl
testl %ebx, %ebx
sete %dl
orb %cl, %dl
jne 0x1026f
incl %r15d
movl %r15d, %ebp
movq 0x18(%r14), %rdi
movl 0x18(%rdi), %r12d
notl %r12d
addl 0x8(%rdi), %r12d
subl %eax, %ebp
shll $0x5, %r12d
addl 0x1c(%rdi), %r12d
movl %ebp, %esi
callq 0x10314
subl %eax, %r12d
jbe 0x10244
movq 0x18(%r14), %rdi
movl %ebx, %esi
callq 0x10314
cmpl %r12d, %eax
jbe 0x10278
xorl %r15d, %r15d
leal 0x2(%r15), %edi
callq 0xab34
movl %r15d, %ecx
incl %r15d
leal (%rcx,%rax,2), %eax
cmpl %r12d, %eax
jbe 0x1020a
pushq $-0x1
popq %r12
movl %r15d, %ecx
shll %cl, %r12d
notl %r12d
movq %r14, %rdi
movl %ebp, %esi
movl %r12d, %edx
callq 0x102e2
subl %r12d, %ebx
movl (%r14), %r15d
incl %r15d
movl %r15d, (%r14)
incl 0x4(%r14)
movq %r14, %rdi
callq 0xf778
jmp 0x10260
movq %r14, %rdi
movl %r15d, %esi
callq 0xf854
cmpl $0x2, %ebx
jb 0x1026f
decl %ebx
pushq $0x1
popq %rsi
movq %r14, %rdi
jmp 0x1027d
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x102e2
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/rlevector.cpp
// Function: CSA::RLEEncoder::addRun(unsigned int, unsigned int)
void
RLEEncoder::addRun(usint start, usint len)
{
  if(this->run.second == 0)
  {
    this->run = pair_type(start, len);
  }
  else if(start == this->run.first + this->run.second)
  {
    this->run.second += len;
  }
  else
  {
    this->setRun(this->run.first, this->run.second);
    this->run = pair_type(start, len);
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movl 0x74(%rdi), %edx
testl %edx, %edx
je 0x102bf
movl 0x70(%r14), %esi
leal (%rsi,%rdx), %eax
cmpl %ebp, %eax
jne 0x102b7
addl %ebx, %edx
movl %edx, %ebx
jmp 0x102c3
movq %r14, %rdi
callq 0x1019c
movl %ebp, 0x70(%r14)
movl %ebx, 0x74(%r14)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/bits/rlevector.h
// Function: CSA::RLEEncoder::RLEncode(unsigned int, unsigned int)
inline void RLEncode(usint diff, usint len)
    {
      this->size += diff + len - 1;
      this->items += len;
      this->buffer->writeDeltaCode(diff);
      this->buffer->writeDeltaCode(len);
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rdi, %r14
movl (%rdi), %eax
leal (%rsi,%rbx), %ecx
addl %ecx, %eax
decl %eax
movl %eax, (%rdi)
addl %edx, 0x4(%rdi)
movq 0x18(%rdi), %rdi
callq 0xe3de
movq 0x18(%r14), %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe3de
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/misc/parameters.cpp
// Function: CSA::Parameters::read(std::basic_ifstream<char, std::char_traits<char>>&)
void
Parameters::read(std::ifstream& file)
{
  while(file)
  {
    std::string key;
    std::string c;
    usint value;

    file >> key >> c >> value;
    if(c == "=") { this->parameters[key] = value; }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
movq %rdi, 0x10(%rsp)
xorl %r14d, %r14d
leaq 0x38(%rsp), %r15
leaq 0x18(%rsp), %r12
leaq 0x357a(%rip), %rbp      # 0x13926
movq (%rbx), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%rbx,%rax)
jne 0x10444
leaq 0x48(%rsp), %rax
movq %rax, 0x38(%rsp)
andq $0x0, 0x40(%rsp)
movb %r14b, 0x48(%rsp)
leaq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
andq $0x0, 0x20(%rsp)
movb %r14b, 0x28(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x32a0
movq %rax, %rdi
movq %r12, %rsi
callq 0x32a0
movq %rax, %rdi
leaq 0xc(%rsp), %rsi
callq 0x3400
movq %r12, %rdi
movq %rbp, %rsi
callq 0x108d2
testb %al, %al
je 0x1042f
movl 0xc(%rsp), %r13d
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x1086c
movl %r13d, (%rax)
movq %r12, %rdi
callq 0x3478
movq %r15, %rdi
callq 0x3478
jmp 0x103ac
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3478
leaq 0x38(%rsp), %rdi
callq 0x3478
movq %rbx, %rdi
callq 0x3410
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/misc/parameters.cpp
// Function: CSA::Parameters::read(_IO_FILE*)
void
Parameters::read(FILE* file)
{
  if(file == 0) { return; }

  while(!std::feof(file))
  {
    char buffer[1000];
    if(!std::fgets(buffer, 1000, file)) { break; }
    std::stringstream stream;
    stream << buffer;

    std::string key;
    std::string c;
    usint value;
    stream >> key >> c >> value;
    if(c == "=") { this->parameters[key] = value; }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x5c8, %rsp            # imm = 0x5C8
movq %rdi, 0x10(%rsp)
testq %rsi, %rsi
je 0x1057b
movq %rsi, %rbx
leaq 0x1e0(%rsp), %r12
leaq 0x58(%rsp), %r13
leaq 0x38(%rsp), %rbp
leaq 0x18(%rsp), %r15
movq %rbx, %rdi
callq 0x3350
testl %eax, %eax
jne 0x1057b
movq %r12, %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movq %rbx, %rdx
callq 0x3370
testq %rax, %rax
je 0x1057b
movq %r13, %rdi
callq 0x3180
leaq 0x68(%rsp), %rdi
movq %r12, %rsi
callq 0x3200
leaq 0x48(%rsp), %rax
movq %rax, 0x38(%rsp)
andq $0x0, 0x40(%rsp)
xorl %ecx, %ecx
movb %cl, 0x48(%rsp)
leaq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
andq $0x0, 0x20(%rsp)
movb %cl, 0x28(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
callq 0x32a0
movq %rax, %rdi
movq %r15, %rsi
callq 0x32a0
movq %rax, %rdi
leaq 0xc(%rsp), %rsi
callq 0x3400
movq %r15, %rdi
leaq 0x33e6(%rip), %rsi      # 0x13926
callq 0x108d2
testb %al, %al
je 0x1055e
movl 0xc(%rsp), %r14d
movq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0x1086c
movl %r14d, (%rax)
movq %r15, %rdi
callq 0x3478
movq %rbp, %rdi
callq 0x3478
movq %r13, %rdi
callq 0x31a0
jmp 0x104ab
addq $0x5c8, %rsp            # imm = 0x5C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x105a9
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3478
leaq 0x38(%rsp), %rdi
callq 0x3478
leaq 0x58(%rsp), %rdi
callq 0x31a0
movq %rbx, %rdi
callq 0x3410
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/misc/parameters.cpp
// Function: CSA::Parameters::read(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Parameters::read(const std::string& file_name)
{
  std::ifstream file(file_name.c_str(), std::ios_base::binary);
  if(!file)
  {
    std::cerr << "Cannot open parameter file " << file_name << " for reading!" << std::endl;
    return;
  }
  this->read(file);
  file.close();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rsi
leaq 0x8(%rsp), %r15
pushq $0x4
popq %rdx
movq %r15, %rdi
callq 0x3430
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x28(%rsp,%rax)
je 0x10626
movq 0xc9fa(%rip), %rdi      # 0x1cff0
leaq 0x32d3(%rip), %rsi      # 0x138d0
callq 0x3200
movq %rax, %rdi
movq %rbx, %rsi
callq 0x31f0
leaq 0x32d8(%rip), %rsi      # 0x138ec
movq %rax, %rdi
callq 0x3200
movq %rax, %rdi
callq 0x3100
jmp 0x1063d
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x10382
leaq 0x8(%rsp), %rdi
callq 0x3090
leaq 0x8(%rsp), %rdi
callq 0x30a0
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x30a0
movq %rbx, %rdi
callq 0x3410
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/misc/parameters.cpp
// Function: CSA::Parameters::write(_IO_FILE*) const
void
Parameters::write(FILE* file) const
{
  if(file == 0) { return; }

  for(std::map<std::string, usint>::const_iterator iter = this->parameters.begin(); iter != this->parameters.end(); iter++)
  {
    std::stringstream buffer;
    buffer << iter->first << " = " << iter->second << std::endl;
    std::string line = buffer.str();
    std::fwrite(line.c_str(), line.length(), 1, file);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
testq %rsi, %rsi
je 0x1079e
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18(%rdi), %r12
addq $0x8, %r14
leaq 0x20(%rsp), %rbp
movq %rsp, %r13
pushq $0x1
popq %r15
cmpq %r14, %r12
je 0x1079e
movq %rbp, %rdi
callq 0x3180
leaq 0x20(%r12), %rsi
leaq 0x30(%rsp), %rdi
callq 0x31f0
movq %rax, %rdi
leaq 0x31b4(%rip), %rsi      # 0x138fa
callq 0x3200
movl 0x40(%r12), %esi
movq %rax, %rdi
callq 0x3160
movq %rax, %rdi
callq 0x3100
movq %r13, %rdi
leaq 0x38(%rsp), %rsi
callq 0x3380
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x3440
movq %r13, %rdi
callq 0x3478
movq %rbp, %rdi
callq 0x31a0
movq %r12, %rdi
callq 0x3270
movq %rax, %r12
jmp 0x10720
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x107b2
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x31a0
movq %rbx, %rdi
callq 0x3410
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/misc/parameters.cpp
// Function: CSA::Parameters::write(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
void
Parameters::write(const std::string& file_name) const
{
  std::ofstream file(file_name.c_str(), std::ios_base::binary);
  if(!file)
  {
    std::cerr << "Cannot open parameter file " << file_name << " for writing!" << std::endl;
    return;
  }
  this->write(file);
  file.close();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rsi
movq %rsp, %r15
pushq $0x4
popq %rdx
movq %r15, %rdi
callq 0x3260
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%rsp,%rax)
je 0x10830
movq 0xc7f0(%rip), %rdi      # 0x1cff0
leaq 0x30c9(%rip), %rsi      # 0x138d0
callq 0x3200
movq %rax, %rdi
movq %rbx, %rsi
callq 0x31f0
leaq 0x30e0(%rip), %rsi      # 0x138fe
movq %rax, %rdi
callq 0x3200
movq %rax, %rdi
callq 0x3100
jmp 0x10843
movq %rsp, %rsi
movq %r14, %rdi
callq 0x10684
movq %rsp, %rdi
callq 0x3300
movq %rsp, %rdi
callq 0x3320
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x3320
movq %rbx, %rdi
callq 0x3410
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/misc/utils.cpp
// Function: CSA::fileSize(std::basic_ifstream<char, std::char_traits<char>>&)
std::streamoff
fileSize(std::ifstream& file)
{
  std::streamoff curr = file.tellg();

  file.seekg(0, std::ios::end);
  std::streamoff size = file.tellg();
  file.seekg(0, std::ios::beg);
  size -= file.tellg();

  file.seekg(curr, std::ios::beg);
  return size;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x33f0
movq %rax, %r14
pushq $0x2
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x32e0
movq %rbx, %rdi
callq 0x33f0
movq %rax, %r15
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x32e0
movq %rbx, %rdi
callq 0x33f0
subq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x32e0
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/misc/utils.cpp
// Function: CSA::fileSize(std::basic_ofstream<char, std::char_traits<char>>&)
std::streamoff
fileSize(std::ofstream& file)
{
  std::streamoff curr = file.tellp();

  file.seekp(0, std::ios::end);
  std::streamoff size = file.tellp();
  file.seekp(0, std::ios::beg);
  size -= file.tellp();

  file.seekp(curr, std::ios::beg);
  return size;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x31d0
movq %rax, %r14
pushq $0x2
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3210
movq %rbx, %rdi
callq 0x31d0
movq %rax, %r15
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3210
movq %rbx, %rdi
callq 0x31d0
subq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3210
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/misc/utils.cpp
// Function: CSA::largeWrite(std::basic_ofstream<char, std::char_traits<char>>&, char*, long, long)
void
largeWrite(std::ofstream& file, char* data, std::streamoff size, std::streamoff block_size)
{
	block_size = std::max(block_size, (std::streamoff)1);
	block_size *= MEGABYTE;

	for(std::streamoff i = 0; i < size; i += block_size)
	{
		file.write(data + i, std::min(size - i, block_size));
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
cmpq $0x2, %rcx
pushq $0x1
popq %r12
cmovgeq %rcx, %r12
movq %rdi, %r15
shlq $0x14, %r12
xorl %r13d, %r13d
cmpq %rbx, %r13
jge 0x10e07
leaq (%r14,%r13), %rsi
movq %r12, %rbp
subq %rdx, %rbp
cmovlq %r12, %rdx
negq %rbp
movq %r15, %rdi
callq 0x32d0
addq %r12, %r13
movq %rbp, %rdx
jmp 0x10de1
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/misc/utils.cpp
// Function: CSA::readRows(std::basic_ifstream<char, std::char_traits<char>>&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, bool)
void
readRows(std::ifstream& file, std::vector<std::string>& rows, bool skipEmptyRows)
{
  while(file)
  {
    std::string buf;
    std::getline(file, buf);
    if(skipEmptyRows && buf.length() == 0) { continue; }
    rows.push_back(buf);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x10(%rsp), %r13
movq %rsp, %r12
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%r15,%rax)
jne 0x10e7d
movq %r13, (%rsp)
andq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x3080
testb %bl, %bl
je 0x10e68
cmpq $0x0, 0x8(%rsp)
je 0x10e73
movq %r14, %rdi
movq %r12, %rsi
callq 0x11764
movq %r12, %rdi
callq 0x3478
jmp 0x10e33
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x3478
movq %rbx, %rdi
callq 0x3410
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/misc/utils.cpp
// Function: CSA::readPizzaChili(std::basic_ifstream<char, std::char_traits<char>>&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
void
readPizzaChili(std::ifstream& file, std::vector<std::string>& patterns)
{
  std::string header;
  std::getline(file, header);

  std::size_t start = header.find("number=");
  if(start == std::string::npos) { return; }
  int temp = std::atoi(header.substr(start + 7).c_str());
  if(temp <= 0) { return; }
  usint n = temp;

  start = header.find("length=");
  if(start == std::string::npos) { return; }
  temp = std::atoi(header.substr(start + 7).c_str());
  if(temp <= 0) { return; }
  usint l = temp;

  char buffer[l];
  for(usint i = 0; i < n; i++)
  {
    file.read(buffer, l);
    patterns.push_back(std::string(buffer, l));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, -0x38(%rbp)
leaq -0x70(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x80(%rbp), %rsi
movq %rdi, -0x40(%rbp)
callq 0x3080
leaq 0x2a41(%rip), %rsi      # 0x13918
leaq -0x80(%rbp), %rdi
xorl %edx, %edx
callq 0x3460
cmpq $-0x1, %rax
je 0x10fd2
addq $0x7, %rax
leaq -0x60(%rbp), %rdi
leaq -0x80(%rbp), %rsi
pushq $-0x1
popq %rcx
movq %rax, %rdx
callq 0x3240
leaq -0x60(%rbp), %rbx
movq (%rbx), %rdi
callq 0x3360
movl %eax, %r15d
movq %rbx, %rdi
callq 0x3478
testl %r15d, %r15d
jle 0x10fd2
leaq 0x29f6(%rip), %rsi      # 0x13920
leaq -0x80(%rbp), %rdi
xorl %edx, %edx
callq 0x3460
cmpq $-0x1, %rax
je 0x10fd2
addq $0x7, %rax
leaq -0x60(%rbp), %rdi
leaq -0x80(%rbp), %rsi
pushq $-0x1
popq %rcx
movq %rax, %rdx
callq 0x3240
leaq -0x60(%rbp), %r14
movq (%r14), %rdi
callq 0x3360
movl %eax, %ebx
movq %r14, %rdi
callq 0x3478
testl %ebx, %ebx
jle 0x10fd2
movq %rsp, -0x30(%rbp)
movl %ebx, %r12d
movq %rsp, %r13
leaq 0xf(%r12), %rax
andq $-0x10, %rax
subq %rax, %r13
movq %r13, %rsp
leaq (%r12,%r13), %rbx
subl $0x1, %r15d
jb 0x10fce
movq -0x40(%rbp), %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x3290
leaq -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x4abe
movq -0x38(%rbp), %rdi
movq %r14, %rsi
callq 0x11b6a
movq %r14, %rdi
callq 0x3478
jmp 0x10f8d
movq -0x30(%rbp), %rsp
leaq -0x80(%rbp), %rdi
callq 0x3478
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x10ff2
jmp 0x10ff2
jmp 0x10ff2
jmp 0x10ff2
movq %rax, %rbx
jmp 0x11003
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x3478
leaq -0x80(%rbp), %rdi
callq 0x3478
movq %rbx, %rdi
callq 0x3410
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/misc/utils.cpp
// Function: CSA::initialSort(std::pair<unsigned int, unsigned int>*, unsigned int*, std::vector<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int>>>&, unsigned int, unsigned int, unsigned int)
uint
initialSort(short_pair* pairs, uint* keys, std::vector<ss_range>& unsorted, uint n, uint threads, uint h)
{
  // Sort according to first h characters.
  parallelSort(pairs, pairs + n, key_comparator);
  unsorted.push_back(ss_range(0, n - 1));
  uint total = setRanks(pairs, keys, n, unsorted, threads, 1);
//  std::cout << "Sorted with h = " << h << ", unsorted total = " << total << " (" << unsorted.size() << " ranges)" << std::endl;

  return total;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %r8d, %ebx
movl %ecx, %r14d
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
movl %ecx, %eax
leaq (%rdi,%rax,8), %rsi
callq 0x11c60
leal -0x1(%r14), %eax
leaq 0x8(%rsp), %rsi
andl $0x0, (%rsi)
movl %eax, 0x4(%rsi)
movq %r15, %rdi
callq 0xac2e
pushq $0x1
popq %r9
movq %r13, %rdi
movq %r12, %rsi
movl %r14d, %edx
movq %r15, %rcx
movl %ebx, %r8d
callq 0x11790
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/misc/utils.cpp
// Function: CSA::prefixDoubling(std::pair<unsigned int, unsigned int>*, unsigned int*, std::vector<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int>>>&, unsigned int, unsigned int, unsigned int, unsigned int)
short_pair*
prefixDoubling(short_pair* pairs, uint* keys, std::vector<ss_range>& unsorted, uint n, uint threads, uint total, uint h)
{
  // Double prefix length until sorted.
  while(total > 0)
  {
    uint chunk = std::max((size_t)1, unsorted.size() / (threads * threads));
    #pragma omp parallel for schedule(dynamic, chunk)
    for(uint i = 0; i < unsorted.size(); i++)
    {
      // Set sort keys for the current range.
      short_pair* limit = pairs + unsorted[i].second;
      for(short_pair* curr = pairs + unsorted[i].first; curr <= limit; ++curr)
      {
        curr->second = keys[curr->first + h];
      }
      sequentialSort(pairs + unsorted[i].first, pairs + unsorted[i].second + 1, key_comparator);
    }
    total = setRanks(pairs, keys, n, unsorted, threads, chunk);
    h *= 2;
//    std::cout << "Sorted with h = " << h << ", unsorted total = " << total << " (" << unsorted.size() << " ranges)" << std::endl;
  }

  #pragma omp parallel for schedule(static)
  for(uint i = 0; i < n; i++) { pairs[i].second = keys[i]; }
  delete[] keys; keys = 0;
  return pairs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %eax
movl %ecx, (%rsp)
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
movl 0x50(%rsp), %ebp
movl %r8d, 0x4(%rsp)
movl %r8d, %ecx
imull %ecx, %ecx
movq %rcx, 0x8(%rsp)
leaq 0x8(%rdi), %r15
testl %eax, %eax
je 0x11190
movq (%r12), %rcx
movq 0x8(%r12), %rsi
movq %rsi, %rax
subq %rcx, %rax
sarq $0x3, %rax
xorl %edi, %edi
xorl %edx, %edx
divq 0x8(%rsp)
cmpq $0x1, %rax
adcq $0x0, %rax
movq %rax, 0x10(%rsp)
movl %edi, %r13d
subq %rcx, %rsi
sarq $0x3, %rsi
cmpq %r13, %rsi
jbe 0x1116e
movl (%rcx,%r13,8), %edx
movl 0x4(%rcx,%r13,8), %eax
leaq (%rbx,%rax,8), %rax
leaq (%rbx,%rdx,8), %rdi
movq %rdi, %rdx
cmpq %rax, %rdx
ja 0x11151
movl (%rdx), %esi
addl %ebp, %esi
movl (%r14,%rsi,4), %esi
movl %esi, 0x4(%rdx)
addq $0x8, %rdx
jmp 0x1113b
movl 0x4(%rcx,%r13,8), %eax
leaq (%r15,%rax,8), %rsi
callq 0x11c60
leal 0x1(%r13), %edi
movq (%r12), %rcx
movq 0x8(%r12), %rsi
jmp 0x11118
movq %rbx, %rdi
movq %r14, %rsi
movl (%rsp), %edx
movq %r12, %rcx
movl 0x4(%rsp), %r8d
movq 0x10(%rsp), %r9
callq 0x11790
addl %ebp, %ebp
jmp 0x110e7
movl (%rsp), %eax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x111a7
movl (%r14,%rcx,4), %edx
movl %edx, 0x4(%rbx,%rcx,8)
incq %rcx
jmp 0x11195
testq %r14, %r14
je 0x111b4
movq %r14, %rdi
callq 0x32b0
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/misc/utils.cpp
// Function: CSA::simpleSuffixSort(unsigned int const*, unsigned int, unsigned int)
short_pair*
simpleSuffixSort(const usint* sequence, uint n, uint threads)
{
  if(sequence == 0 || n == 0) { return 0; }

  skew_pair* pairs = (skew_pair*)new short_pair[n * sizeof(skew_pair) / sizeof(short_pair) + 1];
  uint* keys = new uint[n];               // In text order.
  std::vector<ss_range> unsorted;
  threads = std::max(threads, (uint)1);
  #ifdef MULTITHREAD_SUPPORT
  omp_set_num_threads(threads);
  #endif

  // Initialize pairs.
  #pragma omp parallel for schedule(static)
  for(uint i = 0; i < n; i++) { pairs[i].first = i; pairs[i].second = sequence[i]; }

  // Sort according to first character.
  parallelSort(pairs, pairs + n, skew_comparator);
  unsorted.push_back(ss_range(0, n - 1));
  uint total = setRanks(pairs, keys, n, unsorted, threads, 1);

  if(sizeof(usint) < 2 * sizeof(uint))
  {
    return prefixDoubling(packPairs(pairs, n), keys, unsorted, n, threads, total, 1);
  }
  else
  {
    return prefixTripling(pairs, keys, unsorted, n, threads, total, 1);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
testq %rdi, %rdi
sete %al
testl %esi, %esi
sete %cl
orb %al, %cl
je 0x11338
xorl %ebx, %ebx
jmp 0x1140e
movl %esi, %r14d
movq %rdi, %r13
movl %edx, 0xc(%rsp)
movl %esi, %r15d
leaq 0x8(,%r15,8), %r12
movq %r12, %rdi
callq 0x3030
movq %rax, %rbx
xorl %ebp, %ebp
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x3130
leaq (,%r15,4), %rdi
callq 0x3030
movq %rax, %r12
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
cmpq %rbp, %r15
je 0x1139b
movl %ebp, (%rbx,%rbp,8)
movl (%r13,%rbp,4), %eax
movl %eax, 0x4(%rbx,%rbp,8)
incq %rbp
jmp 0x11385
movl 0xc(%rsp), %ebp
cmpl $0x1, %ebp
adcl $0x0, %ebp
leaq (%rbx,%r15,8), %rsi
movq %rbx, %rdi
callq 0x12209
leal -0x1(%r14), %eax
leaq 0x30(%rsp), %rsi
andl $0x0, (%rsi)
movl %eax, 0x4(%rsi)
leaq 0x10(%rsp), %rdi
callq 0xac2e
leaq 0x10(%rsp), %rcx
pushq $0x1
popq %r9
movq %rbx, %rdi
movq %r12, %rsi
movl %r15d, %edx
movl %ebp, %r8d
callq 0x11790
movl $0x1, (%rsp)
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
movq %r12, %rsi
movl %r14d, %ecx
movl %ebp, %r8d
movl %eax, %r9d
callq 0x110b2
leaq 0x10(%rsp), %rdi
callq 0xb30c
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11424
jmp 0x11424
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xb30c
movq %rbx, %rdi
callq 0x3410
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/misc/utils.cpp
// Function: CSA::simpleSuffixSort(std::pair<unsigned int, unsigned int>*, unsigned int, unsigned int)
short_pair*
simpleSuffixSort(short_pair* pairs, uint n, uint threads)
{
  if(pairs == 0 || n == 0) { return 0; }

  uint* keys = new uint[n];   // In text order.
  std::vector<ss_range> unsorted;
  threads = std::max(threads, (uint)1);
  #ifdef MULTITHREAD_SUPPORT
  omp_set_num_threads(threads);
  #endif

  // Initialize pairs.
  #pragma omp parallel for schedule(static)
  for(uint i = 0; i < n; i++) { pairs[i].first = i; }

  uint total = initialSort(pairs, keys, unsorted, n, threads, 1);
  return prefixDoubling(pairs, keys, unsorted, n, threads, total, 1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
testq %rdi, %rdi
sete %al
testl %esi, %esi
sete %cl
orb %al, %cl
je 0x11458
xorl %ebx, %ebx
jmp 0x114d6
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
movl %esi, %r12d
leaq (,%r12,4), %rdi
callq 0x3030
movq %rax, %r15
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
xorl %eax, %eax
cmpq %rax, %r12
je 0x11490
movl %eax, (%rbx,%rax,8)
incq %rax
jmp 0x11483
cmpl $0x1, %ebp
adcl $0x0, %ebp
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
movl %r12d, %ecx
movl %ebp, %r8d
callq 0x1104a
movl $0x1, (%rsp)
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
movl %r14d, %ecx
movl %ebp, %r8d
movl %eax, %r9d
callq 0x110b2
leaq 0x10(%rsp), %rdi
callq 0xb30c
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xb30c
movq %rbx, %rdi
callq 0x3410
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/misc/utils.cpp
// Function: CSA::mergeRanges(std::vector<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int>>>*, bool)
void
mergeRanges(std::vector<pair_type>* vec, bool parallel)
{
  if(vec == 0 || vec->size() <= 1) { return; }
  if(parallel) { parallelSort(vec->begin(), vec->end()); }
  else         { sequentialSort(vec->begin(), vec->end()); }

  std::vector<pair_type>::iterator prev = vec->begin();
  for(std::vector<pair_type>::iterator curr = prev + 1; curr != vec->end(); ++curr)
  {
    if(prev->second + 1 >= curr->first) { prev->second = std::max(curr->second, prev->second); }
    else { ++prev; *prev = *curr; }
  }
  vec->resize((prev - vec->begin()) + 1);
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x11704
movq %rdi, %rbx
movq (%rdi), %rdi
movq 0x8(%rbx), %rsi
movq %rsi, %rax
subq %rdi, %rax
cmpq $0x9, %rax
jae 0x11706
popq %rbx
retq
callq 0xadc1
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movq %rax, %rdx
movq %rax, %rsi
addq $0x8, %rdx
cmpq %rcx, %rdx
je 0x11750
movl 0x4(%rsi), %edi
leal 0x1(%rdi), %r9d
movl (%rdx), %r8d
cmpl %r8d, %r9d
jb 0x11740
movl 0x4(%rdx), %r8d
cmpl %edi, %r8d
cmoval %r8d, %edi
movl %edi, 0x4(%rsi)
jmp 0x11718
movl %r8d, 0x8(%rsi)
movl 0x4(%rdx), %edi
movl %edi, 0xc(%rsi)
addq $0x8, %rsi
jmp 0x11718
subq %rax, %rsi
sarq $0x3, %rsi
incq %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x11922
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/tools/CreateDb.cc
// Function: CreateExample(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void CreateExample(string filename) {

    Options opts;
    if (!hlkvds::DB::CreateDB(filename, opts)) {
        std::cout << "CreateDB Failed!" << std::endl;
        return;
    }

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xc0, %rsp
movq %rdi, %rbx
leaq 0x70(%rsp), %r14
movq %r14, %rdi
callq 0x14354
leaq 0x50(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6510
pushq $0xa
popq %rcx
movq %rsp, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r15, %rdi
callq 0xfbcc
movl %eax, %ebx
leaq 0x50(%rsp), %rdi
callq 0x6768
testb %bl, %bl
jne 0x6a27
movq 0x2a5bd(%rip), %rdi     # 0x30fd0
leaq 0x175ea(%rip), %rsi     # 0x1e004
callq 0x63e0
movq %rax, %rdi
callq 0x61c0
addq $0xc0, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x6768
movq %rbx, %rdi
callq 0x6660
// File: /workspace/github_cpp_makefile_star2_O2/nikolausmayer[P]SimplePlot/./Sparkline.h
// Function: Sparkline::Sparkline(float const*, unsigned long, unsigned long, unsigned long, bool, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, double, double)
std::string Sparkline( const float* const data,
                         size_t number_of_data_points,
                         size_t this_many_lines_high,
                         size_t this_many_characters_wide,
                         bool enclose_in_box,
                         bool print_colored,
                         std::string title,
                         double max,
                         double min
                       ) 
  {
    return Sparkline( data,
                      number_of_data_points,
                      this_many_lines_high,
                      this_many_characters_wide,
                      enclose_in_box,
                      print_colored,
                      title,
                      (float)max,
                      (float)min
                    );
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x8(%rsp)
movl %r9d, %ebp
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
movq 0x78(%rsp), %rsi
leaq 0x18(%rsp), %rdi
callq 0x2200
cvtsd2ss 0x8(%rsp), %xmm0
cvtsd2ss 0x10(%rsp), %xmm1
movzbl 0x70(%rsp), %eax
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %r14, %r8
movl %ebp, %r9d
leaq 0x18(%rsp), %r10
pushq %r10
pushq %rax
callq 0x34dd
popq %rax
popq %rcx
leaq 0x18(%rsp), %rdi
callq 0x22d8
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x22d8
movq %rbx, %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O2/nikolausmayer[P]SimplePlot/./Sparkline.h
// Function: Sparkline::Sparkline(std::vector<float, std::allocator<float>> const&, unsigned long, unsigned long, bool, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, double, double)
std::string Sparkline( const std::vector<float>& data,
                         size_t this_many_lines_high,
                         size_t this_many_characters_wide,
                         bool enclose_in_box,
                         bool print_colored,
                         std::string title,
                         double max,
                         double min
                       ) 
  {
    return Sparkline( data,
                      this_many_lines_high,
                      this_many_characters_wide,
                      enclose_in_box,
                      print_colored,
                      title,
                      (float)max,
                      (float)min
                    );
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movsd %xmm1, 0x20(%rsp)
movsd %xmm0, 0x18(%rsp)
movl %r9d, 0x14(%rsp)
movl %r8d, %r14d
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
movq 0x80(%rsp), %rsi
leaq 0x28(%rsp), %rbp
movq %rbp, %rdi
callq 0x2200
cvtsd2ss 0x18(%rsp), %xmm0
cvtsd2ss 0x20(%rsp), %xmm1
movq %rbp, (%rsp)
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
movl %r14d, %r8d
movl 0x14(%rsp), %r9d
callq 0x3e05
leaq 0x28(%rsp), %rdi
callq 0x22d8
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x22d8
movq %rbx, %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O2/nikolausmayer[P]SimplePlot/./Sparkline.h
// Function: Sparkline::ShowExampleGaussian[abi:cxx11]()
std::string ShowExampleGaussian()
  {
    std::vector<float> data_vec{
      0.000514092998764,
      0.00147728280398,
      0.00379866200793,
      0.0087406296979,
      0.0179969888377,
      0.0331590462642,
      0.054670024892,
      0.080656908173,
      0.106482668507,
      0.125794409231,
      0.132980760134,
      0.125794409231,
      0.106482668507,
      0.080656908173,
      0.054670024892,
      0.0331590462642,
      0.0179969888377,
      0.0087406296979,
      0.00379866200793,
      0.00147728280398,
      0.000514092998764
    };

    Configuration<float> config;
    config.setHeight(3);
    config.setMin(0);
    config.setMax(0.15);
    config.setBox(true);
    config.setTitle("Gaussian");
    config.setColor(false);
    return Sparkline(data_vec, config);
  }

// Assembly:
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
leaq 0x2ca3(%rip), %rsi      # 0x5504
pushq $0x15
popq %rdx
leaq 0x40(%rsp), %rax
movq %rdx, %rcx
movq %rax, %rdi
rep  movsl (%rsi), %es:(%rdi)
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rcx
movq %rax, %rsi
callq 0x3eb0
leaq 0x28e5(%rip), %rsi      # 0x516f
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x34a2
leaq 0x58(%rsp), %r14
movq $0x1, -0x18(%r14)
andq $0x0, -0x10(%r14)
movw $0x100, -0x8(%r14)      # imm = 0x100
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x2200
movsd 0x2769(%rip), %xmm0     # 0x5030
movsd %xmm0, 0x78(%rsp)
leaq 0x8(%rsp), %rdi
callq 0x22d8
movq $0x3, 0x40(%rsp)
movsd 0x2758(%rip), %xmm0     # 0x5040
movsd %xmm0, 0x78(%rsp)
movb $0x1, 0x50(%rsp)
leaq 0x27ee(%rip), %rsi      # 0x50e8
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x34a2
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x2110
leaq 0x8(%rsp), %rdi
callq 0x22d8
leaq 0x40(%rsp), %rdx
movb $0x0, 0x11(%rdx)
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x3ee6
movq %r14, %rdi
callq 0x22d8
leaq 0x28(%rsp), %rdi
callq 0x409c
movq %rbx, %rax
addq $0x98, %rsp
popq %rbx
popq %r14
retq
jmp 0x2967
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x22d8
jmp 0x296a
movq %rax, %rbx
movq %r14, %rdi
jmp 0x2977
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x22d8
jmp 0x2981
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x409c
movq %rbx, %rdi
callq 0x2290