// File: /workspace/github_cpp_makefile_star2_O1/hanhwi[P]SimPoint/analysiscode/CmdLineParser.cpp
// Function: CmdLineParser::printExplanationPretty(CmdLineOption const*, unsigned int, std::ostream&, unsigned int)
void CmdLineParser::printExplanationPretty(const CmdLineOption *option,
        unsigned int prefixWidth, ostream &os, unsigned int lineWidth) {
    prefixWidth += 3;  // to account for the string " : " below
    string nameAndArg = prettyOptionNameAndArg(option);
    os << nameAndArg;
    if (nameAndArg.size() < prefixWidth - 3) { os << ' '; }
    for (unsigned int i = nameAndArg.size() + 1; i < prefixWidth - 3; i++) {
        os << '.';
    }
    os << " : ";

    // strip the explanation of leading, trailing, and duplicate spaces
    string expl, explanation = option->getExplanation();
    unsigned int start = 0, end = explanation.size() - 1;
    while ((start < end) && (explanation[start] == ' ')) { start++; }
    while ((start < end) && (explanation[end] == ' ')) { end--; }
    for (unsigned int i = start; i <= end; i++) {
        expl += explanation[i];
        if (explanation[i] == ' ') {
            while ((i <= end) && (explanation[i+1] == ' ')) {
                i++;
            }
        }
    }

    unsigned int position = 0;
    bool firstLine = true;
    while (expl.size() - position > lineWidth - prefixWidth) {
        if (! firstLine) {
            for (unsigned int i = 0; i < prefixWidth; i++) {
                os << ' ';
            }
        }

        // find the first index of a space that is earlier than the limit of the
        // line width
        unsigned long searchStart = min((unsigned long)position + lineWidth - prefixWidth, 
                                        (unsigned long)expl.size() - 1);
        unsigned long spaceNdx = expl.rfind(' ', searchStart);
        if ((spaceNdx == string::npos) || (spaceNdx <= position)) {
            spaceNdx = expl.find(' ', searchStart);
            if (spaceNdx == string::npos) {
                spaceNdx = expl.size();
            }
        }
        os << expl.substr(position, spaceNdx - position) << endl;
        position = spaceNdx + 1;
        firstLine = false;
    }

    if (position < expl.size()) {
        if (! firstLine) {
            for (unsigned int i = 0; i < prefixWidth; i++) {
                os << ' ';
            }
        }
        os << expl.substr(position) << endl;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %ecx, 0x40(%rsp)
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r15
leaq 0x78(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x5850
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %rbx, %rdi
callq 0x4330
movl %ebp, %eax
cmpq %rax, 0x80(%rsp)
jae 0x5441
movq %rsp, %rsi
movb $0x20, (%rsi)
movl $0x1, %edx
movq %rbx, %rdi
callq 0x4330
movl 0x80(%rsp), %r13d
leal 0x1(%r13), %eax
cmpl %ebp, %eax
jae 0x5473
notl %r13d
addl %ebp, %r13d
movq %rsp, %r12
movb $0x2e, (%rsp)
movl $0x1, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4330
decl %r13d
jne 0x545a
leaq 0x16c2d(%rip), %rsi     # 0x1c0a7
movl $0x3, %edx
movq %rbx, %rdi
callq 0x4330
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x48(%r15), %rsi
movq 0x50(%r15), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0x5ff6
movl 0x50(%rsp), %r12d
decl %r12d
je 0x54e2
movq 0x48(%rsp), %rax
movl %r12d, %ecx
xorl %r13d, %r13d
cmpb $0x20, (%rax,%r13)
jne 0x54e5
incq %r13
cmpl %r13d, %ecx
jne 0x54ce
movl %r12d, %r13d
jmp 0x54e5
xorl %r13d, %r13d
cmpl %r12d, %r13d
jae 0x5503
movq 0x48(%rsp), %rax
movl %r12d, %ecx
cmpb $0x20, (%rax,%rcx)
jne 0x5503
decl %r12d
cmpl %r12d, %r13d
jb 0x54ef
movl %r13d, %r12d
cmpl %r12d, %r13d
ja 0x554e
movq %rsp, %r15
movl %r13d, %r14d
movq 0x48(%rsp), %rax
movsbl (%rax,%r14), %esi
movq %r15, %rdi
callq 0x4250
movq 0x48(%rsp), %rcx
cmpb $0x20, (%rcx,%r14)
jne 0x5541
movl %r13d, %eax
cmpl %r12d, %r13d
ja 0x5544
leal 0x1(%rax), %r13d
cmpb $0x20, (%rcx,%r13)
je 0x552c
jmp 0x5544
movl %r13d, %eax
incl %eax
movl %eax, %r13d
cmpl %r12d, %eax
jbe 0x550b
addl $0x3, %ebp
movl 0x40(%rsp), %eax
movl %eax, %ecx
subl %ebp, %ecx
movq 0x8(%rsp), %rdx
movq %rcx, 0x68(%rsp)
cmpq %rcx, %rdx
movq %rdx, 0x70(%rsp)
jbe 0x568f
movl %eax, %ecx
movl %ebp, %eax
subq %rax, %rcx
movq %rcx, 0x40(%rsp)
movb $0x1, %al
xorl %r13d, %r13d
leaq 0x20(%rsp), %r15
testl %ebp, %ebp
sete %cl
orb %al, %cl
testb $0x1, %cl
jne 0x55b0
movl %ebp, %r14d
movb $0x20, 0x20(%rsp)
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4330
decl %r14d
jne 0x5596
movq 0x40(%rsp), %rax
addq %r13, %rax
movq 0x8(%rsp), %r14
decq %r14
cmpq %rax, %r14
cmovaeq %rax, %r14
movq %rsp, %rdi
movl $0x20, %esi
movq %r14, %rdx
callq 0x45f0
cmpq $-0x1, %rax
je 0x55e5
movq %rax, %r12
cmpq %r13, %rax
ja 0x5603
movq %rsp, %rdi
movl $0x20, %esi
movq %r14, %rdx
callq 0x43d0
movq %rax, %r12
cmpq $-0x1, %rax
jne 0x5603
movq 0x8(%rsp), %r12
movq %r12, %rcx
subq %r13, %rcx
movq %r15, %rdi
movq %rsp, %rsi
movq %r13, %rdx
callq 0x42f0
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x4330
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4290
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x41d0
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x566f
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x42d0
incl %r12d
movq 0x8(%rsp), %rcx
movq %rcx, %rdx
subq %r12, %rdx
xorl %eax, %eax
movq %r12, %r13
cmpq 0x68(%rsp), %rdx
ja 0x5587
jmp 0x5695
xorl %r12d, %r12d
movq %rdx, %rcx
cmpq %rcx, %r12
jae 0x5740
movq 0x70(%rsp), %rax
cmpq 0x68(%rsp), %rax
setbe %al
testl %ebp, %ebp
sete %cl
orb %al, %cl
jne 0x56d2
leaq 0x20(%rsp), %r14
movb $0x20, 0x20(%rsp)
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4330
decl %ebp
jne 0x56b9
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
movq %r12, %rdx
movq $-0x1, %rcx
callq 0x42f0
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x4330
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x41d0
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5740
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x42d0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x575c
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x42d0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x5777
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42d0
leaq 0x88(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5798
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x42d0
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x57ed
movq %rax, %rbx
jmp 0x580c
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x57d9
jmp 0x57c7
jmp 0x57ed
jmp 0x57ed
jmp 0x57ed
movq %rax, %rbx
jmp 0x5827
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x57f0
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0x57f0
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x580c
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x42d0
leaq 0x10(%rsp), %rax
movq (%rsp), %rdi
cmpq %rax, %rdi
je 0x5827
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42d0
leaq 0x88(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5848
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x42d0
movq %rbx, %rdi
callq 0x4580