// File: /workspace/github_cpp_makefile_star2_O1/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, %rbx
movq %rdi, %r14
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %r15
movaps %xmm0, (%r15)
movq $0x0, 0x10(%r15)
leaq 0x80(%rsp), %rdi
movq %r14, %rsi
callq 0x1138a
movq %r15, %rdi
movq %r14, %rsi
callq 0x111a4
cmpq $0x0, 0x8(%r15)
je 0x12131
movaps 0x30(%rsp), %xmm0
movaps %xmm0, 0x10(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x18(%rsp), %rax
cmpq $0x2, %rax
jb 0x1212d
movq 0x10(%rsp), %rcx
movq 0x20(%rsp), %rdx
cmpl $0x2d, (%rdx,%rcx,4)
jne 0x1212d
cmpq $0x2, %rax
jne 0x11f1d
cmpl $0x2d, 0x4(%rdx,%rcx,4)
je 0x1212d
xorps %xmm0, %xmm0
leaq 0x80(%rsp), %r15
movups %xmm0, 0x6c(%r15)
movaps %xmm0, 0x60(%r15)
movaps %xmm0, 0x50(%r15)
movaps %xmm0, 0x40(%r15)
movaps %xmm0, 0x30(%r15)
movaps %xmm0, 0x20(%r15)
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
leaq 0x20(%r14), %rdx
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x787e
testb %al, %al
je 0x11f90
leaq 0xb0(%rsp), %rdi
xorl %edx, %edx
leaq -0x18(%rdx), %rsi
cmpq $-0x60, %rsi
je 0x11fbd
cmpq $0x0, 0xb8(%rsp,%rdx)
leaq (%rdi,%rdx), %rdx
cmovneq %rdx, %rcx
movq %rsi, %rdx
je 0x11f6e
jmp 0x11fc0
movq 0x20(%r14), %rcx
cmpq 0x28(%r14), %rcx
jne 0x12129
leaq 0x1102d(%rip), %rdi     # 0x22fd2
leaq 0x10f40(%rip), %rsi     # 0x22eec
leaq 0x11035(%rip), %rcx     # 0x22fe8
movl $0xfb, %edx
callq 0x7120
movq %r15, %rcx
cmpq $0x0, 0x8(%rcx)
je 0x12145
movb %al, 0xf(%rsp)
movq 0x18(%r14), %rax
movq (%rax), %r15
movq 0x8(%rax), %rbp
xorl %r13d, %r13d
cmpq %rbp, %r15
je 0x12006
leaq 0x80(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0xf5a2
testb %al, %al
cmovneq %r15, %r13
jne 0x12006
subq $-0x80, %r15
cmpq %rbp, %r15
jne 0x11fea
movq 0x10(%r14), %rax
movq %rax, 0x60(%rsp)
movups (%r14), %xmm0
movaps %xmm0, 0x50(%rsp)
leaq 0x68(%rsp), %rdi
movq %r14, %rsi
callq 0x1138a
leaq 0x68(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x111a4
movq 0x60(%rsp), %rax
movq %rax, 0x10(%r14)
movaps 0x50(%rsp), %xmm0
movups %xmm0, (%r14)
movq 0x8(%r15), %rax
cmpq $0x3, %rax
jb 0x120ed
movq 0x68(%rsp), %rcx
movq 0x78(%rsp), %rdx
cmpl $0x3c, (%rdx,%rcx,4)
jne 0x120ed
leaq (%rdx,%rcx,4), %rcx
cmpl $0x3e, -0x4(%rcx,%rax,4)
jne 0x120ed
testq %r13, %r13
je 0x12080
cmpq $0x0, 0x50(%r13)
je 0x120ed
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %rsi
movaps %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq %r14, %rdi
callq 0x11038
testb %al, %al
je 0x12164
leaq 0x100(%rsp), %r14
leaq 0x30(%rsp), %r15
leaq 0x50(%rsp), %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x9c12
movq 0x10(%r14), %rax
movq %rax, 0x10(%r15)
movups (%r14), %xmm0
movaps %xmm0, (%r15)
movaps (%r12), %xmm0
movups %xmm0, 0xc8(%rsp)
movq 0x10(%r12), %rax
movq %rax, 0xd8(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rbx)
movaps 0x30(%rsp), %xmm0
testq %r13, %r13
leaq 0x80(%rsp), %rax
cmovneq %r13, %rax
movups %xmm0, (%rbx)
leaq 0x18(%rbx), %rdi
movl $0xf, %ecx
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl 0x78(%rax), %eax
movl %eax, 0x90(%rbx)
movb 0xf(%rsp), %al
testb %al, %al
je 0x12131
movb $0x1, %al
jmp 0x12133
xorl %eax, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10ed8(%rip), %rdi     # 0x23024
leaq 0x10d99(%rip), %rsi     # 0x22eec
leaq 0x10e8e(%rip), %rcx     # 0x22fe8
movl $0xfe, %edx
callq 0x7120
leaq 0x10d79(%rip), %rdi     # 0x22ee4
leaq 0x10d7a(%rip), %rsi     # 0x22eec
leaq 0x10e6f(%rip), %rcx     # 0x22fe8
movl $0x113, %edx            # imm = 0x113
callq 0x7120