// File: /workspace/github_cpp_makefile_star2_O1/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 0x8b06
movq %rdi, %r15
leaq 0x20(%rdi), %rbx
leaq 0x28(%rdi), %r12
cmpq $-0x1, 0x58(%rdi)
je 0x89a6
movq 0x30(%r15), %rsi
cmpq 0x38(%r15), %rsi
je 0x8aec
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x30(%r15)
jmp 0x8af7
movq %rsi, %r14
movq %r15, %rdi
callq 0x9eea
cmpq $0x2, 0x8(%rax)
jne 0x89da
movq (%rax), %rax
cmpl $0x2d, (%rax)
jne 0x89da
cmpl $0x2d, 0x4(%rax)
jne 0x89da
movq 0x20(%r15), %rax
movq %rax, 0x58(%r15)
incq %rax
movq %rax, 0x20(%r15)
jmp 0x8afa
leaq 0x1cbe2(%rip), %rsi     # 0x255c3
movq %r15, %rdi
callq 0x9f1c
testb %al, %al
je 0x8a0a
movq %r15, %rdi
movl $0x2, %esi
movq %r14, %rdx
callq 0x817e
testb %al, %al
je 0x8af7
jmp 0x8afa
leaq 0x1cbb3(%rip), %rsi     # 0x255c4
movq %r15, %rdi
callq 0x9f1c
testb %al, %al
je 0x8ad9
movq %r15, %rdi
callq 0x9eea
cmpq $0x2, 0x8(%rax)
jb 0x8ad9
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 0x817e
testb %al, %al
jne 0x8aaa
movq %rsp, %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x817e
testb %al, %al
jne 0x8aaa
movq %rsp, %rsi
movq %r15, %rdi
callq 0x84fc
testb %al, %al
jne 0x8aaa
testq %r14, %r14
je 0x8aa7
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %r14, %rdx
callq 0x101fa
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq %r14, %rdx
callq 0x101fa
incq (%rbx)
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x8ac0
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x7200
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x8afa
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x7200
jmp 0x8afa
movq 0x30(%r15), %rsi
cmpq 0x38(%r15), %rsi
je 0x8aec
movq 0x20(%r15), %rax
jmp 0x8996
movq %r12, %rdi
movq %rbx, %rdx
callq 0x10536
incq (%rbx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x198f6(%rip), %rdi     # 0x22403
leaq 0x19520(%rip), %rsi     # 0x22034
leaq 0x19900(%rip), %rcx     # 0x2241b
movl $0x2b9, %edx            # imm = 0x2B9
callq 0x7120
jmp 0x8b27
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x8b40
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x7200
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x8b57
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x7200
movq %rbx, %rdi
callq 0x7360
nop