// File: /workspace/github_cpp_makefile_star2_O3/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), %rcx
movq 0x20(%rdi), %rax
movq 0x8(%rcx), %rdx
subq (%rcx), %rdx
sarq $0x5, %rdx
cmpq %rdx, %rax
jae 0x7aa9
movq %rdi, %r15
leaq 0x20(%rdi), %rbx
leaq 0x28(%rdi), %r12
cmpq $-0x1, 0x58(%rdi)
je 0x7940
movq 0x30(%r15), %rsi
cmpq 0x38(%r15), %rsi
je 0x7a89
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x30(%r15)
jmp 0x7a97
movq %rsi, %r14
movq %r15, %rdi
callq 0x8e7a
cmpq $0x2, 0x8(%rax)
jne 0x7974
movq (%rax), %rax
cmpl $0x2d, (%rax)
jne 0x7974
cmpl $0x2d, 0x4(%rax)
jne 0x7974
movq 0x20(%r15), %rax
movq %rax, 0x58(%r15)
incq %rax
movq %rax, 0x20(%r15)
jmp 0x7a9d
leaq 0x1bbf8(%rip), %rsi     # 0x23573
movq %r15, %rdi
callq 0x8eac
testb %al, %al
je 0x79a7
movq %r15, %rdi
movl $0x2, %esi
movq %r14, %rdx
callq 0x70d2
testb %al, %al
jne 0x7a9d
incq (%rbx)
jmp 0x7a9d
leaq 0x1bbc6(%rip), %rsi     # 0x23574
movq %r15, %rdi
callq 0x8eac
testb %al, %al
je 0x7a76
movq %r15, %rdi
callq 0x8e7a
cmpq $0x2, 0x8(%rax)
jb 0x7a76
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdx
movaps %xmm0, (%rdx)
xorl %eax, %eax
movq %rax, 0x10(%rdx)
movq %rax, 0x10(%rsp)
movaps %xmm0, (%rsp)
movq %r15, %rdi
movl $0x1, %esi
callq 0x70d2
testb %al, %al
jne 0x7a47
movq %rsp, %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x70d2
testb %al, %al
jne 0x7a47
movq %rsp, %rsi
movq %r15, %rdi
callq 0x744a
testb %al, %al
jne 0x7a47
testq %r14, %r14
je 0x7a44
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %r14, %rdx
callq 0xf1da
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq %r14, %rdx
callq 0xf1da
incq (%rbx)
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x7a5d
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x6200
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x7a9d
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x6200
jmp 0x7a9d
movq 0x30(%r15), %rsi
cmpq 0x38(%r15), %rsi
je 0x7a89
movq 0x20(%r15), %rax
jmp 0x7930
movq %r12, %rdi
movq %rbx, %rdx
callq 0xf516
movq (%rbx), %rax
incq %rax
movq %rax, (%rbx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x18983(%rip), %rdi     # 0x20433
leaq 0x185ad(%rip), %rsi     # 0x20064
leaq 0x1898d(%rip), %rcx     # 0x2044b
movl $0x2b9, %edx            # imm = 0x2B9
callq 0x6120
jmp 0x7aca
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x7ae3
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x6200
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x7afa
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x6200
movq %rbx, %rdi
callq 0x6360