// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rax
movl 0x10(%rax), %eax
andl $0x1f, %eax
addl $-0x8, %eax
movl %eax, %ecx
movq %rcx, 0x10(%rsp)
subl $0x17, %eax
ja 0xa446
movq 0x10(%rsp), %rax
leaq 0x1ac5(%rip), %rcx      # 0xbb58
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x1, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x9960
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0xa0c5
movq $0x0, 0x30(%rsp)
jmp 0xa491
movq 0x28(%rsp), %rax
movsd 0x18(%rax), %xmm0
movq 0x20(%rsp), %rax
movsd %xmm0, 0x8(%rax)
movq 0x28(%rsp), %rdi
callq 0x7e70
jmp 0xa487
xorl %edi, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x9960
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0xa10e
movq $0x0, 0x30(%rsp)
jmp 0xa491
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x28(%rsp), %rdi
callq 0x7e70
jmp 0xa487
movq 0x28(%rsp), %rax
movl 0x10(%rax), %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x9960
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0xa15b
movq $0x0, 0x30(%rsp)
jmp 0xa491
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x28(%rsp), %rax
movl 0x10(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0xa18f
movq 0x28(%rsp), %rax
movq 0x20(%rax), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x28(%rsp), %rdi
callq 0x7e70
movq 0x28(%rsp), %rax
cmpl $0x1c, 0x10(%rax)
jne 0xa1d3
movq 0x28(%rsp), %rdi
callq 0x7e70
movq 0x28(%rsp), %rax
cmpl $0x1d, 0x10(%rax)
je 0xa1c7
movq 0x28(%rsp), %rax
movl $0x19, 0x10(%rax)
jmp 0xa1d1
movq 0x28(%rsp), %rdi
callq 0x7e70
jmp 0xa1d3
jmp 0xa487
movq 0x28(%rsp), %rax
movl 0x10(%rax), %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x9960
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0xa204
movq $0x0, 0x30(%rsp)
jmp 0xa491
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x28(%rsp), %rax
movl 0x10(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0xa238
movq 0x28(%rsp), %rax
movq 0x20(%rax), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x28(%rsp), %rdi
callq 0x7e70
movq 0x28(%rsp), %rdi
callq 0x9f00
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x20(%rsp), %rax
cmpq $0x0, 0x10(%rax)
jne 0xa27c
movq 0x20(%rsp), %rdi
callq 0x7e40
movq $0x0, 0x30(%rsp)
jmp 0xa491
jmp 0xa487
movq 0x28(%rsp), %rax
movl 0x10(%rax), %eax
andl $0x18, %eax
cmpl $0x0, %eax
je 0xa2a2
movq 0x28(%rsp), %rax
movl 0x10(%rax), %eax
andl $0x7, %eax
movl %eax, 0xc(%rsp)
jmp 0xa2aa
xorl %eax, %eax
movl %eax, 0xc(%rsp)
jmp 0xa2aa
movl 0xc(%rsp), %eax
movl %eax, 0x1c(%rsp)
movq 0x28(%rsp), %rax
movl 0x10(%rax), %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x9960
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0xa2de
movq $0x0, 0x30(%rsp)
jmp 0xa491
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x28(%rsp), %rax
movl 0x10(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0xa318
movq 0x28(%rsp), %rax
movq 0x20(%rax), %rdx
movq 0x20(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movq %rdx, 0x10(%rax,%rcx,8)
movq 0x28(%rsp), %rdi
callq 0x7e70
movq 0x28(%rsp), %rax
cmpl $0x1c, 0x10(%rax)
je 0xa33e
movq 0x28(%rsp), %rax
movl $0x19, 0x10(%rax)
jmp 0xa3f0
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jge 0xa3bc
movq 0x28(%rsp), %rdi
callq 0x7e70
movq 0x28(%rsp), %rdi
callq 0x9810
movq %rax, %rdx
movq 0x20(%rsp), %rax
movslq 0x18(%rsp), %rcx
movq %rdx, 0x10(%rax,%rcx,8)
movq 0x20(%rsp), %rax
movslq 0x18(%rsp), %rcx
cmpq $0x0, 0x10(%rax,%rcx,8)
jne 0xa3a0
movq 0x20(%rsp), %rdi
callq 0x7e40
movq $0x0, 0x30(%rsp)
jmp 0xa491
movq 0x28(%rsp), %rax
cmpl $0x1b, 0x10(%rax)
je 0xa3ad
jmp 0xa3bc
jmp 0xa3af
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0xa346
movq 0x28(%rsp), %rax
cmpl $0x1d, 0x10(%rax)
jne 0xa3d6
movl 0x18(%rsp), %eax
movl 0x1c(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
je 0xa3e4
movq 0x28(%rsp), %rax
movl $0x19, 0x10(%rax)
jmp 0xa3ee
movq 0x28(%rsp), %rdi
callq 0x7e70
jmp 0xa3f0
jmp 0xa487
movq 0x28(%rsp), %rdi
callq 0x7e70
movq 0x28(%rsp), %rdi
callq 0x90f0
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0xa421
movq $0x0, 0x30(%rsp)
jmp 0xa491
movq 0x28(%rsp), %rax
cmpl $0x1d, 0x10(%rax)
je 0xa43a
movq 0x28(%rsp), %rax
movl $0x19, 0x10(%rax)
jmp 0xa444
movq 0x28(%rsp), %rdi
callq 0x7e70
jmp 0xa487
xorl %edi, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x9960
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0xa469
movq $0x0, 0x30(%rsp)
jmp 0xa491
movq 0x28(%rsp), %rax
movl $0x19, 0x10(%rax)
movq 0x20(%rsp), %rax
movsd 0x1736(%rip), %xmm0     # 0xbbb8
movsd %xmm0, 0x8(%rax)
movq 0x20(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq