// File: /workspace/github_c_makefile_star2_O3/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
testq %r15, %r15
je 0xd5549
movl $0x2400000, %ebp        # imm = 0x2400000
leaq 0x427cb(%rip), %r12     # 0x117b23
leaq 0x427a4(%rip), %r13     # 0x117b03
movq 0x10(%r15), %rax
cmpq 0x128(%rbx), %rax
jne 0xd5500
movl (%r15), %eax
andl %ebp, %eax
cmpl $0x2000000, %eax        # imm = 0x2000000
jne 0xd5500
movq 0x28(%r15), %r14
movzbl (%r14), %eax
cmpl $0x1, %eax
je 0xd5472
cmpl $0xa, %eax
jne 0xd54fc
movq 0x8(%rbx), %rax
movq 0x18(%rax), %rdx
movq 0x20(%r14), %rcx
cmpq %rcx, %rdx
je 0xd53c3
jle 0xd53ba
movq 0x10(%rax), %rax
movq 0x18(%rax), %rdx
cmpq %rdx, %rcx
jl 0xd53ad
cmpq %rcx, %rdx
jne 0xd5513
movq 0x18(%r14), %rcx
movq 0x10(%rcx), %rax
testq %rax, %rax
jne 0xd53db
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9c492
movq %rax, 0x10(%r15)
cmpq 0x128(%rbx), %rax
jne 0xd5500
movq 0x8(%rbx), %rax
movq 0x10(%rax), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbe9a
movq %rax, 0x10(%r15)
cmpq 0x128(%rbx), %rax
jne 0xd5500
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 0x38dfa
jmp 0xd5500
movq 0x8(%r14), %rax
cmpq 0x17b0(%rbx), %rax
jne 0xd5568
movq 0x10(%r14), %rax
cmpb $0x1, (%rax)
jne 0xd5495
movq 0x10(%rax), %rcx
cmpb $0x1, (%rcx)
jne 0xd54f2
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 0x38dfa
movq 0x10(%r14), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%r15)
jmp 0xd5500
movq %r14, 0x10(%r15)
movq 0x18(%r15), %r15
movq %r15, 0x10(%rbx)
testq %r15, %r15
jne 0xd535f
jmp 0xd5549
cmpb $0x1c, (%rax)
jne 0xd5537
movq 0x8(%rax), %rcx
testq %rcx, %rcx
je 0xd5531
cmpq %r14, 0x8(%rcx)
je 0xd53c7
movq 0x18(%rcx), %rcx
jmp 0xd551c
movq 0x10(%rax), %rax
jmp 0xd5513
movq 0x10(%r14), %rcx
cmpb $0x20, (%rcx)
je 0xd53c7
jmp 0xd53d0
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
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 $0x5, %eax
jmp 0xd5559