// File: /workspace/github_cpp_makefile_star2_O2/gdaws[P]process-monitor/program_arguments.cpp
// Function: program_arguments::parser::parse(int, char const**)
void parser::parse(int argc, const char ** argv)
{
    bool print_help = false;
    set_options_group(NULL);
    add_option('h', "help", "display this help and exit", print_help);
    
    std::vector<std::string> error_messages;
    
    for(int i = 1; i < argc; i++)
    {
        const char * arg = argv[i];
        
        if(arg[0] == '-')
        {
            if(arg[1] == '-')
            {
                const char * name_begin = arg + 2;
                const char * value = strstr(name_begin, "=");
                const char * name_end = 
                    (value ? value : name_begin + strlen(name_begin));
                
                verbose_names_iterator iter = 
                    m_verbose_names.find(std::string(name_begin, name_end));
                
                if(iter == m_verbose_names.end())
                {
                    std::stringstream format;
                    format<<"unknown option  '--"
                          <<std::string(name_begin, name_end)
                          <<"'";
                    error_messages.push_back(format.str());
                    continue;
                }
                
                option * opt = &(iter->second);
                
                if(value)
                {
                    if(!opt->value_name)
                    {
                        std::stringstream format;
                        format<<"option '--"
                              <<std::string(name_begin, name_end)
                              <<"' doesn't allow an argument";
                        error_messages.push_back(format.str());
                        continue;
                    }
                }
                else
                {
                    if(opt->value_name)
                    {
                        std::stringstream format;
                        format<<"option  '--"
                              <<std::string(name_begin, name_end)
                              <<"' requires an argument";
                        error_messages.push_back(format.str());
                        continue;
                    }
                }
                
                opt->binding->parse_value(value + 1);
            }
            else
            {
                names_iterator iter = m_names.find(arg[1]);
                
                if(iter == m_names.end())
                {
                    std::stringstream format;
                    format<<"unknown option  '-"<<arg[1]<<"'";
                    error_messages.push_back(format.str());
                    continue;
                }
                
                option * opt = &(iter->second);
                
                const char * value = "=";
                
                if(opt->value_name)
                {
                    value = argv[++i];
                    
                    if(!value || value[0] == '-')
                    {
                        std::stringstream format;
                        format<<"option  '-"<<arg[1]
                              <<"' requires an argument";
                        error_messages.push_back(format.str());
                        continue;
                    }
                }
                
                opt->binding->parse_value(value);
            }
        }
        else
        {
            if(m_next_argument == m_arguments.end())
            {
                if(m_argument_repeat_last)
                {
                    m_next_argument = m_arguments.begin() + 
                        (m_arguments.size() - m_argument_repeat_last);
                }
                else
                {
                    error_messages.push_back("too many arguments");
                    continue;
                }
            }
            
            (*m_next_argument).binding->parse_value(arg);
            m_next_argument++;
        }
    }
    
    if(print_help)
    {
        help(argv[0]);
        exit(0);
    }
    
    if(m_next_argument < m_arguments.end()  - m_argument_repeat_last)
    {
        for(; m_next_argument != m_arguments.end(); m_next_argument++)
        {
            std::stringstream format;
            format<<"missing "<<uppercase(m_next_argument->value_name)
                  <<" argument";
            error_messages.push_back(format.str());
        }
    }
    
    if(error_messages.size())
    {
        for(std::vector<std::string>::const_iterator iter 
                = error_messages.begin(); iter != error_messages.end(); iter++)
        {
            std::cerr<<argv[0]<<": "<<*iter<<std::endl;
        }
        exit(1);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rdx, 0x18(%rsp)
movl %esi, 0x64(%rsp)
movq %rdi, %r14
leaq 0x7(%rsp), %rbx
movb $0x0, (%rbx)
xorl %esi, %esi
callq 0x2d80
leaq 0x326d(%rip), %rdx      # 0x6074
leaq 0x326b(%rip), %rcx      # 0x6079
pushq $0x68
popq %rsi
pushq $0x1
popq %rbp
movq %r14, %rdi
movq %rbx, %r8
movl %ebp, %r9d
callq 0x2c1e
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rax
andq $0x0, 0x10(%rax)
movaps %xmm0, (%rax)
leaq 0x8(%r14), %rax
movq %rax, 0x78(%rsp)
leaq 0x30(%r14), %rax
movq %rax, 0x70(%rsp)
movq %r14, 0x8(%rsp)
leaq 0x38(%r14), %rax
movq %rax, 0x68(%rsp)
movl %ebp, %eax
leaq 0xa0(%rsp), %rbp
leaq 0x20(%rsp), %r12
cmpl 0x64(%rsp), %eax
jge 0x324f
movl %eax, 0x14(%rsp)
movslq %eax, %rbx
movq 0x18(%rsp), %rax
movq (%rax,%rbx,8), %r13
cmpb $0x2d, (%r13)
jne 0x2f88
cmpb $0x2d, 0x1(%r13)
jne 0x2ff2
addq $0x2, %r13
movq %r13, %rdi
pushq $0x3d
popq %rsi
callq 0x2090
movq %rax, %rbx
testq %rax, %rax
jne 0x2eb3
movq %r13, %rdi
callq 0x20b0
addq %r13, %rax
movq %rax, %rdx
leaq 0xb0(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq %rbp, %rdi
movq %r13, %rsi
movq %rdx, %r15
callq 0x42b4
movq 0x70(%rsp), %rdi
movq %rbp, %rsi
callq 0x5428
movq %rax, %r14
movq %rbp, %rdi
callq 0x20c0
cmpq 0x68(%rsp), %r14
je 0x30e8
movq 0x50(%r14), %rax
testq %rbx, %rbx
je 0x31a4
testq %rax, %rax
jne 0x3235
movq %rbp, %rdi
callq 0x2120
leaq 0xb0(%rsp), %rdi
leaq 0x3188(%rip), %rsi      # 0x60ac
callq 0x21b0
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x42b4
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2190
movq %rax, %rdi
leaq 0x315e(%rip), %rsi      # 0x60b7
callq 0x21b0
movq %r12, %rdi
callq 0x20c0
movq %r12, %rdi
leaq 0xb8(%rsp), %rsi
callq 0x22b0
leaq 0x40(%rsp), %rdi
movq %r12, %rsi
callq 0x5466
jmp 0x3223
movq 0x8(%rsp), %rcx
movq 0x80(%rcx), %rax
movq 0x90(%rcx), %rcx
cmpq %rax, %rcx
jne 0x2fd4
movq 0x8(%rsp), %rsi
movslq 0x98(%rsi), %rcx
testq %rcx, %rcx
je 0x3163
movq 0x78(%rsi), %rdx
subq %rdx, %rax
shrq $0x4, %rax
subq %rcx, %rax
shlq $0x4, %rax
addq %rdx, %rax
movq %rax, 0x90(%rsi)
movq %rax, %rcx
movq 0x8(%rcx), %rdi
movq (%rdi), %rax
movq %r13, %rsi
callq *(%rax)
movq 0x8(%rsp), %rax
addq $0x10, 0x90(%rax)
jmp 0x3244
incq %r13
movq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x562e
cmpq 0x78(%rsp), %rax
je 0x308e
cmpq $0x0, 0x38(%rax)
je 0x318f
incl 0x14(%rsp)
movq 0x18(%rsp), %rcx
movq 0x8(%rcx,%rbx,8), %rsi
testq %rsi, %rsi
je 0x3034
cmpb $0x2d, (%rsi)
jne 0x3196
movq %rbp, %rdi
callq 0x2120
leaq 0xb0(%rsp), %rdi
leaq 0x30a7(%rip), %rsi      # 0x60f2
callq 0x21b0
movsbl (%r13), %esi
movq %rax, %rdi
callq 0x2210
movq %rax, %rdi
leaq 0x306c(%rip), %rsi      # 0x60d3
callq 0x21b0
movq %r12, %rdi
leaq 0xb8(%rsp), %rsi
callq 0x22b0
leaq 0x40(%rsp), %rdi
movq %r12, %rsi
callq 0x5466
jmp 0x3223
movq %rbp, %rdi
callq 0x2120
leaq 0xb0(%rsp), %rdi
leaq 0x3045(%rip), %rsi      # 0x60ea
callq 0x21b0
movsbl (%r13), %esi
movq %rax, %rdi
callq 0x2210
movq %rax, %rdi
leaq 0x2fe9(%rip), %rsi      # 0x60aa
callq 0x21b0
movq %r12, %rdi
leaq 0xb8(%rsp), %rsi
callq 0x22b0
leaq 0x40(%rsp), %rdi
movq %r12, %rsi
callq 0x5466
jmp 0x3223
movq %rbp, %rdi
callq 0x2120
leaq 0xb0(%rsp), %rdi
leaq 0x2f97(%rip), %rsi      # 0x6096
callq 0x21b0
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x42b4
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2190
movq %rax, %rdi
leaq 0x2f76(%rip), %rsi      # 0x60aa
callq 0x21b0
movq %r12, %rdi
callq 0x20c0
movq %r12, %rdi
leaq 0xb8(%rsp), %rsi
callq 0x22b0
leaq 0x40(%rsp), %rdi
movq %r12, %rsi
callq 0x5466
jmp 0x3223
movq %rbp, %rdi
leaq 0x2f90(%rip), %rsi      # 0x60fd
movq %r12, %rdx
callq 0x3b22
leaq 0x40(%rsp), %rdi
movq %rbp, %rsi
callq 0x5466
movq %rbp, %rdi
callq 0x20c0
jmp 0x3244
leaq 0x2efe(%rip), %rsi      # 0x6094
movq 0x48(%rax), %rdi
movq (%rdi), %rax
callq *(%rax)
jmp 0x3244
testq %rax, %rax
je 0x3235
movq %rbp, %rdi
callq 0x2120
leaq 0xb0(%rsp), %rdi
leaq 0x2eda(%rip), %rsi      # 0x609e
callq 0x21b0
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x42b4
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2190
movq %rax, %rdi
leaq 0x2eda(%rip), %rsi      # 0x60d3
callq 0x21b0
movq %r12, %rdi
callq 0x20c0
movq %r12, %rdi
leaq 0xb8(%rsp), %rsi
callq 0x22b0
leaq 0x40(%rsp), %rdi
movq %r12, %rsi
callq 0x5466
movq %r12, %rdi
callq 0x20c0
movq %rbp, %rdi
callq 0x2140
jmp 0x3244
movq 0x60(%r14), %rdi
incq %rbx
movq (%rdi), %rax
movq %rbx, %rsi
callq *(%rax)
movl 0x14(%rsp), %eax
incl %eax
jmp 0x2e61
cmpb $0x0, 0x7(%rsp)
jne 0x3396
movq 0x8(%rsp), %rdx
movq 0x80(%rdx), %rax
movq 0x90(%rdx), %rcx
movslq 0x98(%rdx), %rdx
shlq $0x4, %rdx
movq %rax, %rsi
subq %rdx, %rsi
cmpq %rsi, %rcx
jae 0x336b
leaq 0xb0(%rsp), %r14
leaq 0xa0(%rsp), %r12
leaq 0x80(%rsp), %rbp
leaq 0x20(%rsp), %r15
leaq 0x40(%rsp), %rbx
cmpq %rax, %rcx
je 0x336b
movq %r12, %rdi
callq 0x2120
movq %r14, %rdi
leaq 0x2e4c(%rip), %rsi      # 0x6110
callq 0x21b0
movq %rax, %r13
movq 0x8(%rsp), %rax
movq 0x90(%rax), %rax
movq (%rax), %rsi
movq %rbp, %rdi
leaq 0x13(%rsp), %rdx
callq 0x3b22
movq %r15, %rdi
movq %rbp, %rsi
callq 0x38de
movq %r13, %rdi
movq %r15, %rsi
callq 0x2190
movq %rax, %rdi
leaq 0x2dd8(%rip), %rsi      # 0x60e0
callq 0x21b0
movq %r15, %rdi
callq 0x20c0
movq %rbp, %rdi
callq 0x20c0
movq %r15, %rdi
leaq 0xb8(%rsp), %rsi
callq 0x22b0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5466
movq %r15, %rdi
callq 0x20c0
movq %r12, %rdi
callq 0x2140
movq 0x8(%rsp), %rdx
movq 0x80(%rdx), %rax
movq 0x90(%rdx), %rcx
addq $0x10, %rcx
movq %rcx, 0x90(%rdx)
jmp 0x32a9
movq 0x40(%rsp), %rbx
movq 0x48(%rsp), %rax
cmpq %rbx, %rax
jne 0x33af
leaq 0x40(%rsp), %rdi
callq 0x2868
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rsp), %rdi
callq 0x34b2
xorl %edi, %edi
callq 0x2220
movq 0x6c3a(%rip), %r14      # 0x9ff0
leaq 0x2d61(%rip), %r15      # 0x611e
cmpq %rax, %rbx
je 0x33fb
movq 0x18(%rsp), %rax
movq (%rax), %rsi
movq %r14, %rdi
callq 0x21b0
movq %rax, %rdi
movq %r15, %rsi
callq 0x21b0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2190
movq %rax, %rdi
callq 0x20d0
addq $0x20, %rbx
movq 0x48(%rsp), %rax
jmp 0x33bd
pushq $0x1
popq %rdi
callq 0x2220
jmp 0x3467
jmp 0x3467
jmp 0x346e
jmp 0x3467
jmp 0x345d
jmp 0x3467
jmp 0x345d
jmp 0x346e
jmp 0x346e
jmp 0x346e
jmp 0x346e
jmp 0x346e
jmp 0x3467
jmp 0x345d
jmp 0x346e
jmp 0x3467
jmp 0x3443
jmp 0x345d
jmp 0x345d
jmp 0x3467
jmp 0x3467
jmp 0x346e
jmp 0x346e
jmp 0x3467
jmp 0x345d
jmp 0x346e
jmp 0x346e
jmp 0x345d
jmp 0x3467
jmp 0x345d
jmp 0x346e
jmp 0x3467
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x20c0
jmp 0x349f
jmp 0x3467
jmp 0x346e
jmp 0x3467
jmp 0x346e
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
jmp 0x348d
movq %rax, %rbx
jmp 0x349f
jmp 0x346e
movq %rax, %rbx
jmp 0x3492
movq %rax, %rbx
jmp 0x3485
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x20c0
leaq 0x80(%rsp), %rdi
callq 0x20c0
leaq 0xa0(%rsp), %rdi
callq 0x2140
leaq 0x40(%rsp), %rdi
callq 0x2868
movq %rbx, %rdi
callq 0x2300
nop