// File: /workspace/github_cpp_makefile_star2_O1/ridiculousfish[P]docopt_fish/docopt_fish.cpp
// Function: docopt_fish::docopt_impl::combine_short_suggestions(std::vector<docopt_fish::suggestion_t, std::allocator<docopt_fish::suggestion_t>>*, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t>> const&) const
void combine_short_suggestions(suggestion_list_t *suggestions, const string_t &partial_str) const {
        // Verify it starts with a - and at least one other character
        // Verify that every character in partial is a combinable short option in our suggestions
        // If so, append as a suggestion every combinable short option that doesn't appear in partial
        if (partial_str.length() <= 1 || partial_str.at(0) != '-') {
            return; // EARLY OUT
        }

        constexpr size_t short_option_name_length = 2;
        
        // Helper to return an option with the given short name
        auto short_option_named = [&](const string_t &name){
            const option_t *result = nullptr;
            if (name.length() == short_option_name_length) {
                const rstring_t rname(name);
                for (const option_t &opt : this->all_options) {
                    if (opt.names[option_t::single_short] == rname) {
                        result = &opt;
                        break;
                    }
                }
            }
            return result;
        };
        
        // Helper to indicate if the suggestion corresponds to a short option
        auto is_short_option_suggestion = [&](const suggestion_t &s) {
            return short_option_named(s.token) != nullptr;
        };
        
        
        // Generate map from character to suggestion for each short suggestion
        // e.g. an option '-e' would have an entry 'e' -> suggestion
        std::map<string_t::value_type, suggestion_t> char_to_suggestion;
        for (const suggestion_t &s : *suggestions) {
            if (is_short_option_suggestion(s)) {
                assert(s.token.length() == short_option_name_length);
                char_to_suggestion[s.token.at(1)] = s;
            }
        }
        
        // Verify that every character in the partial arg is in our suggestions,
        // and that the corresponding option does not require a value
        // If so, remove the corresponding suggestion (so that we only pick it up once)
        // Start at 1 to skip the leading dash
        // TODO: handle options with multiplicities (-vvv)
        bool partial_arg_is_valid_combined_shorts = true;
        for (rstring_t::char_t c : rstring_t(partial_str, 1)) {
            if (! char_to_suggestion.erase(c)) {
                // Not found in the map
                // So some character in the partial is not a suggestion
                partial_arg_is_valid_combined_shorts = false;
                break;
            }
            
            // Check for a value; short options with values must be last in a combined option,
            // and therefore cannot appear in partial strings
            // We should always have a short option, else it would not have been found
            // in char_to_suggestion
            const option_t *opt = short_option_named({'-', c});
            assert(opt != nullptr);
            if (opt->has_value()) {
                partial_arg_is_valid_combined_shorts = false;
                break;
            }
        }
        
        if (partial_arg_is_valid_combined_shorts) {
            // Whatever's left are our new suggestions
            // Erase all short suggestions, and append our new ones
            // New suggestions are the partial string, with each short option appended,
            // along with that short option's metadata
            suggestions->erase(std::remove_if(suggestions->begin(), suggestions->end(),
                                              is_short_option_suggestion),
                               suggestions->end());
            for (const auto &p : char_to_suggestion) {
                suggestions->emplace_back(partial_str + p.first, p.second.md);
            }
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
cmpq $0x2, 0x8(%rdx)
jb 0xca93
movq (%rdx), %rax
cmpl $0x2d, (%rax)
jne 0xca93
movq %rdx, 0x30(%rsp)
movq %rdi, 0x28(%rsp)
leaq 0x58(%rsp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq (%rsi), %r15
movq %rsi, 0x40(%rsp)
movq 0x8(%rsi), %rbx
cmpq %rbx, %r15
je 0xc867
movq %rsp, %r12
movq 0x8(%r15), %rax
cmpq $0x2, %rax
jne 0xc857
movq 0x28(%rsp), %rcx
movq $0x0, (%rsp)
movq %rax, 0x8(%rsp)
movq (%r15), %rax
movq %rax, 0x10(%rsp)
movq 0x68(%rcx), %rbp
movq 0x70(%rcx), %r14
cmpq %r14, %rbp
je 0xc857
xorl %r13d, %r13d
movq 0x8(%rbp), %rax
cmpq 0x8(%rsp), %rax
jne 0xc7d0
movq %rbp, %rdi
movq %r12, %rsi
callq 0xbfd4
testl %eax, %eax
sete %al
jmp 0xc7d2
xorl %eax, %eax
testb %al, %al
cmovneq %rbp, %r13
jne 0xc7e3
subq $-0x80, %rbp
cmpq %r14, %rbp
jne 0xc7b3
testq %r13, %r13
je 0xc857
cmpq $0x2, 0x8(%r15)
jne 0xcac4
movq (%r15), %rsi
addq $0x4, %rsi
leaq 0x50(%rsp), %rdi
callq 0xd158
movq %rax, %rbp
movq %rax, %rdi
movq %r15, %rsi
callq 0x72f0
leaq 0x20(%rbp), %rdi
leaq 0x20(%r15), %rsi
callq 0x72f0
leaq 0x40(%rbp), %rdi
leaq 0x40(%r15), %rsi
callq 0x72f0
movq %rbp, %rdi
addq $0x60, %rdi
leaq 0x60(%r15), %rsi
callq 0x72f0
movl 0x80(%r15), %eax
movl %eax, 0x80(%rbp)
movq 0x88(%r15), %rax
movq %rax, 0x88(%rbp)
addq $0x90, %r15
cmpq %rbx, %r15
jne 0xc777
movq 0x30(%rsp), %rax
movq (%rax), %r13
movq 0x8(%rax), %rax
leaq (,%rax,4), %r14
addq %r13, %r14
movb $0x1, %r15b
leaq 0x50(%rsp), %r12
leaq 0x80(%rsp), %rbp
movq %r14, 0x48(%rsp)
addq $0x4, %r13
cmpq %r14, %r13
je 0xc9ca
movl (%r13), %eax
movl %eax, 0x24(%rsp)
movq %r12, %rdi
leaq 0x24(%rsp), %rsi
callq 0xd4e2
movq 0x78(%rsp), %rbx
movq %r12, %rdi
movq %rax, %rsi
callq 0xd55a
xorl %ecx, %ecx
movl $0x0, %eax
cmpq 0x78(%rsp), %rbx
je 0xc9bd
movl $0x2d, 0x38(%rsp)
movl 0x24(%rsp), %eax
movl %eax, 0x3c(%rsp)
leaq 0x10(%rsp), %rdi
movq %rdi, (%rsp)
movl $0x2, %edx
leaq 0x38(%rsp), %rsi
callq 0x73d0
movl $0x2, %edx
movq %rdx, 0x8(%rsp)
movq (%rsp), %rax
movl $0x0, 0x8(%rax)
movq 0x28(%rsp), %rcx
movq $0x0, 0x80(%rsp)
movq %rdx, 0x88(%rsp)
movq %rax, 0x90(%rsp)
movq 0x68(%rcx), %r14
movq 0x70(%rcx), %rbx
xorl %r12d, %r12d
cmpq %rbx, %r14
je 0xc975
movq 0x8(%r14), %rax
cmpq 0x88(%rsp), %rax
jne 0xc965
movq %r14, %rdi
movq %rbp, %rsi
callq 0xbfd4
testl %eax, %eax
sete %al
jmp 0xc967
xorl %eax, %eax
testb %al, %al
cmovneq %r14, %r12
jne 0xc975
subq $-0x80, %r14
jmp 0xc940
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xc995
movq 0x10(%rsp), %rax
leaq 0x4(,%rax,4), %rsi
callq 0x7200
testq %r12, %r12
je 0xcaa5
cmpq $0x0, 0x50(%r12)
sete %cl
movzbl %r15b, %eax
movl $0x0, %edx
cmovnel %edx, %eax
movq 0x48(%rsp), %r14
leaq 0x50(%rsp), %r12
movl %eax, %r15d
testb %cl, %cl
jne 0xc893
jmp 0xc9cd
movl %r15d, %eax
testb $0x1, %al
movq 0x30(%rsp), %rbx
movq 0x40(%rsp), %r14
leaq 0x58(%rsp), %r15
je 0xca89
movq (%r14), %rdi
movq 0x8(%r14), %rsi
leaq 0x28(%rsp), %rdx
callq 0xd787
movq 0x8(%r14), %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0xd674
movq 0x68(%rsp), %r12
cmpq %r15, %r12
je 0xca89
movq %rsp, %r13
movl 0x20(%r12), %ebp
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rax
leaq (%rsi,%rax,4), %rdx
movq %r13, %rdi
callq 0x10742
movq 0x8(%rsp), %rsi
movl $0x1, %ecx
movq %r13, %rdi
xorl %edx, %edx
movl %ebp, %r8d
callq 0x71a0
leaq 0x48(%r12), %rdx
movq %r14, %rdi
movq %r13, %rsi
callq 0xd1bc
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xca79
movq 0x10(%rsp), %rax
leaq 0x4(,%rax,4), %rsi
callq 0x7200
movq %r12, %rdi
callq 0x7130
movq %rax, %r12
cmpq %r15, %rax
jne 0xca11
leaq 0x50(%rsp), %rdi
callq 0xdcb0
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x15f06(%rip), %rdi     # 0x229b2
leaq 0x15581(%rip), %rsi     # 0x22034
leaq 0x15e92(%rip), %rcx     # 0x2294c
movl $0x488, %edx            # imm = 0x488
callq 0x7120
leaq 0x15e54(%rip), %rdi     # 0x2291f
leaq 0x15562(%rip), %rsi     # 0x22034
leaq 0x15e73(%rip), %rcx     # 0x2294c
movl $0x470, %edx            # imm = 0x470
callq 0x7120
jmp 0xcb16
jmp 0xcb16
jmp 0xcb16
jmp 0xcaf1
jmp 0xcaf1
jmp 0xcb16
jmp 0xcb16
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xcb19
movq 0x10(%rsp), %rax
leaq 0x4(,%rax,4), %rsi
callq 0x7200
jmp 0xcb19
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0xdcb0
movq %rbx, %rdi
callq 0x7360
nop