// File: /workspace/github_cpp_makefile_star2_O2/ridiculousfish[P]docopt_fish/docopt_fish.cpp
// Function: docopt_fish::argv_classifier_t::parse_next_arg(std::vector<docopt_fish::error_t, std::allocator<docopt_fish::error_t>>*)
void argv_classifier_t::parse_next_arg(error_list_t *out_errors) {
    assert(this->idx < argv.size());
    
    if (this->classification.double_dash_idx != npos) {
        // we saw a double-dash
        // everything remaining is positional
        this->classification.positionals.emplace_back(this->idx);
        this->idx += 1;
    } else if (is_double_dash(this->arg())) {
        // Literal --. The remaining arguments are positional.
        this->classification.double_dash_idx = this->idx;
        this->idx += 1;
    } else if (this->arg_has_prefix("--")) {
        // Leading long option
        if (this->parse_separated_option(option_t::double_long, out_errors)) {
            // this will have updated this->idx
        } else {
            // This argument is unused
            // We have to update idx
            this->idx += 1;
        }
    } else if (this->arg_has_prefix("-") && this->arg().length() > 1) {
        // An option with a leading dash, like -foo
        // This can be a lot of different things:
        // 1. A combined short option: tar -cf ...
        // 2. A long option with a single dash: -std=c++
        // 3. A short option with a value: -DNDEBUG
        // Try to parse it as a long option; if that fails try to parse it as a
        // short option. We cache the errors locally so that failing to parse it
        // as a long option doesn't report an error if it parses successfully
        // as a short option. This may result in duplicate error messages.
        error_list_t long_errors, short_errors;
        if (this->parse_separated_option(option_t::single_long, &long_errors)) {
            // successfully parsed as long option
        } else if (this->parse_separated_option(option_t::single_short, &short_errors)) {
            // parse_unseparated_short will have updated idx
        } else if (this->parse_unseparated_short_options(&short_errors)) {
            // parse_unseparated_short_options succeeded.
        } else {
            // Unparseable argument.
            // Say the user enters -Dfoo. This may be an unknown long option, or a
            // short option with a value. If there is a short option -D, then it is
            // more likely that the error from the short option parsing is what we
            // want. So append our short errors first.
            if (out_errors) {
                auto dst = std::back_inserter(*out_errors);
                std::move(short_errors.begin(), short_errors.end(), dst);
                std::move(long_errors.begin(), long_errors.end(), dst);
            }
            this->idx += 1;
        }
    } else {
        // Positional argument
        // Note this includes just single-dash arguments, which are often a
        // stand-in for stdin
        this->classification.positionals.emplace_back(this->idx);
        this->idx += 1;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq (%rdi), %rax
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x5, %rcx
cmpq %rcx, 0x20(%rdi)
jae 0x8619
movq %rdi, %r15
leaq 0x20(%rdi), %rbx
leaq 0x28(%rdi), %r12
cmpq $-0x1, 0x58(%rdi)
je 0x850f
movq %r12, %rdi
movq %rbx, %rsi
callq 0x93de
incq (%rbx)
jmp 0x8535
movq %rsi, %r14
movq %r15, %rdi
callq 0x922e
movq %rax, %rdi
callq 0x75dc
testb %al, %al
je 0x8541
movq 0x20(%r15), %rax
movq %rax, 0x58(%r15)
incq %rax
movq %rax, 0x20(%r15)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x170e3(%rip), %rsi     # 0x1f62b
movq %r15, %rdi
callq 0x923e
testb %al, %al
je 0x8568
pushq $0x2
popq %rsi
movq %r15, %rdi
movq %r14, %rdx
callq 0x7db6
testb %al, %al
je 0x850a
jmp 0x8535
leaq 0x170bd(%rip), %rsi     # 0x1f62c
movq %r15, %rdi
callq 0x923e
testb %al, %al
je 0x84ff
movq %r15, %rdi
callq 0x922e
cmpq $0x2, 0x8(%rax)
jb 0x84ff
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdx
movaps %xmm0, (%rdx)
andq $0x0, 0x10(%rdx)
movaps %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
pushq $0x1
popq %rsi
movq %r15, %rdi
callq 0x7db6
testb %al, %al
jne 0x8602
movq %rsp, %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x7db6
testb %al, %al
jne 0x8602
movq %rsp, %rsi
movq %r15, %rdi
callq 0x80ee
testb %al, %al
jne 0x8602
testq %r14, %r14
je 0x85ff
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %r14, %rdx
callq 0xed00
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq %r14, %rdx
callq 0xed00
incq (%rbx)
movq %rsp, %rdi
callq 0xebbc
leaq 0x20(%rsp), %rdi
callq 0xebbc
jmp 0x8535
leaq 0x13de3(%rip), %rdi     # 0x1c403
leaq 0x13a0d(%rip), %rsi     # 0x1c034
leaq 0x13ded(%rip), %rcx     # 0x1c41b
movl $0x2b9, %edx            # imm = 0x2B9
callq 0x7150
jmp 0x863a
movq %rax, %rbx
movq %rsp, %rdi
callq 0xebbc
leaq 0x20(%rsp), %rdi
callq 0xebbc
movq %rbx, %rdi
callq 0x7390
nop