// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/docarray.cpp
// Function: CSA::DocArray::reportSize(bool) const
usint
DocArray::reportSize(bool print) const
{
  usint bytes = sizeof(*this);

  usint tree_bytes = this->leaf_ranges->reportSize() +
    this->first_children->reportSize() +
    this->parents->reportSize() +
    this->next_leaves->reportSize();
  if(print)
  {
    std::cout << "Tree:            " << (tree_bytes / (double)MEGABYTE) << " MB" << std::endl;
  }

  usint rule_bytes = 0, block_bytes = 0;
  if(this->hasGrammar())
  {
    rule_bytes = this->rule_borders->reportSize() + this->rules->reportSize();
    block_bytes = this->block_borders->reportSize() + this->blocks->reportSize();
  }
  if(print && this->hasGrammar())
  {
    std::cout << "Rules:           " << (rule_bytes / (double)MEGABYTE) << " MB" << std::endl;
    std::cout << "Blocks:          " << (block_bytes / (double)MEGABYTE) << " MB" << std::endl;
  }

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

  return bytes;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %r14
movq 0x8(%rdi), %rdi
callq 0x13c50
movl %eax, %ebx
movq 0x10(%r14), %rdi
callq 0x14ada
movl %eax, %r15d
addl %ebx, %r15d
movq 0x18(%r14), %rdi
callq 0x12bd4
movl %eax, %r12d
movq 0x20(%r14), %rdi
callq 0x12bd4
movl %eax, %ebx
addl %r12d, %ebx
addl %r15d, %ebx
testl %ebp, %ebp
je 0x10ad8
movq 0x13532(%rip), %rdi     # 0x23fd0
leaq 0x8045(%rip), %rsi      # 0x18aea
callq 0x3210
movl %ebx, %ecx
cvtsi2sd %rcx, %xmm0
mulsd 0x78d7(%rip), %xmm0     # 0x18390
movq %rax, %rdi
callq 0x33b0
leaq 0x7aad(%rip), %rsi      # 0x18575
movq %rax, %rdi
callq 0x3210
movq %rax, %rdi
callq 0x3100
xorl %r15d, %r15d
cmpb $0x1, 0x49(%r14)
movl $0x0, %r12d
jne 0x10b1e
movq 0x28(%r14), %rdi
callq 0x14ada
movl %eax, %r12d
movq 0x30(%r14), %rdi
callq 0x12bd4
movl %eax, %r15d
addl %r12d, %r15d
movq 0x38(%r14), %rdi
callq 0x14ada
movl %eax, %r13d
movq 0x40(%r14), %rdi
callq 0x12bd4
movl %eax, %r12d
addl %r13d, %r12d
testb %bpl, %bpl
je 0x10c09
cmpb $0x1, 0x49(%r14)
jne 0x10bb4
movq 0x13497(%rip), %r14     # 0x23fd0
leaq 0x7fbc(%rip), %rsi      # 0x18afc
movq %r14, %rdi
callq 0x3210
movl %r15d, %ecx
cvtsi2sd %rcx, %xmm0
mulsd 0x7838(%rip), %xmm0     # 0x18390
movq %rax, %rdi
callq 0x33b0
leaq 0x7a0e(%rip), %r13      # 0x18575
movq %rax, %rdi
movq %r13, %rsi
callq 0x3210
movq %rax, %rdi
callq 0x3100
leaq 0x7f8d(%rip), %rsi      # 0x18b0e
movq %r14, %rdi
callq 0x3210
movl %r12d, %ecx
cvtsi2sd %rcx, %xmm0
mulsd 0x77f7(%rip), %xmm0     # 0x18390
movq %rax, %rdi
callq 0x33b0
movq %rax, %rdi
movq %r13, %rsi
callq 0x3210
movq %rax, %rdi
callq 0x3100
addl %r15d, %ebx
addl %r12d, %ebx
addl $0x50, %ebx
movq 0x1340c(%rip), %r14     # 0x23fd0
leaq 0x79d2(%rip), %rsi      # 0x1859d
movq %r14, %rdi
callq 0x3210
cvtsi2sd %rbx, %xmm0
mulsd 0x77b0(%rip), %xmm0     # 0x18390
movq %rax, %rdi
callq 0x33b0
leaq 0x7986(%rip), %rsi      # 0x18575
movq %rax, %rdi
callq 0x3210
movq %rax, %rdi
callq 0x3100
movq %r14, %rdi
callq 0x3100
jmp 0x10c12
addl %r15d, %ebx
addl %r12d, %ebx
addl $0x50, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop