// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: lambda_star_default
static inline goto_t lambda_star_default(s7_scheme *sc)
                {
                    while (true)
                    {
                        s7_pointer z;
                        z = sc->args;
                        if (tis_slot(z))
                        {
                            if ((slot_value(z) == sc->undefined) &&    /* trouble: (lambda* ((e #<undefined>))...) */
                                    (slot_has_expression(z)) &&            /* if default val is not a pair or a symbol, this is false */
                                    (!is_checked_slot(z)))
                            {
                                s7_pointer val;
                                val = slot_expression(z);
                                if (is_symbol(val))
                                {
                                    slot_set_value(z, lookup_checked(sc, val));
                                    if (slot_value(z) == sc->undefined)
                                    {
                                        /* the current environment here contains the function parameters which
                                         *   defaulted to #<undefined> (or maybe #<unused>?) earlier in apply_*_closure_star_1,
                                         *   so (define (f f) (define* (f (f f)) f) (f)) (f 0) looks for the
                                         *   default f, finds itself currently undefined, and raises an error!
                                         *   So, before claiming it is unbound, we need to check outlet as well.
                                         *   But in the case above, the inner define* shadows the caller's
                                         *   parameter before checking the default arg values, so the default f
                                         *   refers to the define* -- I'm not sure this is a bug.  It means
                                         *   that (define* (f (a f)) a) returns f: (equal? f (f)) -> #t, so
                                         *   any outer f needs an extra let and endless outlets:
                                         *   (let ((f 3)) (let () (define* (f (a ((outlet (outlet (outlet (curlet)))) 'f))) a) (f))) -> 3
                                         *   We want the shadowing once the define* is done, so the current mess is simplest.
                                         */
                                        slot_set_value(z, s7_symbol_local_value(sc, val, outlet(sc->envir)));
                                        if (slot_value(z) == sc->undefined)
                                            eval_error_no_return(sc, sc->syntax_error_symbol, "lambda* defaults: ~A is unbound", 31, slot_symbol(z));
                                    }
                                }
                                else
                                {
                                    if (is_pair(val))
                                    {
                                        if (car(val) == sc->quote_symbol)
                                        {
                                            if ((!is_pair(cdr(val))) ||      /* (lambda* ((a (quote))) a) or (lambda* ((a (quote 1 1))) a) etc */
                                                    (is_pair(cddr(val))))
                                                eval_error_no_return(sc, sc->syntax_error_symbol, "lambda* default: ~A is messed up", 32, val);
                                            slot_set_value(z, cadr(val));
                                        }
                                        else
                                        {
                                            push_stack(sc, OP_LAMBDA_STAR_DEFAULT, sc->args, sc->code);
                                            sc->code = val;
                                            return(goto_eval);
                                        }
                                    }
                                    else slot_set_value(z, val);
                                }
                            }
                            sc->args = next_slot(z);
                        }
                        else break;
                    }
                    sc->args = sc->nil;
                    return(fall_through);
                }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %r15
movl $0x2400000, %ebp        # imm = 0x2400000
leaq 0x3b107(%rip), %r12     # 0xe3ac3
leaq 0x3b0e0(%rip), %r13     # 0xe3aa3
testq %r15, %r15
je 0xa8b54
movq 0x10(%r15), %rax
cmpq 0x128(%rbx), %rax
jne 0xa8b47
movl (%r15), %eax
andl %ebp, %eax
cmpl $0x2000000, %eax        # imm = 0x2000000
jne 0xa8b47
movq 0x28(%r15), %r14
movzbl (%r14), %eax
cmpl $0x1, %eax
je 0xa8ab9
cmpl $0xa, %eax
jne 0xa8b43
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7d158
testq %rax, %rax
jne 0xa8a22
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7d1b2
movq %rax, 0x10(%r15)
cmpq 0x128(%rbx), %rax
jne 0xa8b47
movq 0x8(%rbx), %rax
movq 0x10(%rax), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xb072
movq %rax, 0x10(%r15)
cmpq 0x128(%rbx), %rax
jne 0xa8b47
movq 0x1918(%rbx), %rsi
movq 0x820(%rbx), %rax
movslq 0x7dc(%rbx), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%rbx)
movq %r13, 0x10(%rax)
movq $0x1f, 0x8(%rax)
movq 0x8(%r15), %rcx
movq 0x6e0(%rbx), %rdx
movq %rax, 0x8(%rdx)
movq 0x6e0(%rbx), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x8(%rax)
movq 0x6e0(%rbx), %rdx
movq %rbx, %rdi
callq 0x2cdc0
jmp 0xa8b47
movq 0x8(%r14), %rax
cmpq 0x17b0(%rbx), %rax
jne 0xa8b71
movq 0x10(%r14), %rax
cmpb $0x1, (%rax)
jne 0xa8adc
movq 0x10(%rax), %rcx
cmpb $0x1, (%rcx)
jne 0xa8b39
movq 0x1918(%rbx), %rsi
movq 0x820(%rbx), %rax
movslq 0x7dc(%rbx), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%rbx)
movq %r12, 0x10(%rax)
movq $0x20, 0x8(%rax)
movq 0x6e0(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x6e0(%rbx), %rax
movq 0x10(%rax), %rax
movq %r14, 0x8(%rax)
movq 0x6e0(%rbx), %rdx
movq %rbx, %rdi
callq 0x2cdc0
movq 0x10(%r14), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%r15)
jmp 0xa8b47
movq %r14, 0x10(%r15)
movq 0x18(%r15), %r15
movq %r15, 0x10(%rbx)
jmp 0xa89c3
movq 0x110(%rbx), %rax
movq %rax, 0x10(%rbx)
pushq $0x2
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rbx), %rax
movq 0x50(%rbx), %rcx
movq %rax, (%rcx)
movq 0x8(%rbx), %rax
movq 0x50(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x10(%rbx), %rax
movq 0x50(%rbx), %rcx
movq %rax, 0x10(%rcx)
movq 0x50(%rbx), %rax
movq $0x1ec, 0x18(%rax)      # imm = 0x1EC
addq $0x20, 0x50(%rbx)
movq %r14, (%rbx)
pushq $0x5
jmp 0xa8b61