// File: /workspace/github_cpp_makefile_star2_O3/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 0xa684
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xf8e2
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe5ca
leaq 0x20(%rsp), %rdi
callq 0xe816
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0xfcfc
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 0xe952
movq 0x70(%rbx), %rsi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %r15, %rdi
callq 0xea08
movq 0x70(%rbx), %rsi
movq 0x50(%rbx), %rdx
movq 0x58(%rbx), %rcx
movq %r15, %rdi
callq 0xea08
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x89e8
movq 0x50(%rbx), %rdi
movq 0x58(%rbx), %rsi
leaq 0x8(%rsp), %rdx
callq 0xec17
cmpq 0x58(%rbx), %rax
je 0xa70f
movq %rax, 0x58(%rbx)
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xa726
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x6200
movb $0x1, %al
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xe816
jmp 0xa763
jmp 0xa749
jmp 0xa749
jmp 0xa749
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xa763
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x6200
movq %rbx, %rdi
callq 0x6360
nop