// File: acherkaoui[P]HTOP/modules/RAM.cpp
// Function: RAM::refresh()
void RAM::refresh()
{
	struct sysinfo _sysInfo;
	sysinfo(&_sysInfo);
	int minute = 60;
	int hour = minute * 60;
	int day = hour * 24;

	_upTime = std::to_string(_sysInfo.uptime / day) +
		" days " + std::to_string((_sysInfo.uptime % day) / hour) +
		" hours " + std::to_string((_sysInfo.uptime % hour) / minute) +
		" min.";
	_totalRam = _sysInfo.totalram / MB;
	_totalSwap = _sysInfo.totalswap / MB;
	_freeRam = _sysInfo.freeram / MB;
	_freeSwap = _sysInfo.freeswap / MB;
	_processes = _sysInfo.procs;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1a8(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x4560
movl $0x3c, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
imull $0x3c, %eax, %eax
movl %eax, -0x80(%rbp)
movl -0x80(%rbp), %ecx
shll $0x3, %ecx
movl %ecx, %eax
leal (%rax,%rax,2), %eax
movl %eax, -0x84(%rbp)
movq -0x78(%rbp), %rax
movslq -0x84(%rbp), %rcx
cqto
idivq %rcx
movq %rax, %rsi
leaq -0x148(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
callq 0xf040
movq -0x1a0(%rbp), %rsi
leaq 0x58a3(%rip), %rdx      # 0x1426b
leaq -0x128(%rbp), %rdi
callq 0xef20
jmp 0xe9d6
movq -0x78(%rbp), %rax
movslq -0x84(%rbp), %rcx
cqto
idivq %rcx
movq %rdx, %rax
movslq -0x80(%rbp), %rcx
cqto
idivq %rcx
movq %rax, %rsi
leaq -0x178(%rbp), %rdi
callq 0xf040
jmp 0xea03
leaq -0x108(%rbp), %rdi
leaq -0x128(%rbp), %rsi
leaq -0x178(%rbp), %rdx
callq 0xef70
jmp 0xea1f
leaq 0x584c(%rip), %rdx      # 0x14272
leaq -0xe8(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0xef20
jmp 0xea3b
movq -0x78(%rbp), %rax
movslq -0x80(%rbp), %rcx
cqto
idivq %rcx
movq %rdx, %rax
movslq -0x7c(%rbp), %rcx
cqto
idivq %rcx
movq %rax, %rsi
leaq -0x198(%rbp), %rdi
callq 0xf040
jmp 0xea65
leaq -0xc8(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
leaq -0x198(%rbp), %rdx
callq 0xef70
jmp 0xea81
leaq 0x57f2(%rip), %rdx      # 0x1427a
leaq -0xa8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0xef20
jmp 0xea9d
movq -0x1a8(%rbp), %rdi
addq $0x30, %rdi
leaq -0xa8(%rbp), %rsi
callq 0x4510
leaq -0xa8(%rbp), %rdi
callq 0x42a0
leaq -0xc8(%rbp), %rdi
callq 0x42a0
leaq -0x198(%rbp), %rdi
callq 0x42a0
leaq -0xe8(%rbp), %rdi
callq 0x42a0
leaq -0x108(%rbp), %rdi
callq 0x42a0
leaq -0x178(%rbp), %rdi
callq 0x42a0
leaq -0x128(%rbp), %rdi
callq 0x42a0
leaq -0x148(%rbp), %rdi
callq 0x42a0
movq -0x1a8(%rbp), %rax
movq -0x58(%rbp), %rcx
shrq $0xa, %rcx
shlq $0xa, %rcx
movq %rcx, 0x50(%rax)
movq -0x38(%rbp), %rcx
shrq $0xa, %rcx
shlq $0xa, %rcx
movq %rcx, 0x60(%rax)
movq -0x50(%rbp), %rcx
shrq $0xa, %rcx
shlq $0xa, %rcx
movq %rcx, 0x58(%rax)
movq -0x30(%rbp), %rcx
shrq $0xa, %rcx
shlq $0xa, %rcx
movq %rcx, 0x68(%rax)
movzwl -0x28(%rbp), %ecx
movq %rcx, 0x70(%rax)
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x150(%rbp)
movl %eax, -0x154(%rbp)
jmp 0xec44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x150(%rbp)
movl %eax, -0x154(%rbp)
jmp 0xec38
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x150(%rbp)
movl %eax, -0x154(%rbp)
jmp 0xec2c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x150(%rbp)
movl %eax, -0x154(%rbp)
jmp 0xec20
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x150(%rbp)
movl %eax, -0x154(%rbp)
jmp 0xec14
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x150(%rbp)
movl %eax, -0x154(%rbp)
jmp 0xec08
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x150(%rbp)
movl %eax, -0x154(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x42a0
leaq -0x198(%rbp), %rdi
callq 0x42a0
leaq -0xe8(%rbp), %rdi
callq 0x42a0
leaq -0x108(%rbp), %rdi
callq 0x42a0
leaq -0x178(%rbp), %rdi
callq 0x42a0
leaq -0x128(%rbp), %rdi
callq 0x42a0
leaq -0x148(%rbp), %rdi
callq 0x42a0
movq -0x150(%rbp), %rdi
callq 0x46f0
nopl (%rax)