// File: ridiculousfish[P]docopt_fish/docopt_fish_parse_tree.cpp
// Function: docopt_fish::parse_context_t::parse(docopt_fish::expression_t*)
bool parse(expression_t *result) {
        rstring_t token;
        bool success = false;
        // Note that options must come before trying to parse it as a list, because
        // "[options]"
        // itself looks like a list
        if (this->scan("[options]", &token)) {
            result->production = 3;
            success = this->parse(&result->options_shortcut);
        } else if (this->scan("(", &token) || this->scan("[", &token)) {
            if (!this->try_parse_unique(&result->alternation_list)) {
                error(token, error_empty_bracket_paren, "Expected an expression inside");
            }
            bool is_paren = (token[0] == '(');
            rstring_t close_token;
            if (this->scan(is_paren ? ")" : "]", &close_token)) {
                result->production = is_paren ? 1 : 2;
                success = parse(&result->opt_ellipsis);  // never fails
            } else {
                // No closing bracket or paren
                if (is_paren) {
                    error(token, error_missing_close_paren, "Missing ')' to match opening '('");
                } else {
                    error(token, error_missing_close_bracket, "Missing ']' to match opening '['");
                }
            }
        } else if (this->scan("...", &token)) {
            error(token, error_leading_ellipsis, "Ellipsis may only follow an expression");
        } else if (this->peek("|")) {
            // End of an alternation list, nothing to do
            success = false;
        } else {
            // Simple clause
            success = try_parse_unique(&result->simple_clause);
            if (success) {
                result->production = 0;
                parse(&result->opt_ellipsis);  // never fails except on error
            }
        }
        return success;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x28(%rbp), %rdi
callq 0xbe70
movq -0x50(%rbp), %rdi
movb $0x0, -0x29(%rbp)
leaq 0x23bca(%rip), %rsi     # 0x4bf9a
leaq -0x28(%rbp), %rdx
callq 0x27db0
testb $0x1, %al
jne 0x283df
jmp 0x28402
movq -0x50(%rbp), %rdi
movq -0x10(%rbp), %rax
movb $0x3, 0x61(%rax)
movq -0x10(%rbp), %rsi
addq $0x60, %rsi
callq 0x28860
andb $0x1, %al
movb %al, -0x29(%rbp)
jmp 0x285bc
movq -0x50(%rbp), %rdi
leaq 0x23b97(%rip), %rsi     # 0x4bfa4
leaq -0x28(%rbp), %rdx
callq 0x27db0
testb $0x1, %al
jne 0x28437
movq -0x50(%rbp), %rdi
leaq 0x23b81(%rip), %rsi     # 0x4bfa6
leaq -0x28(%rbp), %rdx
callq 0x27db0
testb $0x1, %al
jne 0x28437
jmp 0x28532
movq -0x50(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
callq 0x28880
testb $0x1, %al
jne 0x28465
movq -0x50(%rbp), %rdi
leaq -0x28(%rbp), %rsi
movl $0x9, %edx
leaq 0x23b48(%rip), %rcx     # 0x4bfa8
callq 0x27ea0
leaq -0x28(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x110a0
cmpl $0x28, %eax
sete %al
andb $0x1, %al
movb %al, -0x2a(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xbe70
testb $0x1, -0x2a(%rbp)
je 0x28499
leaq 0x22dc3(%rip), %rax     # 0x4b256
movq %rax, -0x58(%rbp)
jmp 0x284a6
leaq 0x24eec(%rip), %rax     # 0x4d38c
movq %rax, -0x58(%rbp)
jmp 0x284a6
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x27db0
testb $0x1, %al
jne 0x284bd
jmp 0x284f1
movq -0x50(%rbp), %rdi
movb -0x2a(%rbp), %dl
movl $0x2, %eax
movl $0x1, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x61(%rax)
movq -0x10(%rbp), %rsi
addq $0x40, %rsi
callq 0x28910
andb $0x1, %al
movb %al, -0x29(%rbp)
jmp 0x2852d
testb $0x1, -0x2a(%rbp)
je 0x28512
movq -0x50(%rbp), %rdi
leaq -0x28(%rbp), %rsi
movl $0x7, %edx
leaq 0x23abb(%rip), %rcx     # 0x4bfc6
callq 0x27ea0
jmp 0x2852b
movq -0x50(%rbp), %rdi
leaq -0x28(%rbp), %rsi
movl $0x8, %edx
leaq 0x2386b(%rip), %rcx     # 0x4bd91
callq 0x27ea0
jmp 0x2852d
jmp 0x285ba
movq -0x50(%rbp), %rdi
leaq 0x25709(%rip), %rsi     # 0x4dc46
leaq -0x28(%rbp), %rdx
callq 0x27db0
testb $0x1, %al
jne 0x2854c
jmp 0x28567
movq -0x50(%rbp), %rdi
leaq -0x28(%rbp), %rsi
movl $0x2, %edx
leaq 0x23a87(%rip), %rcx     # 0x4bfe7
callq 0x27ea0
jmp 0x285b8
movq -0x50(%rbp), %rdi
leaq 0x23a10(%rip), %rsi     # 0x4bf82
callq 0x28950
testb $0x1, %al
jne 0x2857d
jmp 0x28583
movb $0x0, -0x29(%rbp)
jmp 0x285b6
movq -0x50(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x289d0
andb $0x1, %al
movb %al, -0x29(%rbp)
testb $0x1, -0x29(%rbp)
je 0x285b4
movq -0x50(%rbp), %rdi
movq -0x10(%rbp), %rax
movb $0x0, 0x61(%rax)
movq -0x10(%rbp), %rsi
addq $0x40, %rsi
callq 0x28910
jmp 0x285b6
jmp 0x285b8
jmp 0x285ba
jmp 0x285bc
movb -0x29(%rbp), %al
andb $0x1, %al
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)