// File: /workspace/github_cpp_makefile_star2_O3/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, %r12d
movq %rdi, %r15
movq 0x8(%rdi), %rdi
callq 0x18704
movl %eax, %ebx
movq 0x10(%r15), %rdi
callq 0x1ab44
movl %eax, %ebp
addl %ebx, %ebp
movq 0x18(%r15), %rdi
callq 0x16f98
movl %eax, %r14d
movq 0x20(%r15), %rdi
callq 0x16f98
movl %eax, %ebx
addl %r14d, %ebx
addl %ebp, %ebx
testl %r12d, %r12d
je 0x1435c
movq 0x13cdd(%rip), %r14     # 0x27fd0
leaq 0xa830(%rip), %rsi      # 0x1eb2a
movl $0x11, %edx
movq %r14, %rdi
callq 0x32b0
movl %ebx, %eax
cvtsi2sd %rax, %xmm0
mulsd 0xa0ba(%rip), %xmm0     # 0x1e3d0
movq %r14, %rdi
callq 0x33d0
movq %rax, %r14
leaq 0xa28d(%rip), %rsi      # 0x1e5b5
movl $0x3, %edx
movq %rax, %rdi
callq 0x32b0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3190
xorl %ebp, %ebp
cmpb $0x1, 0x49(%r15)
movl $0x0, %r14d
jne 0x143a0
movq 0x28(%r15), %rdi
callq 0x1ab44
movl %eax, %r14d
movq 0x30(%r15), %rdi
callq 0x16f98
movl %eax, %ebp
addl %r14d, %ebp
movq 0x38(%r15), %rdi
callq 0x1ab44
movl %eax, %r13d
movq 0x40(%r15), %rdi
callq 0x16f98
movl %eax, %r14d
addl %r13d, %r14d
testb %r12b, %r12b
je 0x14536
cmpb $0x1, 0x49(%r15)
jne 0x14494
movq 0x13c15(%rip), %r15     # 0x27fd0
leaq 0xa77a(%rip), %rsi      # 0x1eb3c
movl $0x11, %edx
movq %r15, %rdi
callq 0x32b0
movl %ebp, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x9fef(%rip), %xmm0     # 0x1e3d0
movq %r15, %rdi
callq 0x33d0
movq %rax, %r13
leaq 0xa1c2(%rip), %r12      # 0x1e5b5
movl $0x3, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x32b0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq %r13, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3190
leaq 0xa71c(%rip), %rsi      # 0x1eb4e
movl $0x11, %edx
movq %r15, %rdi
callq 0x32b0
movl %r14d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x9f7e(%rip), %xmm0     # 0x1e3d0
movq %r15, %rdi
callq 0x33d0
movq %rax, %r15
movl $0x3, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x32b0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3190
addl %ebp, %ebx
addl %r14d, %ebx
addl $0x50, %ebx
movq 0x13b2d(%rip), %r14     # 0x27fd0
leaq 0xa133(%rip), %rsi      # 0x1e5dd
movl $0x11, %edx
movq %r14, %rdi
callq 0x32b0
xorps %xmm0, %xmm0
cvtsi2sd %rbx, %xmm0
mulsd 0x9f09(%rip), %xmm0     # 0x1e3d0
movq %r14, %rdi
callq 0x33d0
movq %rax, %r15
leaq 0xa0dc(%rip), %rsi      # 0x1e5b5
movl $0x3, %edx
movq %rax, %rdi
callq 0x32b0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3190
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3190
jmp 0x1453e
addl %ebp, %ebx
addl %r14d, %ebx
addl $0x50, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop