// File: ridiculousfish[P]docopt_fish/docopt_fish.cpp
// Function: docopt_fish::docopt_impl::populate_from_usage(std::vector<docopt_fish::error_t, std::allocator<docopt_fish::error_t>>*)
void populate_from_usage(error_list_t *out_errors) {
        // Distinguish between normal (docopt) and exposition (e.g. description). */
        enum mode_t { mode_normal, mode_exposition } mode = mode_normal;

        // We need to parse the usage spec ranges after all of the Options
        // This is because we need the options to disambiguate some usages
        rstring_list_t usage_specs;

        rstring_t line;
        while (get_next_line(this->usage_storage, &line)) {
            // There are a couple of possibilitise for each line
            //
            // 1. It may have a header like "Usage:". If so, we want to strip that
            //    header, and optionally use it to determine the mode.
            // 2. It may be a usage spec. We can tell because the first word is plain text.
            // 3. It may be an option spec. We can tell because the first character is a dash.
            // 4. It may be a variable spec. We can tell because the first character is a <.
            // 5. It may be just whitespace or empty, and is ignored.
            //
            // Also note that a (nonempty) line indented more than the previous line is
            // considered a continuation of that line.
            rstring_t trimmed_line = line.trim_whitespace();
            const rstring_t header = find_header(trimmed_line);
            if (!header.empty()) {
                // It's a header
                // Set mode based on header, and remove header from line
                // The headers we know about are Usage, Synopsis, Options, and Arguments,
                // all case insensitive
                // Everything else is considered exposition and is ignored
                mode = mode_exposition;
                const char *const keywords[] = {"Usage", "Synopsis", "Options", "Arguments"};
                size_t keyword_count = sizeof keywords / sizeof *keywords;
                for (size_t i = 0; i < keyword_count; i++) {
                    if (header.find_case_insensitive(keywords[i]) != rstring_t::npos) {
                        mode = mode_normal;
                        break;
                    }
                }
                // Remove the header range from the trimmed line
                assert(header.length() <= trimmed_line.length());
                trimmed_line = trimmed_line.substr_from(header.length()).trim_whitespace();
            }

            // Skip exposition or empty lines
            if (mode == mode_exposition || trimmed_line.empty()) {
                continue;
            }

            // Compute the indent. Note that the header is considered part of the indent, so that:
            //
            //
            // Usage: foo
            // bar
            //
            // Here 'foo' is indented more than 'bar'.
            const size_t line_indent = compute_indent(line, trimmed_line);

            // Determine the "line group." That is, this line plus all subsequent
            // nonempty lines
            // that are indented more than this line.
            rstring_t line_group = trimmed_line;
            rstring_t all_consumed_lines = line;
            rstring_t next_line = line;
            while (get_next_line(this->usage_storage, &next_line)) {
                rstring_t trimmed_next_line = next_line.trim_whitespace();
                size_t next_line_indent = compute_indent(next_line, trimmed_next_line);
                if (trimmed_next_line.empty() || next_line_indent <= line_indent) {
                    break;
                }
                line_group = line_group.merge(next_line);
                all_consumed_lines = all_consumed_lines.merge(next_line);
            }

            rstring_t::char_t first_char = line_group.front();
            if (first_char == '-') {
                // It's an option spec
                this->shortcut_options.push_back(
                    parse_one_option_spec(line_group, &this->names_to_metadata, out_errors));

            } else if (first_char == '<') {
                // It's a variable command spec
                rstring_t variable_name = parse_variable_name(&line_group, out_errors);
                if (! variable_name.empty()) {
                    base_metadata_t<rstring_t> *md = &this->names_to_metadata[variable_name];
                    if (!md->command.empty()) {
                        append_token_error(out_errors, line_group,
                                           error_one_variable_multiple_commands,
                                           "Duplicate command for variable");
                    }
                    // remaining part of line is the command
                    md->command = line_group.trim_whitespace();;
                }
            } else if (isalnum(first_char) || first_char == '_') {
                // It's a usage spec. We will come back to this.
                usage_specs.push_back(line_group);

            } else {
                // It's an error
                append_token_error(out_errors, trimmed_line, error_unknown_leader,
                                    "Lines must start with a normal character, "
                                    "less-than sign, or dash.");
                break;
            }

            // Note the line range we consumed, for the next iteration of the loop
            line = all_consumed_lines;
        }

        // Ensure our shortcut options don't have duplicates
        uniqueize_options(&this->shortcut_options, true /* error on duplicates */, out_errors);

        // Now parse our usage_spec_ranges
        this->usages.reserve(usage_specs.size());
        for (const rstring_t &usage_spec : usage_specs) {
            usage_t usage = parse_one_usage(usage_spec, this->shortcut_options, out_errors);
            this->usages.push_back(std::move(usage));
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2f0, %rsp            # imm = 0x2F0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x2a8(%rbp)
movl $0x0, -0x14(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x1ba90
leaq -0x48(%rbp), %rdi
callq 0xbe70
jmp 0xdd99
jmp 0xdd9b
movq -0x2a8(%rbp), %rdi
addq $0x18, %rdi
leaq -0x48(%rbp), %rsi
callq 0xb050
movb %al, -0x2a9(%rbp)
jmp 0xddb7
movb -0x2a9(%rbp), %al
testb $0x1, %al
jne 0xddc6
jmp 0xe2d9
leaq -0x70(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x1bab0
jmp 0xddd5
leaq -0x88(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xb1e0
jmp 0xdde7
leaq -0x88(%rbp), %rdi
callq 0xbe30
testb $0x1, %al
jne 0xdf64
movl $0x1, -0x14(%rbp)
movq 0x62497(%rip), %rax     # 0x702a0
movq %rax, -0xb0(%rbp)
movq 0x62491(%rip), %rax     # 0x702a8
movq %rax, -0xa8(%rbp)
movq 0x6248b(%rip), %rax     # 0x702b0
movq %rax, -0xa0(%rbp)
movq 0x62485(%rip), %rax     # 0x702b8
movq %rax, -0x98(%rbp)
movq $0x4, -0xb8(%rbp)
movq $0x0, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
cmpq -0xb8(%rbp), %rax
jae 0xdec1
movq -0xc0(%rbp), %rax
movq -0xb0(%rbp,%rax,8), %rsi
leaq -0x88(%rbp), %rdi
callq 0x1bbb0
movq %rax, -0x2b8(%rbp)
jmp 0xde84
movq -0x2b8(%rbp), %rax
cmpq $-0x1, %rax
je 0xdeab
movl $0x0, -0x14(%rbp)
jmp 0xdec1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xe3f0
jmp 0xdead
movq -0xc0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xc0(%rbp)
jmp 0xde50
leaq -0x88(%rbp), %rdi
callq 0xbf20
movq %rax, -0x2c0(%rbp)
leaq -0x70(%rbp), %rdi
callq 0xbf20
movq %rax, %rcx
movq -0x2c0(%rbp), %rax
cmpq %rcx, %rax
ja 0xdeee
jmp 0xdf0d
leaq 0x3db61(%rip), %rdi     # 0x4ba56
leaq 0x3d18c(%rip), %rsi     # 0x4b088
movl $0x358, %edx            # imm = 0x358
leaq 0x3db77(%rip), %rcx     # 0x4ba7f
callq 0x81e0
leaq -0x88(%rbp), %rdi
callq 0xbf20
movq %rax, %rdx
leaq -0xf0(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xc5d0
jmp 0xdf2e
leaq -0xd8(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x1bab0
jmp 0xdf43
movq -0xd8(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0xd0(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0x60(%rbp)
cmpl $0x1, -0x14(%rbp)
je 0xdf79
leaq -0x70(%rbp), %rdi
callq 0xbe30
testb $0x1, %al
jne 0xdf79
jmp 0xdf7e
jmp 0xdd9b
leaq -0x48(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xb2b0
movq %rax, -0x2c8(%rbp)
jmp 0xdf94
movq -0x2c8(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x120(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x2a8(%rbp), %rdi
addq $0x18, %rdi
leaq -0x140(%rbp), %rsi
callq 0xb050
movb %al, -0x2c9(%rbp)
jmp 0xe024
movb -0x2c9(%rbp), %al
testb $0x1, %al
jne 0xe033
jmp 0xe11a
leaq -0x158(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x1bab0
jmp 0xe048
leaq -0x140(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0xb2b0
movq %rax, -0x2d8(%rbp)
jmp 0xe064
movq -0x2d8(%rbp), %rax
movq %rax, -0x160(%rbp)
leaq -0x158(%rbp), %rdi
callq 0xbe30
testb $0x1, %al
jne 0xe092
movq -0x160(%rbp), %rax
cmpq -0xf8(%rbp), %rax
ja 0xe097
jmp 0xe11a
leaq -0x178(%rbp), %rdi
leaq -0x110(%rbp), %rsi
leaq -0x140(%rbp), %rdx
callq 0xc010
jmp 0xe0b3
movq -0x168(%rbp), %rax
movq %rax, -0x100(%rbp)
movups -0x178(%rbp), %xmm0
movaps %xmm0, -0x110(%rbp)
leaq -0x190(%rbp), %rdi
leaq -0x128(%rbp), %rsi
leaq -0x140(%rbp), %rdx
callq 0xc010
jmp 0xe0eb
movq -0x190(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x188(%rbp), %rax
movq %rax, -0x120(%rbp)
movq -0x180(%rbp), %rax
movq %rax, -0x118(%rbp)
jmp 0xe005
leaq -0x110(%rbp), %rdi
callq 0xfa90
movl %eax, -0x2dc(%rbp)
jmp 0xe12e
movl -0x2dc(%rbp), %eax
movl %eax, -0x194(%rbp)
cmpl $0x2d, -0x194(%rbp)
jne 0xe18f
movq -0x2a8(%rbp), %rdx
movq %rdx, %rax
addq $0x50, %rax
movq %rax, -0x2e8(%rbp)
subq $-0x80, %rdx
movq -0x10(%rbp), %rcx
leaq -0x218(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0xb3d0
jmp 0xe175
movq -0x2e8(%rbp), %rdi
leaq -0x218(%rbp), %rsi
callq 0x1bbe0
jmp 0xe18a
jmp 0xe2b3
cmpl $0x3c, -0x194(%rbp)
jne 0xe265
movq -0x10(%rbp), %rdx
leaq -0x230(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x8ed0
jmp 0xe1b5
leaq -0x230(%rbp), %rdi
callq 0xbe30
testb $0x1, %al
jne 0xe263
movq -0x2a8(%rbp), %rdi
subq $-0x80, %rdi
leaq -0x230(%rbp), %rsi
callq 0x1bc10
movq %rax, -0x2f0(%rbp)
jmp 0xe1e9
movq -0x2f0(%rbp), %rax
movq %rax, -0x238(%rbp)
movq -0x238(%rbp), %rdi
callq 0xbe30
testb $0x1, %al
jne 0xe227
movq -0x10(%rbp), %rdi
leaq 0x3d8b0(%rip), %rcx     # 0x4bac2
leaq -0x110(%rbp), %rsi
movl $0xc, %edx
callq 0x8e80
jmp 0xe225
jmp 0xe227
leaq -0x250(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x1bab0
jmp 0xe23c
movq -0x238(%rbp), %rax
movq -0x250(%rbp), %rcx
movq %rcx, (%rax)
movq -0x248(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x240(%rbp), %rcx
movq %rcx, 0x10(%rax)
jmp 0xe2b1
movl -0x194(%rbp), %edi
callq 0x8340
cmpl $0x0, %eax
jne 0xe27e
cmpl $0x5f, -0x194(%rbp)
jne 0xe292
leaq -0x30(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x1bcf0
jmp 0xe290
jmp 0xe2af
movq -0x10(%rbp), %rdi
leaq 0x3d844(%rip), %rcx     # 0x4bae1
leaq -0x70(%rbp), %rsi
movl $0xf, %edx
callq 0x8e80
jmp 0xe2ad
jmp 0xe2d9
jmp 0xe2b1
jmp 0xe2b3
movq -0x128(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x120(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x118(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0xdd9b
movq -0x2a8(%rbp), %rdi
addq $0x50, %rdi
movq -0x10(%rbp), %rdx
movl $0x1, %esi
callq 0xb740
jmp 0xe2f4
leaq -0x30(%rbp), %rdi
callq 0x1be60
movq -0x2a8(%rbp), %rdi
movq %rax, %rsi
callq 0x1bd60
jmp 0xe30e
leaq -0x30(%rbp), %rax
movq %rax, -0x258(%rbp)
movq -0x258(%rbp), %rdi
callq 0x1be90
movq %rax, -0x260(%rbp)
movq -0x258(%rbp), %rdi
callq 0x1bec0
movq %rax, -0x268(%rbp)
leaq -0x260(%rbp), %rdi
leaq -0x268(%rbp), %rsi
callq 0x1bef0
testb $0x1, %al
jne 0xe35b
jmp 0xe3de
leaq -0x260(%rbp), %rdi
callq 0x1bf30
movq -0x2a8(%rbp), %rdx
movq %rax, -0x270(%rbp)
movq -0x270(%rbp), %rsi
addq $0x50, %rdx
movq -0x10(%rbp), %rcx
leaq -0x2a0(%rbp), %rdi
callq 0x26be0
jmp 0xe392
movq -0x2a8(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0x1bf50
jmp 0xe3a7
leaq -0x2a0(%rbp), %rdi
callq 0x1bf80
leaq -0x260(%rbp), %rdi
callq 0x1bfa0
jmp 0xe33f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x1bf80
jmp 0xe3f0
leaq -0x30(%rbp), %rdi
callq 0x1bfc0
addq $0x2f0, %rsp            # imm = 0x2F0
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x1bfc0
movq -0x50(%rbp), %rdi
callq 0x85d0
nopw %cs:(%rax,%rax)
nopl (%rax)