// File: /workspace/github_cpp_makefile_star2_O3/ridiculousfish[P]docopt_fish/docopt_fish.cpp
// Function: docopt_fish::argv_classifier_t::parse_separated_option(docopt_fish::option_t::name_type_t, std::vector<docopt_fish::error_t, std::allocator<docopt_fish::error_t>>*)
bool argv_classifier_t::parse_separated_option(option_t::name_type_t type, error_list_t *out_errors) {
    const string_t &arg = this->arg();
    assert(this->arg_has_prefix(type == option_t::double_long ? "--" : "-"));

    // Parse the argument into an 'option'. Note that this option does not appear
    // in the options list because its range reflects the string in the argument.
    // TODO: Need to distinguish between equivalent ways of specifying parameters
    // (--foo=bar and --foo bar)
    option_t arg_as_option = option_t::parse_from_argument(arg, type);
    const rstring_t arg_name = arg_as_option.names[type];
    assert(!arg_name.empty());

    // Get list of matching options.
    // Short options must have a value to match, else we handle them in parse_unseparated_short_options
    auto match_iter = std::find_if(this->options.cbegin(), this->options.cend(), [&](const option_t &opt) {
        bool does_match = opt.names[type] == arg_name &&
            (type != option_t::single_short || opt.has_value());
        return does_match;
    });
    
    bool errored = false;
    // Our option de-duplication ensures we should never have more than one match
    if (match_iter == this->options.cend()) {
        this->error(out_errors, error_unknown_option, "Unknown option");
        errored = true;
    } else {
        const option_t &match = *match_iter;
        // Ensure the option and argument agree on having a value
        rstring_t value;
        const size_t name_idx = this->idx;
        size_t arg_index = npos;
        if (match.has_value()) {
            if (arg_as_option.has_value()) {
                // The arg was specified as --foo=bar (long) or -DNDEBUG (short)
                // The range is the value portion; the index is the same as our
                // argument.
                value = arg_as_option.value;
                arg_index = this->idx;
            } else if (! (match.flags & value_is_optional)) {
                if (this->idx + 1 < this->argv.size()) {
                    this->idx += 1;
                    arg_index = this->idx;
                    value = rstring_t(this->argv.at(arg_index));
                } else {
                    // We are at the last argument, and we expect a value. Return the
                    // value as a suggestion.
                    this->suggest(match.value);
                    this->error(out_errors, error_option_has_missing_argument,
                                      "Option expects an argument");
                    errored = true;
                }
            } else {
                // There was no value match, but it was optional
                assert(match.flags & value_is_optional);
            }
        } else if (arg_as_option.has_value()) {
            // A value was specified as --foo=bar, but none was expected
            this->error(out_errors, error_option_unexpected_argument,
                              "Option does not expect an argument");
            errored = true;
        }
        
        // Apply our SEPARATOR-NOTE
        // Be strict about = separators
        // Note that we use the single_long_strict_eqsep flag in arg_as_option
        // to indicate that we got an = separator
        if (! errored && type == option_t::single_long) {
            bool requires_eq = match.flags & single_long_strict_eqsep;
            bool has_eq = arg_as_option.flags & single_long_strict_eqsep;
            if (requires_eq != has_eq) {
                const char *msg = has_eq ?
                                   "Option requires a space to separate its argument" :
                                   "Option requires '=' to separate its argument";
                this->error(out_errors, error_wrong_separator, msg);
                errored = true;
            }
        }

        if (!errored) {
            this->classification.resolved_options.emplace_back(match, name_idx, arg_index, value);
            this->idx += 1;
        }
    }
    return ! errored;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
movl %esi, 0x4(%rsp)
callq 0x8e7a
movq %rax, %r15
cmpl $0x2, %ebp
leaq 0x1c472(%rip), %rax     # 0x23573
leaq 0x1c46c(%rip), %rsi     # 0x23574
cmoveq %rax, %rsi
movq %rbx, %rdi
callq 0x8eac
testb %al, %al
je 0x740c
leaq 0x58(%rsp), %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x6ee6
movl 0x4(%rsp), %eax
leaq (%rax,%rax,2), %rax
movups 0x58(%rsp,%rax,8), %xmm0
movaps %xmm0, 0x40(%rsp)
movq 0x68(%rsp,%rax,8), %rax
movq %rax, 0x50(%rsp)
cmpq $0x0, 0x48(%rsp)
je 0x742b
movq %r14, 0x8(%rsp)
movq 0x8(%rbx), %rax
movq (%rax), %r15
movq 0x8(%rax), %r14
leaq 0x4(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x40(%rsp), %rax
movq %rax, 0x18(%rsp)
movq %r14, 0x30(%rsp)
subq %r15, %r14
movq %r14, %rbp
sarq $0x9, %rbp
testq %rbp, %rbp
jle 0x7207
incq %rbp
leaq 0x10(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x8b42
testb %al, %al
jne 0x7243
leaq 0x80(%r15), %r12
movq %r13, %rdi
movq %r12, %rsi
callq 0x8b42
testb %al, %al
jne 0x726b
leaq 0x100(%r15), %r12
movq %r13, %rdi
movq %r12, %rsi
callq 0x8b42
testb %al, %al
jne 0x726b
leaq 0x180(%r15), %r12
movq %r13, %rdi
movq %r12, %rsi
callq 0x8b42
testb %al, %al
jne 0x726b
addq $0x200, %r15            # imm = 0x200
decq %rbp
addq $-0x200, %r14           # imm = 0xFE00
cmpq $0x1, %rbp
jg 0x7193
sarq $0x7, %r14
cmpq $0x1, %r14
je 0x7253
cmpq $0x2, %r14
je 0x7232
cmpq $0x3, %r14
jne 0x7248
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x8b42
testb %al, %al
jne 0x7243
subq $-0x80, %r15
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x8b42
testb %al, %al
je 0x724f
movq %r15, %r12
jmp 0x726b
movq 0x30(%rsp), %r12
jmp 0x726b
subq $-0x80, %r15
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x8b42
testb %al, %al
movq 0x30(%rsp), %r12
cmovneq %r15, %r12
movq 0x8(%rbx), %rax
cmpq 0x8(%rax), %r12
je 0x72d1
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x20(%rbx), %rax
movq %rax, 0x38(%rsp)
movq $-0x1, 0x28(%rsp)
cmpq $0x0, 0x50(%r12)
movq 0xa8(%rsp), %rcx
je 0x72ed
testq %rcx, %rcx
je 0x730e
movq 0xb0(%rsp), %rcx
movq %rcx, 0x20(%rsp)
movups 0xa0(%rsp), %xmm0
movaps %xmm0, 0x10(%rsp)
movq %rax, 0x28(%rsp)
jmp 0x735c
leaq 0x18fd1(%rip), %rcx     # 0x202a9
xorl %r15d, %r15d
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
movl $0x67, %edx
jmp 0x73ef
testq %rcx, %rcx
je 0x735c
leaq 0x18fda(%rip), %rcx     # 0x202d3
xorl %r15d, %r15d
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
movl $0x65, %edx
jmp 0x73ef
testb $0x1, 0x78(%r12)
jne 0x735c
incq %rax
movq (%rbx), %rdx
movq (%rdx), %rcx
movq 0x8(%rdx), %rdx
subq %rcx, %rdx
sarq $0x5, %rdx
cmpq %rdx, %rax
jae 0x73c9
movq %rax, 0x20(%rbx)
movq %rax, 0x28(%rsp)
shlq $0x5, %rax
movq (%rcx,%rax), %rdx
movq 0x8(%rcx,%rax), %rax
movq $0x0, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movq %rdx, 0x20(%rsp)
cmpl $0x1, 0x4(%rsp)
jne 0x737f
movl 0x78(%r12), %ecx
movl 0xd0(%rsp), %eax
andl $0x2, %eax
shrl %ecx
andl $0x1, %ecx
movl %eax, %edx
shrl %edx
cmpl %edx, %ecx
jne 0x73a3
leaq 0x40(%rbx), %rdi
leaq 0x38(%rsp), %rdx
leaq 0x28(%rsp), %rcx
leaq 0x10(%rsp), %r8
movq %r12, %rsi
callq 0x9064
incq 0x20(%rbx)
movb $0x1, %r15b
jmp 0x73f7
testl %eax, %eax
leaq 0x18f7b(%rip), %rax     # 0x20327
leaq 0x18f43(%rip), %rcx     # 0x202f6
cmoveq %rax, %rcx
xorl %r15d, %r15d
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
movl $0x68, %edx
jmp 0x73ef
addq $0x48, %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x8f58
leaq 0x18ed9(%rip), %rcx     # 0x202b8
xorl %r15d, %r15d
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
movl $0x64, %edx
xorl %r8d, %r8d
callq 0x8f00
movl %r15d, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18de0(%rip), %rdi     # 0x201f3
leaq 0x18c4a(%rip), %rsi     # 0x20064
leaq 0x18e13(%rip), %rcx     # 0x20234
movl $0x1fd, %edx            # imm = 0x1FD
callq 0x6120
leaq 0x18e65(%rip), %rdi     # 0x20297
leaq 0x18c2b(%rip), %rsi     # 0x20064
leaq 0x18df4(%rip), %rcx     # 0x20234
movl $0x205, %edx            # imm = 0x205
callq 0x6120