// File: ridiculousfish[P]docopt_fish/docopt_matching.cpp
// Function: docopt_fish::match_context_t::unused_arguments(docopt_fish::match_state_t const*) const
index_list_t unused_arguments(const match_state_t *state) const {
        // To find the unused arguments, we walk over the used arguments and take
        // what's left
        // Arguments may be unused for any of three reasons:
        // 1. It is an unconsumed positional
        // 2. It is an option that we found in the tree, but was not matched during
        //    tree descent
        // 3. It is an option that was not found in the tree at all
        // Make a vector the same size as argv.
        // As we walk over positionals and options, we will mark the corresponding
        // index as used.
        // At the end, the unset bits are the unused arguments
        std::vector<bool> used_argv_indexes(this->argv.size(), false);
        
        auto mark_used = [&](size_t idx) {
            if (idx != npos)
                used_argv_indexes.at(idx) = true;
        };
        auto mark_unused = [&](size_t idx) {
            if (idx != npos)
                used_argv_indexes.at(idx) = false;
        };
        
        // consumed_options is a vector parallel to resolved_options,
        // which tracks whether each resolved_option was used
        const std::vector<bool> &copts = *state->consumed_options;

        // Walk over used positionals.
        // next_positional_index is the first unused one
        for (size_t i = 0; i < state->next_positional_index; i++) {
            mark_used(this->aclass.positionals.at(i).idx_in_argv);
        }

        // Walk over options matched during tree descent.
        // We should have one bit per option
        assert(copts.size() == this->aclass.resolved_options.size());
        for (size_t i = 0; i < copts.size(); i++) {
            if (copts.at(i)) {
                // This option was used. The name index is definitely used. The value
                // index is also used, if it's not npos
                // (note that it may be the same as the name index)
                const resolved_option_t &opt = this->aclass.resolved_options.at(i);
                mark_used(opt.name_idx_in_argv);
                mark_used(opt.value_idx_in_argv);
            }
        }

        // Walk over options NOT matched during tree descent and clear their bits.
        // An argument may be both matched and unmatched, i.e. if "-vv" is parsed
        // into two short options.
        // In that case, we want to mark it as unmatched.
        for (size_t i = 0; i < copts.size(); i++) {
            if (!copts.at(i)) {
                const resolved_option_t &opt = this->aclass.resolved_options.at(i);
                mark_unused(opt.name_idx_in_argv);
            }
        }

        // Don't report the double-dash argument as unused
        mark_used(this->aclass.double_dash_idx);

        // Extract the unused indexes from the bitmap of used arguments
        index_list_t unused_argv_idxs;
        for (size_t i = 0; i < used_argv_indexes.size(); i++) {
            if (!used_argv_indexes.at(i)) {
                unused_argv_idxs.push_back(i);
            }
        }
        return unused_argv_idxs;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0xe0(%rbp)
movq %rdi, %rax
movq %rax, -0xd8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq 0x18(%rax), %rdi
callq 0xc910
movq %rax, -0xc8(%rbp)
movb $0x0, -0x41(%rbp)
leaq -0x42(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x38f20
movq -0xc8(%rbp), %rsi
movq -0xc0(%rbp), %rcx
leaq -0x40(%rbp), %rdi
leaq -0x41(%rbp), %rdx
callq 0x38f40
jmp 0x32454
leaq -0x42(%rbp), %rdi
callq 0x37110
leaq -0x40(%rbp), %rax
movq %rax, -0x60(%rbp)
leaq -0x40(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rdi
addq $0x10, %rdi
callq 0x349f0
movq %rax, -0x70(%rbp)
movq $0x0, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x32501
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x78(%rbp), %rsi
callq 0x32c70
movq %rax, -0xe8(%rbp)
jmp 0x324b1
movq -0xe8(%rbp), %rax
movq (%rax), %rsi
leaq -0x60(%rbp), %rdi
callq 0x3a120
jmp 0x324c6
jmp 0x324c8
movq -0x78(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
jmp 0x32486
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x42(%rbp), %rdi
callq 0x37110
jmp 0x32817
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x3280e
movq -0x70(%rbp), %rdi
callq 0x362e0
movq %rax, %rcx
movq -0xd0(%rbp), %rax
movq %rcx, -0xf0(%rbp)
movq 0x10(%rax), %rdi
addq $0x18, %rdi
callq 0x25030
movq %rax, %rcx
movq -0xf0(%rbp), %rax
cmpq %rcx, %rax
jne 0x32539
jmp 0x32558
leaq 0x1a3cc(%rip), %rdi     # 0x4c90c
leaq 0x19cec(%rip), %rsi     # 0x4c233
movl $0xd9, %edx
leaq 0x1a3ee(%rip), %rcx     # 0x4c941
callq 0x81e0
movq $0x0, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x70(%rbp), %rdi
callq 0x362e0
movq %rax, %rcx
movq -0xf8(%rbp), %rax
cmpq %rcx, %rax
jae 0x3261e
movq -0x70(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x36040
movb %al, -0xf9(%rbp)
jmp 0x3259c
movb -0xf9(%rbp), %al
testb $0x1, %al
jne 0x325a8
jmp 0x3260b
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rdi
addq $0x18, %rdi
movq -0x80(%rbp), %rsi
callq 0x36080
movq %rax, -0x108(%rbp)
jmp 0x325c9
movq -0x108(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movq 0x80(%rax), %rsi
leaq -0x60(%rbp), %rdi
callq 0x3a120
jmp 0x325f0
movq -0x88(%rbp), %rax
movq 0x88(%rax), %rsi
leaq -0x60(%rbp), %rdi
callq 0x3a120
jmp 0x32609
jmp 0x3260b
jmp 0x3260d
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x32560
movq $0x0, -0x90(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x70(%rbp), %rdi
callq 0x362e0
movq %rax, %rcx
movq -0x110(%rbp), %rax
cmpq %rcx, %rax
jae 0x326dd
movq -0x70(%rbp), %rdi
movq -0x90(%rbp), %rsi
callq 0x36040
movb %al, -0x111(%rbp)
jmp 0x3266b
movb -0x111(%rbp), %al
testb $0x1, %al
jne 0x326c4
jmp 0x32677
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rdi
addq $0x18, %rdi
movq -0x90(%rbp), %rsi
callq 0x36080
movq %rax, -0x120(%rbp)
jmp 0x3269b
movq -0x120(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq 0x80(%rax), %rsi
leaq -0x68(%rbp), %rdi
callq 0x3a170
jmp 0x326c2
jmp 0x326c4
jmp 0x326c6
movq -0x90(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
jmp 0x32629
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x30(%rax), %rsi
leaq -0x60(%rbp), %rdi
callq 0x3a120
jmp 0x326f7
movq -0xe0(%rbp), %rdi
movb $0x0, -0x99(%rbp)
callq 0xcf10
movq $0x0, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, -0x128(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x362e0
movq %rax, %rcx
movq -0x128(%rbp), %rax
cmpq %rcx, %rax
jae 0x327d9
movq -0xa8(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x3a1c0
movq %rdx, -0x138(%rbp)
movq %rax, -0x130(%rbp)
jmp 0x3275f
movq -0x138(%rbp), %rax
movq -0x130(%rbp), %rcx
movq %rcx, -0xb8(%rbp)
movq %rax, -0xb0(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x350d0
xorb $-0x1, %al
testb $0x1, %al
jne 0x3278f
jmp 0x327c0
movq -0xe0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x322b0
jmp 0x327a4
jmp 0x327c0
movq -0xe0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
callq 0xd160
jmp 0x3280e
jmp 0x327c2
movq -0xa8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa8(%rbp)
jmp 0x32715
movb $0x1, -0x99(%rbp)
testb $0x1, -0x99(%rbp)
jne 0x327f5
movq -0xe0(%rbp), %rdi
callq 0xd160
leaq -0x40(%rbp), %rdi
callq 0x37e20
movq -0xd8(%rbp), %rax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
leaq -0x40(%rbp), %rdi
callq 0x37e20
movq -0x50(%rbp), %rdi
callq 0x85d0