// File: acherkaoui[P]HTOP/terminal/terminal.cpp
// Function: Curses::printCpu()
void Curses::printCpu()
{
	int x = 0;
	print(_cpu, x++, 2, "                                     "
		"                   ", 2);
	print(_cpu, x++, 2, ("                         " +
		data.cpu.getModuleName()).c_str(), 8);
	print(_cpu, x++, 2, "                                     "
		"                   ", 2);

	x++;
	std::vector<CPUData> cpu = data.cpu.getStats();

	mvwprintw(_cpu, x++, 2, " Threads: %s", std::to_string(cpu.size()).c_str());
	x++;
	print(_cpu, x, 2, " cpu", 7);
	print(_cpu, x, 35, "Active", 8);
	print(_cpu, x++, 42, "Idle", 4);
	x++;

	for(size_t i = 0; i < cpu.size(); ++i) {
		print(_cpu, x, 2,  (" " + cpu[i].cpu).c_str(), 7);
		ProgressBar(_cpu, x, 9, cpu[i].active);
		print(_cpu, x, 32, ( "   " + std::to_string(cpu[i].active).substr(0, 5) + "%%").c_str(), 8);
		print(_cpu, x++, 40, ( "   " + std::to_string(cpu[i].idle).substr(0, 5) + "%%").c_str(), 4);
		x++;
	}
	print(_cpu, x++, 2, "                                     "
		"                   ", 2);

	mvwin(_cpu  , 1, 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x260, %rsp            # imm = 0x260
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x200(%rbp)
movl $0x0, -0xc(%rbp)
movq 0x6b8(%rdi), %rsi
movl -0xc(%rbp), %edx
movl %edx, %eax
incl %eax
movl %eax, -0xc(%rbp)
leaq 0x2ddc(%rip), %r8       # 0x147f5
movl $0x2, %r9d
movl %r9d, %ecx
callq 0xfad0
movq -0x200(%rbp), %rsi
movq 0x6b8(%rsi), %rax
movq %rax, -0x1f8(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x1ec(%rbp)
incl %eax
movl %eax, -0xc(%rbp)
addq $0x20, %rsi
leaq -0x50(%rbp), %rdi
movq %rdi, -0x1e8(%rbp)
callq 0xbcf0
movq -0x1e8(%rbp), %rdx
leaq 0x2da8(%rip), %rsi      # 0x14814
leaq -0x30(%rbp), %rdi
callq 0x12990
jmp 0x11a77
leaq -0x30(%rbp), %rdi
callq 0x41f0
movq -0x200(%rbp), %rdi
movq -0x1f8(%rbp), %rsi
movl -0x1ec(%rbp), %edx
movq %rax, %r8
movl $0x2, %ecx
movl $0x8, %r9d
callq 0xfad0
jmp 0x11aa9
leaq -0x30(%rbp), %rdi
callq 0x42a0
leaq -0x50(%rbp), %rdi
callq 0x42a0
movq -0x200(%rbp), %rdi
movq 0x6b8(%rdi), %rsi
movl -0xc(%rbp), %edx
movl %edx, %eax
incl %eax
movl %eax, -0xc(%rbp)
leaq 0x2d1b(%rip), %r8       # 0x147f5
movl $0x2, %r9d
movl %r9d, %ecx
callq 0xfad0
movq -0x200(%rbp), %rsi
movl -0xc(%rbp), %eax
incl %eax
movl %eax, -0xc(%rbp)
addq $0x20, %rsi
leaq -0x78(%rbp), %rdi
movq %rdi, -0x218(%rbp)
callq 0xc270
movq -0x200(%rbp), %rax
movq -0x218(%rbp), %rdi
movq 0x6b8(%rax), %rax
movq %rax, -0x210(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x204(%rbp)
incl %eax
movl %eax, -0xc(%rbp)
callq 0xca70
movq %rax, %rsi
leaq -0x98(%rbp), %rdi
callq 0x129e0
jmp 0x11b4b
leaq -0x98(%rbp), %rdi
callq 0x41f0
movq -0x210(%rbp), %rdi
movl -0x204(%rbp), %esi
movq %rax, %r8
leaq 0x2d93(%rip), %rcx      # 0x14901
xorl %eax, %eax
movl $0x2, %edx
callq 0x4110
jmp 0x11b7c
leaq -0x98(%rbp), %rdi
callq 0x42a0
movq -0x200(%rbp), %rdi
movl -0xc(%rbp), %eax
incl %eax
movl %eax, -0xc(%rbp)
movq 0x6b8(%rdi), %rsi
movl -0xc(%rbp), %edx
leaq 0x2d66(%rip), %r8       # 0x1490e
movl $0x2, %ecx
movl $0x7, %r9d
callq 0xfad0
jmp 0x11bba
movq -0x200(%rbp), %rdi
movq 0x6b8(%rdi), %rsi
movl -0xc(%rbp), %edx
leaq 0x2d41(%rip), %r8       # 0x14913
movl $0x23, %ecx
movl $0x8, %r9d
callq 0xfad0
jmp 0x11be4
movq -0x200(%rbp), %rdi
movq 0x6b8(%rdi), %rsi
movl -0xc(%rbp), %edx
movl %edx, %eax
incl %eax
movl %eax, -0xc(%rbp)
leaq 0x2d17(%rip), %r8       # 0x1491a
movl $0x2a, %ecx
movl $0x4, %r9d
callq 0xfad0
jmp 0x11c15
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movq $0x0, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x220(%rbp)
leaq -0x78(%rbp), %rdi
callq 0xca70
movq %rax, %rcx
movq -0x220(%rbp), %rax
cmpq %rcx, %rax
jae 0x120ad
movq -0x200(%rbp), %rax
movq 0x6b8(%rax), %rax
movq %rax, -0x230(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x224(%rbp)
movq -0xa0(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0xcaa0
movq %rax, %rdx
leaq 0x2ba1(%rip), %rsi      # 0x1482c
leaq -0xc0(%rbp), %rdi
callq 0x12ae0
jmp 0x11c99
leaq -0xc0(%rbp), %rdi
callq 0x41f0
movq -0x200(%rbp), %rdi
movq -0x230(%rbp), %rsi
movl -0x224(%rbp), %edx
movq %rax, %r8
movl $0x2, %ecx
movl $0x7, %r9d
callq 0xfad0
jmp 0x11cce
leaq -0xc0(%rbp), %rdi
callq 0x42a0
movq -0x200(%rbp), %rax
movq 0x6b8(%rax), %rax
movq %rax, -0x240(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x234(%rbp)
movq -0xa0(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0xcaa0
movq -0x200(%rbp), %rsi
movq -0x240(%rbp), %rdx
movl -0x234(%rbp), %ecx
movss 0x70(%rax), %xmm0
leaq -0xe0(%rbp), %rdi
movl $0x9, %r8d
callq 0x10b50
jmp 0x11d35
leaq -0xe0(%rbp), %rdi
callq 0x42a0
movq -0x200(%rbp), %rax
movq 0x6b8(%rax), %rax
movq %rax, -0x250(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x244(%rbp)
movq -0xa0(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0xcaa0
movss 0x70(%rax), %xmm0
leaq -0x160(%rbp), %rdi
callq 0x12bf0
jmp 0x11d82
xorl %eax, %eax
movl %eax, %edx
leaq -0x140(%rbp), %rdi
leaq -0x160(%rbp), %rsi
movl $0x5, %ecx
callq 0x4440
jmp 0x11da0
leaq 0x2a83(%rip), %rsi      # 0x1482a
leaq -0x120(%rbp), %rdi
leaq -0x140(%rbp), %rdx
callq 0x12990
jmp 0x11dbc
leaq 0x29ad(%rip), %rdx      # 0x14770
leaq -0x100(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0xef20
jmp 0x11dd8
leaq -0x100(%rbp), %rdi
callq 0x41f0
movq -0x200(%rbp), %rdi
movq -0x250(%rbp), %rsi
movl -0x244(%rbp), %edx
movq %rax, %r8
movl $0x20, %ecx
movl $0x8, %r9d
callq 0xfad0
jmp 0x11e0d
leaq -0x100(%rbp), %rdi
callq 0x42a0
leaq -0x120(%rbp), %rdi
callq 0x42a0
leaq -0x140(%rbp), %rdi
callq 0x42a0
leaq -0x160(%rbp), %rdi
callq 0x42a0
movq -0x200(%rbp), %rax
movq 0x6b8(%rax), %rax
movq %rax, -0x260(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x254(%rbp)
incl %eax
movl %eax, -0xc(%rbp)
movq -0xa0(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0xcaa0
movss 0x74(%rax), %xmm0
leaq -0x1e0(%rbp), %rdi
callq 0x12bf0
jmp 0x11e83
xorl %eax, %eax
movl %eax, %edx
leaq -0x1c0(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
movl $0x5, %ecx
callq 0x4440
jmp 0x11ea1
leaq 0x2982(%rip), %rsi      # 0x1482a
leaq -0x1a0(%rbp), %rdi
leaq -0x1c0(%rbp), %rdx
callq 0x12990
jmp 0x11ebd
leaq 0x28ac(%rip), %rdx      # 0x14770
leaq -0x180(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0xef20
jmp 0x11ed9
leaq -0x180(%rbp), %rdi
callq 0x41f0
movq -0x200(%rbp), %rdi
movq -0x260(%rbp), %rsi
movl -0x254(%rbp), %edx
movq %rax, %r8
movl $0x28, %ecx
movl $0x4, %r9d
callq 0xfad0
jmp 0x11f0e
leaq -0x180(%rbp), %rdi
callq 0x42a0
leaq -0x1a0(%rbp), %rdi
callq 0x42a0
leaq -0x1c0(%rbp), %rdi
callq 0x42a0
leaq -0x1e0(%rbp), %rdi
callq 0x42a0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movq -0xa0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa0(%rbp)
jmp 0x11c29
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x11f81
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x42a0
leaq -0x50(%rbp), %rdi
callq 0x42a0
jmp 0x12113
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x1210a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x42a0
jmp 0x1210a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x42a0
jmp 0x1210a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x12034
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x12028
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x1201c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x42a0
leaq -0x120(%rbp), %rdi
callq 0x42a0
leaq -0x140(%rbp), %rdi
callq 0x42a0
leaq -0x160(%rbp), %rdi
callq 0x42a0
jmp 0x1210a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x1209f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x12093
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x12087
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x42a0
leaq -0x1a0(%rbp), %rdi
callq 0x42a0
leaq -0x1c0(%rbp), %rdi
callq 0x42a0
leaq -0x1e0(%rbp), %rdi
callq 0x42a0
jmp 0x1210a
movq -0x200(%rbp), %rdi
movq 0x6b8(%rdi), %rsi
movl -0xc(%rbp), %edx
movl %edx, %eax
incl %eax
movl %eax, -0xc(%rbp)
leaq 0x2729(%rip), %r8       # 0x147f5
movl $0x2, %r9d
movl %r9d, %ecx
callq 0xfad0
jmp 0x120dc
movq -0x200(%rbp), %rax
movq 0x6b8(%rax), %rdi
movl $0x1, %edx
movl %edx, %esi
callq 0x4200
jmp 0x120f8
leaq -0x78(%rbp), %rdi
callq 0xcac0
addq $0x260, %rsp            # imm = 0x260
popq %rbp
retq
leaq -0x78(%rbp), %rdi
callq 0xcac0
movq -0x58(%rbp), %rdi
callq 0x46f0
nopl (%rax)