// File: acherkaoui[P]HTOP/modules/Network.cpp
// Function: Network::refreshCpuData()
void  Network::refreshCpuData()
{
	std::ifstream file("/proc/net/dev", std::ifstream::in);
	std::string line;

	while (!file.eof())
	{
		std::getline(file, line);
		if (line.find("wlo1:") != std::string::npos)
			break;
	}
	std::string array[STAT_COLUMNS];
	std::size_t i = 0;
	std::stringstream ssin(line);
	while (ssin.good() && i < STAT_COLUMNS)
	{
		ssin >> array[i];
		i++;
	}
	fillValue(array[IN_BYTES], _inBytes);
	fillValue(array[IN_PACKETS], _inPackets);
	fillValue(array[OUT_BYTES], _outBytes);
	fillValue(array[OUT_PACKETS], _outPackets);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x650, %rsp            # imm = 0x650
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x5f8(%rbp)
leaq -0x210(%rbp), %rdi
leaq 0x620b(%rip), %rsi      # 0x14243
movl $0x8, %edx
callq 0x4720
leaq -0x230(%rbp), %rdi
callq 0x45b0
movq -0x210(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x210(%rbp,%rax), %rdi
callq 0x4730
movb %al, -0x5f9(%rbp)
jmp 0xe06e
movb -0x5f9(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe07c
jmp 0xe0c9
leaq -0x210(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x40e0
jmp 0xe091
leaq -0x230(%rbp), %rdi
leaq 0x61b2(%rip), %rsi      # 0x14251
xorl %eax, %eax
movl %eax, %edx
callq 0x4770
cmpq $-0x1, %rax
je 0xe0c7
jmp 0xe0c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
jmp 0xe347
jmp 0xe04e
leaq -0x460(%rbp), %rax
movq %rax, %rcx
addq $0x220, %rcx            # imm = 0x220
movq %rcx, -0x610(%rbp)
movq %rax, -0x608(%rbp)
movq -0x608(%rbp), %rdi
movq %rdi, -0x618(%rbp)
callq 0x45b0
movq -0x618(%rbp), %rax
movq -0x610(%rbp), %rcx
addq $0x20, %rax
cmpq %rcx, %rax
movq %rax, -0x608(%rbp)
jne 0xe0e8
movq $0x0, -0x468(%rbp)
movl $0x10, %edi
movl $0x8, %esi
callq 0xe540
movl %eax, -0x61c(%rbp)
jmp 0xe13b
movl -0x61c(%rbp), %edx
leaq -0x5f0(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x4630
jmp 0xe156
jmp 0xe158
movq -0x5f0(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x5f0(%rbp,%rax), %rdi
callq 0x46a0
movb %al, -0x61d(%rbp)
jmp 0xe178
movb -0x61d(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x61e(%rbp)
jne 0xe18d
jmp 0xe19e
cmpq $0x11, -0x468(%rbp)
setb %al
movb %al, -0x61e(%rbp)
movb -0x61e(%rbp), %al
testb $0x1, %al
jne 0xe1aa
jmp 0xe21c
movq -0x468(%rbp), %rax
shlq $0x5, %rax
leaq -0x460(%rbp,%rax), %rsi
leaq -0x5f0(%rbp), %rdi
callq 0x4540
jmp 0xe1cb
movq -0x468(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x468(%rbp)
jmp 0xe158
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
jmp 0xe2f9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
leaq -0x5f0(%rbp), %rdi
callq 0x4330
jmp 0xe2f9
movq -0x5f8(%rbp), %rsi
leaq -0x440(%rbp), %rdi
addq $0x30, %rsi
callq 0xe560
jmp 0xe235
movq -0x5f8(%rbp), %rsi
leaq -0x420(%rbp), %rdi
addq $0x38, %rsi
callq 0xe560
jmp 0xe24e
movq -0x5f8(%rbp), %rsi
leaq -0x340(%rbp), %rdi
addq $0x40, %rsi
callq 0xe560
jmp 0xe267
movq -0x5f8(%rbp), %rsi
leaq -0x320(%rbp), %rdi
addq $0x48, %rsi
callq 0xe560
jmp 0xe280
leaq -0x5f0(%rbp), %rdi
callq 0x4330
leaq -0x460(%rbp), %rax
movq %rax, -0x630(%rbp)
addq $0x220, %rax            # imm = 0x220
movq %rax, -0x628(%rbp)
movq -0x628(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x638(%rbp)
callq 0x42a0
movq -0x630(%rbp), %rcx
movq -0x638(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x628(%rbp)
jne 0xe2a7
leaq -0x230(%rbp), %rdi
callq 0x42a0
leaq -0x210(%rbp), %rdi
callq 0x4130
addq $0x650, %rsp            # imm = 0x650
popq %rbp
retq
leaq -0x460(%rbp), %rax
movq %rax, -0x648(%rbp)
addq $0x220, %rax            # imm = 0x220
movq %rax, -0x640(%rbp)
movq -0x640(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x650(%rbp)
callq 0x42a0
movq -0x648(%rbp), %rcx
movq -0x650(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x640(%rbp)
jne 0xe314
jmp 0xe347
leaq -0x230(%rbp), %rdi
callq 0x42a0
leaq -0x210(%rbp), %rdi
callq 0x4130
movq -0x238(%rbp), %rdi
callq 0x46f0
nopl (%rax,%rax)