// File: /workspace/github_cpp_makefile_star2_O1/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, 0x8(%rsp)
movq %rdi, %rbx
movl %esi, 0x4(%rsp)
callq 0x9eea
movq %rax, %r15
cmpl $0x2, 0x4(%rsp)
leaq 0x1d414(%rip), %rax     # 0x255c3
leaq 0x1d40e(%rip), %rsi     # 0x255c4
cmoveq %rax, %rsi
movq %rbx, %rdi
callq 0x9f1c
testb %al, %al
je 0x84be
movl 0x4(%rsp), %edx
leaq 0x58(%rsp), %rdi
movq %r15, %rsi
callq 0x7f92
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 0x84dd
movq 0x8(%rbx), %rax
movq (%rax), %r12
movq 0x8(%rax), %r14
leaq 0x4(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x40(%rsp), %rax
movq %rax, 0x18(%rsp)
movq %r14, %rbp
subq %r12, %rbp
sarq $0x9, %rbp
testq %rbp, %rbp
jle 0x82a9
incq %rbp
leaq 0x10(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x9bc4
testb %al, %al
jne 0x82eb
leaq 0x80(%r12), %r15
movq %r13, %rdi
movq %r15, %rsi
callq 0x9bc4
testb %al, %al
jne 0x830a
leaq 0x100(%r12), %r15
movq %r13, %rdi
movq %r15, %rsi
callq 0x9bc4
testb %al, %al
jne 0x830a
leaq 0x180(%r12), %r15
movq %r13, %rdi
movq %r15, %rsi
callq 0x9bc4
testb %al, %al
jne 0x830a
addq $0x200, %r12            # imm = 0x200
decq %rbp
cmpq $0x1, %rbp
jg 0x8239
movq %r14, %rax
subq %r12, %rax
sarq $0x7, %rax
cmpq $0x1, %rax
je 0x82f4
cmpq $0x2, %rax
je 0x82da
cmpq $0x3, %rax
jne 0x8307
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x9bc4
testb %al, %al
jne 0x82eb
subq $-0x80, %r12
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x9bc4
testb %al, %al
je 0x82f0
movq %r12, %r15
jmp 0x830a
subq $-0x80, %r12
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x9bc4
testb %al, %al
cmovneq %r12, %r14
movq %r14, %r15
movq 0x8(%rbx), %rax
cmpq 0x8(%rax), %r15
je 0x836f
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x20(%rbx), %rax
movq %rax, 0x38(%rsp)
movq $-0x1, 0x30(%rsp)
cmpq $0x0, 0x50(%r15)
movq 0xa8(%rsp), %rcx
je 0x8393
testq %rcx, %rcx
je 0x83b9
movq 0xb0(%rsp), %rcx
movq %rcx, 0x20(%rsp)
movups 0xa0(%rsp), %xmm0
movaps %xmm0, 0x10(%rsp)
movq %rax, 0x30(%rsp)
jmp 0x8406
leaq 0x19f03(%rip), %rcx     # 0x22279
xorl %r12d, %r12d
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
movl $0x67, %edx
xorl %r8d, %r8d
callq 0x9f74
jmp 0x8484
testq %rcx, %rcx
je 0x8406
leaq 0x19f04(%rip), %rcx     # 0x222a3
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
movl $0x65, %edx
xorl %r8d, %r8d
callq 0x9f74
movb $0x1, %r12b
jmp 0x8409
testb $0x1, 0x78(%r15)
jne 0x8406
incq %rax
movq (%rbx), %rdx
movq (%rdx), %rcx
movq 0x8(%rdx), %rdx
subq %rcx, %rdx
sarq $0x5, %rdx
cmpq %rdx, %rax
jae 0x8499
movq %rax, 0x20(%rbx)
movq %rax, 0x30(%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)
xorl %r12d, %r12d
testb %r12b, %r12b
jne 0x845c
cmpl $0x1, 0x4(%rsp)
jne 0x845c
movl 0x78(%r15), %ecx
movl 0xd0(%rsp), %eax
andl $0x2, %eax
shrl %ecx
andl $0x1, %ecx
movl %eax, %edx
shrl %edx
cmpl %edx, %ecx
je 0x845c
testl %eax, %eax
leaq 0x19ebe(%rip), %rax     # 0x222f7
leaq 0x19e86(%rip), %rcx     # 0x222c6
cmoveq %rax, %rcx
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
movl $0x68, %edx
xorl %r8d, %r8d
callq 0x9f74
movb $0x1, %r12b
testb %r12b, %r12b
jne 0x8480
leaq 0x40(%rbx), %rdi
leaq 0x38(%rsp), %rdx
leaq 0x30(%rsp), %rcx
leaq 0x10(%rsp), %r8
movq %r15, %rsi
callq 0xa0d8
incq 0x20(%rbx)
xorb $0x1, %r12b
movl %r12d, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x48(%r15), %rsi
movq %rbx, %rdi
callq 0x9fcc
leaq 0x19ddc(%rip), %rcx     # 0x22288
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
movl $0x64, %edx
jmp 0x83ac
leaq 0x19cfe(%rip), %rdi     # 0x221c3
leaq 0x19b68(%rip), %rsi     # 0x22034
leaq 0x19d31(%rip), %rcx     # 0x22204
movl $0x1fd, %edx            # imm = 0x1FD
callq 0x7120
leaq 0x19d83(%rip), %rdi     # 0x22267
leaq 0x19b49(%rip), %rsi     # 0x22034
leaq 0x19d12(%rip), %rcx     # 0x22204
movl $0x205, %edx            # imm = 0x205
callq 0x7120