LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: adamiaonr[P]rid-analytics/src/argvparser.cpp
// Function: CommandLineProcessing::splitOptionAndValue(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool CommandLineProcessing::splitOptionAndValue(const string& _string,
        string& _option, string& _value)
{
    // string token container
    std::vector<string> tokens;

    // split string by '=' delimiter
    splitString(tokens, _string, "=");

    // check for option value assignment 'option=value'
    if (tokens.size() < 2)
    {
        _option = _string; // the option is the whole string
        return(false);
    }

    // separate option and value
    _option = tokens[0];

    // concat all remaining tokens to the value string
    for (unsigned int i=1; i<tokens.size(); ++i)
    {
        _value.append(tokens[i]);
    }

    return(true);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
leaq -0x38(%rbp), %rdi
movq %rdi, -0x58(%rbp)
callq 0x42dc0
movq -0x58(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq 0x2260c(%rip), %rdx     # 0x634dc
callq 0x43d20
jmp 0x40ed7
leaq -0x38(%rbp), %rdi
callq 0x436e0
cmpq $0x2, %rax
jae 0x40f1f
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdi
callq 0x5070
jmp 0x40ef5
movb $0x0, -0x1(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x40f99
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x42de0
jmp 0x40fad
xorl %eax, %eax
movl %eax, %esi
leaq -0x38(%rbp), %rdi
callq 0x43e80
movq %rax, %rsi
movq -0x18(%rbp), %rdi
callq 0x5070
jmp 0x40f3a
movl $0x1, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movq %rax, -0x60(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x436e0
movq %rax, %rcx
movq -0x60(%rbp), %rax
cmpq %rcx, %rax
jae 0x40f8e
movq -0x20(%rbp), %rax
movq %rax, -0x68(%rbp)
movl -0x4c(%rbp), %eax
movl %eax, %esi
leaq -0x38(%rbp), %rdi
callq 0x43e80
movq -0x68(%rbp), %rdi
movq %rax, %rsi
callq 0x5a10
jmp 0x40f81
jmp 0x40f83
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x40f41
movb $0x1, -0x1(%rbp)
movl $0x1, -0x48(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x42de0
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x70, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x5920
nopw %cs:(%rax,%rax)
// File: adamiaonr[P]rid-analytics/src/argvparser.cpp
// Function: CommandLineProcessing::ArgvParser::getAllOptionAlternatives[abi:cxx11](unsigned int) const
list<string> ArgvParser::getAllOptionAlternatives( unsigned int _key ) const
{
    // keys go here
    list<string> keys;
    // for all container elements
    for( map<string, unsigned int>::const_iterator it = option2key.begin();
            it != option2key.end();
            ++it )
    {
        if (it->second == _key)
            keys.push_back(it->first);
    }
    return(keys);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x50(%rbp)
movq %rdi, %rax
movq %rax, -0x48(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movb $0x0, -0x15(%rbp)
callq 0x43c30
movq -0x40(%rbp), %rdi
addq $0x8, %rdi
callq 0x43c50
movq %rax, -0x20(%rbp)
movq -0x40(%rbp), %rdi
addq $0x8, %rdi
callq 0x42fc0
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x43010
testb $0x1, %al
jne 0x41024
jmp 0x41072
leaq -0x20(%rbp), %rdi
callq 0x42ff0
movl 0x20(%rax), %eax
cmpl -0x14(%rbp), %eax
jne 0x41065
leaq -0x20(%rbp), %rdi
callq 0x42ff0
movq -0x50(%rbp), %rdi
movq %rax, %rsi
callq 0x43c80
jmp 0x4104c
jmp 0x41065
movq -0x50(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x43680
jmp 0x4108f
jmp 0x41067
leaq -0x20(%rbp), %rdi
callq 0x43cc0
jmp 0x41000
movb $0x1, -0x15(%rbp)
testb $0x1, -0x15(%rbp)
jne 0x41085
movq -0x50(%rbp), %rdi
callq 0x43680
movq -0x48(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x5920
nopl (%rax,%rax)
// File: adamiaonr[P]rid-analytics/src/argvparser.cpp
// Function: CommandLineProcessing::ArgvParser::argument[abi:cxx11](unsigned int) const
string ArgvParser::argument(unsigned int _id) const
{
    if (_id >= arguments())
    {
        cerr << "ArgvParser::argument(): Request for non-existing argument." << endl;
        return ("");
    }
    else
        return(argument_container[_id]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x40(%rbp)
movq %rdi, %rax
movq %rax, -0x38(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x30(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x28(%rbp)
callq 0x410a0
movl %eax, %ecx
movl -0x28(%rbp), %eax
cmpl %ecx, %eax
jb 0x41171
movq 0x40edf(%rip), %rdi     # 0x81ff0
leaq 0x2297a(%rip), %rsi     # 0x63a92
callq 0x5480
movq %rax, %rdi
movq 0x40e69(%rip), %rsi     # 0x81f90
callq 0x54f0
leaq -0x15(%rbp), %rdi
movq %rdi, -0x48(%rbp)
callq 0x5930
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rdx
leaq 0x223c0(%rip), %rsi     # 0x63508
callq 0x30320
jmp 0x4114f
leaq -0x15(%rbp), %rdi
callq 0x5510
jmp 0x41192
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x15(%rbp), %rdi
callq 0x5510
jmp 0x4119c
movq -0x30(%rbp), %rdi
addq $0xf8, %rdi
movl -0x14(%rbp), %eax
movl %eax, %esi
callq 0x43700
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x51f0
movq -0x38(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x5920
nopw %cs:(%rax,%rax)
// File: adamiaonr[P]rid-analytics/src/argvparser.cpp
// Function: CommandLineProcessing::ArgvParser::defineOption(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)
bool ArgvParser::defineOption( const string & _name,
                               const string& _descr,
                               OptionAttributes _attrs)
{
    // do nothing if there already is an option of this name
    if (isDefinedOption(_name))
    {
        cerr << "ArgvParser::defineOption(): The option label equals an already defined option." << endl;
        return(false);
    }

    // no digits as short options allowed
    if (_name.length() == 1 && isDigit(_name[0]))
    {
        cerr << "ArgvParser::defineOption(): Digits as short option labels are not allowd." << endl;
        return(false);
    }

    option2key[_name] = max_key;     // give the option a unique key

    // store the option attributes
    option2attribute[max_key] = _attrs;

    // store the option description if there is one
    if (_descr.length())
        option2descr[max_key] = _descr;

    // inc the key counter
    ++max_key;

    return(true);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x30(%rbp)
movq -0x18(%rbp), %rsi
callq 0x3fd80
testb $0x1, %al
jne 0x4256e
jmp 0x42599
movq 0x3fa7b(%rip), %rdi     # 0x81ff0
leaq 0x216ad(%rip), %rsi     # 0x63c29
callq 0x5480
movq %rax, %rdi
movq 0x3fa05(%rip), %rsi     # 0x81f90
callq 0x54f0
movb $0x0, -0x1(%rbp)
jmp 0x42663
movq -0x18(%rbp), %rdi
callq 0x57e0
cmpq $0x1, %rax
jne 0x425eb
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x5530
movq %rax, %rdi
callq 0x42670
testb $0x1, %al
jne 0x425c3
jmp 0x425eb
movq 0x3fa26(%rip), %rdi     # 0x81ff0
leaq 0x216a7(%rip), %rsi     # 0x63c78
callq 0x5480
movq %rax, %rdi
movq 0x3f9b0(%rip), %rsi     # 0x81f90
callq 0x54f0
movb $0x0, -0x1(%rbp)
jmp 0x42663
movq -0x30(%rbp), %rdi
movl (%rdi), %eax
movl %eax, -0x38(%rbp)
addq $0x8, %rdi
movq -0x18(%rbp), %rsi
callq 0x43990
movl -0x38(%rbp), %ecx
movq -0x30(%rbp), %rsi
movl %ecx, (%rax)
movl -0x24(%rbp), %eax
movl %eax, -0x34(%rbp)
movq %rsi, %rdi
addq $0x38, %rdi
callq 0x43a70
movl -0x34(%rbp), %ecx
movl %ecx, (%rax)
movq -0x20(%rbp), %rdi
callq 0x57e0
cmpq $0x0, %rax
je 0x42654
movq -0x30(%rbp), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq %rsi, %rdi
addq $0x68, %rdi
callq 0x43200
movq -0x40(%rbp), %rsi
movq %rax, %rdi
callq 0x5070
movq -0x30(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nop
// File: adamiaonr[P]rid-analytics/src/argvparser.cpp
// Function: CommandLineProcessing::isDigit(char const&)
bool CommandLineProcessing::isDigit(const char& _char)
{
    if (_char == '0' || _char == '1' || _char == '2' || _char == '3'
            || _char == '4' || _char == '5' || _char == '6' || _char == '7'
            || _char == '8' || _char == '9')
        return(true);
    else
        return(false);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
je 0x426f0
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x31, %eax
je 0x426f0
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x32, %eax
je 0x426f0
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x33, %eax
je 0x426f0
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x34, %eax
je 0x426f0
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x35, %eax
je 0x426f0
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x36, %eax
je 0x426f0
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x37, %eax
je 0x426f0
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x38, %eax
je 0x426f0
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x39, %eax
jne 0x426f6
movb $0x1, -0x1(%rbp)
jmp 0x426fa
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: adamiaonr[P]rid-analytics/src/argvparser.cpp
// Function: CommandLineProcessing::ArgvParser::defineOptionAlternative(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool ArgvParser::defineOptionAlternative( const string & _original,
        const string & _alternative )
{
    // do nothing if there already is no option of this name
    if (!isDefinedOption(_original))
    {
        cerr << "ArgvParser::defineOptionAlternative(): Original option label is not a defined option." << endl;
        return(false);
    }

    // AND no digits as short options allowed
    if (_alternative.length() == 1 && isDigit(_alternative[0]))
    {
        cerr << "ArgvParser::defineOptionAlternative(): Digits as short option labels are not allowd." << endl;
        return(false);
    }

    // AND do nothing if there already is an option with the alternativ name
    if (isDefinedOption(_alternative))
    {
        cerr << "ArgvParser::defineOptionAlternative(): The alternative option label equals an already defined option." << endl;
        return(false);
    }

    option2key[_alternative] = optionKey(_original);

    return(true);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x28(%rbp)
movq -0x18(%rbp), %rsi
callq 0x3fd80
testb $0x1, %al
jne 0x42764
movq 0x3f8b0(%rip), %rdi     # 0x81ff0
leaq 0x2157b(%rip), %rsi     # 0x63cc2
callq 0x5480
movq %rax, %rdi
movq 0x3f83a(%rip), %rsi     # 0x81f90
callq 0x54f0
movb $0x0, -0x1(%rbp)
jmp 0x4281b
movq -0x20(%rbp), %rdi
callq 0x57e0
cmpq $0x1, %rax
jne 0x427b6
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x5530
movq %rax, %rdi
callq 0x42670
testb $0x1, %al
jne 0x4278e
jmp 0x427b6
movq 0x3f85b(%rip), %rdi     # 0x81ff0
leaq 0x2157c(%rip), %rsi     # 0x63d18
callq 0x5480
movq %rax, %rdi
movq 0x3f7e5(%rip), %rsi     # 0x81f90
callq 0x54f0
movb $0x0, -0x1(%rbp)
jmp 0x4281b
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3fd80
testb $0x1, %al
jne 0x427c9
jmp 0x427f1
movq 0x3f820(%rip), %rdi     # 0x81ff0
leaq 0x21596(%rip), %rsi     # 0x63d6d
callq 0x5480
movq %rax, %rdi
movq 0x3f7aa(%rip), %rsi     # 0x81f90
callq 0x54f0
movb $0x0, -0x1(%rbp)
jmp 0x4281b
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x3fd10
movq -0x28(%rbp), %rdi
movl %eax, -0x2c(%rbp)
addq $0x8, %rdi
movq -0x20(%rbp), %rsi
callq 0x43990
movl -0x2c(%rbp), %ecx
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: adamiaonr[P]rid-analytics/src/argvparser.cpp
// Function: CommandLineProcessing::ArgvParser::setHelpOption(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool ArgvParser::setHelpOption(const string& _shortname,
                               const string& _longname,
                               const string& _descr)
{
    // do nothing if any name is already in use
    if (isDefinedOption(_shortname) || isDefinedOption(_longname))
    {
        cerr << "ArgvParser::setHelpOption(): Short or long help option label equals an already defined option." << endl;
        return(false);
    }

    // define the help option's short name and the alternative
    // longname
    defineOption(_shortname, _descr, NoOptionAttribute);
    defineOptionAlternative(_shortname, _longname);

    help_option = max_key-1; // store the key in a special member

    return(true);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x30(%rbp)
movq -0x18(%rbp), %rsi
callq 0x3fd80
testb $0x1, %al
jne 0x42870
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3fd80
testb $0x1, %al
jne 0x42870
jmp 0x42898
movq 0x3f779(%rip), %rdi     # 0x81ff0
leaq 0x21555(%rip), %rsi     # 0x63dd3
callq 0x5480
movq %rax, %rdi
movq 0x3f703(%rip), %rsi     # 0x81f90
callq 0x54f0
movb $0x0, -0x1(%rbp)
jmp 0x428cf
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
xorl %ecx, %ecx
callq 0x42540
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x42710
movq -0x30(%rbp), %rax
movl (%rax), %ecx
subl $0x1, %ecx
movl %ecx, 0x130(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: adamiaonr[P]rid-analytics/src/argvparser.cpp
// Function: CommandLineProcessing::trimmedString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
string CommandLineProcessing::trimmedString( const std::string & _str )
{
    // no string no work
    if(_str.length() == 0)
        return _str;

    string::size_type start_pos = _str.find_first_not_of(" \a\b\f\n\r\t\v");
    string::size_type end_pos = _str.find_last_not_of(" \a\b\f\n\r\t\v");

    // check whether there was any non-whitespace
    if (start_pos == string::npos)
        return("");

    return string(_str, start_pos, end_pos - start_pos + 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x48(%rbp)
movq %rdi, %rax
movq %rax, -0x40(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x57e0
cmpq $0x0, %rax
jne 0x4299c
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x51f0
jmp 0x42a38
movq -0x10(%rbp), %rdi
leaq 0x2148b(%rip), %rsi     # 0x63e32
xorl %eax, %eax
movl %eax, %edx
callq 0x52b0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x21473(%rip), %rsi     # 0x63e32
movq $-0x1, %rdx
callq 0x5970
movq %rax, -0x20(%rbp)
cmpq $-0x1, -0x18(%rbp)
jne 0x42a1b
leaq -0x21(%rbp), %rdi
movq %rdi, -0x50(%rbp)
callq 0x5930
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rdx
leaq 0x20b16(%rip), %rsi     # 0x63508
callq 0x30320
jmp 0x429f9
leaq -0x21(%rbp), %rdi
callq 0x5510
jmp 0x42a38
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x21(%rbp), %rdi
callq 0x5510
jmp 0x42a42
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
subq -0x18(%rbp), %rcx
addq $0x1, %rcx
callq 0x5710
movq -0x40(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x5920
nopl (%rax,%rax)
// File: adamiaonr[P]rid-analytics/include/argvparser.h
// Function: void CommandLineProcessing::splitString<std::vector<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>>>>>(std::vector<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>>>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char const*)
void splitString(Container& _container, const std::string& _in,
                 const char* const _delimiters = " \t\n")
{
    const std::string::size_type len = _in.length();
    std::string::size_type i = 0;

    while ( i < len )
    {
        // eat leading whitespace
        i = _in.find_first_not_of (_delimiters, i);
        if (i == std::string::npos)
            return;   // nothing left but white space

        // find the end of the token
        std::string::size_type j = _in.find_first_of (_delimiters, i);

        // push token
        if (j == std::string::npos)
        {
            _container.push_back (_in.substr(i));
            return;
        }
        else
            _container.push_back (_in.substr(i, j-i));

        // set up for next loop
        i = j + 1;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x57e0
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x43e6d
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x52b0
movq %rax, -0x28(%rbp)
cmpq $-0x1, -0x28(%rbp)
jne 0x43d7b
jmp 0x43e6d
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x5260
movq %rax, -0x30(%rbp)
cmpq $-0x1, -0x30(%rbp)
jne 0x43dfb
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x50(%rbp), %rdi
movq %rdi, -0x88(%rbp)
movq $-0x1, %rcx
callq 0x54d0
movq -0x90(%rbp), %rdi
movq -0x88(%rbp), %rsi
callq 0x4a6d0
jmp 0x43dd6
leaq -0x50(%rbp), %rdi
callq 0x52f0
jmp 0x43e6d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x52f0
jmp 0x43e76
movq -0x8(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
subq %rdx, %rcx
leaq -0x80(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0x54d0
movq -0xa0(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0x4a6d0
jmp 0x43e3a
leaq -0x80(%rbp), %rdi
callq 0x52f0
jmp 0x43e5c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x52f0
jmp 0x43e76
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x43d4c
addq $0xa0, %rsp
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x5920
nop
// File: adamiaonr[P]rid-analytics/src/rid-analytics.cpp
// Function: RID_Analytics::~RID_Analytics()
RID_Analytics::~RID_Analytics() {

    // erase the routers in the topology. use the router map for that (see the 
    // advantage of using modern C++ features you dummy?)
    for(RID_RouterMap::iterator rit = this->routers.begin(); 
        rit != this->routers.end(); 
        ++rit) {

        delete (*rit).second;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
addq $0x50, %rdi
callq 0x51be0
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rdi
addq $0x50, %rdi
callq 0x51c40
movq %rax, -0x18(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x51c10
testb $0x1, %al
jne 0x4dfb5
jmp 0x4dff0
leaq -0x10(%rbp), %rdi
callq 0x51c70
movq 0x20(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0x4dfe3
movq -0x28(%rbp), %rdi
callq 0x324e0
movq -0x28(%rbp), %rdi
movl $0xa8, %esi
callq 0x54b0
jmp 0x4dfe5
leaq -0x10(%rbp), %rdi
callq 0x51c90
jmp 0x4df91
movq -0x20(%rbp), %rdi
addq $0x98, %rdi
callq 0x51b40
movq -0x20(%rbp), %rdi
addq $0x50, %rdi
callq 0x51ba0
movq -0x20(%rbp), %rdi
addq $0x20, %rdi
callq 0x51bc0
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x34b10
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: adamiaonr[P]rid-analytics/src/rid-analytics.cpp
// Function: on_path_to_origin(RID_Router*, int, int)
bool on_path_to_origin(RID_Router * router, int i, int os_id) {

    // check if bit is on 
    unsigned int byte_ix = (unsigned int) (os_id / 8);
    std::vector<uint8_t> * bitmask = router->get_tree_bitmask(i);

    // std::cout << "RID_Analytics : on_path_to_origin() : is [" 
    //     << router->get_id() << "][" << i << "] on the path to " << os_id << "?"
    //     << "\n\t [byte] : " << byte_ix
    //     << "\n\t [bit] : " << std::bitset<(sizeof(uint8_t) * 8)>(1 << (os_id % 8))
    //     << "\n\t [ bitmask[byte] ] : " << std::bitset<(sizeof(uint8_t) * 8)>((*bitmask)[byte_ix])
    //     << "\n\t [result] : " << (((1 << (os_id % 8)) & (*bitmask)[byte_ix]) > 0 ? "YES" : "NO") << std::endl;

    if (byte_ix < (*bitmask).size())
        return (((1 << (os_id % 8)) & (*bitmask)[byte_ix]) > 0);

    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %eax
movzbl %al, %esi
callq 0x51ef0
movq %rax, -0x28(%rbp)
movl -0x1c(%rbp), %eax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0x35580
movq %rax, %rcx
movq -0x30(%rbp), %rax
cmpq %rcx, %rax
jae 0x4e77c
movl -0x18(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %edx, %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0x34(%rbp)
movq -0x28(%rbp), %rdi
movl -0x1c(%rbp), %eax
movl %eax, %esi
callq 0x34d30
movq %rax, %rcx
movl -0x34(%rbp), %eax
movzbl (%rcx), %ecx
andl %ecx, %eax
cmpl $0x0, %eax
setg %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x4e780
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: adamiaonr[P]rid-analytics/src/rid-analytics.cpp
// Function: RID_Analytics::add_events(RID_Router*, std::vector<long double, std::allocator<long double>>)
void RID_Analytics::add_events(
    RID_Router * router,
    std::vector<__float080> events) {

    // header: router\tnlm\tllm\tmlm\tslm\n
    this->output_file[0] << router->get_id();
    for (unsigned int e = 0; e < events.size(); e++) {

        // if(((e == EVENT_SLMC) || (e == EVENT_SLMI) || (e == EVENT_LLM)) && events[e] > 1.1)
        //     std::cout << "RID_Analytics::add_events() : [ERROR] E[" << ((e == EVENT_LLM) ? "LLM" : "SLMx") << "] = " 
        //         << events[e] << " (> 1.0) @R" << router->get_id() << std::endl;

        this->output_file[0] << "\t" << events[e];
    }
    this->output_file[0] << "\n";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdx, -0x68(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x60(%rbp)
addq $0x98, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x51df0
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x38(%rbp), %rdi
movq %rdi, -0x50(%rbp)
callq 0x35650
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x5430
jmp 0x4e7e7
leaq -0x38(%rbp), %rdi
callq 0x52f0
movl $0x0, -0x48(%rbp)
movq -0x68(%rbp), %rdi
movl -0x48(%rbp), %eax
movq %rax, -0x70(%rbp)
callq 0x355f0
movq %rax, %rcx
movq -0x70(%rbp), %rax
cmpq %rcx, %rax
jae 0x4e87a
movq -0x60(%rbp), %rdi
addq $0x98, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x51df0
movq %rax, %rdi
leaq 0x14cd6(%rip), %rsi     # 0x63507
callq 0x5480
movq -0x68(%rbp), %rdi
movq %rax, -0x78(%rbp)
movl -0x48(%rbp), %eax
movl %eax, %esi
callq 0x34c70
movq -0x78(%rbp), %rdi
fldt (%rax)
movq %rsp, %rax
fstpt (%rax)
callq 0x55b0
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x4e7f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x52f0
jmp 0x4e8a6
movq -0x60(%rbp), %rdi
addq $0x98, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x51df0
movq %rax, %rdi
leaq 0x14c2b(%rip), %rsi     # 0x634c3
callq 0x5480
addq $0x90, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x5920
nop
// File: adamiaonr[P]rid-analytics/src/rid-analytics.cpp
// Function: RID_Analytics::handle_ttl_drop(RID_Router*, long double, Path_State*)
int RID_Analytics::handle_ttl_drop(
    RID_Router * router,
    __float080 event_num,
    Path_State * prev_state) {

    std::cout << "RID_Analytics::handle_ttl_drop() : analyzing TTL drop event" 
        << std::endl;

    add_outcome(
        router, 
        OUTCOME_TTL_DROP, 
        event_num, 
        prev_state->get_length());

    // FIXME: special event to end simulation
    //  - it's not solved by any kind of resolution
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
fldt 0x10(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
fstpt -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq 0x32f3f(%rip), %rdi     # 0x81fb8
leaq 0x15194(%rip), %rsi     # 0x64214
callq 0x5480
movq %rax, %rdi
movq 0x32f01(%rip), %rsi     # 0x81f90
callq 0x54f0
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
fldt -0x20(%rbp)
fstpt -0x4c(%rbp)
movq -0x28(%rbp), %rdi
callq 0x3f5c0
fldt -0x4c(%rbp)
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl %eax, -0x2c(%rbp)
fildl -0x2c(%rbp)
movq %rsp, %rax
fstpt 0x10(%rax)
fstpt (%rax)
movl $0x5, %edx
callq 0x4e440
xorl %eax, %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: adamiaonr[P]rid-analytics/src/prob.cpp
// Function: count_set_bits(int)
int count_set_bits(int number) {

    int set_bits = 0;
    int _num = number;
    
    while(_num > 0) {
        clear_lsb(_num);
        set_bits++;
    }

    return set_bits;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jle 0x59b52
leaq -0xc(%rbp), %rdi
callq 0x59af0
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x59b38
movl -0x8(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: adamiaonr[P]rid-analytics/src/prob.cpp
// Function: count_shared_trees(int, Prob::fp_data*, std::map<int, std::vector<unsigned char, std::allocator<unsigned char>>, std::less<int>, std::allocator<std::pair<int const, std::vector<unsigned char, std::allocator<unsigned char>>>>>*)
int count_shared_trees(
    int t,
    Prob::fp_data * iface_fp_data,
    std::map<int, std::vector<uint8_t> > * tree_bitmasks) {

    int count = 0;
    for (unsigned int k = 0; k < (*tree_bitmasks)[t].size(); k++)
        count += count_set_bits((int) (((*tree_bitmasks)[t][k]) & (iface_fp_data->tree_bitmasks[t][k])));

    return count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x4(%rbp), %rsi
callq 0x354a0
movq %rax, %rdi
callq 0x35580
movq %rax, %rcx
movq -0x28(%rbp), %rax
cmpq %rcx, %rax
jae 0x59ea8
movq -0x18(%rbp), %rdi
leaq -0x4(%rbp), %rsi
callq 0x354a0
movq %rax, %rdi
movl -0x20(%rbp), %eax
movl %eax, %esi
callq 0x34d30
movzbl (%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rdi
addq $0x60, %rdi
leaq -0x4(%rbp), %rsi
callq 0x354a0
movq %rax, %rdi
movl -0x20(%rbp), %eax
movl %eax, %esi
callq 0x34d30
movl -0x2c(%rbp), %edi
movzbl (%rax), %eax
andl %eax, %edi
callq 0x59b20
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x59e21
movl -0x1c(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: adamiaonr[P]rid-analytics/src/prob.cpp
// Function: Prob::calc_lm_probs(std::vector<std::vector<Prob::fp_data*, std::allocator<Prob::fp_data*>>, std::allocator<std::vector<Prob::fp_data*, std::allocator<Prob::fp_data*>>>>*, std::map<int, std::vector<unsigned char, std::allocator<unsigned char>>, std::less<int>, std::allocator<std::pair<int const, std::vector<unsigned char, std::allocator<unsigned char>>>>>*)
int Prob::calc_lm_probs(
    std::vector<std::vector<Prob::fp_data *> > * iface_fp_data,
    std::map<int, std::vector<uint8_t> > * tree_bitmasks) {

    for (uint8_t i = 0; i < this->iface_num; i++) {

        // time complexity : O(N^2 * I)
        calc_lm_prob(i, (*iface_fp_data)[0][i], tree_bitmasks);       // iface i
        // time complexity : O(N^2 * I)
        calc_lm_prob(i, (*iface_fp_data)[1][i], tree_bitmasks, true); // iface ~i

        // print_lm_prob(i);
        // print_lm_prob(i, true);
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movb $0x0, -0x19(%rbp)
movq -0x28(%rbp), %rcx
movzbl -0x19(%rbp), %eax
movzbl 0xb0(%rcx), %ecx
cmpl %ecx, %eax
jge 0x5aeb2
movb -0x19(%rbp), %al
movb %al, -0x2a(%rbp)
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x35850
movq %rax, %rdi
movzbl -0x19(%rbp), %eax
movl %eax, %esi
callq 0x358e0
movq -0x28(%rbp), %rdi
movq %rax, %rcx
movb -0x2a(%rbp), %al
movq (%rcx), %rdx
movq -0x18(%rbp), %rcx
xorl %r8d, %r8d
movzbl %al, %esi
callq 0x5a6f0
movb -0x19(%rbp), %al
movb %al, -0x29(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x35850
movq %rax, %rdi
movzbl -0x19(%rbp), %eax
movl %eax, %esi
callq 0x358e0
movq -0x28(%rbp), %rdi
movq %rax, %rcx
movb -0x29(%rbp), %al
movq (%rcx), %rdx
movq -0x18(%rbp), %rcx
movl $0x1, %r8d
movzbl %al, %esi
callq 0x5a6f0
movb -0x19(%rbp), %al
addb $0x1, %al
movb %al, -0x19(%rbp)
jmp 0x5ae10
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: zgimbutas[P]mwrap/src/stringify.c
// Function: stringify
void stringify(const char* name)
{
    char line[512];
    char* p;

    printf("/*\n"
           " * Auto-generated by stringify\n"
           " */\n\n");
    printf("const char* %s =", name);
    while (fgets(line, sizeof(line), stdin)) {
        printf("\n  \"");
        for (p = line; *p; ++p) {
            if (*p == '"' || *p == '\\')
                putc('\\', stdout);
            if (*p != '\n' && *p != '\r')
                putc(*p, stdout);
        }
        printf("\\n\"");
    }
    printf(";\n\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x220, %rsp            # imm = 0x220
movq %rdi, -0x8(%rbp)
leaq 0xe6e(%rip), %rdi       # 0x2004
movb $0x0, %al
callq 0x1030
movq -0x8(%rbp), %rsi
leaq 0xe84(%rip), %rdi       # 0x202c
movb $0x0, %al
callq 0x1030
leaq -0x210(%rbp), %rdi
movq 0x2e1b(%rip), %rax      # 0x3fd8
movq (%rax), %rdx
movl $0x200, %esi            # imm = 0x200
callq 0x1040
cmpq $0x0, %rax
je 0x1295
leaq 0xe62(%rip), %rdi       # 0x203d
movb $0x0, %al
callq 0x1030
leaq -0x210(%rbp), %rax
movq %rax, -0x218(%rbp)
movq -0x218(%rbp), %rax
cmpb $0x0, (%rax)
je 0x1282
movq -0x218(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
je 0x121e
movq -0x218(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5c, %eax
jne 0x1232
movq 0x2dab(%rip), %rax      # 0x3fd0
movq (%rax), %rsi
movl $0x5c, %edi
callq 0x1050
movq -0x218(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
je 0x1269
movq -0x218(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xd, %eax
je 0x1269
movq -0x218(%rbp), %rax
movsbl (%rax), %edi
movq 0x2d6f(%rip), %rax      # 0x3fd0
movq (%rax), %rsi
callq 0x1050
jmp 0x126b
movq -0x218(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x218(%rbp)
jmp 0x11f0
leaq 0xdb9(%rip), %rdi       # 0x2042
movb $0x0, %al
callq 0x1030
jmp 0x11af
leaq 0xdaa(%rip), %rdi       # 0x2046
movb $0x0, %al
callq 0x1030
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
nopl (%rax)
// File: zgimbutas[P]mwrap/src/stringify.c
// Function: main
int main(int argc, char** argv)
{
    if (argc != 2) {
        fprintf(stderr, "String name required\n");
        exit(-1);
    }
    stringify(argv[1]);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x8(%rbp)
je 0x12ee
movq 0x2d25(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xd6d(%rip), %rsi       # 0x204a
movb $0x0, %al
callq 0x1060
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1070
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1180
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
// File: calgagi[P]cp_gen/main.cpp
// Function: noAfterDot(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
string noAfterDot(const string& filename) {
    int where = filename.find(".");
    if (where == string::npos) {
        error("Could not find task in filename");
    } 
    return filename.substr(0, where);
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x8(%rsp)
movq %rdi, %rax
movq %rax, 0x10(%rsp)
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq 0x58(%rsp), %rdi
leaq 0x7529(%rip), %rsi      # 0xb080
xorl %eax, %eax
movl %eax, %edx
callq 0x3480
movl %eax, 0x54(%rsp)
movslq 0x54(%rsp), %rax
cmpq $-0x1, %rax
jne 0x3bea
leaq 0x2f(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x3430
movq (%rsp), %rdx
leaq 0x74a0(%rip), %rsi      # 0xb028
leaq 0x30(%rsp), %rdi
callq 0x4d50
jmp 0x3b94
leaq 0x30(%rsp), %rdi
callq 0x3ae0
jmp 0x3ba0
leaq 0x30(%rsp), %rdi
callq 0x34a8
leaq 0x2f(%rsp), %rdi
callq 0x32e0
jmp 0x3bea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
jmp 0x3bde
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x34a8
leaq 0x2f(%rsp), %rdi
callq 0x32e0
jmp 0x3c0c
movq 0x8(%rsp), %rdi
movq 0x58(%rsp), %rsi
movslq 0x54(%rsp), %rcx
xorl %eax, %eax
movl %eax, %edx
callq 0x3290
movq 0x10(%rsp), %rax
addq $0x68, %rsp
retq
movq 0x20(%rsp), %rdi
callq 0x3420
nopw %cs:(%rax,%rax)
// File: calgagi[P]cp_gen/main.cpp
// Function: pathToGen[abi:cxx11]()
string pathToGen() {
    char buff[512];

    // Linux syscall that gets the linked path to the current executable, "gen"
    ssize_t r = ::readlink("/proc/self/exe", buff, 511);
    if (r == -1) {
        error("Could not find path to current executable."); 
    }
    else {
        buff[r] = '\0';
    }

    // this assumes that gen is in the root directory of cp_gen (where lib is)
    string gen_path = buff;
    shavePath(gen_path);
    return gen_path;
}

// Assembly:
subq $0x268, %rsp            # imm = 0x268
movq %rdi, 0x10(%rsp)
movq %rdi, %rax
movq %rax, 0x18(%rsp)
movq %rdi, 0x260(%rsp)
leaq 0x60(%rsp), %rsi
leaq 0x73a0(%rip), %rdi      # 0xb048
movl $0x1ff, %edx            # imm = 0x1FF
callq 0x32d0
movq %rax, 0x58(%rsp)
cmpq $-0x1, 0x58(%rsp)
jne 0x3d43
leaq 0x37(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x3430
movq 0x8(%rsp), %rdx
leaq 0x7379(%rip), %rsi      # 0xb057
leaq 0x38(%rsp), %rdi
callq 0x4d50
jmp 0x3cea
leaq 0x38(%rsp), %rdi
callq 0x3ae0
jmp 0x3cf6
leaq 0x38(%rsp), %rdi
callq 0x34a8
leaq 0x37(%rsp), %rdi
callq 0x32e0
jmp 0x3d4d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
jmp 0x3d34
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x34a8
leaq 0x37(%rsp), %rdi
callq 0x32e0
jmp 0x3dc8
movq 0x58(%rsp), %rax
movb $0x0, 0x60(%rsp,%rax)
movb $0x0, 0x23(%rsp)
leaq 0x22(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x3430
movq 0x10(%rsp), %rdi
movq (%rsp), %rdx
leaq 0x60(%rsp), %rsi
callq 0x4d50
jmp 0x3d75
leaq 0x22(%rsp), %rdi
callq 0x32e0
movq 0x10(%rsp), %rdi
callq 0x3c20
movb $0x1, 0x23(%rsp)
testb $0x1, 0x23(%rsp)
jne 0x3dbb
jmp 0x3db1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
leaq 0x22(%rsp), %rdi
callq 0x32e0
jmp 0x3dc8
movq 0x10(%rsp), %rdi
callq 0x34a8
movq 0x18(%rsp), %rax
addq $0x268, %rsp            # imm = 0x268
retq
movq 0x28(%rsp), %rdi
callq 0x3420
nopw %cs:(%rax,%rax)
// File: calgagi[P]cp_gen/main.cpp
// Function: output_file(std::basic_fstream<char, std::char_traits<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void output_file(fstream& new_file, const string& file_path) {
    fstream to_output;
    to_output.open(file_path);
    if (!to_output.is_open()) {
        error("Could not find " + file_path + " file");
    }
    string line;
    while (getline(to_output, line)) {
        // Skip "#pragma once" lines, they are used for dependencies in testing
        if (line != "#pragma once") {
            new_file << line << endl;
        }
    }
    return;
}

// Assembly:
subq $0x2c8, %rsp            # imm = 0x2C8
movq %rdi, 0x2c0(%rsp)
movq %rsi, 0x2b8(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0x3310
movq 0x2b8(%rsp), %rax
movq %rax, 0x28(%rsp)
movl $0x8, %edi
movl $0x10, %esi
callq 0x5120
movl %eax, 0x34(%rsp)
jmp 0x3e26
movl 0x34(%rsp), %edx
movq 0x28(%rsp), %rsi
leaq 0xa8(%rsp), %rdi
callq 0x3380
jmp 0x3e3e
leaq 0xa8(%rsp), %rdi
callq 0x3410
movb %al, 0x27(%rsp)
jmp 0x3e51
movb 0x27(%rsp), %al
testb $0x1, %al
jne 0x3f10
jmp 0x3e5f
movq 0x2b8(%rsp), %rdx
leaq 0x7214(%rip), %rsi      # 0xb082
leaq 0x58(%rsp), %rdi
callq 0x5190
jmp 0x3e7a
leaq 0x7211(%rip), %rdx      # 0xb092
leaq 0x78(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x5140
jmp 0x3e92
leaq 0x78(%rsp), %rdi
callq 0x3ae0
jmp 0x3e9e
leaq 0x78(%rsp), %rdi
callq 0x34a8
leaq 0x58(%rsp), %rdi
callq 0x34a8
jmp 0x3f10
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa0(%rsp)
movl %eax, 0x9c(%rsp)
jmp 0x3fee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa0(%rsp)
movl %eax, 0x9c(%rsp)
jmp 0x3f01
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa0(%rsp)
movl %eax, 0x9c(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x34a8
leaq 0x58(%rsp), %rdi
callq 0x34a8
jmp 0x3fee
leaq 0x38(%rsp), %rdi
callq 0x3390
leaq 0xa8(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x3080
movq %rax, 0x18(%rsp)
jmp 0x3f33
movq 0x18(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3360
movb %al, 0x17(%rsp)
jmp 0x3f4d
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0x3f57
jmp 0x3fcf
leaq 0x713a(%rip), %rsi      # 0xb098
leaq 0x38(%rsp), %rdi
callq 0x52c0
movb %al, 0x16(%rsp)
jmp 0x3f6e
movb 0x16(%rsp), %al
testb $0x1, %al
jne 0x3f78
jmp 0x3fca
movq 0x2c0(%rsp), %rdi
addq $0x10, %rdi
leaq 0x38(%rsp), %rsi
callq 0x3230
movq %rax, 0x8(%rsp)
jmp 0x3f95
movq 0x8(%rsp), %rdi
movq 0xc017(%rip), %rsi      # 0xffb8
callq 0x32b0
jmp 0x3fa8
jmp 0x3fca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa0(%rsp)
movl %eax, 0x9c(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x34a8
jmp 0x3fee
jmp 0x3f1a
leaq 0x38(%rsp), %rdi
callq 0x34a8
leaq 0xa8(%rsp), %rdi
callq 0x3090
addq $0x2c8, %rsp            # imm = 0x2C8
retq
leaq 0xa8(%rsp), %rdi
callq 0x3090
movq 0xa0(%rsp), %rdi
callq 0x3420
nopl (%rax,%rax)
// File: calgagi[P]cp_gen/main.cpp
// Function: output(std::basic_fstream<char, std::char_traits<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<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&)
void output(fstream& new_file, const string& filename, const vector<string>& templates) {
    // Static Header
    time_t now = time(0);
    new_file << "/*\n"
        " * generated by github.com/calgagi/cp_gen\n" 
        " * file: " << filename << "\n"
        " * time: " << ctime(&now) << ""
        " */\n"
        "\n"
        "#include <bits/stdc++.h>\n"
        "using namespace std;\n"
        "typedef long long ll;\n"
        "typedef long double ld;\n\n"
        "namespace cp {\n\n";


    string gen_path = pathToGen();

    // Output templates
    output_templates(new_file, templates);
    new_file << "}\n\n"
                "/* ===== BEGIN USER CODE ===== */\n\n";
    // User-defined after cp namespace file
    output_file(new_file, gen_path + CP_GEN_AFTER);

    return;
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdx, 0x70(%rsp)
xorl %eax, %eax
movl %eax, %edi
callq 0x3240
movq %rax, 0x68(%rsp)
movq 0x80(%rsp), %rdi
addq $0x10, %rdi
leaq 0x6b65(%rip), %rsi      # 0xb0af
callq 0x3260
movq %rax, %rdi
movq 0x78(%rsp), %rsi
callq 0x3230
movq %rax, %rdi
leaq 0x6b80(%rip), %rsi      # 0xb0e6
callq 0x3260
movq %rax, 0x10(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x30e0
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x3260
movq %rax, %rdi
leaq 0x6b60(%rip), %rsi      # 0xb0f1
callq 0x3260
leaq 0x48(%rsp), %rdi
callq 0x3c80
movq 0x80(%rsp), %rdi
movq 0x70(%rsp), %rsi
callq 0x4010
jmp 0x45b4
movq 0x80(%rsp), %rdi
addq $0x10, %rdi
leaq 0x6b9d(%rip), %rsi      # 0xb164
callq 0x3260
jmp 0x45ce
movq 0x80(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0xbc96(%rip), %rdx      # 0x10278
leaq 0x18(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x57a0
jmp 0x45f3
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x3de0
jmp 0x4604
leaq 0x18(%rsp), %rdi
callq 0x34a8
leaq 0x48(%rsp), %rdi
callq 0x34a8
addq $0x88, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x40(%rsp)
movl %eax, 0x3c(%rsp)
jmp 0x4648
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x40(%rsp)
movl %eax, 0x3c(%rsp)
leaq 0x18(%rsp), %rdi
callq 0x34a8
leaq 0x48(%rsp), %rdi
callq 0x34a8
movq 0x40(%rsp), %rdi
callq 0x3420
nopl (%rax)
// File: ahupowerdns[P]mcounter/mcounter-multi.cc
// Function: unsharedStructWorker(unsigned int)
void unsharedStructWorker(unsigned int a)
{
  UnsharedCounterStruct<MyCounters> uc(&myc);
  for(unsigned int n = 0; n < a; ++n) {
    ++uc.d_value.a;
    ++uc.d_value.b;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
leaq -0x20(%rbp), %rdi
leaq 0x9d2a(%rip), %rsi      # 0xc1a0
callq 0x2b70
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x4(%rbp), %eax
jae 0x24ad
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x2482
leaq -0x20(%rbp), %rdi
callq 0x2bb0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: ahupowerdns[P]mcounter/mcounter-multi.cc
// Function: sharedStructWorker(unsigned int)
void sharedStructWorker(unsigned int a)
{
  UnsharedCounterStruct<MyCounters> uc(&myc);
  for(unsigned int n = 0; n < a; ++n) {
    ++mca.a;
    ++mca.b;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
leaq -0x20(%rbp), %rdi
leaq 0x9cca(%rip), %rsi      # 0xc1a0
callq 0x2b70
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x4(%rbp), %eax
jae 0x2511
leaq 0x9d1f(%rip), %rdi      # 0xc210
callq 0x2bf0
leaq 0x9d13(%rip), %rdi      # 0xc210
addq $0x8, %rdi
callq 0x2bf0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x24e2
leaq -0x20(%rbp), %rdi
callq 0x2bb0
addq $0x30, %rsp
popq %rbp
retq
// File: ahupowerdns[P]mcounter/./mcounter.hh
// Function: UnsharedCounterStructParent<MyCounters>::get()
T UnsharedCounterStructParent<T>::get()
{
  std::lock_guard<std::mutex> l(d_mutex);
  T ret = d_formerChildren;

  for(const auto& c : d_children) {
    StructPlusIs(ret, c->d_value);
  }
  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x18(%rbp)
movq -0x18(%rbp), %rsi
movq %rsi, -0x48(%rbp)
addq $0x38, %rsi
leaq -0x20(%rbp), %rdi
callq 0x3c70
movq -0x48(%rbp), %rax
movq 0x60(%rax), %rcx
movq %rcx, -0x10(%rbp)
movq 0x68(%rax), %rcx
movq %rcx, -0x8(%rbp)
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x5060
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0x5090
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x50c0
testb $0x1, %al
jne 0x2c86
jmp 0x2cb2
leaq -0x30(%rbp), %rdi
callq 0x50f0
movq -0x48(%rbp), %rdi
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rdx
leaq -0x10(%rbp), %rsi
callq 0x4d40
leaq -0x30(%rbp), %rdi
callq 0x5120
jmp 0x2c73
leaq -0x20(%rbp), %rdi
callq 0x3ce0
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: ahupowerdns[P]mcounter/./mcounter.hh
// Function: UnsharedCounterStructParent<MyCounters>::StructPlusIs(MyCounters&, MyCounters const volatile&)
void UnsharedCounterStructParent<T>::StructPlusIs(T& dst, const volatile T& src)
{
  // get your helmet on
  auto dptr = (uint64_t*)&dst;
  auto sptr = (const uint64_t*)&src;
  static_assert((sizeof(T) % 8) == 0, "Struct does not consist of integral number of 64 bit counters");
  int num = sizeof(T)/8;

  for(int n = 0 ; n < num; ++n)
    *dptr++ += *sptr++;

  // so this just added the 64 bit counters in struct src to those in dst
  // "roughly"
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x2, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x4da8
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x28(%rbp)
movq (%rax), %rcx
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, -0x20(%rbp)
addq (%rax), %rcx
movq %rcx, (%rax)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x4d6e
popq %rbp
retq
nopw (%rax,%rax)
// File: pxzwxx[P]SynBS/./serverFile/./../share/log.h
// Function: void Log::INFO<>(char const*)
static void INFO(const char *format, Args ...args) {
        m_emptyBuff.P();
        m_mutex.lock();
      
        char log_buf[10240] = {0};
        time_t t = time(NULL);
        struct tm *sys_tm = localtime(&t);
        sprintf(log_buf, "%d-%d-%d-%d-%d", sys_tm->tm_year + 1900, sys_tm->tm_mon + 1, sys_tm->tm_mday, sys_tm->tm_hour, sys_tm->tm_min);
        int n = strlen(log_buf);
        sprintf(log_buf + n, "  %s", "[info]  : ");
        n = strlen(log_buf);
        sprintf(log_buf + n, format, args...);
        std::string s(log_buf);

        m_list.push_back(std::move(s));

        m_mutex.unlock();
        m_fullBuff.V();
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2880, %rsp           # imm = 0x2880
movq %rdi, -0x8(%rbp)
leaq 0x1372a(%rip), %rdi     # 0x17360
callq 0x5530
leaq 0x1368e(%rip), %rdi     # 0x172d0
callq 0x5580
leaq -0x2810(%rbp), %rdi
movq %rdi, -0x2870(%rbp)
xorl %esi, %esi
movl %esi, -0x2878(%rbp)
movl $0x2800, %edx           # imm = 0x2800
callq 0x31e0
movl -0x2878(%rbp), %eax
movl %eax, %edi
callq 0x3300
movq %rax, -0x2818(%rbp)
leaq -0x2818(%rbp), %rdi
callq 0x3270
movq -0x2870(%rbp), %rdi
movq %rax, %rcx
movl -0x2878(%rbp), %eax
movq %rcx, -0x2820(%rbp)
movq -0x2820(%rbp), %rsi
movl 0x14(%rsi), %edx
addl $0x76c, %edx            # imm = 0x76C
movl 0x10(%rsi), %ecx
incl %ecx
movl 0xc(%rsi), %r8d
movl 0x4(%rsi), %r10d
movl 0x8(%rsi), %r9d
movq %rsp, %rsi
movl %r10d, (%rsi)
leaq 0xb459(%rip), %rsi      # 0xf125
movb %al, -0x2871(%rbp)
callq 0x30b0
movq -0x2870(%rbp), %rdi
callq 0x3180
movq %rax, %rcx
movb -0x2871(%rbp), %al
movl %ecx, -0x2824(%rbp)
movslq -0x2824(%rbp), %rcx
leaq -0x2810(%rbp,%rcx), %rdi
leaq 0xb42c(%rip), %rsi      # 0xf134
leaq 0xb42a(%rip), %rdx      # 0xf139
callq 0x30b0
movq -0x2870(%rbp), %rdi
callq 0x3180
movq %rax, %rcx
movb -0x2871(%rbp), %al
movl %ecx, -0x2824(%rbp)
movslq -0x2824(%rbp), %rcx
leaq -0x2810(%rbp,%rcx), %rdi
movq -0x8(%rbp), %rsi
callq 0x30b0
leaq -0x2849(%rbp), %rdi
movq %rdi, -0x2868(%rbp)
callq 0x34d0
movq -0x2870(%rbp), %rsi
movq -0x2868(%rbp), %rdx
leaq -0x2848(%rbp), %rdi
callq 0x4060
jmp 0x3d76
leaq -0x2849(%rbp), %rdi
callq 0x3370
leaq 0x13637(%rip), %rdi     # 0x173c0
leaq -0x2848(%rbp), %rsi
callq 0x55b0
jmp 0x3d97
leaq 0x13532(%rip), %rdi     # 0x172d0
callq 0x55f0
jmp 0x3da5
leaq 0x13554(%rip), %rdi     # 0x17300
callq 0x5610
jmp 0x3db3
leaq -0x2848(%rbp), %rdi
callq 0x3220
addq $0x2880, %rsp           # imm = 0x2880
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2858(%rbp)
movl %eax, -0x285c(%rbp)
leaq -0x2849(%rbp), %rdi
callq 0x3370
jmp 0x3e06
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2858(%rbp)
movl %eax, -0x285c(%rbp)
leaq -0x2848(%rbp), %rdi
callq 0x3220
movq -0x2858(%rbp), %rdi
callq 0x34c0
nopw %cs:(%rax,%rax)
nopl (%rax)