// File: /workspace/github_cpp_makefile_star2_O2/hanhwi[P]SimPoint/analysiscode/CmdLineParser.cpp
// Function: CmdLineParser::parseCmdLine(int, char**)
bool CmdLineParser::parseCmdLine(int argc, char **argv) {
    for (int argNdx = 0; argNdx < argc; argNdx++) {
        const char *arg = argv[argNdx];
        Utilities::check(arg != NULL, 
                "CmdLineParser::parseCmdLine(): found NULL argument");
        if (strlen(arg) == 0) {
            parseError("received a command line option that was empty");
            return false;
        }

        if (arg[0] == '-') {
            string optionName(arg + 1);
            CmdLineOption *option = findOption(optionName);
            if (option == NULL) {
                parseError(string("Unknown option: ") + optionName);
                return false;
            }

            // tell this option that it was specified
            option->setSpecified();

            string argument;
            if (option->requiresArgument()) {
                if (argNdx >= argc - 1) {
                    parseError(string("Argument required for option ") +
                               option->getName());
                    return false;
                }

                // don't check if the next token is actually another option; in
                // this case the user must figure it out...
                argNdx++;
                argument = string(argv[argNdx]);

                if (! option->parseArgument(argument)) {
                    parseError("Parsing argument -" + option->getName() + 
                                " : " + option->getParseError());
                    return false;
                }
            }
        } else {
            extraArguments.push_back(string(arg));
        }
    }

    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rdx, 0x38(%rsp)
movl %esi, %r15d
leal -0x1(%r15), %eax
movl %eax, 0x14(%rsp)
leaq 0x68(%rdi), %rax
movq %rax, 0x8(%rsp)
movq %rdi, 0x90(%rsp)
leaq 0x50(%rdi), %rax
movq %rax, 0x88(%rsp)
xorl %r12d, %r12d
leaq 0xd8(%rsp), %r14
movq %r15, 0x80(%rsp)
cmpl %r15d, %r12d
jge 0x4bfd
movslq %r12d, %rbx
movq 0x38(%rsp), %rax
movq (%rax,%rbx,8), %r13
leaq 0x40(%rsp), %rbp
movq %rbp, %rdi
leaq 0x106d3(%rip), %rsi     # 0x15004
leaq 0x18(%rsp), %rdx
callq 0x53a6
xorl %edi, %edi
testq %r13, %r13
setne %dil
movq %rbp, %rsi
callq 0x5364
movq %rbp, %rdi
callq 0x45e8
movzbl (%r13), %eax
cmpl $0x2d, %eax
je 0x499b
testl %eax, %eax
je 0x4bce
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
leaq 0x18(%rsp), %rdx
callq 0x53a6
movq 0x88(%rsp), %rdi
movq %rbx, %rsi
callq 0x568a
movq %rbx, %rdi
callq 0x45e8
movl %r12d, %ebx
jmp 0x4bc4
incq %r13
movq %rbp, %rdi
movq %r13, %rsi
leaq 0x18(%rsp), %rdx
callq 0x53a6
movq 0x90(%rsp), %rdi
movq %rbp, %rsi
callq 0x53e2
movq %rax, %r13
testq %rax, %rax
je 0x4af7
movq (%r13), %rax
movq %r13, %rdi
callq *0x10(%rax)
leaq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
andq $0x0, 0x20(%rsp)
movb $0x0, 0x28(%rsp)
movb $0x1, %r15b
cmpb $0x1, 0x88(%r13)
jne 0x4ba0
cmpl 0x14(%rsp), %r12d
jge 0x4b4d
movq 0x38(%rsp), %rax
movq 0x8(%rax,%rbx,8), %rsi
leaq 0x98(%rsp), %rbp
movq %rbp, %rdi
leaq 0x60(%rsp), %rdx
callq 0x53a6
leal 0x1(%r12), %ebx
leaq 0x18(%rsp), %rdi
movq %rbp, %rsi
callq 0x4350
movq %rbp, %rdi
callq 0x45e8
cmpb $0x1, 0x88(%r13)
leaq 0x60(%rsp), %rbp
jne 0x4a64
movq (%r13), %rax
movq %r13, %rdi
leaq 0x18(%rsp), %rsi
callq *0x18(%rax)
testb %al, %al
jne 0x4ba3
leaq 0x8(%r13), %rdx
movq %r14, %r15
movq %r14, %rdi
leaq 0x1061f(%rip), %rsi     # 0x15094
callq 0x54af
movq %rbp, %rdi
movq %r15, %rsi
leaq 0x10620(%rip), %rdx     # 0x150a7
callq 0x5490
addq $0x68, %r13
leaq 0xb8(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
callq 0x43e0
leaq 0x98(%rsp), %r15
movq %r15, %rdi
leaq 0x60(%rsp), %rsi
movq %rbp, %rdx
callq 0x5429
movq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x41a0
movq %r15, %rdi
callq 0x45e8
leaq 0xb8(%rsp), %rdi
callq 0x45e8
leaq 0x60(%rsp), %rdi
callq 0x45e8
movq %r14, %rdi
callq 0x45e8
xorl %r15d, %r15d
jmp 0x4ba3
leaq 0x98(%rsp), %rbx
movq %rbx, %rdi
leaq 0x1055c(%rip), %rsi     # 0x15065
leaq 0x60(%rsp), %rdx
callq 0x53a6
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
leaq 0x40(%rsp), %rdx
callq 0x540a
movq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x41a0
movq %r15, %rdi
callq 0x45e8
movq %rbx, %rdi
callq 0x45e8
xorl %r15d, %r15d
movl %r12d, %ebx
jmp 0x4bad
leaq 0x60(%rsp), %r15
movq %r15, %rdi
leaq 0x1051a(%rip), %rsi     # 0x15076
movq %r14, %rdx
callq 0x53a6
addq $0x8, %r13
leaq 0x98(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x540a
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x41a0
movq %rbx, %rdi
callq 0x45e8
leaq 0x60(%rsp), %rdi
callq 0x45e8
xorl %r15d, %r15d
movl %r12d, %ebx
leaq 0x18(%rsp), %rdi
callq 0x45e8
leaq 0x40(%rsp), %rdi
callq 0x45e8
testb %r15b, %r15b
movq 0x80(%rsp), %r15
je 0x4bfd
incl %ebx
movl %ebx, %r12d
jmp 0x490d
leaq 0x10462(%rip), %rsi     # 0x15037
leaq 0x40(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x53a6
leaq 0x40(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x41a0
leaq 0x40(%rsp), %rdi
callq 0x45e8
cmpl %r15d, %r12d
setge %al
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4cc0
jmp 0x4cbb
jmp 0x4c86
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x45e8
jmp 0x4c36
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x45e8
jmp 0x4c48
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x45e8
jmp 0x4c57
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
jmp 0x4c7f
jmp 0x4c86
jmp 0x4c86
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x45e8
jmp 0x4c7a
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x45e8
jmp 0x4c89
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
jmp 0x4caa
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x45e8
jmp 0x4ca2
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x45e8
jmp 0x4cc3
jmp 0x4cc0
jmp 0x4cbb
jmp 0x4cc0
jmp 0x4cbb
jmp 0x4cc0
movq %rax, %rbx
jmp 0x4ccd
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x45e8
movq %rbx, %rdi
callq 0x4530
nop