// File: /workspace/github_cpp_makefile_star2_O3/trapexit[P]bbf/src/info.cpp
// Function: InfoPrinter::print(unsigned long)
void
InfoPrinter::print(const size_t current_block_)
{
  const double current_time      = Time::get_monotonic();
  const size_t badcount          = _badblocks->size();
  const size_t processed_blocks  = (current_block_ - _start_block);
  const size_t total_blocks      = (_end_block - _start_block);
  const size_t blocks_left       = (total_blocks - processed_blocks);
  const double percentage        = (((double)processed_blocks / total_blocks) * 100.0);
  const double time_passed       = (current_time - _start_time);
  const double blocks_per_second = ((double)processed_blocks / time_passed);
  const size_t time_left         = ((double)blocks_left / blocks_per_second);

  std::cout << "\x1B" << '8'
            << "\x1B[2K"
            << "Current: " << current_block_ << " ("
            << std::fixed
            << std::setprecision(2)
            << percentage
            << "%); bps: " << blocks_per_second
            << "; eta: "
            << std::setfill('0') << std::setw(2)
            << (time_left/(60*60)) << ':'
            << std::setfill('0') << std::setw(2)
            << ((time_left/60)%60)  << ':'
            << std::setfill('0') << std::setw(2)
            << (time_left%60)
            << "; bad: " << badcount;
  if(badcount)
    std::cout << "; last: " << (*_badblocks)[badcount-1];
  std::cout << std::endl << "\x1B[2K" << std::flush;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r12
movq %rdi, %rbx
callq 0x15340
movq 0x18(%rbx), %rax
movq (%rax), %rbp
movq 0x8(%rax), %r14
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %rax
movq %r12, %rdx
subq %rcx, %rdx
subq %rcx, %rax
movq %rax, %xmm1
subq %rdx, %rax
movq %rdx, %xmm2
movq 0x7ec8(%rip), %xmm3     # 0x16a50
punpckldq %xmm3, %xmm2    # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
movapd 0x7ecc(%rip), %xmm4     # 0x16a60
subpd %xmm4, %xmm2
movapd %xmm2, %xmm5
unpckhpd %xmm2, %xmm5            # xmm5 = xmm5[1],xmm2[1]
addsd %xmm2, %xmm5
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm4, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
movapd %xmm5, %xmm1
divsd %xmm2, %xmm1
mulsd 0x7ea8(%rip), %xmm1     # 0x16a70
movapd %xmm1, 0x10(%rsp)
subsd (%rbx), %xmm0
divsd %xmm0, %xmm5
movapd %xmm5, 0x20(%rsp)
movq %rax, %xmm0
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
subpd %xmm4, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd %xmm5, %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x7e6b(%rip), %xmm1     # 0x16a78
cvttsd2si %xmm1, %r15
andq %rcx, %r15
orq %rax, %r15
movq 0x15399(%rip), %r13     # 0x23fb8
leaq 0x7e60(%rip), %rsi      # 0x16a86
movl $0x1, %edx
movq %r13, %rdi
callq 0x4500
leaq 0xd(%rsp), %rsi
movb $0x38, (%rsi)
movl $0x1, %edx
movq %r13, %rdi
callq 0x4500
movq %rax, %r13
leaq 0x7e2f(%rip), %rsi      # 0x16a81
movl $0x4, %edx
movq %rax, %rdi
callq 0x4500
leaq 0x7e22(%rip), %rsi      # 0x16a88
movl $0x9, %edx
movq %r13, %rdi
callq 0x4500
movq %r13, %rdi
movq %r12, %rsi
callq 0x4300
movq %rax, %r12
leaq 0x7657(%rip), %rsi      # 0x162df
movl $0x2, %edx
movq %rax, %rdi
callq 0x4500
movq (%r12), %rax
movq -0x18(%rax), %rcx
movl $0xfffffefb, %edx       # imm = 0xFFFFFEFB
andl 0x18(%r12,%rcx), %edx
orl $0x4, %edx
movl %edx, 0x18(%r12,%rcx)
movq -0x18(%rax), %rax
movq $0x2, 0x8(%r12,%rax)
movq %r12, %rdi
movaps 0x10(%rsp), %xmm0
callq 0x4670
movq %rax, %r12
leaq 0x7dbf(%rip), %rsi      # 0x16a92
movl $0x9, %edx
movq %rax, %rdi
callq 0x4500
movq %r12, %rdi
movaps 0x20(%rsp), %xmm0
callq 0x4670
movq %rax, %r12
leaq 0x7da5(%rip), %rsi      # 0x16a9c
movl $0x7, %edx
movq %rax, %rdi
callq 0x4500
movq (%r12), %rax
movq -0x18(%rax), %rcx
leaq (%r12,%rcx), %r13
cmpb $0x0, 0xe1(%r12,%rcx)
jne 0xed34
movq %r13, %rdi
movl $0x20, %esi
callq 0x4480
movb $0x1, 0xe1(%r13)
movq (%r12), %rax
movq %r14, 0x10(%rsp)
movq %rbp, 0x20(%rsp)
subq %rbp, %r14
movb $0x30, 0xe0(%r13)
movq -0x18(%rax), %rax
movq $0x2, 0x10(%r12,%rax)
movq %r15, %rax
shrq $0x4, %rax
movabsq $0x91a2b3c4d5e6f81, %rcx # imm = 0x91A2B3C4D5E6F81
mulq %rcx
shrq $0x3, %rdx
movq %r12, %rdi
movq %rdx, %rsi
callq 0x4300
leaq 0xe(%rsp), %rsi
movb $0x3a, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x4500
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rcx
leaq (%rcx,%r13), %rbp
cmpb $0x0, 0xe1(%r13,%rcx)
jne 0xedbf
movq %rbp, %rdi
movl $0x20, %esi
callq 0x4480
movb $0x1, 0xe1(%rbp)
movq (%r13), %rax
movq %r14, %r12
sarq $0x3, %r12
movb $0x30, 0xe0(%rbp)
movq -0x18(%rax), %rax
movq $0x2, 0x10(%r13,%rax)
movabsq $-0x7777777777777777, %rcx # imm = 0x8888888888888889
movq %r15, %rax
mulq %rcx
movq %rdx, %rsi
shrq $0x5, %rsi
imulq $0x3c, %rsi, %rax
subq %rax, %r15
movabsq $0x888888888888889, %rcx # imm = 0x888888888888889
movq %rsi, %rax
mulq %rcx
shrq %rdx
imulq $0x3c, %rdx, %rax
subq %rax, %rsi
movq %r13, %rdi
callq 0x4300
leaq 0xf(%rsp), %rsi
movb $0x3a, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x4500
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rcx
leaq (%rcx,%r13), %rbp
cmpb $0x0, 0xe1(%r13,%rcx)
jne 0xee60
movq %rbp, %rdi
movl $0x20, %esi
callq 0x4480
movb $0x1, 0xe1(%rbp)
movq (%r13), %rax
movb $0x30, 0xe0(%rbp)
movq -0x18(%rax), %rax
movq $0x2, 0x10(%r13,%rax)
movq %r13, %rdi
movq %r15, %rsi
callq 0x4300
movq %rax, %r15
leaq 0x7c1b(%rip), %rsi      # 0x16aa4
movl $0x7, %edx
movq %rax, %rdi
callq 0x4500
movq %r15, %rdi
movq %r12, %rsi
callq 0x4300
movq 0x10(%rsp), %rax
cmpq 0x20(%rsp), %rax
je 0xeedc
movq 0x15104(%rip), %r15     # 0x23fb8
leaq 0x7bf1(%rip), %rsi      # 0x16aac
movl $0x8, %edx
movq %r15, %rdi
callq 0x4500
movq 0x18(%rbx), %rax
movq (%rax), %rax
movq -0x8(%rax,%r14), %rsi
movq %r15, %rdi
callq 0x4300
movq 0x150d5(%rip), %rbx     # 0x23fb8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4480
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4050
movq %rax, %rdi
callq 0x4310
movq %rax, %rbx
leaq 0x7b6d(%rip), %rsi      # 0x16a81
movl $0x4, %edx
movq %rax, %rdi
callq 0x4500
movq %rbx, %rdi
callq 0x4310
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq