// File: /workspace/github_cpp_makefile_star2_O2/Juve45[P]batstat/main.cpp
// Function: newPrint()
void newPrint()
{
	char buff[255];
	erase();
	sprintf(buff, "%-30s\n", "Status: ");
	mvaddstr(0, 0, buff);
	
	if(status[0] == 'C')
		attron(COLOR_PAIR(3));
	else
		attron(COLOR_PAIR(2));
	mvaddstr(0, strlen(buff) - 1, status.c_str());

	attron(COLOR_PAIR(1));
	sprintf(buff, "%-30s%.2lf %ch\n", "Max energy:", maxEnergy/1000000, powerUnit);
	mvaddstr(1, 0, buff);
	sprintf(buff, "%-30s%.2lf %ch\n", "Energy left:", currentEnergy/1000000, powerUnit);
	mvaddstr(2, 0, buff);
	sprintf(buff, "%-30s%.2lf %c\n", "Power Consumption:", currentPower/1000000, powerUnit);
	mvaddstr(3, 0, buff);
	sprintf(buff, "%-30s%.2lf%%\n", "Percentage left:", currentEnergy/maxEnergy*100);
	mvaddstr(4, 0, buff);
	sprintf(buff, "%-30s%.2lf %c\n", "Average power Consumption:", (initEnergy - currentEnergy) / 1000000 / (1. * timeElapsed / 3600.), powerUnit);
	
	mvaddstr(5, 0, buff);
	sprintf(buff, "%-30s%2d:%2d:%2d since %.2lf%%\n", "Time elapsed:", timeElapsed/3600, (timeElapsed/60)%60, timeElapsed%60, initEnergy/maxEnergy*100);
	mvaddstr(6, 0, buff);

	sprintf(buff, "= Time   ======== Percent ============================================\n");
	mvaddstr(7, 0, buff);

	for(int i = logIndex; i < logCache.size(); i++)
		mvaddstr(8 + i - logIndex, 0, logCache[i].c_str());

	refresh();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
callq 0x3340
leaq 0xb56e(%rip), %rsi      # 0xf6ae
leaq 0xb56e(%rip), %rdx      # 0xf6b5
leaq -0x130(%rbp), %rdi
xorl %eax, %eax
callq 0x3090
movq 0x15e6c(%rip), %r14     # 0x19fc8
movq (%r14), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3320
cmpl $-0x1, %eax
je 0x417f
movq (%r14), %rdi
leaq -0x130(%rbp), %rsi
pushq $-0x1
popq %rdx
callq 0x30d0
movq 0x1621a(%rip), %rax     # 0x1a3a0
xorl %esi, %esi
cmpb $0x43, (%rax)
sete %sil
movq (%r14), %rdi
orl $0x2, %esi
shll $0x8, %esi
xorl %edx, %edx
callq 0x31a0
movq (%r14), %rbx
leaq -0x130(%rbp), %rdi
callq 0x3160
leal -0x1(%rax), %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3320
cmpl $-0x1, %eax
je 0x41d2
movq (%r14), %rdi
movq 0x161d6(%rip), %rsi     # 0x1a3a0
pushq $-0x1
popq %rdx
callq 0x30d0
movq (%r14), %rdi
movl $0x100, %esi            # imm = 0x100
xorl %edx, %edx
callq 0x31a0
movss 0x1616f(%rip), %xmm0    # 0x1a358
divss 0xae13(%rip), %xmm0     # 0xf004
cvtss2sd %xmm0, %xmm0
movsbl 0x16264(%rip), %ecx     # 0x1a460
leaq 0xb4bb(%rip), %rsi      # 0xf6be
leaq 0xb4c4(%rip), %rdx      # 0xf6ce
leaq -0x130(%rbp), %rdi
movb $0x1, %al
callq 0x3090
movq (%r14), %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x3320
cmpl $-0x1, %eax
je 0x423c
movq (%r14), %rdi
leaq -0x130(%rbp), %rsi
pushq $-0x1
popq %rdx
callq 0x30d0
movss 0x1611c(%rip), %xmm0    # 0x1a360
divss 0xadb8(%rip), %xmm0     # 0xf004
cvtss2sd %xmm0, %xmm0
movsbl 0x16209(%rip), %ecx     # 0x1a460
leaq 0xb460(%rip), %rsi      # 0xf6be
leaq 0xb475(%rip), %rdx      # 0xf6da
leaq -0x130(%rbp), %rdi
movb $0x1, %al
callq 0x3090
movq (%r14), %rdi
pushq $0x2
popq %rsi
xorl %edx, %edx
callq 0x3320
cmpl $-0x1, %eax
je 0x4297
movq (%r14), %rdi
leaq -0x130(%rbp), %rsi
pushq $-0x1
popq %rdx
callq 0x30d0
movss 0x160bd(%rip), %xmm0    # 0x1a35c
divss 0xad5d(%rip), %xmm0     # 0xf004
cvtss2sd %xmm0, %xmm0
movsbl 0x161ae(%rip), %ecx     # 0x1a460
leaq 0xb42e(%rip), %rsi      # 0xf6e7
leaq 0xb436(%rip), %rdx      # 0xf6f6
leaq -0x130(%rbp), %rdi
movb $0x1, %al
callq 0x3090
movq (%r14), %rdi
pushq $0x3
popq %rsi
xorl %edx, %edx
callq 0x3320
cmpl $-0x1, %eax
je 0x42f2
movq (%r14), %rdi
leaq -0x130(%rbp), %rsi
pushq $-0x1
popq %rdx
callq 0x30d0
movss 0x16066(%rip), %xmm0    # 0x1a360
divss 0x16056(%rip), %xmm0    # 0x1a358
mulss 0xacfe(%rip), %xmm0     # 0xf008
cvtss2sd %xmm0, %xmm0
leaq 0xb3f4(%rip), %rsi      # 0xf709
leaq 0xb3fb(%rip), %rdx      # 0xf717
leaq -0x130(%rbp), %rdi
movb $0x1, %al
callq 0x3090
movq (%r14), %rdi
pushq $0x4
popq %rsi
xorl %edx, %edx
callq 0x3320
cmpl $-0x1, %eax
je 0x434e
movq (%r14), %rdi
leaq -0x130(%rbp), %rsi
pushq $-0x1
popq %rdx
callq 0x30d0
movss 0x1600e(%rip), %xmm0    # 0x1a364
subss 0x16002(%rip), %xmm0    # 0x1a360
divss 0xac9e(%rip), %xmm0     # 0xf004
cvtss2sd %xmm0, %xmm0
cvtsi2sdl 0x16002(%rip), %xmm1 # 0x1a374
divsd 0xac96(%rip), %xmm1     # 0xf010
divsd %xmm1, %xmm0
movsbl 0x160db(%rip), %ecx     # 0x1a460
leaq 0xb35b(%rip), %rsi      # 0xf6e7
leaq 0xb395(%rip), %rdx      # 0xf728
leaq -0x130(%rbp), %rdi
movb $0x1, %al
callq 0x3090
movq (%r14), %rdi
pushq $0x5
popq %rsi
xorl %edx, %edx
callq 0x3320
cmpl $-0x1, %eax
je 0x43c5
movq (%r14), %rdi
leaq -0x130(%rbp), %rsi
pushq $-0x1
popq %rdx
callq 0x30d0
movl 0x15fa9(%rip), %esi     # 0x1a374
movl $0xe10, %ecx            # imm = 0xE10
movl %esi, %eax
cltd
idivl %ecx
movl %eax, %ecx
pushq $0x3c
popq %rdi
movl %esi, %eax
cltd
idivl %edi
movl %edx, %r9d
cltd
idivl %edi
movl %edx, %r8d
movss 0x15f74(%rip), %xmm0    # 0x1a364
divss 0x15f60(%rip), %xmm0    # 0x1a358
mulss 0xac08(%rip), %xmm0     # 0xf008
cvtss2sd %xmm0, %xmm0
leaq 0xb338(%rip), %rsi      # 0xf743
leaq 0xb351(%rip), %rdx      # 0xf763
leaq -0x130(%rbp), %rdi
movb $0x1, %al
callq 0x3090
movq (%r14), %rdi
pushq $0x6
popq %rsi
xorl %edx, %edx
callq 0x3320
cmpl $-0x1, %eax
je 0x4444
movq (%r14), %rdi
leaq -0x130(%rbp), %rsi
pushq $-0x1
popq %rdx
callq 0x30d0
leaq 0xb326(%rip), %rsi      # 0xf771
leaq -0x130(%rbp), %rdi
pushq $0x48
popq %rdx
callq 0x3270
movq (%r14), %rdi
pushq $0x7
popq %rsi
xorl %edx, %edx
callq 0x3320
cmpl $-0x1, %eax
je 0x447e
movq (%r14), %rdi
leaq -0x130(%rbp), %rsi
pushq $-0x1
popq %rdx
callq 0x30d0
movslq 0x15ef7(%rip), %r15     # 0x1a37c
leal 0x8(%r15), %r12d
movq %r15, %r13
shlq $0x5, %r13
pushq $-0x1
popq %rbx
movq 0x15fde(%rip), %rax     # 0x1a478
subq 0x15fcf(%rip), %rax     # 0x1a470
sarq $0x5, %rax
cmpq %r15, %rax
jbe 0x44e3
movq (%r14), %rdi
movl %r12d, %esi
subl 0x15ec6(%rip), %esi     # 0x1a37c
xorl %edx, %edx
callq 0x3320
cmpl $-0x1, %eax
je 0x44d7
movq (%r14), %rdi
movq 0x15fa4(%rip), %rax     # 0x1a470
movq (%rax,%r13), %rsi
movl %ebx, %edx
callq 0x30d0
incq %r15
incl %r12d
addq $0x20, %r13
jmp 0x4493
callq 0x34e0
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq