// File: /workspace/github_c_makefile_star2_O0/samsonjs[P]lake/src/eval.c
// Function: lambda
static LakeVal *_lambda(LakeCtx *ctx, Env *env, LakeList *expr)
{
    /* (lambda (a b c) ...) */
    if (LIST_N(expr) >= 3 && lake_is_type(TYPE_LIST, LIST_VAL(expr, 1)))
    {
        list_shift(expr); /* drop the "lambda" symbol */
        LakeList *params = LIST(list_shift(expr));
        LakeList *body = expr;
        return VAL(fn_make(params, NULL, body, env));
    }
    else if (LIST_N(expr) >= 3 && lake_is_type(TYPE_DLIST, LIST_VAL(expr, 1)))
    {
        list_shift(expr); /* drop the "lambda" symbol */
        LakeDottedList *def = DLIST(list_shift(expr));
        LakeList *params = dlist_head(def);
        LakeSym *varargs = SYM(dlist_tail(def));
        LakeList *body = expr;
        return VAL(fn_make(params, varargs, body, env));
    }
    else if (LIST_N(expr) >= 3 && lake_is_type(TYPE_SYM, LIST_VAL(expr, 1)))
    {
        list_shift(expr); /* drop the "lambda" symbol */
        LakeSym *varargs = SYM(list_shift(expr));
        LakeList *body = expr;
        return VAL(fn_make(list_make(), varargs, body, env));
    }
    else
    {
        invalid_special_form(expr, "lambda requires at least 2 parameters");
        return NULL;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x3, 0x18(%rax)
jb 0x25fa
movq -0x20(%rbp), %rcx
movl $0x1, %eax
cmpq 0x18(%rcx), %rax
jae 0x25a3
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x68(%rbp)
jmp 0x25ab
xorl %eax, %eax
movq %rax, -0x68(%rbp)
jmp 0x25ab
movq -0x68(%rbp), %rsi
movl $0x5, %edi
callq 0x40d0
cmpl $0x0, %eax
je 0x25fa
movq -0x20(%rbp), %rdi
callq 0x4a90
movq -0x20(%rbp), %rdi
callq 0x4a90
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rdx
movq -0x18(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
callq 0x32c0
movq %rax, -0x8(%rbp)
jmp 0x2737
movq -0x20(%rbp), %rax
cmpq $0x3, 0x18(%rax)
jb 0x269b
movq -0x20(%rbp), %rcx
movl $0x1, %eax
cmpq 0x18(%rcx), %rax
jae 0x262a
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x70(%rbp)
jmp 0x2632
xorl %eax, %eax
movq %rax, -0x70(%rbp)
jmp 0x2632
movq -0x70(%rbp), %rsi
movl $0x6, %edi
callq 0x40d0
cmpl $0x0, %eax
je 0x269b
movq -0x20(%rbp), %rdi
callq 0x4a90
movq -0x20(%rbp), %rdi
callq 0x4a90
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0x16f0
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
callq 0x1710
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0x32c0
movq %rax, -0x8(%rbp)
jmp 0x2737
movq -0x20(%rbp), %rax
cmpq $0x3, 0x18(%rax)
jb 0x271f
movq -0x20(%rbp), %rcx
movl $0x1, %eax
cmpq 0x18(%rcx), %rax
jae 0x26c7
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x78(%rbp)
jmp 0x26cf
xorl %eax, %eax
movq %rax, -0x78(%rbp)
jmp 0x26cf
movq -0x78(%rbp), %rsi
movl $0x1, %edi
callq 0x40d0
cmpl $0x0, %eax
je 0x271f
movq -0x20(%rbp), %rdi
callq 0x4a90
movq -0x20(%rbp), %rdi
callq 0x4a90
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
callq 0x4640
movq %rax, %rdi
movq -0x58(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0x32c0
movq %rax, -0x8(%rbp)
jmp 0x2737
movq -0x20(%rbp), %rdi
leaq 0x6b11(%rip), %rsi      # 0x923b
callq 0x3210
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)