// File: /workspace/github_cpp_makefile_star2_O2/acherkaoui[P]HTOP/modules/CPU.cpp
// Function: Cpu::getStats()
std::vector<CPUData> Cpu::getStats()
{
	std::vector<CPUData> stat1;
	std::vector<CPUData> stat2;
	std::vector<CPUData> cpu;

	this->updateCpu(stat1, stat2);
	const size_t NUM_STAT = stat1.size();

	for(size_t i = 0; i < NUM_STAT; ++i) {
		const float ACTIVE_TIME	= static_cast<float>(
			GetActiveTime(stat2[i]) -
				GetActiveTime(stat1[i]));
		const float IDLE_TIME	= static_cast<float>(
			GetIdleTime(stat2[i]) - GetIdleTime(stat1[i]));
		const float TOTAL_TIME	= ACTIVE_TIME + IDLE_TIME;

		cpu.emplace_back(CPUData());
		CPUData &entry = cpu.back();

		entry.cpu = stat1[i].cpu;
		entry.active = 100.f * ACTIVE_TIME / TOTAL_TIME;
		entry.idle = 100.f * IDLE_TIME / TOTAL_TIME;
	}
	return (cpu);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
leaq 0x50(%rsp), %rdx
movaps %xmm0, (%rdx)
andq $0x0, 0x10(%rdx)
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movq %rdi, 0x8(%rsp)
callq 0x7450
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
pushq $0x78
popq %rcx
cqto
idivq %rcx
movq %rax, %r14
xorl %ebp, %ebp
leaq 0x70(%rsp), %r13
subq $0x1, %r14
jb 0x7627
movq 0x50(%rsp), %r15
leaq (%r15,%rbp), %rdi
callq 0x768a
movq %rax, %r12
movq 0x10(%rsp), %rbx
leaq (%rbx,%rbp), %rdi
callq 0x768a
movq 0x40(%r15,%rbp), %rcx
addq 0x38(%r15,%rbp), %rcx
movq 0x38(%rbx,%rbp), %rdx
addq 0x40(%rbx,%rbp), %rdx
movq %r12, %xmm0
movq %rcx, %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movq %rax, %xmm1
movq %rdx, %xmm2
punpcklqdq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0]
psubq %xmm1, %xmm0
movq %xmm0, %rax
testq %rax, %rax
js 0x754d
cvtsi2ss %rax, %xmm1
jmp 0x7562
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm1
addss %xmm1, %xmm1
movaps %xmm1, 0x40(%rsp)
pshufd $0xee, %xmm0, %xmm0     # xmm0 = xmm0[2,3,2,3]
movq %xmm0, %rax
testq %rax, %rax
movq 0x8(%rsp), %rbx
js 0x7582
cvtsi2ss %rax, %xmm0
jmp 0x7597
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
xorps %xmm0, %xmm0
leaq 0x80(%rsp), %rax
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
andq $0x0, 0x60(%rax)
movq %rax, 0x70(%rsp)
andq $0x0, 0x78(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x7836
movq %r13, %rdi
callq 0x41f0
movq 0x8(%rbx), %r12
leaq -0x78(%r12), %rdi
movq 0x10(%rsp), %rsi
addq %rbp, %rsi
callq 0x4240
movaps 0x40(%rsp), %xmm0
movaps 0x30(%rsp), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
shufps $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0]
addps %xmm0, %xmm1
mulps 0x3bee(%rip), %xmm0     # 0xb200
unpcklps %xmm1, %xmm1            # xmm1 = xmm1[0,0,1,1]
divps %xmm1, %xmm0
movlps %xmm0, -0x8(%r12)
addq $0x78, %rbp
jmp 0x74df
leaq 0x50(%rsp), %rdi
callq 0x78b8
leaq 0x10(%rsp), %rdi
callq 0x78b8
movq %rbx, %rax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7661
movq %rax, %r14
leaq 0x70(%rsp), %rdi
callq 0x41f0
jmp 0x7664
movq %rax, %r14
movq 0x8(%rsp), %rdi
callq 0x78b8
leaq 0x50(%rsp), %rdi
callq 0x78b8
leaq 0x10(%rsp), %rdi
callq 0x78b8
movq %r14, %rdi
callq 0x45a0