// File: /workspace/github_cpp_makefile_star2_O1/jovermann[P]streplace/src/CommandLineParser.cpp
// Function: ut1::CommandLineParser::parseLongOption(int, char const**, int&)
void CommandLineParser::parseLongOption(int argc, const char* argv[], int& i)
{
    std::vector<std::string> fields     = ut1::splitString(argv[i] + 2, '=', 1);
    std::string              longOption = fields[0];

    // First try exact match.
    Option* option = getOption(longOption);
    if (option == nullptr)
    {
        // Then try prefix and take it when it is unique.
        std::vector<std::string> matchingOptions;
        for (const auto& optName: optionList)
        {
            if (ut1::hasPrefix(optName, longOption) && (!ut1::hasPrefix(optName, HEADER_PREFIX)))
            {
                matchingOptions.push_back(optName);
            }
        }
        if (matchingOptions.size() == 0)
        {
            error("Unknown option --" + longOption + ".");
        }
        else if (matchingOptions.size() == 1)
        {
            longOption = matchingOptions[0];
            option     = getOption(longOption);
        }
        else
        {
            error("Ambiguous option --" + longOption + " (matches --" + ut1::joinStrings(matchingOptions, ", --") + ").");
        }
    }

    // We only get here when we had an exact match or a unique prefix.
    assert(option != nullptr);

    if (option->hasArg())
    {
        if (fields.size() == 2)
        {
            // --foo=bar
            option->setValue(fields[1], listSepChar);
        }
        else if (++i < argc)
        {
            // --foo bar
            option->setValue(argv[i], listSepChar);
        }
        else
        {
            error("Option --" + longOption + " requires an argument.");
        }
    }
    else
    {
        if (fields.size() == 1)
        {
            // --foo
            option->setValue("", 0);
        }
        else
        {
            error("Option --" + longOption + " does not accept arguments.");
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %rdx, %r12
movl %esi, 0x6c(%rsp)
movq %rdi, %r13
movq %rcx, 0x98(%rsp)
movslq (%rcx), %rax
movq (%rdx,%rax,8), %r14
leaq 0x2(%r14), %rbx
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
movq %rbx, %rdi
callq 0x51b0
leaq (%r14,%rax), %rdx
addq $0x2, %rdx
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x90b2
leaq 0xa0(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movl $0x3d, %edx
movl $0x1, %ecx
callq 0xaa44
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x6953
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0xa0(%rsp), %rax
leaq 0x20(%rsp), %rdi
movq %r15, (%rdi)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
callq 0x9022
movq %r12, 0x90(%rsp)
leaq 0x20(%rsp), %rsi
movq %r13, %rdi
callq 0xa316
leaq 0x8(%r13), %rdx
leaq 0x40(%rax), %rcx
xorl %r12d, %r12d
cmpq %rdx, %rax
cmovneq %rcx, %r12
jne 0x6acd
movq %rdx, 0x88(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
movq 0x30(%r13), %r12
movq %r13, 0x60(%rsp)
movq 0x38(%r13), %r15
cmpq %r15, %r12
je 0x6a71
leaq 0x20(%rsp), %r13
leaq 0xd8(%rsp), %r14
movq %r12, %rdi
movq %r13, %rsi
callq 0xa35c
movl %eax, %ebp
testb %al, %al
je 0x6a27
leaq 0xe8(%rsp), %rax
movq %rax, 0xd8(%rsp)
movq %r14, %rdi
leaq 0x1a656(%rip), %rsi     # 0x2105f
leaq 0x1a656(%rip), %rdx     # 0x21066
callq 0x90b2
movq %r12, %rdi
movq %r14, %rsi
callq 0xa35c
movl %eax, %ebx
xorb $0x1, %bl
jmp 0x6a29
xorl %ebx, %ebx
testb %bpl, %bpl
je 0x6a53
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x6a53
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x5410
testb %bl, %bl
je 0x6a64
leaq 0x70(%rsp), %rdi
movq %r12, %rsi
callq 0x8d52
addq $0x20, %r12
cmpq %r15, %r12
jne 0x69de
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq $0x1, %rax
jne 0x6c0c
leaq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %r15
callq 0x5220
movq 0x60(%rsp), %r13
movq 0x88(%rsp), %rbx
leaq 0x20(%rsp), %rsi
movq %r13, %rdi
callq 0xa316
leaq 0x40(%rax), %rcx
xorl %r12d, %r12d
cmpq %rbx, %rax
cmovneq %rcx, %r12
leaq 0x70(%rsp), %rdi
callq 0x88ce
testq %r12, %r12
je 0x6bed
movq 0xa0(%rsp), %rsi
movq 0xa8(%rsp), %rax
subq %rsi, %rax
cmpq $0x0, 0x50(%r12)
je 0x6b11
cmpq $0x40, %rax
jne 0x6b8f
addq $0x20, %rsi
movsbl 0x90(%r13), %edx
movq %r12, %rdi
callq 0x5b4c
jmp 0x6b59
cmpq $0x20, %rax
jne 0x6c64
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1a57f(%rip), %rdx     # 0x210aa
movq %rsp, %rdi
movq %rdx, %rsi
callq 0x90b2
movq %rsp, %rsi
movq %r12, %rdi
xorl %edx, %edx
callq 0x5b4c
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x6b59
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x6b70
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5410
leaq 0xa0(%rsp), %rdi
callq 0x88ce
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x98(%rsp), %rdx
movslq (%rdx), %rax
leal 0x1(%rax), %ecx
movl %ecx, (%rdx)
cmpl 0x6c(%rsp), %ecx
jge 0x6d0b
movq 0x90(%rsp), %rcx
movq 0x8(%rcx,%rax,8), %rsi
movq %rsp, %rdi
leaq 0x40(%rsp), %rdx
callq 0x8890
movsbl 0x90(%r13), %edx
movq %rsp, %rsi
movq %r12, %rdi
callq 0x5b4c
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x6b4c
jmp 0x6b59
leaq 0x1a602(%rip), %rdi     # 0x211f6
leaq 0x1a60d(%rip), %rsi     # 0x21208
leaq 0x1a620(%rip), %rcx     # 0x21222
movl $0x1c3, %edx            # imm = 0x1C3
callq 0x52b0
testq %rax, %rax
jne 0x6cb3
leaq 0x1a5a2(%rip), %rsi     # 0x211be
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x8929
leaq 0x1afa1(%rip), %rsi     # 0x21bd3
leaq 0x40(%rsp), %rdi
callq 0x57c0
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x6d8d
movups (%rcx), %xmm0
movups %xmm0, (%r14)
jmp 0x6d99
leaq 0x1a5ff(%rip), %rsi     # 0x2126a
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x8929
leaq 0x1a60a(%rip), %rsi     # 0x2128b
leaq 0x40(%rsp), %rdi
callq 0x57c0
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x6d5a
movups (%rcx), %xmm0
movups %xmm0, (%r14)
jmp 0x6d66
leaq 0x1a516(%rip), %rsi     # 0x211d0
leaq 0x138(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x8929
leaq 0x1a511(%rip), %rsi     # 0x211e4
leaq 0x138(%rsp), %rdi
callq 0x57c0
leaq 0xc8(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x6dc2
movups (%rcx), %xmm0
movups %xmm0, (%r14)
jmp 0x6dd5
leaq 0x1a558(%rip), %rsi     # 0x2126a
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x8929
leaq 0x1a54c(%rip), %rsi     # 0x21274
leaq 0x40(%rsp), %rdi
callq 0x57c0
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x6e7f
movups (%rcx), %xmm0
movups %xmm0, (%r14)
jmp 0x6e8b
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
movq 0x8(%rax), %rdx
movq %rsp, %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r13, %rdi
movl $0x1, %edx
callq 0x87f0
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
movq 0x8(%rax), %rdx
movq %rsp, %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x60(%rsp), %rdi
movl $0x1, %edx
callq 0x87f0
movq %rdx, 0xb8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xc8(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0xc0(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x108(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1a3ee(%rip), %rsi     # 0x211f1
leaq 0x1a3eb(%rip), %rdx     # 0x211f5
leaq 0xf8(%rsp), %rdi
callq 0x90b2
leaq 0x118(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0xf8(%rsp), %rdx
callq 0xb057
leaq 0x40(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
leaq 0x118(%rsp), %rdx
callq 0x8d8f
leaq 0x1b1b3(%rip), %rsi     # 0x22005
leaq 0x40(%rsp), %rdi
callq 0x57c0
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x6eb2
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x6ebe
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
movq 0x8(%rax), %rdx
movq %rsp, %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r13, %rdi
movl $0x1, %edx
callq 0x87f0
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
movq 0x8(%rax), %rdx
movq %rsp, %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x60(%rsp), %rdi
movl $0x1, %edx
callq 0x87f0
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x6f05
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0x6f05
movq %rax, %rbx
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6f25
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0x6f25
movq %rax, %rbx
leaq 0x128(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6f4b
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0x6f4b
movq %rax, %rbx
movq 0xf8(%rsp), %rdi
cmpq %r15, %rdi
je 0x6f6d
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0x6f6d
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
cmpq %r14, %rdi
je 0x6fae
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0x6fae
jmp 0x6ff4
jmp 0x700f
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x6fd0
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0x6fd0
movq %rax, %rbx
leaq 0x148(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7093
movq 0x148(%rsp), %rsi
jmp 0x6fe7
movq %rax, %rbx
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7093
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0x7093
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x7012
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0x7012
movq %rax, %rbx
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x709d
movq 0x50(%rsp), %rsi
jmp 0x7055
jmp 0x7089
jmp 0x7090
jmp 0x7090
jmp 0x7089
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x7050
jmp 0x709d
jmp 0x7089
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x709d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0x709d
jmp 0x7089
jmp 0x7090
movq %rax, %rbx
jmp 0x70b9
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x70c6
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0x70c6
movq %rax, %rbx
jmp 0x70c6
movq %rax, %rbx
jmp 0x709d
jmp 0x7090
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x88ce
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x70b9
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5410
leaq 0xa0(%rsp), %rdi
callq 0x88ce
movq %rbx, %rdi
callq 0x5720