// File: /workspace/github_cpp_makefile_star2_O3/acherkaoui[P]HTOP/modules/CPU.cpp
// Function: ReadStatsCpu(std::vector<CPUData_s, std::allocator<CPUData_s>>&)
void ReadStatsCpu(std::vector<CPUData> &stat)
{
	std::ifstream fileStat("/proc/stat");
	std::string line;

	const std::string STR_CPU("cpu");
	const std::size_t LEN_STR_CPU = STR_CPU.size();
	const std::string STR_TOT("tot");

	while(std::getline(fileStat, line)) {
		if(!line.compare(0, LEN_STR_CPU, STR_CPU)) {
			std::istringstream stringstream(line);

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

			stringstream >> entry.cpu;
			if (entry.cpu.size() > LEN_STR_CPU)
				entry.cpu.erase(0, LEN_STR_CPU);
			else
				entry.cpu = STR_TOT;
			for (int i = 0; i < NUM_CPU_STATES; ++i)
				stringstream >> entry.times[i];
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x468, %rsp            # imm = 0x468
movq %rdi, %r14
leaq 0x54d4(%rip), %rsi      # 0xd244
leaq 0x260(%rsp), %r13
movq %r13, %rdi
movl $0x8, %edx
callq 0x45e0
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x5bb6(%rip), %rsi      # 0xd95f
leaq 0x5bb2(%rip), %rdx      # 0xd962
leaq 0x8(%rsp), %rdi
callq 0x647a
movq 0x10(%rsp), %r12
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x5480(%rip), %rsi      # 0xd24f
leaq 0x547c(%rip), %rdx      # 0xd252
leaq 0x28(%rsp), %rdi
callq 0x647a
leaq 0x78(%rsp), %rbx
leaq 0x48(%rsp), %rbp
leaq 0xe0(%rsp), %r15
movq 0x260(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x4330
movsbl %al, %edx
movq %r13, %rdi
movq %rbp, %rsi
callq 0x45f0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x7f1d
movq %rbp, %rdi
xorl %esi, %esi
movq %r12, %rdx
leaq 0x8(%rsp), %rcx
callq 0x4470
testl %eax, %eax
jne 0x7df2
movq %r15, %rdi
movq %rbp, %rsi
movl $0x8, %edx
callq 0x4570
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%rbx)
movups %xmm0, 0x40(%rbx)
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
xorl %eax, %eax
movq %rax, 0x60(%rbx)
movq %rbx, 0x68(%rsp)
movq %rax, 0x70(%rsp)
movq %r14, %rdi
leaq 0x68(%rsp), %rsi
callq 0x848e
movq 0x68(%rsp), %rdi
cmpq %rbx, %rdi
je 0x7e97
callq 0x4320
movq %r14, %r13
movq 0x8(%r14), %r14
leaq -0x78(%r14), %rbp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x4440
cmpq %r12, -0x70(%r14)
jbe 0x7ec2
movq %rbp, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x40d0
jmp 0x7ecf
movq %rbp, %rdi
leaq 0x28(%rsp), %rsi
callq 0x4240
movq $-0x58, %rbp
leaq (%r14,%rbp), %rsi
movq %r15, %rdi
callq 0x4250
addq $0x8, %rbp
cmpq $-0x8, %rbp
jne 0x7ed6
movq %r15, %rdi
movq 0xa0d2(%rip), %rsi      # 0x11fc8
callq 0x44a0
leaq 0x158(%rsp), %rdi
callq 0x4160
movq %r13, %r14
leaq 0x260(%rsp), %r13
leaq 0x48(%rsp), %rbp
jmp 0x7df2
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x7f31
callq 0x4320
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x7f45
callq 0x4320
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x7f59
callq 0x4320
leaq 0x260(%rsp), %rdi
callq 0x4100
addq $0x468, %rsp            # imm = 0x468
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x7fd7
movq %rax, %r14
jmp 0x7feb
movq %rax, %r14
movq 0x68(%rsp), %rdi
cmpq %rbx, %rdi
je 0x7fa2
callq 0x4320
jmp 0x7fa2
jmp 0x7f9a
jmp 0x7f9f
movq %rax, %r14
jmp 0x7fc3
movq %rax, %r14
movq 0xa01f(%rip), %rsi      # 0x11fc8
leaq 0xe0(%rsp), %rdi
callq 0x44a0
leaq 0x158(%rsp), %rdi
callq 0x4160
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x7fd7
callq 0x4320
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x7feb
callq 0x4320
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x7fff
callq 0x4320
leaq 0x260(%rsp), %rdi
callq 0x4100
movq %r14, %rdi
callq 0x45c0