// File: /workspace/github_cpp_makefile_star2_O1/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, %r13
cmpb $0x0, (%rsi)
je 0x4135
movq %rsi, %rbx
movq %rsi, %rdi
callq 0x30b0
movq 0x5ef0(%rip), %r14      # 0x9ff0
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x3210
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x31b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3110
movq 0x5eb4(%rip), %rbx      # 0x9ff0
leaq 0x2f5f(%rip), %rsi      # 0x70a2
movl $0x7, %edx
movq %rbx, %rdi
callq 0x3210
movq 0x78(%r13), %rsi
movq 0x80(%r13), %rdx
movq %rbx, %rdi
callq 0x3210
leaq 0x2f0e(%rip), %rsi      # 0x7078
movl $0x1, %edx
movq %rax, %rdi
callq 0x3210
leaq -0x398(%rbp), %rdi
callq 0x3120
leaq -0x210(%rbp), %rdi
callq 0x3120
movq 0x60(%r13), %r15
cmpq 0x68(%r13), %r15
jne 0x4239
leaq -0x380(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x32b0
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x5e34(%rip), %rdi      # 0x9ff0
callq 0x3210
movq %rax, %rdi
callq 0x30d0
leaq -0x38(%rbp), %r14
movq -0x10(%r14), %rdi
cmpq %r14, %rdi
je 0x41e2
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x31d0
movq 0x5e07(%rip), %rdi      # 0x9ff0
leaq 0x2ec8(%rip), %rsi      # 0x70b8
movl $0x8, %edx
callq 0x3210
movq 0x5def(%rip), %rdi      # 0x9ff0
callq 0x30d0
leaq -0x1f8(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x32b0
movq 0x5dd3(%rip), %rdi      # 0x9ff0
leaq -0x48(%rbp), %rsi
callq 0x31a0
leaq -0x48(%rbp), %rdi
callq 0x30c0
movl $0x1, %edi
callq 0x3220
leaq -0x388(%rbp), %r14
movq (%r15), %r12
leaq -0x48(%rbp), %rdi
movq %r12, %rdx
leaq 0x2fc9(%rip), %rcx      # 0x721a
callq 0x44fe
leaq -0x88(%rbp), %rdi
movq %r12, %rdx
leaq 0x2e10(%rip), %rcx      # 0x7077
callq 0x44fe
cmpb $0x1, 0x31(%r12)
jne 0x4297
leaq -0x48(%rbp), %rdi
leaq 0x2e2b(%rip), %rsi      # 0x70aa
callq 0x3340
leaq -0x88(%rbp), %rdi
leaq 0x2e18(%rip), %rsi      # 0x70aa
callq 0x3340
cmpb $0x0, 0x30(%r12)
je 0x42b1
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %r14, %rdi
callq 0x3210
jmp 0x42e9
movl $0x1, %edx
movq %r14, %rdi
leaq 0x2df1(%rip), %rsi      # 0x70b1
callq 0x3210
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %r14, %rdi
callq 0x3210
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2dcf(%rip), %rsi      # 0x70b3
callq 0x3210
movl $0x1, %edx
movq %r14, %rdi
leaq 0x2d80(%rip), %rsi      # 0x7078
callq 0x3210
movl $0x1, %edx
leaq -0x200(%rbp), %rdi
leaq 0x2d68(%rip), %rsi      # 0x7078
callq 0x3210
movq -0x200(%rbp), %rax
movq -0x18(%rax), %rcx
movq $0x1e, -0x1f0(%rbp,%rcx)
movq -0x18(%rax), %rax
movl -0x1e8(%rbp,%rax), %ecx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl %edx, %ecx
orl $0x20, %ecx
movl %ecx, -0x1e8(%rbp,%rax)
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
leaq -0x200(%rbp), %rdi
callq 0x3210
movq %rax, %rbx
movl $0x2, %edx
movq %rax, %rdi
leaq 0x2d44(%rip), %rsi      # 0x70b5
callq 0x3210
leaq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
movq 0x38(%r12), %rsi
movq 0x40(%r12), %rdx
addq %rsi, %rdx
leaq -0x68(%rbp), %rdi
callq 0x6370
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq %rbx, %rdi
callq 0x3210
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x31b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3110
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x43e7
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x4403
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x441c
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x31d0
addq $0x8, %r15
cmpq 0x68(%r13), %r15
jne 0x4240
jmp 0x419d
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
jne 0x44a1
jmp 0x44b2
jmp 0x44af
jmp 0x4475
movq %rax, %rbx
jmp 0x4494
jmp 0x44af
jmp 0x44af
movq %rax, %rbx
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x4478
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x31d0
jmp 0x4478
movq %rax, %rbx
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
jmp 0x449c
movq %rax, %rbx
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x4494
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x44b2
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x31d0
jmp 0x44b2
movq %rax, %rbx
movq 0x5aff(%rip), %rsi      # 0x9fb8
leaq -0x210(%rbp), %rdi
callq 0x3140
leaq -0x190(%rbp), %rdi
callq 0x3080
jmp 0x44d6
movq %rax, %rbx
movq 0x5adb(%rip), %rsi      # 0x9fb8
leaq -0x398(%rbp), %rdi
callq 0x3140
leaq -0x318(%rbp), %rdi
callq 0x3080
movq %rbx, %rdi
callq 0x3320
nop