// File: /workspace/github_cpp_makefile_star2_O3/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 0x277d0
movaps 0x128f3(%rip), %xmm0    # 0x75e80
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movl $0x20202020, 0x70(%rsp) # imm = 0x20202020
movb $0x0, 0x74(%rsp)
leaq 0x2d055(%rip), %rax     # 0x90600
movq (%rax), %rsi
leaq 0x128e8(%rip), %rdi     # 0x75e9d
xorl %eax, %eax
callq 0x27070
leaq 0x128ed(%rip), %rdi     # 0x75eb0
xorl %eax, %eax
callq 0x27070
leaq 0x2d00f(%rip), %rax     # 0x905e0
movq (%rax), %rsi
leaq 0x128f4(%rip), %rdi     # 0x75ecf
xorl %eax, %eax
callq 0x27070
leaq 0x2d037(%rip), %rax     # 0x90620
movq (%rax), %rsi
leaq 0x128c5(%rip), %rdi     # 0x75eb8
xorl %eax, %eax
callq 0x27070
leaq 0x2d03f(%rip), %rax     # 0x90640
movq (%rax), %rbx
cmpq 0x8(%rax), %rbx
jne 0x6362c
leaq 0x12a49(%rip), %rdi     # 0x7605a
callq 0x278e0
leaq 0x12a43(%rip), %rdi     # 0x76060
callq 0x278e0
movl $0x1, %edi
callq 0x27710
leaq 0x18(%rsp), %r12
leaq 0x28(%rsp), %rbp
leaq 0x8(%rsp), %r15
leaq 0x50(%rsp), %r14
movq (%rbx), %rsi
leaq 0x12874(%rip), %rdi     # 0x75ebe
xorl %eax, %eax
callq 0x27070
movq 0x20(%rbx), %r13
movq %rbx, 0x48(%rsp)
cmpq 0x28(%rbx), %r13
je 0x63a1f
movq (%r13), %rcx
cmpb $0x1, 0x60(%r13)
jne 0x63693
movq 0x20(%r13), %r8
movl $0x24, %esi
leaq 0x80(%rsp), %rbx
movq %rbx, %rdi
leaq 0x12839(%rip), %rdx     # 0x75ec3
xorl %eax, %eax
callq 0x279c0
jmp 0x636b1
movl $0x24, %esi
leaq 0x80(%rsp), %rbx
movq %rbx, %rdi
leaq 0x12823(%rip), %rdx     # 0x75ecd
xorl %eax, %eax
callq 0x279c0
leaq 0x1281a(%rip), %rdi     # 0x75ed2
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 0x2f10a
cmpb $0x1, 0x61(%r13)
jne 0x637d4
movq %r12, 0x8(%rsp)
movq %r15, %rdi
leaq 0x1311e(%rip), %rdx     # 0x76817
movq %rdx, %rsi
callq 0x2f1a0
leaq 0xb8(%rsp), %rdi
movq %r15, %rsi
callq 0x278a0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x63720
callq 0x27560
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
leaq 0xb0(%rsp), %rdi
callq 0x276b0
movl $0x2, %edx
movq %rax, %rdi
leaq 0x12793(%rip), %rsi     # 0x75ed9
callq 0x276b0
leaq 0x68(%r13), %rbx
movq %rbx, %rdi
callq 0x409ee
testb %al, %al
je 0x63768
movq (%rbx), %rdi
callq 0x40a34
movl 0x10(%rax), %esi
jmp 0x63784
movq %rbx, %rdi
callq 0x64272
testb %al, %al
je 0x63916
movq (%rbx), %rdi
callq 0x649bc
movzbl 0x10(%rax), %esi
leaq 0xb0(%rsp), %rdi
callq 0x27400
movl $0x1, %edx
leaq 0xb0(%rsp), %rdi
leaq 0xe7f7(%rip), %rsi      # 0x71f9c
callq 0x276b0
movq %r15, %rdi
leaq 0xb8(%rsp), %rsi
callq 0x27990
movq %rbp, %rdi
movq %r15, %rsi
callq 0x27350
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x637d4
callq 0x27560
movq 0x28(%rsp), %rdi
cmpq $0x1f, 0x30(%rsp)
jae 0x637eb
callq 0x278e0
jmp 0x638ea
movl $0x20, %ebx
leal -0x2(%rbx), %ecx
decl %ebx
cmpb $0x20, (%rdi,%rcx)
jne 0x637f0
movq %r15, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x27600
movq 0x8(%rsp), %rdi
callq 0x278e0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x63821
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 0x6384f
callq 0x27560
cmpq $0x2b, 0x30(%rsp)
jb 0x638d4
movl $0x2c, %ebx
movq 0x28(%rsp), %rax
leal -0x2(%rbx), %ecx
decl %ebx
cmpb $0x20, (%rax,%rcx)
jne 0x63861
movq %r15, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x27600
movq 0x8(%rsp), %rdx
leaq 0x126ae(%rip), %rdi     # 0x75f33
movq %r14, %rsi
xorl %eax, %eax
callq 0x27070
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x6389e
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 0x638cc
callq 0x27560
cmpq $0x2a, 0x30(%rsp)
ja 0x63857
movq 0x28(%rsp), %rdx
leaq 0x12653(%rip), %rdi     # 0x75f33
movq %r14, %rsi
xorl %eax, %eax
callq 0x27070
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x638fe
callq 0x27560
addq $0x70, %r13
movq 0x48(%rsp), %rax
cmpq 0x28(%rax), %r13
jne 0x63664
jmp 0x63a1f
movq %rbx, %rdi
callq 0x4212e
testb %al, %al
je 0x63965
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 0x42174
cvtss2sd 0x10(%rax), %xmm0
jmp 0x639b2
movq %rbx, %rdi
callq 0x642b4
testb %al, %al
je 0x639c4
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 0x64ac6
movsd 0x10(%rax), %xmm0
leaq 0xb0(%rsp), %rdi
callq 0x279d0
jmp 0x63791
movq %rbx, %rdi
callq 0x3a7b4
testb %al, %al
je 0x63a48
movq (%rbx), %rdi
callq 0x40bbe
movq %r12, 0x8(%rsp)
movq 0x10(%rax), %rsi
movq 0x18(%rax), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x2f10a
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0xb0(%rsp), %rdi
callq 0x276b0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x63791
callq 0x27560
jmp 0x63791
movl $0xa, %edi
callq 0x27810
movq 0x48(%rsp), %rbx
addq $0x38, %rbx
leaq 0x2cc07(%rip), %rax     # 0x90640
cmpq 0x8(%rax), %rbx
jne 0x63640
jmp 0x6360a
movq (%r13), %rsi
leaq 0x12489(%rip), %rdi     # 0x75edc
xorl %eax, %eax
callq 0x27070
jmp 0x63622
jmp 0x63aa6
jmp 0x63a7a
jmp 0x63aa6
jmp 0x63aa6
jmp 0x63a7a
jmp 0x63a7a
jmp 0x63a7a
jmp 0x63a7a
jmp 0x63aa6
movq %rax, %rbx
jmp 0x63a91
jmp 0x63a7a
jmp 0x63a7a
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x63a91
callq 0x27560
leaq 0xb0(%rsp), %rdi
callq 0x27160
movq %rbx, %rdi
callq 0x27b10
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x63a7d
callq 0x27560
jmp 0x63a7d
movq %rax, %rdi
callq 0x2e1cd