// File: /workspace/github_cpp_makefile_star2_O2/ridiculousfish[P]docopt_fish/docopt_fish_parse_tree.cpp
// Function: docopt_fish::parse_context_t::parse(docopt_fish::option_clause_t*)
bool parse(option_clause_t *result) {
        rstring_t word;
        if (!this->scan_word(&word)) {
            return false;
        }

        // TODO: handle -- ?
        // What should happen if options are specified after the -- in the usage spec?

        /* Hack to support specifying parameter names inline.

         Consider usage like this:
           "usage: prog [-m <msg>]"

        There's two ways we can interpret this:
         1. An optional -m flag, followed by a positional parameter
         2. An -m option whose value is <msg>

        The Python reference docopt resolves this ambiguity by looking at the Options: section. If
        it finds a declaration of -m with a variable, then <msg> is assumed to be the value
        (interpretation #2); otherwise it's a positional (interpretation #1).

        But requiring a required positional after a flag seems very unlikely, so in this version we
        always use interpretation #2. We do this by treating it as one token '-m <msg>'. Note this
        token contains a space.

        One exception is if a delimeter is found, e.g.:

        "usage: prog [-m=<foo> <msg>]"

        Now <foo> is the value of the option m, and <msg> is positional.

        The second exception is if the option is also found in the Options: section without a
        variable:

            usage: prog -m <msg>
            options: -m

        Then we ignore the option.

        Also, if you really want interpretation #1, you can use parens:

           "usage: prog [-m (<msg>)]"
        */
        rstring_t remaining = word;
        if (remaining.length() > 1 && remaining[0] == '-' && !remaining.is_double_dash()) {
            // It's an option
            option_t opt_from_usage_section;
            if (!option_t::parse_from_string(&remaining, &opt_from_usage_section, &this->errors)) {
                // must have an error in this case
                assert(!this->errors.empty());
                return false;
            }
            assert(!opt_from_usage_section.best_name().empty());

            // See if we have a corresponding option in the options section
            const option_t *opt_from_options_section = nullptr;
            for (const option_t &test_op : *this->shortcut_options) {
                if (opt_from_usage_section.has_same_name(test_op)) {
                    opt_from_options_section = &test_op;
                    break;
                }
            }

            // Looks like an option without a separator. See if the next token is a
            // variable
            rstring_t next = this->peek_word();
            if (next.length() > 2 && next.front() == '<' && next.back() == '>') {
                // It's a variable. See if we have a presence in options.
                bool options_section_implies_no_value =
                    (opt_from_options_section && opt_from_options_section->value.empty());
                if (!options_section_implies_no_value) {
                    rstring_t variable;
                    bool scanned = this->scan_word(&variable);
                    assert(scanned);  // Should always succeed, since we peeked at the word
                    word = word.merge(variable);
                    opt_from_usage_section.value = variable;
                }
            }

            // Use the option from the Options section in preference to the one from
            // the Usage
            // section, since the options one has more information like the
            // corresponding long name
            // and description
            result->word = word;
            result->option =
                opt_from_options_section ? *opt_from_options_section : opt_from_usage_section;
        }
        return true;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rsi, %r14
movq %rdi, %r15
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
callq 0xf9a2
testb %al, %al
je 0x10419
movaps 0x20(%rsp), %xmm0
movaps %xmm0, (%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movb $0x1, %bl
cmpq $0x2, 0x8(%rsp)
jb 0x1041b
movq %rsp, %rdi
xorl %esi, %esi
callq 0xa94e
cmpl $0x2d, %eax
jne 0x1041b
movq %rsp, %rdi
callq 0x105a4
testb %al, %al
jne 0x1041b
xorps %xmm0, %xmm0
leaq 0x90(%rsp), %rsi
movups %xmm0, 0x6c(%rsi)
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
leaq 0x20(%r15), %rdx
movq %rsp, %rdi
callq 0x75fe
testb %al, %al
je 0x1040b
leaq 0x90(%rsp), %rdi
callq 0xdffe
cmpq $0x0, 0x8(%rax)
je 0x1050e
movq 0x18(%r15), %rax
movq (%rax), %r13
movq 0x8(%rax), %rbp
leaq 0x90(%rsp), %r12
cmpq %rbp, %r13
je 0x1042f
movq %r12, %rdi
movq %r13, %rsi
callq 0xdfba
testb %al, %al
jne 0x10432
subq $-0x80, %r13
jmp 0x103f1
movq 0x20(%r15), %rax
cmpq 0x28(%r15), %rax
je 0x1052d
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r13d, %r13d
leaq 0x60(%rsp), %rbp
movq %rbp, %rdi
movq %r15, %rsi
callq 0x101be
cmpq $0x3, 0x8(%rbp)
jb 0x104e1
leaq 0x60(%rsp), %rdi
callq 0xa922
cmpl $0x3c, %eax
jne 0x104e1
leaq 0x60(%rsp), %rdi
callq 0x105e4
cmpl $0x3e, %eax
jne 0x104e1
testq %r13, %r13
je 0x1047b
cmpq $0x0, 0x50(%r13)
je 0x104e1
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
movq %r15, %rdi
callq 0xf9a2
testb %al, %al
je 0x1054c
leaq 0x78(%rsp), %r15
leaq 0x20(%rsp), %rbp
leaq 0x40(%rsp), %rdx
movq %r15, %rdi
movq %rbp, %rsi
callq 0x8f5c
movq 0x10(%r15), %rax
movq %rax, 0x10(%rbp)
movups (%r15), %xmm0
movaps %xmm0, (%rbp)
leaq 0x40(%rsp), %rax
movaps (%rax), %xmm0
movups %xmm0, 0xd8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0xe8(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%r14)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%r14)
testq %r13, %r13
cmovneq %r13, %r12
addq $0x18, %r14
pushq $0x7c
popq %rcx
movq %r14, %rdi
movq %r12, %rsi
rep  movsb (%rsi), %es:(%rdi)
jmp 0x1041b
leaq 0xcb0f(%rip), %rdi      # 0x1d024
leaq 0xc9d0(%rip), %rsi      # 0x1ceec
leaq 0xcac5(%rip), %rcx      # 0x1cfe8
movl $0xfe, %edx
callq 0x7150
leaq 0xca9e(%rip), %rdi      # 0x1cfd2
leaq 0xc9b1(%rip), %rsi      # 0x1ceec
leaq 0xcaa6(%rip), %rcx      # 0x1cfe8
movl $0xfb, %edx
callq 0x7150
leaq 0xc991(%rip), %rdi      # 0x1cee4
leaq 0xc992(%rip), %rsi      # 0x1ceec
leaq 0xca87(%rip), %rcx      # 0x1cfe8
movl $0x113, %edx            # imm = 0x113
callq 0x7150