// File: /workspace/github_cpp_makefile_star2_O3/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 $0x148, %rsp            # imm = 0x148
movq %rcx, %r13
movq %rdx, %rbp
movl %esi, 0x6c(%rsp)
movq %rdi, %r12
movslq (%rcx), %rax
movq (%rdx,%rax,8), %r14
leaq 0x2(%r14), %rbx
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
movq %rbx, %rdi
callq 0x51b0
leaq (%r14,%rax), %rdx
addq $0x2, %rdx
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0x9172
leaq 0xb0(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movl $0x3d, %edx
movl $0x1, %ecx
callq 0xaa32
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x697a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0xb0(%rsp), %rax
leaq 0x28(%rsp), %rdi
movq %r15, (%rdi)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
callq 0x90dc
leaq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0xa310
leaq 0x8(%r12), %rcx
cmpq %rcx, %rax
jne 0x6ae8
movq %rax, 0xa0(%rsp)
movq %r13, 0xa8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
movq 0x30(%r12), %r13
movq 0x38(%r12), %r14
cmpq %r14, %r13
je 0x6a93
movq %rbp, 0x90(%rsp)
movq %r12, 0x98(%rsp)
leaq 0x18(%rsp), %r12
leaq 0x28(%rsp), %rbp
leaq 0x8(%rsp), %r15
movq %r13, %rdi
movq %rbp, %rsi
callq 0xa358
testb %al, %al
je 0x6a69
movq %r12, 0x8(%rsp)
movq %r15, %rdi
leaq 0x1a637(%rip), %rsi     # 0x2105f
leaq 0x1a637(%rip), %rdx     # 0x21066
callq 0x9172
movq %r13, %rdi
movq %r15, %rsi
callq 0xa358
movl %eax, %ebx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x6a58
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5410
testb %bl, %bl
jne 0x6a69
leaq 0x70(%rsp), %rdi
movq %r13, %rsi
callq 0x8e0c
addq $0x20, %r13
cmpq %r14, %r13
jne 0x6a0a
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rax
leaq 0x38(%rsp), %r15
movq 0x98(%rsp), %r12
movq 0x90(%rsp), %rbp
jmp 0x6a97
xorl %esi, %esi
xorl %eax, %eax
subq %rsi, %rax
sarq $0x5, %rax
cmpq $0x1, %rax
movq 0xa8(%rsp), %r13
movq 0xa0(%rsp), %r14
jne 0x6c03
leaq 0x28(%rsp), %rdi
callq 0x5220
leaq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0xa310
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x896e
cmpq %r14, %rbx
je 0x6d05
movq %rbx, %rax
leaq 0x40(%rax), %rbx
movq 0xb0(%rsp), %rsi
movq 0xb8(%rsp), %rcx
subq %rsi, %rcx
cmpq $0x0, 0x90(%rax)
je 0x6b2a
cmpq $0x40, %rcx
jne 0x6bad
addq $0x20, %rsi
movsbl 0x90(%r12), %edx
movq %rbx, %rdi
callq 0x5b4c
jmp 0x6b77
cmpq $0x20, %rcx
jne 0x6c5e
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1a566(%rip), %rdx     # 0x210aa
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x9172
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x5b4c
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x6b77
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x6b8e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5410
leaq 0xb0(%rsp), %rdi
callq 0x896e
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movslq (%r13), %rax
leal 0x1(%rax), %ecx
movl %ecx, (%r13)
cmpl 0x6c(%rsp), %ecx
jge 0x6d24
movq 0x8(%rbp,%rax,8), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x8930
movsbl 0x90(%r12), %edx
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x5b4c
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x6b6a
jmp 0x6b77
movq %r12, %rbx
testq %rax, %rax
jne 0x6cad
leaq 0x1a5a8(%rip), %rsi     # 0x211be
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x89cc
leaq 0x1afa7(%rip), %rsi     # 0x21bd3
leaq 0x48(%rsp), %rdi
callq 0x57c0
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x6da9
movups (%rcx), %xmm0
movups %xmm0, (%r14)
jmp 0x6db6
leaq 0x1a605(%rip), %rsi     # 0x2126a
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x89cc
leaq 0x1a610(%rip), %rsi     # 0x2128b
leaq 0x48(%rsp), %rdi
callq 0x57c0
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x6d73
movups (%rcx), %xmm0
movups %xmm0, (%r14)
jmp 0x6d80
leaq 0x1a51c(%rip), %rsi     # 0x211d0
leaq 0x128(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x89cc
leaq 0x1a517(%rip), %rsi     # 0x211e4
leaq 0x128(%rsp), %rdi
callq 0x57c0
leaq 0xd8(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x6ddf
movups (%rcx), %xmm0
movups %xmm0, (%r14)
jmp 0x6df2
leaq 0x1a4ea(%rip), %rdi     # 0x211f6
leaq 0x1a4f5(%rip), %rsi     # 0x21208
leaq 0x1a508(%rip), %rcx     # 0x21222
movl $0x1c3, %edx            # imm = 0x1C3
callq 0x52b0
leaq 0x1a53f(%rip), %rsi     # 0x2126a
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x89cc
leaq 0x1a533(%rip), %rsi     # 0x21274
leaq 0x48(%rsp), %rdi
callq 0x57c0
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x6e9c
movups (%rcx), %xmm0
movups %xmm0, (%r14)
jmp 0x6ea9
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r12, %rdi
movl $0x1, %edx
callq 0x8890
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbx, %rdi
movl $0x1, %edx
callq 0x8890
movq %rdx, 0xc8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xd8(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0xd0(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xf8(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1a3d1(%rip), %rsi     # 0x211f1
leaq 0x1a3ce(%rip), %rdx     # 0x211f5
leaq 0xe8(%rsp), %rdi
callq 0x9172
leaq 0x108(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0xe8(%rsp), %rdx
callq 0xb03e
leaq 0x48(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
leaq 0x108(%rsp), %rdx
callq 0x8e49
leaq 0x1b196(%rip), %rsi     # 0x22005
leaq 0x48(%rsp), %rdi
callq 0x57c0
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x6ed2
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x6edf
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r12, %rdi
movl $0x1, %edx
callq 0x8890
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbx, %rdi
movl $0x1, %edx
callq 0x8890
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x6f27
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0x6f27
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6f47
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0x6f47
movq %rax, %rbx
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6f6d
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0x6f6d
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
cmpq %r15, %rdi
je 0x6f8f
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0x6f8f
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0x6fd4
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0x6fd4
jmp 0x701a
jmp 0x7036
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x6ff6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0x6ff6
movq %rax, %rbx
leaq 0x138(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x70bb
movq 0x138(%rsp), %rsi
jmp 0x700d
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x70bb
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0x70bb
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x7039
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0x7039
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x70c5
movq 0x58(%rsp), %rsi
jmp 0x707d
jmp 0x70b1
jmp 0x70b8
jmp 0x70b8
jmp 0x70b1
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x7078
jmp 0x70c5
jmp 0x70b1
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x70c5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0x70c5
jmp 0x70b1
jmp 0x70b8
movq %rax, %rbx
jmp 0x70e1
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x70ee
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0x70ee
movq %rax, %rbx
jmp 0x70ee
movq %rax, %rbx
jmp 0x70c5
jmp 0x70b8
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x896e
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x70e1
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5410
leaq 0xb0(%rsp), %rdi
callq 0x896e
movq %rbx, %rdi
callq 0x5720