// File: /workspace/github_c_makefile_star2_O1/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
movl $0x2400000, %ebp        # imm = 0x2400000
leaq 0x42f48(%rip), %r15     # 0x120a13
leaq 0x42f21(%rip), %r12     # 0x1209f3
movq 0x10(%rbx), %r13
testq %r13, %r13
je 0xddbf3
movq 0x10(%r13), %rax
cmpq 0x128(%rbx), %rax
jne 0xddcc7
movl (%r13), %eax
andl %ebp, %eax
cmpl $0x2000000, %eax        # imm = 0x2000000
jne 0xddcc7
movq 0x28(%r13), %r14
movzbl (%r14), %eax
cmpl $0x1, %eax
je 0xddbfd
cmpl $0xa, %eax
jne 0xddc4a
movq 0x8(%rbx), %rcx
movq 0x18(%rcx), %rdx
movq 0x20(%r14), %rax
cmpq %rax, %rdx
je 0xddb44
jle 0xddb3b
movq 0x10(%rcx), %rcx
movq 0x18(%rcx), %rdx
cmpq %rdx, %rax
jl 0xddb2e
cmpq %rax, %rdx
jne 0xddcdb
movq 0x18(%r14), %rax
movq 0x10(%rax), %rax
testq %rax, %rax
jne 0xddb5c
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa2ee9
movq %rax, 0x10(%r13)
cmpq 0x128(%rbx), %rax
jne 0xddcc7
movq 0x8(%rbx), %rax
movq 0x10(%rax), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xcd2c
movq %rax, 0x10(%r13)
cmpq 0x128(%rbx), %rax
jne 0xddcc7
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 $0x1f, 0x8(%rax)
movq 0x8(%r13), %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 0x3b366
jmp 0xddcc7
movl $0x3, %eax
jmp 0xddcd1
movq 0x8(%r14), %rax
cmpq 0x17b0(%rbx), %rax
je 0xddc50
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)
movl $0x1, %eax
jmp 0xddcd1
movq %r14, 0x10(%r13)
jmp 0xddcc7
movq 0x10(%r14), %rax
cmpb $0x1, (%rax)
jne 0xddc62
movq 0x10(%rax), %rax
cmpb $0x1, (%rax)
jne 0xddcbb
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 %r15, 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 0x3b366
movq 0x10(%r14), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%r13)
movq 0x18(%r13), %rax
movq %rax, 0x10(%rbx)
xorl %eax, %eax
testl %eax, %eax
je 0xddad2
jmp 0xddd21
cmpb $0x1c, (%rcx)
jne 0xddd0d
movq 0x8(%rcx), %rsi
testq %rsi, %rsi
sete %dl
je 0xddcfc
cmpq %r14, 0x8(%rsi)
je 0xddcf8
movq 0x18(%rsi), %rsi
jmp 0xddce4
movq 0x10(%rsi), %rax
testb %dl, %dl
je 0xddb4c
movq 0x10(%rcx), %rcx
cmpb $0x1c, (%rcx)
je 0xddce0
movq 0x10(%r14), %rax
cmpb $0x20, (%rax)
je 0xddb48
xorl %eax, %eax
jmp 0xddb4c
cmpl $0x1, %eax
jne 0xddd2d
movl $0x5, %eax
jmp 0xddd3d
movq 0x110(%rbx), %rax
movq %rax, 0x10(%rbx)
movl $0x2, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq