// File: /workspace/github_c_makefile_star2_O0/Liutos[P]Eloquent/interp.c
// Function: interp_execute_bif
static value_kind_t interp_execute_bif(interp_t *interp, value_t *bif, ast_t *args, value_t **value)
{
    value_t *error = NULL;
    vector_t *vals = NULL;
    if (interp_execute_args(interp, args, &vals, &error) == ERR) {
        if (value != NULL)
            *value = error;
        return error->kind;
    }

    value_t *res = NULL;
    switch (VALUE_FUNC_ARITY(bif)) {
        case 0:
            interp_trace_callbif(interp, bif, NULL);
            res = elo_apply0(bif, interp->denv);
            break;
        case 1: {
            value_t *arg1 = (value_t *)vector_ref(vals, 0);
            interp_trace_callbif(interp, bif, arg1, NULL);
            res = elo_apply1(bif, interp->denv, arg1);
            break;
        }
        case 2: {
            value_t *arg1 = (value_t *)vector_ref(vals, 0);
            value_t *arg2 = (value_t *)vector_ref(vals, 1);
            interp_trace_callbif(interp, bif, arg1, arg2, NULL);
            res = elo_apply2(bif, interp->denv, arg1, arg2);
            break;
        }
        default :
            if (value != NULL)
                *value = value_error_newf("Don't support build in function of arity %d", VALUE_FUNC_ARITY(bif));
            return VALUE_ERROR;
    }
    interp_trace_retbif(interp, bif, res);

    if (value != NULL)
        *value = res;
    return res->kind;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x38(%rbp), %rdx
leaq -0x30(%rbp), %rcx
callq 0x59c0
cmpl $0x0, %eax
jne 0x5722
cmpq $0x0, -0x28(%rbp)
je 0x5714
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x5880
movq $0x0, -0x40(%rbp)
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x5c(%rbp)
testl %eax, %eax
je 0x5751
jmp 0x573a
movl -0x5c(%rbp), %eax
subl $0x1, %eax
je 0x577f
jmp 0x5744
movl -0x5c(%rbp), %eax
subl $0x2, %eax
je 0x57c6
jmp 0x5825
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movb $0x0, %al
callq 0x5ab0
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rdi
callq *%rax
movq %rax, -0x40(%rbp)
jmp 0x5854
movq -0x38(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x9730
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x48(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
movb $0x0, %al
callq 0x5ab0
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rdi
movq -0x48(%rbp), %rsi
callq *%rax
movq %rax, -0x40(%rbp)
jmp 0x5854
movq -0x38(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x9730
movq %rax, -0x50(%rbp)
movq -0x38(%rbp), %rdi
movl $0x1, %esi
callq 0x9730
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0x5ab0
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rdi
movq -0x50(%rbp), %rsi
movq -0x58(%rbp), %rdx
callq *%rax
movq %rax, -0x40(%rbp)
jmp 0x5854
cmpq $0x0, -0x28(%rbp)
je 0x584b
movq -0x18(%rbp), %rax
movl 0x10(%rax), %esi
leaq 0x4d28(%rip), %rdi      # 0xa562
movb $0x0, %al
callq 0x2570
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movl $0x2, -0x4(%rbp)
jmp 0x5880
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x5ce0
cmpq $0x0, -0x28(%rbp)
je 0x5877
movq -0x40(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)