// File: 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
movq %rsp, %rbp
subq $0x240, %rsp            # imm = 0x240
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1e8(%rbp)
movsbl -0x9(%rbp), %eax
cmpl $0x20, %eax
jne 0x833d
movb $0x0, -0x9(%rbp)
movq -0x1e8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xb6c0
cmpq $0x0, %rax
je 0x8420
movb $0x1, -0x7d(%rbp)
movl $0x10, %edi
callq 0x7310
movq %rax, -0x1f0(%rbp)
movq -0x18(%rbp), %rdx
leaq 0x41cd4(%rip), %rsi     # 0x4a04b
leaq -0x70(%rbp), %rdi
callq 0xb5b0
jmp 0x8382
leaq 0x41ceb(%rip), %rdx     # 0x4a074
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xb720
jmp 0x8398
movq -0x1f0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x7950
jmp 0x83aa
movq -0x1f0(%rbp), %rdi
movb $0x0, -0x7d(%rbp)
movq 0x61c2c(%rip), %rsi     # 0x69fe8
movq 0x61bcd(%rip), %rdx     # 0x69f90
callq 0x79d0
jmp 0x8795
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x8407
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x83fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x73c0
leaq -0x70(%rbp), %rdi
callq 0x73c0
testb $0x1, -0x7d(%rbp)
jne 0x840f
jmp 0x841b
movq -0x1f0(%rbp), %rdi
callq 0x74a0
jmp 0x878c
cmpb $0x0, -0x9(%rbp)
je 0x859b
movq -0x1e8(%rbp), %rdi
movsbl -0x9(%rbp), %esi
callq 0x8880
movq %rax, -0x88(%rbp)
cmpq $0x0, -0x88(%rbp)
je 0x8599
movb $0x1, -0xea(%rbp)
movl $0x10, %edi
callq 0x7310
movq %rax, -0x208(%rbp)
movsbl -0x9(%rbp), %eax
movl %eax, -0x1fc(%rbp)
leaq -0xe9(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
callq 0x7a50
movl -0x1fc(%rbp), %edx
movq -0x1f8(%rbp), %rcx
leaq -0xe8(%rbp), %rdi
movl $0x1, %esi
callq 0xb7c0
jmp 0x84a4
leaq 0x41be4(%rip), %rsi     # 0x4a08f
leaq -0xc8(%rbp), %rdi
leaq -0xe8(%rbp), %rdx
callq 0xb770
jmp 0x84c0
leaq 0x41bad(%rip), %rdx     # 0x4a074
leaq -0xa8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0xb720
jmp 0x84dc
movq -0x208(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x7950
jmp 0x84f1
movq -0x208(%rbp), %rdi
movb $0x0, -0xea(%rbp)
movq 0x61ae2(%rip), %rsi     # 0x69fe8
movq 0x61a83(%rip), %rdx     # 0x69f90
callq 0x79d0
jmp 0x8795
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x8571
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x8565
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x8559
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x73c0
leaq -0xc8(%rbp), %rdi
callq 0x73c0
leaq -0xe8(%rbp), %rdi
callq 0x73c0
leaq -0xe9(%rbp), %rdi
callq 0x7670
testb $0x1, -0xea(%rbp)
jne 0x8588
jmp 0x8594
movq -0x208(%rbp), %rdi
callq 0x74a0
jmp 0x878c
jmp 0x859b
leaq -0x1b0(%rbp), %rdi
callq 0xb830
movb -0x9(%rbp), %al
movb %al, -0x1b0(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x1a8(%rbp), %rdi
callq 0x7070
jmp 0x85c2
movq -0x20(%rbp), %rsi
leaq -0x188(%rbp), %rdi
callq 0x7070
jmp 0x85d4
movq -0x28(%rbp), %rsi
leaq -0x168(%rbp), %rdi
callq 0x7070
jmp 0x85e6
movq -0x30(%rbp), %rsi
leaq -0x148(%rbp), %rdi
callq 0x7070
jmp 0x85f8
movq -0x30(%rbp), %rsi
leaq -0x120(%rbp), %rdi
callq 0x7070
jmp 0x860a
movq -0x1e8(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
movq -0x18(%rbp), %rsi
callq 0xb8c0
movq %rax, -0x210(%rbp)
jmp 0x862a
movq -0x210(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0xb9a0
jmp 0x863f
cmpb $0x0, -0x9(%rbp)
je 0x86a1
movq -0x1e8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq %rax, -0x220(%rbp)
addq $0x48, %rdi
leaq -0x9(%rbp), %rsi
callq 0xba70
movq %rax, -0x218(%rbp)
jmp 0x866d
movq -0x220(%rbp), %rsi
movq -0x218(%rbp), %rdi
callq 0x7070
jmp 0x8682
jmp 0x86a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0xbd60
jmp 0x878c
movq -0x1e8(%rbp), %rdi
addq $0x30, %rdi
movq %rdi, -0x230(%rbp)
callq 0xb4a0
movq -0x230(%rbp), %rdi
movq %rax, -0x1c8(%rbp)
callq 0xb550
movq %rax, -0x1d0(%rbp)
movq $0x2, -0x1d8(%rbp)
leaq -0x1d0(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0xb510
movq %rax, -0x228(%rbp)
jmp 0x86f9
movq -0x228(%rbp), %rax
movq (%rax), %rsi
leaq -0x1c8(%rbp), %rdi
callq 0xb4d0
movq %rax, -0x1c0(%rbp)
leaq -0x1b8(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0xb570
movq -0x230(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x1b8(%rbp), %rsi
callq 0xbb50
movq %rax, -0x238(%rbp)
jmp 0x8749
movq -0x1e8(%rbp), %rdi
movq -0x238(%rbp), %rax
movq %rax, -0x1e0(%rbp)
movq -0x18(%rbp), %rsi
callq 0xb8c0
movq %rax, -0x240(%rbp)
jmp 0x8770
leaq -0x1b0(%rbp), %rdi
callq 0xbd60
movq -0x240(%rbp), %rax
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0x7a30
nopw %cs:(%rax,%rax)