// File: /workspace/github_cpp_makefile_star2_O1/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, %rbx
leaq 0x5438(%rip), %rsi      # 0xd244
leaq 0x260(%rsp), %r14
movq %r14, %rdi
movl $0x8, %edx
callq 0x45e0
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x5b0a(%rip), %rsi      # 0xd94f
leaq 0x5b06(%rip), %rdx      # 0xd952
movq %rsp, %rdi
callq 0x6474
movq 0x8(%rsp), %r15
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x53e6(%rip), %rsi      # 0xd24f
leaq 0x53e2(%rip), %rdx      # 0xd252
leaq 0x20(%rsp), %rdi
callq 0x6474
leaq 0x70(%rsp), %rbp
leaq 0x40(%rsp), %r13
leaq 0xe0(%rsp), %r12
movq 0x260(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4330
movsbl %al, %edx
movq %r14, %rdi
movq %r13, %rsi
callq 0x45f0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x7fd9
movq %r13, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %rsp, %rcx
callq 0x4470
testl %eax, %eax
jne 0x7e8c
movq %r12, %rdi
movq %r13, %rsi
movl $0x8, %edx
callq 0x4570
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0xc0(%rsp)
movaps %xmm0, 0xb0(%rsp)
movaps %xmm0, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
movaps %xmm0, 0x80(%rsp)
xorl %eax, %eax
movq %rax, 0xd0(%rsp)
movq %rbp, 0x60(%rsp)
movq %rax, 0x68(%rsp)
movb $0x0, 0x70(%rsp)
movq %rbx, %rdi
leaq 0x60(%rsp), %rsi
callq 0x8564
movq 0x60(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7f53
callq 0x4320
movq %rbx, %r14
movq 0x8(%rbx), %rbx
leaq -0x78(%rbx), %rbp
movq %r12, %rdi
movq %rbp, %rsi
callq 0x4440
cmpq %r15, -0x70(%rbx)
jbe 0x7f7e
movq %rbp, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x40d0
jmp 0x7f8b
movq %rbp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x4240
movq $-0x58, %rbp
leaq (%rbx,%rbp), %rsi
movq %r12, %rdi
callq 0x4250
addq $0x8, %rbp
cmpq $-0x8, %rbp
jne 0x7f92
movq %r12, %rdi
movq 0xa016(%rip), %rsi      # 0x11fc8
callq 0x44a0
leaq 0x158(%rsp), %rdi
callq 0x4160
movq %r14, %rbx
leaq 0x260(%rsp), %r14
leaq 0x70(%rsp), %rbp
jmp 0x7e8c
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x7fed
callq 0x4320
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x8000
callq 0x4320
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x8014
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, %rbx
jmp 0x8092
movq %rax, %rbx
jmp 0x80a5
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %rbp, %rdi
je 0x805d
callq 0x4320
jmp 0x805d
jmp 0x8055
jmp 0x805a
movq %rax, %rbx
jmp 0x807e
movq %rax, %rbx
movq 0x9f64(%rip), %rsi      # 0x11fc8
leaq 0xe0(%rsp), %rdi
callq 0x44a0
leaq 0x158(%rsp), %rdi
callq 0x4160
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x8092
callq 0x4320
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x80a5
callq 0x4320
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x80b9
callq 0x4320
leaq 0x260(%rsp), %rdi
callq 0x4100
movq %rbx, %rdi
callq 0x45c0