// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x50(%rsp)
cmpq $0x0, 0x50(%rsp)
je 0x16aea0
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x58(%rsp), %rcx
cmpq 0x128(%rcx), %rax
jne 0x16ae8c
movq 0x50(%rsp), %rax
movq (%rax), %rax
andq $0x2000000, %rax        # imm = 0x2000000
cmpq $0x0, %rax
je 0x16ae8c
movq 0x50(%rsp), %rax
movq (%rax), %rax
andq $0x400000, %rax         # imm = 0x400000
cmpq $0x0, %rax
jne 0x16ae8c
movq 0x50(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
movzbl (%rax), %eax
cmpl $0xa, %eax
jne 0x16ad35
movq 0x58(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0xde990
movq %rax, 0x40(%rsp)
cmpq $0x0, 0x40(%rsp)
je 0x16ac45
movq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x16ac59
movq 0x58(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0xdead0
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rcx
movq 0x50(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x58(%rsp), %rcx
cmpq 0x128(%rcx), %rax
jne 0x16ad30
movq 0x58(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rdx
callq 0xfe00
movq %rax, %rcx
movq 0x50(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x58(%rsp), %rcx
cmpq 0x128(%rcx), %rax
jne 0x16ad2e
movq 0x58(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x58(%rsp), %rax
movq 0x1918(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x58(%rsp), %rdi
leaq 0x84d1f(%rip), %rsi     # 0x1efa1b
movl $0x1f, %edx
callq 0xb880
movq 0x18(%rsp), %rdi
movq %rax, %rsi
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rdx
callq 0xb830
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq %rax, %rdx
callq 0x2f940
jmp 0x16ad30
jmp 0x16ae8a
movq 0x48(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x16ae7a
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x58(%rsp), %rcx
cmpq 0x17b0(%rcx), %rax
jne 0x16adfc
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x16ad87
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x16ade4
movq 0x58(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%rsp), %rax
movq 0x1918(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x58(%rsp), %rax
movq %rax, (%rsp)
movq 0x58(%rsp), %rdi
leaq 0x84c84(%rip), %rsi     # 0x1efa3b
movl $0x20, %edx
callq 0xb880
movq (%rsp), %rdi
movq %rax, %rsi
movq 0x48(%rsp), %rdx
callq 0xb830
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %rax, %rdx
callq 0x2f940
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rcx
movq 0x50(%rsp), %rax
movq %rcx, 0x10(%rax)
jmp 0x16ae78
jmp 0x16adfe
movq 0x58(%rsp), %rax
movq (%rax), %rcx
movq 0x58(%rsp), %rax
movq 0x50(%rax), %rax
movq %rcx, (%rax)
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x58(%rsp), %rax
movq 0x50(%rax), %rax
movq %rcx, 0x8(%rax)
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0x58(%rsp), %rax
movq 0x50(%rax), %rax
movq %rcx, 0x10(%rax)
movq 0x58(%rsp), %rax
movq 0x50(%rax), %rax
movl $0x1ec, %ecx            # imm = 0x1EC
movq %rcx, 0x18(%rax)
movq 0x58(%rsp), %rax
movq 0x50(%rax), %rcx
addq $0x20, %rcx
movq %rcx, 0x50(%rax)
movq 0x48(%rsp), %rcx
movq 0x58(%rsp), %rax
movq %rcx, (%rax)
movl $0x5, 0x64(%rsp)
jmp 0x16aec4
jmp 0x16ae88
movq 0x48(%rsp), %rcx
movq 0x50(%rsp), %rax
movq %rcx, 0x10(%rax)
jmp 0x16ae8a
jmp 0x16ae8c
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0x10(%rax)
jmp 0x16aea2
jmp 0x16aea7
jmp 0x16ab99
movq 0x58(%rsp), %rax
movq 0x110(%rax), %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0x10(%rax)
movl $0x2, 0x64(%rsp)
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
nopl (%rax)