// File: /workspace/github_cpp_makefile_star2_O2/jovermann[P]streplace/src/CommandLineParser.cpp
// Function: ut1::CommandLineParser::addOption(char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
CommandLineParser::Option& CommandLineParser::addOption(char shortOption, const std::string& longOption, const std::string& help, const std::string& argName, const std::string& defaultValue)
{
    // Accept ' ' (space) as "no short option" to allow nicely formatted addOption() calls with clang-format.
    if (shortOption == ' ')
    {
        shortOption = 0;
    }

    // Check for duplicate long option.
    if (options.count(longOption))
    {
        throw std::runtime_error("CommandLineParser::addOption(longOption=" + longOption + "): Option already exists!\n");
    }

    // Check for duplicate short option.
    if (shortOption)
    {
        Option* existingOption = getShortOption(shortOption);
        if (existingOption)
            throw std::runtime_error("CommandLineParser::addOption(shortOption=" + std::string(1, shortOption) + "): Option already exists!\n");
    }

    Option opt;
    opt.shortOption  = shortOption;
    opt.longOption   = longOption;
    opt.help         = help;
    opt.argName      = argName;
    opt.defaultValue = defaultValue;
    opt.value        = defaultValue;
    opt.parent       = this;

    options[longOption] = opt;
    if (shortOption)
    {
        shortOptionToLongOption[shortOption] = longOption;
    }
    // Keep --help and --version at the end of the list.
    optionList.insert(optionList.end() - std::min(optionList.size(), size_t(2)), longOption);
    return options[longOption];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %r9, %r15
movq %r8, 0x10(%rsp)
movq %rcx, %r13
movq %rdx, %rbx
movq %rdi, %r14
xorl %r12d, %r12d
cmpb $0x20, %sil
cmovnel %esi, %r12d
movb %r12b, 0xf(%rsp)
movq %rdx, %rsi
callq 0x76de
testq %rax, %rax
jne 0x5eb2
testb %r12b, %r12b
je 0x5d5b
movsbl %r12b, %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0x6086
testq %rax, %rax
jne 0x5f10
xorl %eax, %eax
leaq 0x60(%rsp), %rdi
movb %al, -0x7(%rdi)
leaq 0x70(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x90(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %al, (%rcx)
leaq 0xb0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %al, (%rcx)
leaq 0xd0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %al, (%rcx)
movb %al, 0x10(%rcx)
leaq 0xf8(%rsp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
movb %al, (%rdx)
andl $0x0, 0x10(%rdx)
andq $0x0, 0x18(%rdx)
movb %r12b, -0x78(%rcx)
movq %rbx, %rsi
callq 0x5240
leaq 0x80(%rsp), %rdi
movq %r13, %rsi
callq 0x5240
leaq 0xa0(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x5240
leaq 0xc0(%rsp), %rdi
movq %r15, %rsi
callq 0x5240
leaq 0xe8(%rsp), %rdi
movq %r15, %rsi
callq 0x5240
movq %r14, 0x110(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x77b4
leaq 0x58(%rsp), %rsi
movq %rax, %rdi
callq 0x781a
testb %r12b, %r12b
je 0x5e59
leaq 0x48(%r14), %rdi
leaq 0xf(%rsp), %rsi
callq 0x7896
movq %rax, %rdi
movq %rbx, %rsi
callq 0x5240
movq 0x38(%r14), %rsi
movq %rsi, %rax
subq 0x30(%r14), %rax
leaq 0x30(%r14), %rdi
sarq $0x5, %rax
cmpq $0x2, %rax
pushq $0x2
popq %rcx
cmovbq %rax, %rcx
shll $0x5, %ecx
subq %rcx, %rsi
movq %rbx, %rdx
callq 0x78e4
movq %r14, %rdi
movq %rbx, %rsi
callq 0x77b4
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x797c
movq %rbx, %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x5210
movq %rax, %r15
leaq 0x151a3(%rip), %rsi     # 0x1b067
leaq 0x18(%rsp), %rdi
movq %rbx, %rdx
callq 0x7667
leaq 0x151b8(%rip), %rdx     # 0x1b090
leaq 0x58(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x76f8
movb $0x1, %bl
leaq 0x58(%rsp), %rsi
movq %r15, %rdi
callq 0x56a0
xorl %ebx, %ebx
movq 0x250e9(%rip), %rsi     # 0x2afe8
movq 0x25092(%rip), %rdx     # 0x2af98
movq %r15, %rdi
callq 0x56f0
jmp 0x5f87
pushq $0x10
popq %rdi
callq 0x5210
movq %rax, %rbx
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x38(%rsp), %rdi
pushq $0x1
popq %rsi
movl %ebp, %edx
callq 0x54d0
leaq 0x15171(%rip), %rsi     # 0x1b0ab
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0x7717
leaq 0x15140(%rip), %rdx     # 0x1b090
leaq 0x58(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x76f8
movb $0x1, %bpl
leaq 0x58(%rsp), %rsi
movq %rbx, %rdi
callq 0x56a0
xorl %ebp, %ebp
movq 0x25070(%rip), %rsi     # 0x2afe8
movq 0x25019(%rip), %rdx     # 0x2af98
movq %rbx, %rdi
callq 0x56f0
movq %rax, %r14
leaq 0x58(%rsp), %rdi
callq 0x51f0
jmp 0x5f9c
movq %rax, %r14
movb $0x1, %bpl
leaq 0x18(%rsp), %rdi
callq 0x51f0
jmp 0x5fae
movq %rax, %r14
movb $0x1, %bpl
leaq 0x38(%rsp), %rdi
callq 0x51f0
testb %bpl, %bpl
jne 0x5fe6
jmp 0x6007
movq %rax, %r14
leaq 0x58(%rsp), %rdi
callq 0x51f0
jmp 0x5fd3
movq %rax, %r14
movb $0x1, %bl
leaq 0x18(%rsp), %rdi
callq 0x51f0
testb %bl, %bl
jne 0x5fee
jmp 0x6007
movq %rax, %r14
movq %rbx, %rdi
jmp 0x5ff1
movq %rax, %r14
movq %r15, %rdi
callq 0x5330
jmp 0x6007
jmp 0x5ffa
movq %rax, %r14
leaq 0x58(%rsp), %rdi
callq 0x797c
movq %r14, %rdi
callq 0x5730
nop