// File: adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::reportSize(bool) const
usint
RLCSA::reportSize(bool print) const
{
  usint bytes = 0, temp = 0, bwt = 0;

  for(usint c = 0; c < CHARS; c++)
  {
    if(this->array[c])
    {
      bytes += this->array[c]->reportSize();
      bwt += this->array[c]->getCompressedSize();
    }
  }
  bytes += sizeof(*this) + this->alphabet->reportSize() + this->end_points->reportSize();
  if(print)
  {
    std::cout << "RLCSA:           " << (bytes / (double)MEGABYTE) << " MB" << std::endl;
    std::cout << "  BWT only:      " << (bwt / (double)MEGABYTE) << " MB" << std::endl;
  }

  if(this->support_locate || this->support_display)
  {
    temp = this->sa_samples->reportSize();
    if(print) { std::cout << "SA samples:      " << (temp / (double)MEGABYTE) << " MB" << std::endl; }
    bytes += temp;
  }

  if(print)
  {
    std::cout << "Total size:      " << (bytes / (double)MEGABYTE) << " MB" << std::endl;
    std::cout << std::endl;
  }

  return bytes;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0x100, -0x1c(%rbp)     # imm = 0x100
jae 0xb9dd
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
cmpq $0x0, 0x8(%rax,%rcx,8)
je 0xb9d0
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq 0x8(%rax,%rcx,8), %rdi
callq 0x20a60
movl %eax, %ecx
movq -0x28(%rbp), %rax
addl -0x10(%rbp), %ecx
movl %ecx, -0x10(%rbp)
movl -0x1c(%rbp), %ecx
movq 0x8(%rax,%rcx,8), %rdi
callq 0x1f730
addl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
jmp 0xb9d2
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xb988
movq -0x28(%rbp), %rax
movq 0x808(%rax), %rdi
callq 0x17250
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, %ecx
addq $0x830, %rcx            # imm = 0x830
movq %rcx, -0x30(%rbp)
movq 0x828(%rax), %rdi
callq 0x20070
movq -0x30(%rbp), %rcx
movl %eax, %eax
addq %rax, %rcx
movl -0x10(%rbp), %eax
addq %rcx, %rax
movl %eax, -0x10(%rbp)
testb $0x1, -0x9(%rbp)
je 0xbac3
movq 0x2c5a1(%rip), %rdi     # 0x37fd0
movq %rdi, -0x38(%rbp)
leaq 0x1db41(%rip), %rsi     # 0x2957b
callq 0x32a0
movq %rax, %rdi
movl -0x10(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd 0x1d5be(%rip), %xmm1    # 0x29010
mulsd %xmm1, %xmm0
callq 0x3570
movq %rax, %rdi
leaq 0x1db28(%rip), %rsi     # 0x2958d
callq 0x32a0
movq %rax, %rdi
movq 0x2c53c(%rip), %rsi     # 0x37fb0
callq 0x3300
movq -0x38(%rbp), %rdi
leaq 0x1db0d(%rip), %rsi     # 0x29591
callq 0x32a0
movq %rax, %rdi
movl -0x18(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd 0x1d90c(%rip), %xmm1    # 0x293a8
divsd %xmm1, %xmm0
callq 0x3570
movq %rax, %rdi
leaq 0x1dade(%rip), %rsi     # 0x2958d
callq 0x32a0
movq %rax, %rdi
movq 0x2c4f2(%rip), %rsi     # 0x37fb0
callq 0x3300
movq -0x28(%rbp), %rax
testb $0x1, 0x818(%rax)
jne 0xbadd
movq -0x28(%rbp), %rax
testb $0x1, 0x819(%rax)
je 0xbb4c
movq -0x28(%rbp), %rax
movq 0x810(%rax), %rdi
callq 0x14ad0
movl %eax, -0x14(%rbp)
testb $0x1, -0x9(%rbp)
je 0xbb43
movq 0x2c4d3(%rip), %rdi     # 0x37fd0
leaq 0x1da9f(%rip), %rsi     # 0x295a3
callq 0x32a0
movq %rax, %rdi
movl -0x14(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd 0x1d88c(%rip), %xmm1    # 0x293a8
divsd %xmm1, %xmm0
callq 0x3570
movq %rax, %rdi
leaq 0x1da5e(%rip), %rsi     # 0x2958d
callq 0x32a0
movq %rax, %rdi
movq 0x2c472(%rip), %rsi     # 0x37fb0
callq 0x3300
movl -0x14(%rbp), %eax
addl -0x10(%rbp), %eax
movl %eax, -0x10(%rbp)
testb $0x1, -0x9(%rbp)
je 0xbbb2
movq 0x2c477(%rip), %rdi     # 0x37fd0
leaq 0x1da55(%rip), %rsi     # 0x295b5
callq 0x32a0
movq %rax, %rdi
movl -0x10(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd 0x1d830(%rip), %xmm1    # 0x293a8
divsd %xmm1, %xmm0
callq 0x3570
movq %rax, %rdi
leaq 0x1da02(%rip), %rsi     # 0x2958d
callq 0x32a0
movq %rax, %rdi
movq 0x2c416(%rip), %rsi     # 0x37fb0
callq 0x3300
movq 0x2c42a(%rip), %rdi     # 0x37fd0
movq 0x2c403(%rip), %rsi     # 0x37fb0
callq 0x3300
movl -0x10(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)