// File: /workspace/github_cpp_makefile_star2_O2/mgo1977[P]c---parsing-argument-options/./Parser.h
// Function: Parser::usage(char const*)
void
Parser::usage(const char* text) {

    if ( strcmp(text, "") != 0 ) {
        std::cerr << text << std::endl;
    }

    // add the options
    std::cerr << "Usage: ";
    std::cerr << programName << " ";

    std::stringstream optionsSummary;
    std::stringstream fullDescription;

    int maxWidth = 30;


    for(std::vector<BaseOption*>::iterator iter = options.begin();
        iter != options.end();
        ++iter
    ) {

        BaseOption* option = *iter;

        // this is the syntax:
        //   [ ] => optional
        //   short|long
        std::string summaryOptionBase = getSummaryOptionText(option);
        std::string fullOptionBase    = getFullOptionText(option);

        if ( option->needArgument() ) {
            summaryOptionBase += " value";
            fullOptionBase    += " value";
        }

        // summary 
        if ( ! option->isMandatory() ) {
            optionsSummary << "[" << summaryOptionBase << "]";
        }
        else {
            optionsSummary << summaryOptionBase;
        }

        optionsSummary << " ";

        // full description
        fullDescription << " " << std::setw(maxWidth) << std::left << fullOptionBase << "\t\t" << option->getDescription() << std::endl;

    }

    std::cerr << optionsSummary.str() << std::endl;
    std::cerr << "Options:" << std::endl;
    std::cerr << fullDescription.str();

    // end
    exit(1);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x378, %rsp            # imm = 0x378
movq %rdi, %rbx
cmpb $0x0, (%rsi)
je 0x2d98
movq 0x6265(%rip), %rdi      # 0x8ff0
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
movq 0x6251(%rip), %r14      # 0x8ff0
leaq 0x32fa(%rip), %rsi      # 0x60a0
movq %r14, %rdi
callq 0x21a0
leaq 0x78(%rbx), %rsi
movq %r14, %rdi
callq 0x2190
leaq 0x32b5(%rip), %rsi      # 0x6076
movq %rax, %rdi
callq 0x21a0
leaq -0x210(%rbp), %rdi
callq 0x2100
leaq -0x398(%rbp), %rdi
callq 0x2100
movq 0x60(%rbx), %r12
leaq -0x88(%rbp), %r14
cmpq 0x68(%rbx), %r12
je 0x2f35
movq (%r12), %r15
leaq -0x48(%rbp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x372e
leaq -0x68(%rbp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x37f0
cmpb $0x1, 0x31(%r15)
jne 0x2e3f
leaq -0x48(%rbp), %rdi
leaq 0x327e(%rip), %rsi      # 0x60a8
callq 0x2300
leaq -0x68(%rbp), %rdi
leaq 0x326e(%rip), %rsi      # 0x60a8
callq 0x2300
cmpb $0x0, 0x30(%r15)
je 0x2e58
leaq -0x200(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x2190
jmp 0x2e86
leaq -0x200(%rbp), %rdi
leaq 0x3249(%rip), %rsi      # 0x60af
callq 0x21a0
movq %rax, %rdi
leaq -0x48(%rbp), %rsi
callq 0x2190
movq %rax, %rdi
leaq 0x3230(%rip), %rsi      # 0x60b1
callq 0x21a0
leaq -0x200(%rbp), %rdi
leaq 0x31e2(%rip), %rsi      # 0x6076
callq 0x21a0
leaq -0x388(%rbp), %rdi
leaq 0x31cf(%rip), %rsi      # 0x6076
callq 0x21a0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq $0x1e, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
movl $0xffffff4f, %esi       # imm = 0xFFFFFF4F
andl %esi, %edx
orl $0x20, %edx
movl %edx, 0x18(%rax,%rcx)
movq %rax, %rdi
leaq -0x68(%rbp), %rsi
callq 0x2190
movq %rax, %rdi
leaq 0x31cb(%rip), %rsi      # 0x60b3
callq 0x21a0
movq %rax, %r13
addq $0x38, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2230
movq %r13, %rdi
movq %r14, %rsi
callq 0x2190
movq %rax, %rdi
callq 0x20c0
movq %r14, %rdi
callq 0x20b0
leaq -0x68(%rbp), %rdi
callq 0x20b0
leaq -0x48(%rbp), %rdi
callq 0x20b0
addq $0x8, %r12
jmp 0x2dec
leaq -0x1f8(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x2290
movq 0x60a4(%rip), %rdi      # 0x8ff0
leaq -0x48(%rbp), %rsi
callq 0x2190
movq %rax, %rdi
callq 0x20c0
leaq -0x48(%rbp), %rdi
callq 0x20b0
movq 0x6083(%rip), %rdi      # 0x8ff0
leaq 0x3142(%rip), %rsi      # 0x60b6
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
leaq -0x380(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x2290
movq 0x6058(%rip), %rdi      # 0x8ff0
leaq -0x48(%rbp), %rsi
callq 0x2190
leaq -0x48(%rbp), %rdi
callq 0x20b0
pushq $0x1
popq %rdi
callq 0x21e0
jmp 0x2fbe
jmp 0x2fc3
jmp 0x2fc3
jmp 0x2fbe
jmp 0x2fc3
jmp 0x2fd9
movq %rax, %rbx
jmp 0x2fe5
movq %rax, %rbx
jmp 0x2fee
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x20b0
jmp 0x2fdc
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x20b0
leaq -0x48(%rbp), %rdi
callq 0x20b0
leaq -0x398(%rbp), %rdi
callq 0x2130
jmp 0x2fff
movq %rax, %rbx
leaq -0x210(%rbp), %rdi
callq 0x2130
movq %rbx, %rdi
callq 0x22e0
nop