// File: /workspace/github_cpp_makefile_star2_O2/ridiculousfish[P]docopt_fish/docopt_fish.cpp
// Function: docopt_fish::docopt_impl::preflight(std::vector<docopt_fish::error_t, std::allocator<docopt_fish::error_t>>*)
bool preflight(error_list_t *out_errors) {
        // If we have no usage, apply the default one
        if (this->usages.empty()) {
            this->usages.push_back(usage_t::make_default());
        }

        // Extract options from the usage section
        option_list_t usage_options = collect_options(this->usages);

        // Combine these into a single list
        this->all_options.reserve(usage_options.size() + this->shortcut_options.size());
        this->all_options.insert(this->all_options.end(), usage_options.begin(),
                                 usage_options.end());
        this->all_options.insert(this->all_options.end(), this->shortcut_options.begin(),
                                 this->shortcut_options.end());
        uniqueize_options(&this->all_options, false /* do not error on duplicates */, out_errors);

        // Hackish. Consider the following usage:
         // usage: prog [options] [-a]
         // options: -a
         //
         // invoked as: prog -a -a
         //
         // Naively we would expect options to match the first -a arg, and the -a from
         // usage to match the second. But we don't. Instead, if an option appears explicitly
         // in a usage pattern, we excise it from the shortcuts.
         //
         // What Python docopt does is assert, if an option appears anywhere in any
         // usage, it may not be matched by [options]. This seems reasonable, because
         // it means that that option has more particular use cases. So remove all items
         // from shortcut_options() that appear in usage_options.
         //
         // TODO: this currently only removes the matched variant. For example,
         // prog -a --alpha
         // would still be allowed.
        auto opt_is_in_usage = [&](const option_t &shortcut_opt) {
            for (const option_t &usage_opt : usage_options) {
                if (shortcut_opt.has_same_name(usage_opt)) {
                    return true;
                }
            }
            return false;
        };

        this->shortcut_options.erase(std::remove_if(this->shortcut_options.begin(),
                                                    this->shortcut_options.end(), opt_is_in_usage),
                                     this->shortcut_options.end());

        // Example of how to dump
        if ((0)) {
            for (const usage_t &usage : this->usages) {
                errstream() << dump_usage(usage) << "\n";
            }
        }

        // Successfully preflighted
        return true;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rax
cmpq 0x8(%rdi), %rax
jne 0xa328
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xf430
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe0f4
leaq 0x20(%rsp), %rdi
callq 0xe282
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0xf77a
leaq 0x68(%rbx), %r15
movq 0x8(%r12), %rax
subq (%r12), %rax
sarq $0x7, %rax
movq 0x58(%rbx), %rsi
subq 0x50(%rbx), %rsi
sarq $0x7, %rsi
addq %rax, %rsi
movq %r15, %rdi
callq 0xe4a6
movq 0x70(%rbx), %rsi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %r15, %rdi
callq 0xe552
movq 0x70(%rbx), %rsi
movq 0x50(%rbx), %rdx
movq 0x58(%rbx), %rcx
movq %r15, %rdi
callq 0xe552
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x8e00
movq 0x50(%rbx), %rdi
movq 0x58(%rbx), %rsi
leaq 0x8(%rsp), %rdx
callq 0xe7b0
movq 0x58(%rbx), %rdx
addq $0x50, %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xe572
leaq 0x8(%rsp), %rdi
callq 0xef34
movb $0x1, %al
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xe282
jmp 0xa3f8
jmp 0xa3eb
jmp 0xa3eb
jmp 0xa3eb
jmp 0xa3eb
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xef34
movq %rbx, %rdi
callq 0x7390