// File: /workspace/github_c_makefile_star2_O1/codeplea[P]tinyexpr/tinyexpr.c
// Function: te_eval
double te_eval(const te_expr *n) {
    if (!n) return NAN;

    switch(TYPE_MASK(n->type)) {
        case TE_CONSTANT: return n->value;
        case TE_VARIABLE: return *n->bound;

        case TE_FUNCTION0: case TE_FUNCTION1: case TE_FUNCTION2: case TE_FUNCTION3:
        case TE_FUNCTION4: case TE_FUNCTION5: case TE_FUNCTION6: case TE_FUNCTION7:
            switch(ARITY(n->type)) {
                case 0: return TE_FUN(void)();
                case 1: return TE_FUN(double)(M(0));
                case 2: return TE_FUN(double, double)(M(0), M(1));
                case 3: return TE_FUN(double, double, double)(M(0), M(1), M(2));
                case 4: return TE_FUN(double, double, double, double)(M(0), M(1), M(2), M(3));
                case 5: return TE_FUN(double, double, double, double, double)(M(0), M(1), M(2), M(3), M(4));
                case 6: return TE_FUN(double, double, double, double, double, double)(M(0), M(1), M(2), M(3), M(4), M(5));
                case 7: return TE_FUN(double, double, double, double, double, double, double)(M(0), M(1), M(2), M(3), M(4), M(5), M(6));
                default: return NAN;
            }

        case TE_CLOSURE0: case TE_CLOSURE1: case TE_CLOSURE2: case TE_CLOSURE3:
        case TE_CLOSURE4: case TE_CLOSURE5: case TE_CLOSURE6: case TE_CLOSURE7:
            switch(ARITY(n->type)) {
                case 0: return TE_FUN(void*)(n->parameters[0]);
                case 1: return TE_FUN(void*, double)(n->parameters[1], M(0));
                case 2: return TE_FUN(void*, double, double)(n->parameters[2], M(0), M(1));
                case 3: return TE_FUN(void*, double, double, double)(n->parameters[3], M(0), M(1), M(2));
                case 4: return TE_FUN(void*, double, double, double, double)(n->parameters[4], M(0), M(1), M(2), M(3));
                case 5: return TE_FUN(void*, double, double, double, double, double)(n->parameters[5], M(0), M(1), M(2), M(3), M(4));
                case 6: return TE_FUN(void*, double, double, double, double, double, double)(n->parameters[6], M(0), M(1), M(2), M(3), M(4), M(5));
                case 7: return TE_FUN(void*, double, double, double, double, double, double, double)(n->parameters[7], M(0), M(1), M(2), M(3), M(4), M(5), M(6));
                default: return NAN;
            }

        default: return NAN;
    }

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movsd 0x2596(%rip), %xmm0     # 0x8aa0
testq %rdi, %rdi
je 0x6ae8
movq %rdi, %rsi
movl (%rdi), %eax
movl %eax, %ecx
andl $0x1f, %ecx
cmpl $0x17, %ecx
ja 0x6ae8
leaq 0x2473(%rip), %rdx      # 0x89a0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl %eax, %ecx
andl $0x18, %ecx
andl $0x7, %eax
testl %ecx, %ecx
cmovel %ecx, %eax
leaq 0x24d6(%rip), %rcx      # 0x8a20
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmpq *0x8(%rsi)
movl %eax, %ecx
andl $0x18, %ecx
andl $0x7, %eax
testl %ecx, %ecx
cmovel %ecx, %eax
leaq 0x248d(%rip), %rcx      # 0x8a00
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x10(%rsi), %rdi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmpq *0x8(%rsi)
movq 0x30(%rsi), %rbx
movq 0x8(%rsi), %r15
movq 0x10(%rsi), %rdi
movq %rsi, %r14
callq 0x64f9
movsd %xmm0, (%rsp)
movq 0x18(%r14), %rdi
callq 0x64f9
movsd %xmm0, 0x8(%rsp)
movq 0x20(%r14), %rdi
callq 0x64f9
movsd %xmm0, 0x10(%rsp)
movq 0x28(%r14), %rdi
callq 0x64f9
movaps %xmm0, %xmm3
movq %rbx, %rdi
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
movq %r15, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmpq *%rax
movq 0x8(%rsi), %r14
movq 0x10(%rsi), %rdi
movq %rsi, %rbx
callq 0x64f9
movsd %xmm0, (%rsp)
movq 0x18(%rbx), %rdi
callq 0x64f9
movsd %xmm0, 0x8(%rsp)
movq 0x20(%rbx), %rdi
callq 0x64f9
movsd %xmm0, 0x10(%rsp)
movq 0x28(%rbx), %rdi
callq 0x64f9
movaps %xmm0, %xmm3
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
movq %r14, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmpq *%rax
movq 0x20(%rsi), %rbx
movq 0x8(%rsi), %r15
movq 0x10(%rsi), %rdi
movq %rsi, %r14
callq 0x64f9
movsd %xmm0, (%rsp)
movq 0x18(%r14), %rdi
callq 0x64f9
movaps %xmm0, %xmm1
movq %rbx, %rdi
movsd (%rsp), %xmm0
movq %r15, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmpq *%rax
movq 0x8(%rsi), %r14
movq 0x10(%rsi), %rdi
movq %rsi, %rbx
callq 0x64f9
movsd %xmm0, (%rsp)
movq 0x18(%rbx), %rdi
callq 0x64f9
movaps %xmm0, %xmm1
movsd (%rsp), %xmm0
movq %r14, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmpq *%rax
movq 0x28(%rsi), %rbx
movq 0x8(%rsi), %r15
movq 0x10(%rsi), %rdi
movq %rsi, %r14
callq 0x64f9
movsd %xmm0, (%rsp)
movq 0x18(%r14), %rdi
callq 0x64f9
movsd %xmm0, 0x8(%rsp)
movq 0x20(%r14), %rdi
callq 0x64f9
movaps %xmm0, %xmm2
movq %rbx, %rdi
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movq %r15, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmpq *%rax
movq 0x8(%rsi), %r14
movq 0x10(%rsi), %rdi
movq %rsi, %rbx
callq 0x64f9
movsd %xmm0, (%rsp)
movq 0x18(%rbx), %rdi
callq 0x64f9
movsd %xmm0, 0x8(%rsp)
movq 0x20(%rbx), %rdi
callq 0x64f9
movaps %xmm0, %xmm2
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movq %r14, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmpq *%rax
movq 0x48(%rsi), %rbx
movq 0x8(%rsi), %r15
movq 0x10(%rsi), %rdi
movq %rsi, %r14
callq 0x64f9
movsd %xmm0, (%rsp)
movq 0x18(%r14), %rdi
callq 0x64f9
movsd %xmm0, 0x8(%rsp)
movq 0x20(%r14), %rdi
callq 0x64f9
movsd %xmm0, 0x10(%rsp)
movq 0x28(%r14), %rdi
callq 0x64f9
movsd %xmm0, 0x18(%rsp)
movq 0x30(%r14), %rdi
callq 0x64f9
movsd %xmm0, 0x20(%rsp)
movq 0x38(%r14), %rdi
callq 0x64f9
movsd %xmm0, 0x28(%rsp)
movq 0x40(%r14), %rdi
callq 0x64f9
movaps %xmm0, %xmm6
movq %rbx, %rdi
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
movsd 0x18(%rsp), %xmm3
movsd 0x20(%rsp), %xmm4
movsd 0x28(%rsp), %xmm5
movq %r15, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmpq *%rax
movq 0x8(%rsi), %r14
movq 0x10(%rsi), %rdi
movq %rsi, %rbx
callq 0x64f9
movsd %xmm0, (%rsp)
movq 0x18(%rbx), %rdi
callq 0x64f9
movsd %xmm0, 0x8(%rsp)
movq 0x20(%rbx), %rdi
callq 0x64f9
movsd %xmm0, 0x10(%rsp)
movq 0x28(%rbx), %rdi
callq 0x64f9
movsd %xmm0, 0x18(%rsp)
movq 0x30(%rbx), %rdi
callq 0x64f9
movsd %xmm0, 0x20(%rsp)
movq 0x38(%rbx), %rdi
callq 0x64f9
movsd %xmm0, 0x28(%rsp)
movq 0x40(%rbx), %rdi
callq 0x64f9
movaps %xmm0, %xmm6
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
movsd 0x18(%rsp), %xmm3
movsd 0x20(%rsp), %xmm4
movsd 0x28(%rsp), %xmm5
movq %r14, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmpq *%rax
movq 0x18(%rsi), %rbx
movq 0x8(%rsi), %r14
movq 0x10(%rsi), %rdi
callq 0x64f9
movq %rbx, %rdi
movq %r14, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmpq *%rax
movq 0x8(%rsi), %rbx
movq 0x10(%rsi), %rdi
callq 0x64f9
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmpq *%rax
movq 0x38(%rsi), %rbx
movq 0x8(%rsi), %r15
movq 0x10(%rsi), %rdi
movq %rsi, %r14
callq 0x64f9
movsd %xmm0, (%rsp)
movq 0x18(%r14), %rdi
callq 0x64f9
movsd %xmm0, 0x8(%rsp)
movq 0x20(%r14), %rdi
callq 0x64f9
movsd %xmm0, 0x10(%rsp)
movq 0x28(%r14), %rdi
callq 0x64f9
movsd %xmm0, 0x18(%rsp)
movq 0x30(%r14), %rdi
callq 0x64f9
movaps %xmm0, %xmm4
movq %rbx, %rdi
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
movsd 0x18(%rsp), %xmm3
movq %r15, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmpq *%rax
movq 0x8(%rsi), %r14
movq 0x10(%rsi), %rdi
movq %rsi, %rbx
callq 0x64f9
movsd %xmm0, (%rsp)
movq 0x18(%rbx), %rdi
callq 0x64f9
movsd %xmm0, 0x8(%rsp)
movq 0x20(%rbx), %rdi
callq 0x64f9
movsd %xmm0, 0x10(%rsp)
movq 0x28(%rbx), %rdi
callq 0x64f9
movsd %xmm0, 0x18(%rsp)
movq 0x30(%rbx), %rdi
callq 0x64f9
movaps %xmm0, %xmm4
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
movsd 0x18(%rsp), %xmm3
movq %r14, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmpq *%rax
movq 0x40(%rsi), %rbx
movq 0x8(%rsi), %r15
movq 0x10(%rsi), %rdi
movq %rsi, %r14
callq 0x64f9
movsd %xmm0, (%rsp)
movq 0x18(%r14), %rdi
callq 0x64f9
movsd %xmm0, 0x8(%rsp)
movq 0x20(%r14), %rdi
callq 0x64f9
movsd %xmm0, 0x10(%rsp)
movq 0x28(%r14), %rdi
callq 0x64f9
movsd %xmm0, 0x18(%rsp)
movq 0x30(%r14), %rdi
callq 0x64f9
movsd %xmm0, 0x20(%rsp)
movq 0x38(%r14), %rdi
callq 0x64f9
movaps %xmm0, %xmm5
movq %rbx, %rdi
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
movsd 0x18(%rsp), %xmm3
movsd 0x20(%rsp), %xmm4
movq %r15, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmpq *%rax
movq 0x8(%rsi), %r14
movq 0x10(%rsi), %rdi
movq %rsi, %rbx
callq 0x64f9
movsd %xmm0, (%rsp)
movq 0x18(%rbx), %rdi
callq 0x64f9
movsd %xmm0, 0x8(%rsp)
movq 0x20(%rbx), %rdi
callq 0x64f9
movsd %xmm0, 0x10(%rsp)
movq 0x28(%rbx), %rdi
callq 0x64f9
movsd %xmm0, 0x18(%rsp)
movq 0x30(%rbx), %rdi
callq 0x64f9
movsd %xmm0, 0x20(%rsp)
movq 0x38(%rbx), %rdi
callq 0x64f9
movaps %xmm0, %xmm5
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
movsd 0x18(%rsp), %xmm3
movsd 0x20(%rsp), %xmm4
movq %r14, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmpq *%rax
movsd 0x8(%rsi), %xmm0
jmp 0x6ae8
movq 0x8(%rsi), %rax
movsd (%rax), %xmm0
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq