// File: 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
subq $0x130, %rsp            # imm = 0x130
callq 0x4400
leaq -0x100(%rbp), %rdi
leaq 0x223e6(%rip), %rsi     # 0x27c64
leaq 0x223e6(%rip), %rdx     # 0x27c6b
movb $0x0, %al
callq 0x40c0
movq 0x3672d(%rip), %rax     # 0x3bfc0
movq (%rax), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x43d0
cmpl $-0x1, %eax
jne 0x58a6
jmp 0x58c1
movq 0x36713(%rip), %rax     # 0x3bfc0
movq (%rax), %rdi
leaq -0x100(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x4110
leaq 0x36b60(%rip), %rdi     # 0x3c428
xorl %eax, %eax
movl %eax, %esi
callq 0x4690
movsbl (%rax), %eax
cmpl $0x43, %eax
jne 0x58f3
movq 0x366e0(%rip), %rax     # 0x3bfc0
movq (%rax), %rdi
movl $0x300, %esi            # imm = 0x300
xorl %eax, %eax
movl %eax, %edx
callq 0x4200
jmp 0x590b
movq 0x366c6(%rip), %rax     # 0x3bfc0
movq (%rax), %rdi
movl $0x200, %esi            # imm = 0x200
xorl %eax, %eax
movl %eax, %edx
callq 0x4200
movq 0x366ae(%rip), %rax     # 0x3bfc0
movq (%rax), %rax
movq %rax, -0x110(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x41b0
movq -0x110(%rbp), %rdi
subq $0x1, %rax
movl %eax, %edx
xorl %esi, %esi
callq 0x43d0
cmpl $-0x1, %eax
jne 0x5943
jmp 0x5974
movq 0x36676(%rip), %rax     # 0x3bfc0
movq (%rax), %rax
movq %rax, -0x118(%rbp)
leaq 0x36acd(%rip), %rdi     # 0x3c428
callq 0x4180
movq -0x118(%rbp), %rdi
movq %rax, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x4110
movq 0x36645(%rip), %rax     # 0x3bfc0
movq (%rax), %rdi
movl $0x100, %esi            # imm = 0x100
xorl %eax, %eax
movl %eax, %edx
callq 0x4200
leaq -0x100(%rbp), %rdi
movss 0x36a45(%rip), %xmm0    # 0x3c3e0
movss 0x21661(%rip), %xmm1    # 0x27004
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsbl 0x36b36(%rip), %ecx     # 0x3c4e8
leaq 0x222bb(%rip), %rsi     # 0x27c74
leaq 0x222c4(%rip), %rdx     # 0x27c84
movb $0x1, %al
callq 0x40c0
movq 0x365f2(%rip), %rax     # 0x3bfc0
movq (%rax), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x43d0
cmpl $-0x1, %eax
jne 0x59e4
jmp 0x59ff
movq 0x365d5(%rip), %rax     # 0x3bfc0
movq (%rax), %rdi
leaq -0x100(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x4110
leaq -0x100(%rbp), %rdi
movss 0x369da(%rip), %xmm0    # 0x3c3e8
movss 0x215ee(%rip), %xmm1    # 0x27004
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsbl 0x36ac3(%rip), %ecx     # 0x3c4e8
leaq 0x22248(%rip), %rsi     # 0x27c74
leaq 0x2225d(%rip), %rdx     # 0x27c90
movb $0x1, %al
callq 0x40c0
movq 0x3657f(%rip), %rax     # 0x3bfc0
movq (%rax), %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x43d0
cmpl $-0x1, %eax
jne 0x5a57
jmp 0x5a72
movq 0x36562(%rip), %rax     # 0x3bfc0
movq (%rax), %rdi
leaq -0x100(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x4110
leaq -0x100(%rbp), %rdi
movss 0x36963(%rip), %xmm0    # 0x3c3e4
movss 0x2157b(%rip), %xmm1    # 0x27004
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsbl 0x36a50(%rip), %ecx     # 0x3c4e8
leaq 0x221fe(%rip), %rsi     # 0x27c9d
leaq 0x22206(%rip), %rdx     # 0x27cac
movb $0x1, %al
callq 0x40c0
movq 0x3650c(%rip), %rax     # 0x3bfc0
movq (%rax), %rdi
movl $0x3, %esi
xorl %edx, %edx
callq 0x43d0
cmpl $-0x1, %eax
jne 0x5aca
jmp 0x5ae5
movq 0x364ef(%rip), %rax     # 0x3bfc0
movq (%rax), %rdi
leaq -0x100(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x4110
leaq -0x100(%rbp), %rdi
movss 0x368f4(%rip), %xmm0    # 0x3c3e8
divss 0x368e4(%rip), %xmm0    # 0x3c3e0
movss 0x21504(%rip), %xmm1    # 0x27008
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x221ac(%rip), %rsi     # 0x27cbf
leaq 0x221b3(%rip), %rdx     # 0x27ccd
movb $0x1, %al
callq 0x40c0
movq 0x36498(%rip), %rax     # 0x3bfc0
movq (%rax), %rdi
movl $0x4, %esi
xorl %edx, %edx
callq 0x43d0
cmpl $-0x1, %eax
jne 0x5b3e
jmp 0x5b59
movq 0x3647b(%rip), %rax     # 0x3bfc0
movq (%rax), %rdi
leaq -0x100(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x4110
leaq -0x100(%rbp), %rdi
movss 0x36884(%rip), %xmm0    # 0x3c3ec
subss 0x36878(%rip), %xmm0    # 0x3c3e8
movss 0x2148c(%rip), %xmm1    # 0x27004
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
cvtsi2sdl 0x36874(%rip), %xmm2 # 0x3c3fc
movsd 0x21490(%rip), %xmm1    # 0x27020
mulsd %xmm2, %xmm1
movsd 0x2147c(%rip), %xmm2    # 0x27018
divsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsbl 0x3693d(%rip), %ecx     # 0x3c4e8
leaq 0x220eb(%rip), %rsi     # 0x27c9d
leaq 0x22125(%rip), %rdx     # 0x27cde
movb $0x1, %al
callq 0x40c0
movq 0x363f9(%rip), %rax     # 0x3bfc0
movq (%rax), %rdi
movl $0x5, %esi
xorl %edx, %edx
callq 0x43d0
cmpl $-0x1, %eax
jne 0x5bdd
jmp 0x5bf8
movq 0x363dc(%rip), %rax     # 0x3bfc0
movq (%rax), %rdi
leaq -0x100(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x4110
leaq -0x100(%rbp), %rdi
movl 0x367f7(%rip), %eax     # 0x3c3fc
movl $0xe10, %ecx            # imm = 0xE10
cltd
idivl %ecx
movl %eax, %ecx
movl 0x367e7(%rip), %eax     # 0x3c3fc
movl $0x3c, %esi
cltd
idivl %esi
movl $0x3c, %esi
cltd
idivl %esi
movl %edx, %r8d
movl 0x367ce(%rip), %eax     # 0x3c3fc
movl $0x3c, %esi
cltd
idivl %esi
movl %edx, %r9d
movss 0x367ab(%rip), %xmm0    # 0x3c3ec
divss 0x36797(%rip), %xmm0    # 0x3c3e0
movss 0x213b7(%rip), %xmm1    # 0x27008
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x22099(%rip), %rsi     # 0x27cf9
leaq 0x220b2(%rip), %rdx     # 0x27d19
movb $0x1, %al
callq 0x40c0
movq 0x3634b(%rip), %rax     # 0x3bfc0
movq (%rax), %rdi
movl $0x6, %esi
xorl %edx, %edx
callq 0x43d0
cmpl $-0x1, %eax
jne 0x5c8b
jmp 0x5ca6
movq 0x3632e(%rip), %rax     # 0x3bfc0
movq (%rax), %rdi
leaq -0x100(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x4110
leaq -0x100(%rbp), %rdi
leaq 0x22073(%rip), %rsi     # 0x27d27
movb $0x0, %al
callq 0x40c0
movq 0x362fe(%rip), %rax     # 0x3bfc0
movq (%rax), %rdi
movl $0x7, %esi
xorl %edx, %edx
callq 0x43d0
cmpl $-0x1, %eax
jne 0x5cd8
jmp 0x5cf3
movq 0x362e1(%rip), %rax     # 0x3bfc0
movq (%rax), %rdi
leaq -0x100(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x4110
movl 0x3670b(%rip), %eax     # 0x3c404
movl %eax, -0x104(%rbp)
movslq -0x104(%rbp), %rax
movq %rax, -0x120(%rbp)
leaq 0x367e4(%rip), %rdi     # 0x3c4f8
callq 0x66b0
movq %rax, %rcx
movq -0x120(%rbp), %rax
cmpq %rcx, %rax
jae 0x5da3
movq 0x36291(%rip), %rax     # 0x3bfc0
movq (%rax), %rdi
movl -0x104(%rbp), %esi
addl $0x8, %esi
subl 0x366c3(%rip), %esi     # 0x3c404
xorl %edx, %edx
callq 0x43d0
cmpl $-0x1, %eax
jne 0x5d4f
jmp 0x5d8f
movq 0x3626a(%rip), %rax     # 0x3bfc0
movq (%rax), %rax
movq %rax, -0x128(%rbp)
movslq -0x104(%rbp), %rsi
leaq 0x3678a(%rip), %rdi     # 0x3c4f8
callq 0x66d0
movq %rax, %rdi
callq 0x4180
movq -0x128(%rbp), %rdi
movq %rax, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x4110
movl -0x104(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x104(%rbp)
jmp 0x5cff
callq 0x45f0
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nopw %cs:(%rax,%rax)