// File: /workspace/github_cpp_makefile_star2_O3/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 0x20(%rsp), %r15
movaps %xmm0, (%r15)
movq $0x0, 0x10(%r15)
leaq 0x80(%rsp), %rdi
movq %r14, %rsi
callq 0x10358
movq %r15, %rdi
movq %r14, %rsi
callq 0x10158
cmpq $0x0, 0x8(%r15)
je 0x10f36
movaps 0x20(%rsp), %xmm0
movaps %xmm0, (%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x8(%rsp), %rax
movb $0x1, %bpl
cmpq $0x2, %rax
jb 0x10f38
movq (%rsp), %rcx
movq 0x10(%rsp), %rdx
cmpl $0x2d, (%rdx,%rcx,4)
jne 0x10f38
cmpq $0x2, %rax
jne 0x10ec4
cmpl $0x2d, 0x4(%rdx,%rcx,4)
je 0x10f38
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
movq %rsp, %rdi
movq %r15, %rsi
callq 0x685e
testb %al, %al
je 0x10f28
movl $0x38, %eax
leaq -0x18(%rax), %rcx
cmpq $-0x28, %rcx
je 0x10f4c
cmpq $0x0, 0x80(%rsp,%rax)
movq %rcx, %rax
je 0x10f0e
jmp 0x10f5b
movq 0x20(%r14), %rax
cmpq 0x28(%r14), %rax
je 0x110b4
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x0, 0x88(%rsp)
je 0x110d3
movq %rbx, 0x60(%rsp)
movq 0x18(%r14), %rax
movq (%rax), %r12
movq 0x8(%rax), %rbx
cmpq %rbx, %r12
je 0x10f90
leaq 0x80(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0xe544
testb %al, %al
jne 0x10f93
subq $-0x80, %r12
cmpq %rbx, %r12
jne 0x10f78
xorl %r12d, %r12d
movq 0x10(%r14), %rax
movq %rax, 0x50(%rsp)
movups (%r14), %xmm0
movaps %xmm0, 0x40(%rsp)
leaq 0x68(%rsp), %rdi
movq %r14, %rsi
callq 0x10358
leaq 0x68(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x10158
movq 0x50(%rsp), %rax
movq %rax, 0x10(%r14)
movaps 0x40(%rsp), %xmm0
movups %xmm0, (%r14)
movq 0x8(%r13), %rax
cmpq $0x3, %rax
jb 0x11079
movq 0x68(%rsp), %rcx
movq 0x78(%rsp), %rdx
cmpl $0x3c, (%rdx,%rcx,4)
jne 0x11079
leaq (%rdx,%rcx,4), %rcx
cmpl $0x3e, -0x4(%rcx,%rax,4)
jne 0x11079
testq %r12, %r12
je 0x1100e
cmpq $0x0, 0x50(%r12)
je 0x11079
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rsi
movaps %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq %r14, %rdi
callq 0x1000a
testb %al, %al
je 0x110f2
leaq 0x100(%rsp), %r14
leaq 0x20(%rsp), %r13
leaq 0x40(%rsp), %rbx
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x8b90
movq 0x10(%r14), %rax
movq %rax, 0x10(%r13)
movups (%r14), %xmm0
movaps %xmm0, (%r13)
movaps (%rbx), %xmm0
movups %xmm0, 0xc8(%rsp)
movq 0x10(%rbx), %rax
movq %rax, 0xd8(%rsp)
movq 0x30(%rsp), %rax
movq 0x60(%rsp), %rdx
movq %rax, 0x10(%rdx)
movaps 0x20(%rsp), %xmm0
testq %r12, %r12
cmovneq %r12, %r15
movups %xmm0, (%rdx)
leaq 0x18(%rdx), %rdi
movl $0xf, %ecx
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl 0x78(%r15), %eax
movl %eax, 0x90(%rdx)
jmp 0x10f38
leaq 0xfec7(%rip), %rdi      # 0x20f82
leaq 0xfdda(%rip), %rsi      # 0x20e9c
leaq 0xfecf(%rip), %rcx      # 0x20f98
movl $0xfb, %edx
callq 0x6120
leaq 0xfefa(%rip), %rdi      # 0x20fd4
leaq 0xfdbb(%rip), %rsi      # 0x20e9c
leaq 0xfeb0(%rip), %rcx      # 0x20f98
movl $0xfe, %edx
callq 0x6120
leaq 0xfd9b(%rip), %rdi      # 0x20e94
leaq 0xfd9c(%rip), %rsi      # 0x20e9c
leaq 0xfe91(%rip), %rcx      # 0x20f98
movl $0x113, %edx            # imm = 0x113
callq 0x6120