// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
callq 0x3360
leaq 0xcf11(%rip), %rsi      # 0x116be
leaq 0xcf11(%rip), %rdx      # 0x116c5
leaq -0x120(%rbp), %rdi
xorl %eax, %eax
callq 0x30a0
movq 0x157ff(%rip), %r14     # 0x19fc8
movq (%r14), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3340
cmpl $-0x1, %eax
je 0x47ee
movq (%r14), %rdi
leaq -0x120(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x30f0
movq 0x15bb3(%rip), %rax     # 0x1a3a8
xorl %esi, %esi
cmpb $0x43, (%rax)
sete %sil
movq (%r14), %rdi
orl $0x2, %esi
shll $0x8, %esi
xorl %edx, %edx
callq 0x31c0
movq (%r14), %rbx
leaq -0x120(%rbp), %rdi
callq 0x3180
leal -0x1(%rax), %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3340
cmpl $-0x1, %eax
je 0x4843
movq (%r14), %rdi
movq 0x15b6f(%rip), %rsi     # 0x1a3a8
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x30f0
movq (%r14), %rdi
movl $0x100, %esi            # imm = 0x100
xorl %edx, %edx
callq 0x31c0
movss 0x15b06(%rip), %xmm0    # 0x1a360
divss 0xc7a2(%rip), %xmm0     # 0x11004
cvtss2sd %xmm0, %xmm0
movsbl 0x15bfb(%rip), %ecx     # 0x1a468
leaq 0xce5a(%rip), %rsi      # 0x116ce
leaq 0xce63(%rip), %rdx      # 0x116de
leaq -0x120(%rbp), %rdi
movb $0x1, %al
callq 0x30a0
movq (%r14), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x3340
cmpl $-0x1, %eax
je 0x48b1
movq (%r14), %rdi
leaq -0x120(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x30f0
movss 0x15aaf(%rip), %xmm0    # 0x1a368
divss 0xc743(%rip), %xmm0     # 0x11004
cvtss2sd %xmm0, %xmm0
movsbl 0x15b9c(%rip), %ecx     # 0x1a468
leaq 0xcdfb(%rip), %rsi      # 0x116ce
leaq 0xce10(%rip), %rdx      # 0x116ea
leaq -0x120(%rbp), %rdi
movb $0x1, %al
callq 0x30a0
movq (%r14), %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x3340
cmpl $-0x1, %eax
je 0x4910
movq (%r14), %rdi
leaq -0x120(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x30f0
movss 0x15a4c(%rip), %xmm0    # 0x1a364
divss 0xc6e4(%rip), %xmm0     # 0x11004
cvtss2sd %xmm0, %xmm0
movsbl 0x15b3d(%rip), %ecx     # 0x1a468
leaq 0xcdc5(%rip), %rsi      # 0x116f7
leaq 0xcdcd(%rip), %rdx      # 0x11706
leaq -0x120(%rbp), %rdi
movb $0x1, %al
callq 0x30a0
movq (%r14), %rdi
movl $0x3, %esi
xorl %edx, %edx
callq 0x3340
cmpl $-0x1, %eax
je 0x496f
movq (%r14), %rdi
leaq -0x120(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x30f0
movss 0x159f1(%rip), %xmm0    # 0x1a368
divss 0x159e1(%rip), %xmm0    # 0x1a360
mulss 0xc681(%rip), %xmm0     # 0x11008
cvtss2sd %xmm0, %xmm0
leaq 0xcd87(%rip), %rsi      # 0x11719
leaq 0xcd8e(%rip), %rdx      # 0x11727
leaq -0x120(%rbp), %rdi
movb $0x1, %al
callq 0x30a0
movq (%r14), %rdi
movl $0x4, %esi
xorl %edx, %edx
callq 0x3340
cmpl $-0x1, %eax
je 0x49cf
movq (%r14), %rdi
leaq -0x120(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x30f0
movss 0x15995(%rip), %xmm0    # 0x1a36c
subss 0x15989(%rip), %xmm0    # 0x1a368
divss 0xc61d(%rip), %xmm0     # 0x11004
cvtss2sd %xmm0, %xmm0
cvtsi2sdl 0x15989(%rip), %xmm1 # 0x1a37c
divsd 0xc615(%rip), %xmm1     # 0x11010
divsd %xmm1, %xmm0
movsbl 0x15a62(%rip), %ecx     # 0x1a468
leaq 0xccea(%rip), %rsi      # 0x116f7
leaq 0xcd24(%rip), %rdx      # 0x11738
leaq -0x120(%rbp), %rdi
movb $0x1, %al
callq 0x30a0
movq (%r14), %rdi
movl $0x5, %esi
xorl %edx, %edx
callq 0x3340
cmpl $-0x1, %eax
je 0x4a4a
movq (%r14), %rdi
leaq -0x120(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x30f0
movslq 0x1592b(%rip), %r9      # 0x1a37c
imulq $-0x6e5d4c3b, %r9, %rcx # imm = 0x91A2B3C5
shrq $0x20, %rcx
addl %r9d, %ecx
movl %ecx, %eax
shrl $0x1f, %eax
sarl $0xb, %ecx
addl %eax, %ecx
imulq $-0x77777777, %r9, %rax # imm = 0x88888889
shrq $0x20, %rax
addl %r9d, %eax
movl %eax, %edx
shrl $0x1f, %edx
sarl $0x5, %eax
addl %edx, %eax
movslq %eax, %r8
imulq $-0x77777777, %r8, %rax # imm = 0x88888889
shrq $0x20, %rax
addl %r8d, %eax
movl %eax, %edx
shrl $0x1f, %edx
sarl $0x5, %eax
addl %edx, %eax
imull $0x3c, %eax, %eax
imull $0x3c, %r8d, %edx
subl %eax, %r8d
movss 0x158be(%rip), %xmm0    # 0x1a36c
divss 0x158aa(%rip), %xmm0    # 0x1a360
subl %edx, %r9d
mulss 0xc547(%rip), %xmm0     # 0x11008
cvtss2sd %xmm0, %xmm0
leaq 0xcc87(%rip), %rsi      # 0x11753
leaq 0xcca0(%rip), %rdx      # 0x11773
leaq -0x120(%rbp), %rdi
movb $0x1, %al
callq 0x30a0
movq (%r14), %rdi
movl $0x6, %esi
xorl %edx, %edx
callq 0x3340
cmpl $-0x1, %eax
je 0x4b09
movq (%r14), %rdi
leaq -0x120(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x30f0
leaq 0xcc71(%rip), %rsi      # 0x11781
leaq -0x120(%rbp), %rdi
movl $0x48, %edx
callq 0x3290
movq (%r14), %rdi
movl $0x7, %esi
xorl %edx, %edx
callq 0x3340
cmpl $-0x1, %eax
je 0x4b49
movq (%r14), %rdi
leaq -0x120(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x30f0
movslq 0x15834(%rip), %rbx     # 0x1a384
movq 0x15929(%rip), %rax     # 0x1a480
subq 0x1591a(%rip), %rax     # 0x1a478
sarq $0x5, %rax
cmpq %rbx, %rax
jbe 0x4bc3
leal 0x8(%rbx), %r15d
movq %rbx, %r12
shlq $0x5, %r12
movq (%r14), %rdi
movl %r15d, %esi
subl 0x15806(%rip), %esi     # 0x1a384
xorl %edx, %edx
callq 0x3340
cmpl $-0x1, %eax
je 0x4ba2
movq (%r14), %rdi
movq 0x158e4(%rip), %rax     # 0x1a478
movq (%rax,%r12), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x30f0
incq %rbx
movq 0x158d4(%rip), %rax     # 0x1a480
subq 0x158c5(%rip), %rax     # 0x1a478
sarq $0x5, %rax
incl %r15d
addq $0x20, %r12
cmpq %rbx, %rax
ja 0x4b72
callq 0x34f0
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq