// File: yahoo[P]UDPing/src/maclist.cc
// Function: MacList::MacList(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
MacList::MacList (string macListString) {
    const char* mls = macListString.c_str();
    numMacs = 1;
    macs = 0;
    const char* nextString = mls;
    while ((nextString = strchr(nextString + 1, ',')) != 0) {
        numMacs++;
    }
    macs = new uint8_t *[numMacs];
    nextString = mls;
    for (curMac = 0; curMac < numMacs; curMac++) {
        macs[curMac] = new uint8_t[12];
        memset (macs[curMac], 0, 6);
        int numFields = sscanf(mls, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", 
                        &(macs[curMac][0]),
                        &(macs[curMac][1]),
                        &(macs[curMac][2]),
                        &(macs[curMac][3]),
                        &(macs[curMac][4]),
                        &(macs[curMac][5]));
        if (numFields < 6) {
            cerr << "Invalid MAC string: " << macListString << endl;
            numMacs = 0;
            return;
        };
        mls = strchr (mls, ',') + 1;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rsi, -0x40(%rbp)
movq %rdi, %rax
movq -0x40(%rbp), %rdi
movq %rdi, -0x38(%rbp)
movq %rax, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
callq 0x2150
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, -0x18(%rbp)
movl $0x1, (%rax)
movq $0x0, 0x8(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
addq $0x1, %rdi
movl $0x2c, %esi
callq 0x2130
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x63e6
movq -0x30(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x63bd
movq -0x30(%rbp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2030
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rcx
movq %rcx, -0x20(%rbp)
movl $0x0, 0x4(%rax)
movq -0x30(%rbp), %rcx
movl 0x4(%rcx), %eax
cmpl (%rcx), %eax
jge 0x6552
movl $0xc, %edi
callq 0x2030
movq -0x30(%rbp), %rcx
movq %rax, %rsi
movq 0x8(%rcx), %rax
movslq 0x4(%rcx), %rdx
movq %rsi, (%rax,%rdx,8)
movq 0x8(%rcx), %rax
movslq 0x4(%rcx), %rcx
movq (%rax,%rcx,8), %rdi
xorl %esi, %esi
movl $0x6, %edx
callq 0x21a0
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rdi
movq 0x8(%rsi), %rax
movslq 0x4(%rsi), %rcx
movq (%rax,%rcx,8), %rdx
movq 0x8(%rsi), %rax
movslq 0x4(%rsi), %rcx
movq (%rax,%rcx,8), %rcx
addq $0x1, %rcx
movq 0x8(%rsi), %rax
movslq 0x4(%rsi), %r8
movq (%rax,%r8,8), %r8
addq $0x2, %r8
movq 0x8(%rsi), %rax
movslq 0x4(%rsi), %r9
movq (%rax,%r9,8), %r9
addq $0x3, %r9
movq 0x8(%rsi), %rax
movslq 0x4(%rsi), %r10
movq (%rax,%r10,8), %r10
addq $0x4, %r10
movq 0x8(%rsi), %rax
movslq 0x4(%rsi), %rsi
movq (%rax,%rsi,8), %rax
addq $0x5, %rax
leaq 0x131b(%rip), %rsi      # 0x77f2
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x22d0
movl %eax, -0x24(%rbp)
cmpl $0x6, -0x24(%rbp)
jge 0x652a
movq 0x3af9(%rip), %rdi      # 0x9ff0
leaq 0x1312(%rip), %rsi      # 0x7810
callq 0x22f0
movq -0x38(%rbp), %rsi
movq %rax, %rdi
callq 0x2260
movq %rax, %rdi
movq 0x3a9f(%rip), %rsi      # 0x9fb8
callq 0x2310
movq -0x30(%rbp), %rax
movl $0x0, (%rax)
jmp 0x6552
movq -0x18(%rbp), %rdi
movl $0x2c, %esi
callq 0x2130
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
jmp 0x6428
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)