// File: dguglielmi[P]dlan-linux-software/common/packetinterface-linux.cpp
// Function: CPacketInterfaceLinux::GetInterfaceNames(std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&) const
bool CPacketInterfaceLinux::GetInterfaceNames(std::set<std::string>& setIfNames) const
{
    bool bResult = false;
    std::ifstream devfile("/proc/net/dev");
    if (devfile.is_open())
    {
        std::string buf;
        getline(devfile, buf);
        getline(devfile, buf);
        for (;;)
        {
            getline(devfile, buf);
            if (devfile.good() == false) break;
            std::string::size_type nameStart = 0, nameEnd;
            while (nameStart < buf.size() && isspace(buf[nameStart])) nameStart++;
            nameEnd = nameStart;
            while (nameEnd < buf.size() && buf[nameEnd] && buf[nameEnd] != ':' && !isspace(buf[nameEnd])) nameEnd++;
            if (nameStart != nameEnd && nameEnd < buf.size() && buf[nameEnd] == ':' && (nameEnd - nameStart) < IFNAMSIZ)
            {
                setIfNames.insert(buf.substr(nameStart, nameEnd-nameStart));
            }
        }
        devfile.close();
        bResult = true;
    }
    return bResult;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x330, %rsp            # imm = 0x330
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
leaq 0x552a(%rip), %rsi      # 0x386d8
leaq -0x220(%rbp), %rdi
movq %rdi, -0x2a0(%rbp)
movl $0x8, %edx
callq 0x5570
movq -0x2a0(%rbp), %rdi
callq 0x54c0
movb %al, -0x291(%rbp)
jmp 0x331da
movb -0x291(%rbp), %al
testb $0x1, %al
jne 0x331e9
jmp 0x33612
leaq -0x250(%rbp), %rdi
movq %rdi, -0x2a8(%rbp)
callq 0x5450
movq -0x2a8(%rbp), %rsi
leaq -0x220(%rbp), %rdi
callq 0x50d0
jmp 0x33211
leaq -0x220(%rbp), %rdi
leaq -0x250(%rbp), %rsi
callq 0x50d0
jmp 0x33226
jmp 0x33228
leaq -0x220(%rbp), %rdi
leaq -0x250(%rbp), %rsi
callq 0x50d0
jmp 0x3323d
movq -0x220(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x220(%rbp,%rax), %rdi
callq 0x5520
movb %al, -0x2a9(%rbp)
jmp 0x3325d
movb -0x2a9(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x332a0
jmp 0x335e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x33638
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x33604
movq $0x0, -0x258(%rbp)
movq -0x258(%rbp), %rax
movq %rax, -0x2b8(%rbp)
leaq -0x250(%rbp), %rdi
callq 0x5270
movq -0x2b8(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x2aa(%rbp)
jae 0x33353
movq -0x258(%rbp), %rsi
leaq -0x250(%rbp), %rdi
callq 0x55c0
movq %rax, -0x2c0(%rbp)
jmp 0x332f8
movq -0x2c0(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x2c1(%rbp)
je 0x33347
movq -0x258(%rbp), %rsi
leaq -0x250(%rbp), %rdi
callq 0x55c0
movq %rax, -0x2d0(%rbp)
jmp 0x3332b
movq -0x2d0(%rbp), %rax
movsbl (%rax), %eax
subl $0x9, %eax
movzbl %al, %eax
cmpl $0x4, %eax
setle %al
movb %al, -0x2c1(%rbp)
movb -0x2c1(%rbp), %al
movb %al, -0x2aa(%rbp)
movb -0x2aa(%rbp), %al
testb $0x1, %al
jne 0x3335f
jmp 0x33376
movq -0x258(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x258(%rbp)
jmp 0x332ab
movq -0x258(%rbp), %rax
movq %rax, -0x260(%rbp)
movq -0x260(%rbp), %rax
movq %rax, -0x2e0(%rbp)
leaq -0x250(%rbp), %rdi
callq 0x5270
movq -0x2e0(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x2d1(%rbp)
jae 0x33499
movq -0x260(%rbp), %rsi
leaq -0x250(%rbp), %rdi
callq 0x55c0
movq %rax, -0x2e8(%rbp)
jmp 0x333d5
movq -0x2e8(%rbp), %rcx
xorl %eax, %eax
cmpb $0x0, (%rcx)
movb %al, -0x2d1(%rbp)
je 0x33499
movq -0x260(%rbp), %rsi
leaq -0x250(%rbp), %rdi
callq 0x55c0
movq %rax, -0x2f0(%rbp)
jmp 0x33409
movq -0x2f0(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x3a, %ecx
movb %al, -0x2d1(%rbp)
je 0x33499
movq -0x260(%rbp), %rsi
leaq -0x250(%rbp), %rdi
callq 0x55c0
movq %rax, -0x2f8(%rbp)
jmp 0x3343c
movq -0x2f8(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x2f9(%rbp)
je 0x3348b
movq -0x260(%rbp), %rsi
leaq -0x250(%rbp), %rdi
callq 0x55c0
movq %rax, -0x308(%rbp)
jmp 0x3346f
movq -0x308(%rbp), %rax
movsbl (%rax), %eax
subl $0x9, %eax
movzbl %al, %eax
cmpl $0x4, %eax
setle %al
movb %al, -0x2f9(%rbp)
movb -0x2f9(%rbp), %al
xorb $-0x1, %al
movb %al, -0x2d1(%rbp)
movb -0x2d1(%rbp), %al
testb $0x1, %al
jne 0x334a5
jmp 0x334bc
movq -0x260(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x260(%rbp)
jmp 0x33384
movq -0x258(%rbp), %rax
cmpq -0x260(%rbp), %rax
je 0x335df
movq -0x260(%rbp), %rax
movq %rax, -0x310(%rbp)
leaq -0x250(%rbp), %rdi
callq 0x5270
movq %rax, %rcx
movq -0x310(%rbp), %rax
cmpq %rcx, %rax
jae 0x335df
movq -0x260(%rbp), %rsi
leaq -0x250(%rbp), %rdi
callq 0x55c0
movq %rax, -0x318(%rbp)
jmp 0x33519
movq -0x318(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3a, %eax
jne 0x335df
movq -0x260(%rbp), %rax
subq -0x258(%rbp), %rax
cmpq $0x10, %rax
jae 0x335df
movq -0x10(%rbp), %rax
movq %rax, -0x320(%rbp)
movq -0x258(%rbp), %rdx
movq -0x260(%rbp), %rcx
subq %rdx, %rcx
leaq -0x280(%rbp), %rdi
leaq -0x250(%rbp), %rsi
callq 0x5350
jmp 0x33575
movq -0x320(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x34ad0
movb %dl, -0x329(%rbp)
movq %rax, -0x328(%rbp)
jmp 0x33597
movb -0x329(%rbp), %al
movq -0x328(%rbp), %rcx
movq %rcx, -0x290(%rbp)
movb %al, -0x288(%rbp)
leaq -0x280(%rbp), %rdi
callq 0x5240
jmp 0x335df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x280(%rbp), %rdi
callq 0x5240
jmp 0x33604
jmp 0x33228
leaq -0x220(%rbp), %rdi
callq 0x50e0
jmp 0x335f2
movb $0x1, -0x11(%rbp)
leaq -0x250(%rbp), %rdi
callq 0x5240
jmp 0x33612
leaq -0x250(%rbp), %rdi
callq 0x5240
jmp 0x33638
movb -0x11(%rbp), %al
movb %al, -0x32a(%rbp)
leaq -0x220(%rbp), %rdi
callq 0x5110
movb -0x32a(%rbp), %al
andb $0x1, %al
addq $0x330, %rsp            # imm = 0x330
popq %rbp
retq
leaq -0x220(%rbp), %rdi
callq 0x5110
movq -0x228(%rbp), %rdi
callq 0x5530