// File: /workspace/github_cpp_makefile_star2_O1/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 0x277e0
movaps 0x133b3(%rip), %xmm0    # 0x76e80
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movl $0x20202020, 0x70(%rsp) # imm = 0x20202020
movb $0x0, 0x74(%rsp)
leaq 0x2db1d(%rip), %rax     # 0x91608
movq (%rax), %rsi
leaq 0x133a8(%rip), %rdi     # 0x76e9d
xorl %eax, %eax
callq 0x27070
leaq 0x133ad(%rip), %rdi     # 0x76eb0
xorl %eax, %eax
callq 0x27070
leaq 0x2dad7(%rip), %rax     # 0x915e8
movq (%rax), %rsi
leaq 0x133b4(%rip), %rdi     # 0x76ecf
xorl %eax, %eax
callq 0x27070
leaq 0x2daff(%rip), %rax     # 0x91628
movq (%rax), %rsi
leaq 0x13385(%rip), %rdi     # 0x76eb8
xorl %eax, %eax
callq 0x27070
leaq 0x2db07(%rip), %rax     # 0x91648
movq (%rax), %rbx
cmpq 0x8(%rax), %rbx
jne 0x63b6c
leaq 0x13509(%rip), %rdi     # 0x7705a
callq 0x278f0
leaq 0x13503(%rip), %rdi     # 0x77060
callq 0x278f0
movl $0x1, %edi
callq 0x27720
leaq 0x18(%rsp), %r12
leaq 0x28(%rsp), %rbp
leaq 0x8(%rsp), %r15
leaq 0x50(%rsp), %r14
movq (%rbx), %rsi
leaq 0x13334(%rip), %rdi     # 0x76ebe
xorl %eax, %eax
callq 0x27070
movq 0x20(%rbx), %r13
movq %rbx, 0x48(%rsp)
cmpq 0x28(%rbx), %r13
je 0x63f5f
movq (%r13), %rcx
cmpb $0x1, 0x60(%r13)
jne 0x63bd3
movq 0x20(%r13), %r8
movl $0x24, %esi
leaq 0x80(%rsp), %rbx
movq %rbx, %rdi
leaq 0x132f9(%rip), %rdx     # 0x76ec3
xorl %eax, %eax
callq 0x279d0
jmp 0x63bf1
movl $0x24, %esi
leaq 0x80(%rsp), %rbx
movq %rbx, %rdi
leaq 0x132e3(%rip), %rdx     # 0x76ecd
xorl %eax, %eax
callq 0x279d0
leaq 0x132da(%rip), %rdi     # 0x76ed2
movq %rbx, %rsi
xorl %eax, %eax
callq 0x27070
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x40(%r13), %rsi
movq 0x48(%r13), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0x2f122
cmpb $0x1, 0x61(%r13)
jne 0x63d14
movq %r12, 0x8(%rsp)
movq %r15, %rdi
leaq 0x13be2(%rip), %rdx     # 0x7781b
movq %rdx, %rsi
callq 0x2f1b2
leaq 0xb8(%rsp), %rdi
movq %r15, %rsi
callq 0x278b0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x63c60
callq 0x27560
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
leaq 0xb0(%rsp), %rdi
callq 0x276c0
movl $0x2, %edx
movq %rax, %rdi
leaq 0x13253(%rip), %rsi     # 0x76ed9
callq 0x276c0
leaq 0x68(%r13), %rbx
movq %rbx, %rdi
callq 0x40ac8
testb %al, %al
je 0x63ca8
movq (%rbx), %rdi
callq 0x40b0e
movl 0x10(%rax), %esi
jmp 0x63cc4
movq %rbx, %rdi
callq 0x647b2
testb %al, %al
je 0x63e56
movq (%rbx), %rdi
callq 0x64ee4
movzbl 0x10(%rax), %esi
leaq 0xb0(%rsp), %rdi
callq 0x27400
movl $0x1, %edx
leaq 0xb0(%rsp), %rdi
leaq 0xf2b7(%rip), %rsi      # 0x72f9c
callq 0x276c0
movq %r15, %rdi
leaq 0xb8(%rsp), %rsi
callq 0x279a0
movq %rbp, %rdi
movq %r15, %rsi
callq 0x27350
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x63d14
callq 0x27560
movq 0x28(%rsp), %rdi
cmpq $0x1f, 0x30(%rsp)
jae 0x63d2b
callq 0x278f0
jmp 0x63e2a
movl $0x20, %ebx
leal -0x2(%rbx), %ecx
decl %ebx
cmpb $0x20, (%rdi,%rcx)
jne 0x63d30
movq %r15, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x27600
movq 0x8(%rsp), %rdi
callq 0x278f0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x63d61
callq 0x27560
movl %ebx, %edx
movq %r15, %rdi
movq %rbp, %rsi
movq $-0x1, %rcx
callq 0x27600
movq %rbp, %rdi
movq %r15, %rsi
callq 0x27350
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x63d8f
callq 0x27560
cmpq $0x2b, 0x30(%rsp)
jb 0x63e14
movl $0x2c, %ebx
movq 0x28(%rsp), %rax
leal -0x2(%rbx), %ecx
decl %ebx
cmpb $0x20, (%rax,%rcx)
jne 0x63da1
movq %r15, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x27600
movq 0x8(%rsp), %rdx
leaq 0x1316e(%rip), %rdi     # 0x76f33
movq %r14, %rsi
xorl %eax, %eax
callq 0x27070
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x63dde
callq 0x27560
movl %ebx, %edx
movq %r15, %rdi
movq %rbp, %rsi
movq $-0x1, %rcx
callq 0x27600
movq %rbp, %rdi
movq %r15, %rsi
callq 0x27350
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x63e0c
callq 0x27560
cmpq $0x2a, 0x30(%rsp)
ja 0x63d97
movq 0x28(%rsp), %rdx
leaq 0x13113(%rip), %rdi     # 0x76f33
movq %r14, %rsi
xorl %eax, %eax
callq 0x27070
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x63e3e
callq 0x27560
addq $0x70, %r13
movq 0x48(%rsp), %rax
cmpq 0x28(%rax), %r13
jne 0x63ba4
jmp 0x63f5f
movq %rbx, %rdi
callq 0x421f4
testb %al, %al
je 0x63ea5
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 (%rbx), %rdi
callq 0x4223a
cvtss2sd 0x10(%rax), %xmm0
jmp 0x63ef2
movq %rbx, %rdi
callq 0x647f4
testb %al, %al
je 0x63f04
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 (%rbx), %rdi
callq 0x64fe8
movsd 0x10(%rax), %xmm0
leaq 0xb0(%rsp), %rdi
callq 0x279e0
jmp 0x63cd1
movq %rbx, %rdi
callq 0x3a81a
testb %al, %al
je 0x63f88
movq (%rbx), %rdi
callq 0x40c94
movq %r12, 0x8(%rsp)
movq 0x10(%rax), %rsi
movq 0x18(%rax), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x2f122
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0xb0(%rsp), %rdi
callq 0x276c0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x63cd1
callq 0x27560
jmp 0x63cd1
movl $0xa, %edi
callq 0x27820
movq 0x48(%rsp), %rbx
addq $0x38, %rbx
leaq 0x2d6cf(%rip), %rax     # 0x91648
cmpq 0x8(%rax), %rbx
jne 0x63b80
jmp 0x63b4a
movq (%r13), %rsi
leaq 0x12f49(%rip), %rdi     # 0x76edc
xorl %eax, %eax
callq 0x27070
jmp 0x63b62
jmp 0x63fe6
jmp 0x63fba
jmp 0x63fe6
jmp 0x63fe6
jmp 0x63fba
jmp 0x63fba
jmp 0x63fba
jmp 0x63fba
jmp 0x63fe6
movq %rax, %rbx
jmp 0x63fd1
jmp 0x63fba
jmp 0x63fba
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x63fd1
callq 0x27560
leaq 0xb0(%rsp), %rdi
callq 0x27160
movq %rbx, %rdi
callq 0x27b20
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x63fbd
callq 0x27560
jmp 0x63fbd
movq %rax, %rdi
callq 0x2e1ed