// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/utils/bamtools_options.cpp
// Function: BamTools::Options::DisplayHelp()
void Options::DisplayHelp(void) {

    // initialize
    char argumentBuffer[ARGUMENT_LENGTH + 1];
    ostringstream sb;

    char indentBuffer[MAX_LINE_LENGTH - DESC_LENGTH + 1];
    memset(indentBuffer, ' ', MAX_LINE_LENGTH - DESC_LENGTH);
    indentBuffer[MAX_LINE_LENGTH - DESC_LENGTH] = 0;

    // display the menu
    printf("Description: %s.\n\n", m_description.c_str());
    printf("Usage: ");
    printf("%s", m_programName.c_str());
    printf(" %s\n\n", m_exampleArguments.c_str());

    vector<Option>::const_iterator      optionIter;
    vector<OptionGroup>::const_iterator groupIter;
    for (groupIter = m_optionGroups.begin(); groupIter != m_optionGroups.end(); ++groupIter) {
        
        printf("%s:\n", groupIter->Name.c_str());

        for (optionIter = groupIter->Options.begin(); optionIter != groupIter->Options.end(); ++optionIter) {

            if (optionIter->StoreValue) 
                snprintf(argumentBuffer, ARGUMENT_LENGTH + 1, "  %s <%s>", optionIter->Argument.c_str(), optionIter->ValueDescription.c_str());
            else 
                snprintf(argumentBuffer, ARGUMENT_LENGTH + 1, "  %s", optionIter->Argument.c_str());
            printf("%-35s ", argumentBuffer);

            string description = optionIter->Description;

            // handle default values
            if (optionIter->HasDefaultValue) {
                
                sb.str("");
                sb << description << " [";

                if (optionIter->DefaultValue.is_type<unsigned int>()) {
                    sb << (unsigned int)optionIter->DefaultValue;
                } else if (optionIter->DefaultValue.is_type<unsigned char>()) {
                    sb << (unsigned short)(unsigned char)optionIter->DefaultValue;
                } else if (optionIter->DefaultValue.is_type<float>()) {
                    sb << std::fixed << std::setprecision(2) << (float)optionIter->DefaultValue;
                } else if (optionIter->DefaultValue.is_type<double>()) {
                    sb << std::fixed << std::setprecision(4) << (double)optionIter->DefaultValue;
                } else if (optionIter->DefaultValue.is_type<std::string>()) {
                    const std::string stringValue = optionIter->DefaultValue;
                    sb << stringValue;
                } else {
                    printf("ERROR: Found an unsupported data type for argument %s when casting the default value.\n",
                           optionIter->Argument.c_str());
                    exit(1);
                }

                sb << "]";
                description = sb.str(); 
            }

            if ( description.size() <= DESC_LENGTH_FIRST_ROW ) {
                printf("%s\n", description.c_str());
            } else {

                // handle the first row
                const char* pDescription = description.data();
                unsigned int cutIndex = DESC_LENGTH_FIRST_ROW;
                while(pDescription[cutIndex] != ' ') 
                    cutIndex--;
                printf("%s\n", description.substr(0, cutIndex).c_str());
                description = description.substr(cutIndex + 1);

                // handle subsequent rows
                while(description.size() > DESC_LENGTH) {
                    pDescription = description.data();
                    cutIndex = DESC_LENGTH;
                    while(pDescription[cutIndex] != ' ') 
                        cutIndex--;
                    printf("%s%s\n", indentBuffer, description.substr(0, cutIndex).c_str());
                    description = description.substr(cutIndex + 1);
                }

                // handle last row
                printf("%s%s\n", indentBuffer, description.c_str());
            }                       
        }

        printf("\n");
    }

    printf("Help:\n"); 
    printf("  --help, -h                        shows this help text\n");
    exit(1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
leaq 0xb0(%rsp), %rdi
callq 0x357f0
movaps 0x1099d(%rip), %xmm0    # 0x75e40
leaq 0x50(%rsp), %rax
movaps %xmm0, 0x10(%rax)
movaps %xmm0, (%rax)
movl $0x20202020, 0x20(%rax) # imm = 0x20202020
movb $0x0, 0x24(%rax)
leaq 0x3117f(%rip), %rax     # 0x96640
movq (%rax), %rsi
leaq 0x10992(%rip), %rdi     # 0x75e5d
xorl %eax, %eax
callq 0x35060
leaq 0x10997(%rip), %rdi     # 0x75e70
xorl %eax, %eax
callq 0x35060
leaq 0x31139(%rip), %rax     # 0x96620
movq (%rax), %rsi
leaq 0x1099e(%rip), %rdi     # 0x75e8f
xorl %eax, %eax
callq 0x35060
leaq 0x31161(%rip), %rax     # 0x96660
movq (%rax), %rsi
leaq 0x1096f(%rip), %rdi     # 0x75e78
xorl %eax, %eax
callq 0x35060
leaq 0x31169(%rip), %rax     # 0x96680
movq (%rax), %r14
leaq 0x30(%rsp), %r15
leaq 0x10(%rsp), %r12
pushq $-0x1
popq %r13
leaq 0x109c4(%rip), %rbx     # 0x75ef3
leaq 0x3114a(%rip), %rax     # 0x96680
cmpq 0x8(%rax), %r14
je 0x6589e
movq (%r14), %rsi
leaq 0x10934(%rip), %rdi     # 0x75e7e
xorl %eax, %eax
callq 0x35060
movq %r14, 0x8(%rsp)
movq 0x20(%r14), %r14
movq 0x8(%rsp), %rax
cmpq 0x28(%rax), %r14
je 0x65888
movq (%r14), %rcx
cmpb $0x1, 0x60(%r14)
jne 0x65595
movq 0x20(%r14), %r8
leaq 0x80(%rsp), %rbp
movq %rbp, %rdi
pushq $0x24
popq %rsi
leaq 0x108f7(%rip), %rdx     # 0x75e83
xorl %eax, %eax
callq 0x359f0
jmp 0x655b1
leaq 0x80(%rsp), %rbp
movq %rbp, %rdi
pushq $0x24
popq %rsi
leaq 0x108e3(%rip), %rdx     # 0x75e8d
xorl %eax, %eax
callq 0x359f0
leaq 0x108da(%rip), %rdi     # 0x75e92
movq %rbp, %rsi
xorl %eax, %eax
callq 0x35060
leaq 0x40(%r14), %rsi
movq %r15, %rdi
callq 0x35810
cmpb $0x1, 0x61(%r14)
jne 0x65794
movq %r12, %rdi
leaq 0x11214(%rip), %rsi     # 0x767f7
leaq 0x7(%rsp), %rdx
callq 0x35280
leaq 0xb8(%rsp), %rdi
movq %r12, %rsi
callq 0x358d0
movq %r12, %rdi
callq 0x35730
leaq 0xb0(%rsp), %rdi
movq %r15, %rsi
callq 0x35510
movq %rax, %rdi
leaq 0x1087a(%rip), %rsi     # 0x75e99
callq 0x355b0
leaq 0x68(%r14), %rbp
movq %rbp, %rdi
callq 0x49790
testb %al, %al
je 0x65650
movq %rbp, %rdi
callq 0x65f78
movl %eax, %esi
leaq 0xb0(%rsp), %rdi
callq 0x35400
jmp 0x6575d
movq %rbp, %rdi
callq 0x65f86
testb %al, %al
je 0x65679
movq %rbp, %rdi
callq 0x65fa8
movzbl %al, %esi
leaq 0xb0(%rsp), %rdi
callq 0x35a90
jmp 0x6575d
movq %rbp, %rdi
callq 0x4ae32
testb %al, %al
je 0x656d3
movq 0xb0(%rsp), %rax
movq -0x18(%rax), %rcx
movl 0xc8(%rsp,%rcx), %edx
movl $0xfffffefb, %esi       # imm = 0xFFFFFEFB
andl %esi, %edx
orl $0x4, %edx
movl %edx, 0xc8(%rsp,%rcx)
movq -0x18(%rax), %rax
movq $0x2, 0xb8(%rsp,%rax)
movq %rbp, %rdi
callq 0x65fb6
leaq 0xb0(%rsp), %rdi
callq 0x35480
jmp 0x6575d
movq %rbp, %rdi
callq 0x65fc6
testb %al, %al
je 0x6572a
movq 0xb0(%rsp), %rax
movq -0x18(%rax), %rcx
movl 0xc8(%rsp,%rcx), %edx
movl $0xfffffefb, %esi       # imm = 0xFFFFFEFB
andl %esi, %edx
orl $0x4, %edx
movl %edx, 0xc8(%rsp,%rcx)
movq -0x18(%rax), %rax
movq $0x4, 0xb8(%rsp,%rax)
movq %rbp, %rdi
callq 0x65fe8
leaq 0xb0(%rsp), %rdi
callq 0x35a00
jmp 0x6575d
movq %rbp, %rdi
callq 0x43ec6
testb %al, %al
je 0x658b8
movq %r12, %rdi
movq %rbp, %rsi
callq 0x65ff8
leaq 0xb0(%rsp), %rdi
movq %r12, %rsi
callq 0x35510
movq %r12, %rdi
callq 0x35730
leaq 0xb0(%rsp), %rdi
leaq 0xc7bd(%rip), %rsi      # 0x71f29
callq 0x355b0
movq %r12, %rdi
leaq 0xb8(%rsp), %rsi
callq 0x359c0
movq %r15, %rdi
movq %r12, %rsi
callq 0x35340
movq %r12, %rdi
callq 0x35730
movq 0x30(%rsp), %rdi
cmpq $0x1f, 0x38(%rsp)
jae 0x657ab
callq 0x35910
jmp 0x65877
pushq $0x20
popq %rax
movl %eax, %ebp
leal -0x2(%rbp), %ecx
decl %ebp
cmpb $0x20, (%rdi,%rcx)
jne 0x657b0
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x35600
movq 0x10(%rsp), %rdi
callq 0x35910
movq %r12, %rdi
callq 0x35730
movl %ebp, %edx
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rcx
callq 0x35600
movq %r15, %rdi
movq %r12, %rsi
callq 0x35340
movq %r12, %rdi
callq 0x35730
movq 0x30(%rsp), %rdx
cmpq $0x2b, 0x38(%rsp)
jb 0x65868
pushq $0x2c
popq %rax
movl %eax, %ebp
leal -0x2(%rbp), %ecx
decl %ebp
cmpb $0x20, (%rdx,%rcx)
jne 0x6580f
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x35600
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
leaq 0x50(%rsp), %rsi
xorl %eax, %eax
callq 0x35060
movq %r12, %rdi
callq 0x35730
movl %ebp, %edx
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rcx
callq 0x35600
movq %r15, %rdi
movq %r12, %rsi
callq 0x35340
movq %r12, %rdi
callq 0x35730
jmp 0x657fd
movq %rbx, %rdi
leaq 0x50(%rsp), %rsi
xorl %eax, %eax
callq 0x35060
movq %r15, %rdi
callq 0x35730
addq $0x70, %r14
jmp 0x6555a
pushq $0xa
popq %rdi
callq 0x35840
movq 0x8(%rsp), %r14
addq $0x38, %r14
jmp 0x6552f
leaq 0x10772(%rip), %rdi     # 0x76017
callq 0x35910
leaq 0x1076c(%rip), %rdi     # 0x7601d
callq 0x35910
jmp 0x658c9
movq (%r14), %rsi
leaq 0x105da(%rip), %rdi     # 0x75e9c
xorl %eax, %eax
callq 0x35060
pushq $0x1
popq %rdi
callq 0x35720
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x35730
jmp 0x65932
jmp 0x6592f
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x35730
jmp 0x65932
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x35730
jmp 0x65932
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x35730
jmp 0x65932
jmp 0x6592f
jmp 0x6592f
jmp 0x6592f
jmp 0x6592f
movq %rax, %rbx
jmp 0x6593c
jmp 0x6592f
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x35730
jmp 0x65932
jmp 0x6592f
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x35730
leaq 0xb0(%rsp), %rdi
callq 0x35160
movq %rbx, %rdi
callq 0x35b50
movq %rax, %rdi
callq 0x3a198
nop