// File: /workspace/github_c_makefile_star2_O3/codeplea[P]tinyexpr/tinyexpr.c
// Function: base
static te_expr *base(state *s) {
    /* <base>      =    <constant> | <variable> | <function-0> {"(" ")"} | <function-1> <power> | <function-X> "(" <expr> {"," <expr>} ")" | "(" <list> ")" */
    te_expr *ret;
    int arity;

    switch (TYPE_MASK(s->type)) {
        case TOK_NUMBER:
            ret = new_expr(TE_CONSTANT, 0);
            CHECK_NULL(ret);

            ret->value = s->value;
            next_token(s);
            break;

        case TOK_VARIABLE:
            ret = new_expr(TE_VARIABLE, 0);
            CHECK_NULL(ret);

            ret->bound = s->bound;
            next_token(s);
            break;

        case TE_FUNCTION0:
        case TE_CLOSURE0:
            ret = new_expr(s->type, 0);
            CHECK_NULL(ret);

            ret->function = s->function;
            if (IS_CLOSURE(s->type)) ret->parameters[0] = s->context;
            next_token(s);
            if (s->type == TOK_OPEN) {
                next_token(s);
                if (s->type != TOK_CLOSE) {
                    s->type = TOK_ERROR;
                } else {
                    next_token(s);
                }
            }
            break;

        case TE_FUNCTION1:
        case TE_CLOSURE1:
            ret = new_expr(s->type, 0);
            CHECK_NULL(ret);

            ret->function = s->function;
            if (IS_CLOSURE(s->type)) ret->parameters[1] = s->context;
            next_token(s);
            ret->parameters[0] = power(s);
            CHECK_NULL(ret->parameters[0], te_free(ret));
            break;

        case TE_FUNCTION2: case TE_FUNCTION3: case TE_FUNCTION4:
        case TE_FUNCTION5: case TE_FUNCTION6: case TE_FUNCTION7:
        case TE_CLOSURE2: case TE_CLOSURE3: case TE_CLOSURE4:
        case TE_CLOSURE5: case TE_CLOSURE6: case TE_CLOSURE7:
            arity = ARITY(s->type);

            ret = new_expr(s->type, 0);
            CHECK_NULL(ret);

            ret->function = s->function;
            if (IS_CLOSURE(s->type)) ret->parameters[arity] = s->context;
            next_token(s);

            if (s->type != TOK_OPEN) {
                s->type = TOK_ERROR;
            } else {
                int i;
                for(i = 0; i < arity; i++) {
                    next_token(s);
                    ret->parameters[i] = expr(s);
                    CHECK_NULL(ret->parameters[i], te_free(ret));

                    if(s->type != TOK_SEP) {
                        break;
                    }
                }
                if(s->type != TOK_CLOSE || i != arity - 1) {
                    s->type = TOK_ERROR;
                } else {
                    next_token(s);
                }
            }

            break;

        case TOK_OPEN:
            next_token(s);
            ret = list(s);
            CHECK_NULL(ret);

            if (s->type != TOK_CLOSE) {
                s->type = TOK_ERROR;
            } else {
                next_token(s);
            }
            break;

        default:
            ret = new_expr(0, 0);
            CHECK_NULL(ret);

            s->type = TOK_ERROR;
            ret->value = NAN;
            break;
    }

    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl 0x10(%rdi), %edi
movl %edi, %eax
andl $0x1f, %eax
addl $-0x8, %eax
cmpl $0x17, %eax
ja 0x7780
leaq 0x1464(%rip), %rcx      # 0x8a40
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl %edi, %eax
andl $0x18, %eax
movl %edi, %ebp
andl $0x7, %ebp
testl %eax, %eax
cmovel %eax, %ebp
xorl %r14d, %r14d
xorl %esi, %esi
callq 0x7237
testq %rax, %rax
je 0x780e
movq %rax, %r14
movq 0x18(%rbx), %rax
movq %rax, 0x8(%r14)
testb $0x10, 0x10(%rbx)
je 0x7623
movq 0x20(%rbx), %rax
movl %ebp, %ecx
movq %rax, 0x10(%r14,%rcx,8)
movq %rbx, %rdi
callq 0x6347
cmpl $0x1c, 0x10(%rbx)
jne 0x77fb
testl %ebp, %ebp
je 0x77fb
movl %ebp, %r15d
xorl %r12d, %r12d
movq %rbx, %rdi
callq 0x6347
movq %rbx, %rdi
callq 0x716f
movq %rax, 0x10(%r14,%r12,8)
testq %rax, %rax
je 0x77cf
movl 0x10(%rbx), %eax
cmpl $0x1b, %eax
jne 0x77e4
incq %r12
cmpq %r12, %r15
jne 0x7643
jmp 0x77fb
xorl %r14d, %r14d
xorl %esi, %esi
callq 0x7237
testq %rax, %rax
je 0x780e
movq %rax, %r15
movq 0x18(%rbx), %rax
movq %rax, 0x8(%r15)
testb $0x10, 0x10(%rbx)
je 0x76a6
movq 0x20(%rbx), %rax
movq %rax, 0x10(%r15)
movq %rbx, %rdi
callq 0x6347
cmpl $0x1c, 0x10(%rbx)
jne 0x780b
movq %rbx, %rdi
callq 0x6347
cmpl $0x1d, 0x10(%rbx)
jne 0x7804
movq %rbx, %rdi
callq 0x6347
jmp 0x780b
xorl %r14d, %r14d
xorl %esi, %esi
callq 0x7237
testq %rax, %rax
je 0x780e
movq %rax, %r15
movq 0x18(%rbx), %rax
movq %rax, 0x8(%r15)
testb $0x10, 0x10(%rbx)
je 0x7703
movq 0x20(%rbx), %rax
movq %rax, 0x18(%r15)
movq %rbx, %rdi
callq 0x6347
movq %rbx, %rdi
callq 0x74f3
movq %rax, 0x10(%r15)
testq %rax, %rax
jne 0x780b
movq %r15, %rdi
callq 0x6240
movq %r15, %rdi
jmp 0x77da
movl $0x1, %edi
movl $0x10, %esi
callq 0x30d0
testq %rax, %rax
je 0x77df
movq %rax, %r14
movl $0x1, (%rax)
movsd 0x18(%rbx), %xmm0
movsd %xmm0, 0x8(%rax)
jmp 0x77f1
movq %rbx, %rdi
callq 0x6347
movq %rbx, %rdi
callq 0x6cd3
testq %rax, %rax
je 0x77df
movq %rax, %r14
cmpl $0x1d, 0x10(%rbx)
je 0x77f1
jmp 0x77fb
movl $0x1, %edi
movl $0x10, %esi
callq 0x30d0
testq %rax, %rax
je 0x77df
movq %rax, %r14
movl $0x19, 0x10(%rbx)
movabsq $0x7ff8000000000000, %rax # imm = 0x7FF8000000000000
movq %rax, 0x8(%r14)
jmp 0x780e
movl $0x1, %edi
movl $0x10, %esi
callq 0x30d0
testq %rax, %rax
je 0x77df
movq %rax, %r14
movq 0x18(%rbx), %rax
movq %rax, 0x8(%r14)
jmp 0x77f1
movq %r14, %rdi
callq 0x6240
movq %r14, %rdi
callq 0x3030
xorl %r14d, %r14d
jmp 0x780e
cmpl $0x1d, %eax
jne 0x77fb
decl %r15d
cmpl %r12d, %r15d
jne 0x77fb
movq %rbx, %rdi
callq 0x6347
jmp 0x780e
movl $0x19, 0x10(%rbx)
jmp 0x780e
movl $0x19, 0x10(%rbx)
movq %r15, %r14
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq