// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %r12
movq 0x6b8(%rdi), %rsi
leaq 0x1b63(%rip), %r8       # 0xb815
pushq $0x2
popq %rcx
xorl %edx, %edx
movl %ecx, %r9d
callq 0x8c16
movq 0x6b8(%r12), %rbx
leaq 0x20(%r12), %r14
leaq 0x50(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x7196
leaq 0x1b51(%rip), %rsi      # 0xb834
leaq 0x10(%rsp), %rdi
movq %r15, %rdx
callq 0xa5dd
movq 0x10(%rsp), %r8
pushq $0x1
popq %rdx
pushq $0x2
popq %rcx
pushq $0x8
popq %r9
movq %rbx, %rsi
callq 0x8c16
leaq 0x10(%rsp), %rdi
callq 0x41f0
leaq 0x50(%rsp), %rdi
callq 0x41f0
movq 0x6b8(%r12), %rsi
leaq 0x1aeb(%rip), %r8       # 0xb815
pushq $0x2
popq %rcx
movl %ecx, %edx
movl %ecx, %r9d
callq 0x8c16
leaq 0x38(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x7480
movq 0x6b8(%r12), %rbx
movq 0x8(%r15), %rax
subq (%r15), %rax
pushq $0x78
popq %rcx
cqto
idivq %rcx
leaq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0xa601
movq 0x10(%rsp), %r8
leaq 0x1baa(%rip), %rcx      # 0xb921
pushq $0x4
popq %rsi
pushq $0x2
popq %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x40f0
leaq 0x10(%rsp), %rdi
callq 0x41f0
movq 0x6b8(%r12), %rsi
leaq 0x1b8e(%rip), %r8       # 0xb92e
pushq $0x6
popq %rdx
pushq $0x2
popq %rcx
pushq $0x7
popq %r9
callq 0x8c16
movq 0x6b8(%r12), %rsi
leaq 0x1b75(%rip), %r8       # 0xb933
pushq $0x6
popq %rdx
pushq $0x23
popq %rcx
pushq $0x8
popq %r9
callq 0x8c16
movq 0x6b8(%r12), %rsi
leaq 0x1b5e(%rip), %r8       # 0xb93a
pushq $0x6
popq %rdx
pushq $0x2a
popq %rcx
pushq $0x4
popq %r9
callq 0x8c16
movq %r12, 0x8(%rsp)
xorl %edi, %edi
leaq 0x78(%rsp), %r13
pushq $0x8
popq %r14
xorl %r8d, %r8d
movq 0x38(%rsp), %rcx
movq 0x40(%rsp), %rax
subq %rcx, %rax
cqto
pushq $0x78
popq %rsi
idivq %rsi
movq 0x8(%rsp), %rdx
movq 0x6b8(%rdx), %rbx
cmpq %rax, %r8
jae 0xa002
movq %r8, 0x70(%rsp)
movq %rdi, 0x30(%rsp)
addq %rdi, %rcx
leaq 0x10(%rsp), %rdi
leaq 0x1a0b(%rip), %rsi      # 0xb84c
movq %rcx, %rdx
callq 0xa643
movq %r13, %r12
movq 0x10(%rsp), %r8
movq %rbx, %rsi
movl %r14d, %edx
pushq $0x2
popq %rcx
pushq $0x7
popq %r9
callq 0x8c16
leaq 0x10(%rsp), %rdi
callq 0x41f0
movq 0x8(%rsp), %rbx
movq 0x6b8(%rbx), %rdx
movq 0x38(%rsp), %rax
movq 0x30(%rsp), %r15
movss 0x70(%rax,%r15), %xmm0
leaq 0xb8(%rsp), %r13
movq %r13, %rdi
movl %r14d, %ebp
movl %r14d, %ecx
pushq $0x9
popq %r8
callq 0x953c
movq %r13, %rdi
callq 0x41f0
movq 0x6b8(%rbx), %rbx
movq 0x38(%rsp), %rax
movss 0x70(%rax,%r15), %xmm0
movq %r12, %r13
movq %r12, %rdi
callq 0xa6b9
leaq 0x98(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
pushq $0x5
popq %r15
movq %r15, %rcx
callq 0x4380
movl %ebp, %r14d
leaq 0x50(%rsp), %rbp
movq %rbp, %rdi
leaq 0x1952(%rip), %rsi      # 0xb84a
movq %r12, %rdx
callq 0xa5dd
leaq 0x10(%rsp), %rdi
movq %rbp, %rsi
leaq 0x1881(%rip), %rbp      # 0xb790
movq %rbp, %rdx
callq 0x85ec
movq 0x10(%rsp), %r8
movq %rbx, %rsi
movl %r14d, %edx
pushq $0x20
popq %rcx
pushq $0x8
popq %r9
callq 0x8c16
leaq 0x10(%rsp), %rdi
callq 0x41f0
leaq 0x50(%rsp), %rdi
callq 0x41f0
movq %r12, %rdi
callq 0x41f0
movq %r13, %rdi
callq 0x41f0
movq 0x8(%rsp), %rax
movq 0x6b8(%rax), %rbx
movq 0x38(%rsp), %rax
movq 0x30(%rsp), %rcx
movss 0x74(%rax,%rcx), %xmm0
movq %r13, %rdi
callq 0xa6b9
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
movq %r15, %rcx
callq 0x4380
leaq 0x50(%rsp), %r15
movq %r15, %rdi
leaq 0x18b5(%rip), %rsi      # 0xb84a
movq %r12, %rdx
callq 0xa5dd
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x85ec
movq 0x10(%rsp), %r8
movq %rbx, %rsi
movl %r14d, %edx
pushq $0x28
popq %rcx
pushq $0x4
popq %r9
callq 0x8c16
leaq 0x10(%rsp), %rdi
callq 0x41f0
leaq 0x50(%rsp), %rdi
callq 0x41f0
movq %r12, %rdi
callq 0x41f0
movq %r13, %rdi
callq 0x41f0
addl $0x2, %r14d
movq 0x70(%rsp), %r8
incq %r8
movq 0x30(%rsp), %rdi
addq $0x78, %rdi
jmp 0x9dfe
leaq 0x180c(%rip), %r8       # 0xb815
pushq $0x2
popq %rcx
movq %rbx, %rsi
movl %r14d, %edx
movl %ecx, %r9d
callq 0x8c16
movq 0x8(%rsp), %rax
movq 0x6b8(%rax), %rdi
pushq $0x1
popq %rdx
movl %edx, %esi
callq 0x41c0
leaq 0x38(%rsp), %rdi
callq 0x78b8
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa0d5
jmp 0xa0c0
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x41f0
jmp 0xa065
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x41f0
jmp 0xa0cd
jmp 0xa0c0
jmp 0xa09b
jmp 0xa0c0
jmp 0xa08a
jmp 0xa07b
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x41f0
jmp 0xa08d
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x41f0
jmp 0xa0a3
jmp 0xa0a0
movq %rax, %rbx
jmp 0xa0b0
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x41f0
leaq 0x78(%rsp), %rdi
callq 0x41f0
jmp 0xa0c3
jmp 0xa0c0
jmp 0xa0c0
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x78b8
movq %rbx, %rdi
callq 0x45a0
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0xa0b5
nop