// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: check_letrec
static s7_pointer check_letrec(s7_scheme *sc, bool letrec)
                {
                    s7_pointer x, caller, form;
                    form = sc->code;
                    sc->code = cdr(sc->code);

                    caller = (letrec) ? sc->letrec_symbol : sc->letrec_star_symbol;

                    if ((!is_pair(sc->code)) ||                 /* (letrec . 1) */
                            (!is_list(car(sc->code))))              /* (letrec 1 ...) */
                        eval_error_with_caller(sc, "~A: variable list is messed up: ~A", 34, caller, form);

                    if (!is_pair(cdr(sc->code)))               /* (letrec ()) */
                        eval_error_with_caller(sc, "~A has no body: ~A", 18, caller, form);

                    clear_symbol_list(sc);
                    for (x = car(sc->code); is_not_null(x); x = cdr(x))
                    {
                        s7_pointer y, carx;
                        if (!is_pair(x))                        /* (letrec ((a 1) . 2) ...) */
                            eval_error_with_caller(sc, "~A: improper list of variables? ~A", 34, caller, form);

                        carx = car(x);
                        if ((!is_pair(carx)) ||                 /* (letrec (1 2) #t) */
                                (!(is_symbol(car(carx)))))
                            eval_error_with_caller(sc, "~A: bad variable ~S", 19, caller, carx);

                        y = car(carx);
                        if (is_constant_symbol(sc, y))
                            return(s7_error(sc, sc->wrong_type_arg_symbol,
                                        set_elist_2(sc, wrap_string(sc, "can't bind an immutable object: ~S", 34), x)));

                        if (!is_pair(cdr(carx)))                /* (letrec ((x . 1))...) */
                        {
                            if (is_null(cdr(carx)))             /* (letrec ((x)) x) -- perhaps this is legal? */
                                eval_error_with_caller(sc, "~A: variable declaration has no value?: ~A", 42, caller, carx);
                            eval_error_with_caller(sc, "~A: variable declaration is not a proper list?: ~A", 50, caller, carx);
                        }
                        if (is_not_null(cddr(carx)))            /* (letrec ((x 1 2 3)) ...) */
                            eval_error_with_caller(sc, "~A: variable declaration has more than one value?: ~A", 53, caller, carx);

                        /* check for name collisions -- this is needed in letrec* else which of the two legit values does our "rec" refer to, so to speak */
                        if (symbol_is_in_list(sc, y))
                            eval_error_with_caller(sc, "~A: duplicate identifier: ~A", 28, caller, y);
                        add_symbol_to_list(sc, y);
                        set_local(y);
                    }

                    if (!s7_is_proper_list(sc, cdr(sc->code)))
                        eval_error_with_caller(sc, "stray dot in ~A body: ~S", 24, caller, cdr(sc->code));

                    pair_set_syntax_op(form, (letrec) ? OP_LETREC_UNCHECKED : OP_LETREC_STAR_UNCHECKED);
                    sc->code = form;
                    return(sc->code);
                }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq (%rdi), %r12
movq 0x10(%r12), %rax
movq %rax, (%rdi)
movl %esi, %ecx
xorb $0x1, %cl
movzbl %cl, %ecx
movq 0x1878(%rdi,%rcx,8), %rdx
cmpb $0x1, (%rax)
jne 0xa014a
movq 0x8(%rax), %rcx
movb (%rcx), %cl
decb %cl
cmpb $0x2, %cl
jae 0xa014a
movq 0x10(%rax), %rax
cmpb $0x1, (%rax)
jne 0xa01b9
movl %esi, 0x14(%rsp)
movq %rdx, 0x8(%rsp)
movq %rbx, %rdi
callq 0x7c981
movq (%rbx), %r15
addq $0x8, %r15
movq (%r15), %r15
movq 0x110(%rbx), %rbp
cmpq %rbp, %r15
je 0xa022e
cmpb $0x1, (%r15)
jne 0xa026e
movq 0x8(%r15), %r13
cmpb $0x1, (%r13)
jne 0xa01f2
movq 0x8(%r13), %r14
cmpb $0xa, (%r14)
jne 0xa01f2
movq %rbx, %rdi
movq %r14, %rsi
callq 0x72bfa
testb %al, %al
jne 0xa02c2
movq 0x10(%r13), %rax
cmpb $0x1, (%rax)
jne 0xa031f
cmpq %rbp, 0x10(%rax)
jne 0xa0365
movl 0xa88(%rbx), %eax
movq 0x8(%r14), %rcx
cmpl %eax, 0x2c(%r14)
jne 0xa011a
movq 0x20(%rcx), %rdx
movl 0xc(%rdx), %edx
cmpl 0xa8c(%rbx), %edx
je 0xa0413
movl %eax, 0x2c(%r14)
movl 0xa8c(%rbx), %eax
movq 0x20(%rcx), %rcx
movl %eax, 0xc(%rcx)
movq (%r14), %rax
movq $-0x112201, %rcx        # imm = 0xFFEEDDFF
andq %rcx, %rax
orq $0x100000, %rax         # imm = 0x100000
movq %rax, (%r14)
addq $0x10, %r15
jmp 0xa0093
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)
leaq 0x44cd2(%rip), %rcx     # 0xe4e47
movq %rcx, 0x10(%rax)
movq $0x22, 0x8(%rax)
movq 0x6e8(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x10(%rcx), %rax
movq %rdx, 0x8(%rax)
movq 0x10(%rax), %rax
movq %r12, 0x8(%rax)
movq 0x6e8(%rbx), %rdx
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2cdc0
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)
leaq 0x44c86(%rip), %rcx     # 0xe4e6a
movq %rcx, 0x10(%rax)
movq $0x12, 0x8(%rax)
jmp 0xa0181
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)
leaq 0x44c83(%rip), %rcx     # 0xe4ea0
movq %rcx, 0x10(%rax)
movq $0x13, 0x8(%rax)
jmp 0xa039c
movq (%rbx), %rax
movq 0x10(%rax), %rsi
movq %rbx, %rdi
callq 0x2db34
testb %al, %al
je 0xa03b0
movzbl 0x14(%rsp), %eax
xorl $0x235, %eax            # imm = 0x235
movw %ax, 0x4(%r12)
movw $0x201, (%r12)          # imm = 0x201
movq %r12, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
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)
leaq 0x44be4(%rip), %rcx     # 0xe4e7d
movq %rcx, 0x10(%rax)
movq $0x22, 0x8(%rax)
movq 0x6e8(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x10(%rcx), %rax
movq 0x8(%rsp), %rcx
movq %rcx, 0x8(%rax)
jmp 0xa0194
movq 0x1940(%rbx), %rsi
movq 0x820(%rbx), %rax
movslq 0x7dc(%rbx), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%rbx)
leaq 0x440cd(%rip), %rcx     # 0xe43ba
movq %rcx, 0x10(%rax)
movq $0x22, 0x8(%rax)
movq 0x6e0(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x6e0(%rbx), %rax
movq 0x10(%rax), %rax
movq %r15, 0x8(%rax)
movq 0x6e0(%rbx), %rdx
jmp 0xa01a3
movslq 0x7dc(%rbx), %rcx
leal 0x1(%rcx), %edx
andl $0x7, %edx
movq 0x820(%rbx), %rsi
movq (%rsi,%rcx,8), %rcx
movq 0x1918(%rbx), %rsi
movl %edx, 0x7dc(%rbx)
cmpq %rbp, %rax
je 0xa046f
leaq 0x44b8b(%rip), %rax     # 0xe4edf
movq %rax, 0x10(%rcx)
movq $0x32, 0x8(%rcx)
jmp 0xa0482
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)
leaq 0x44b82(%rip), %rcx     # 0xe4f12
movq %rcx, 0x10(%rax)
movq $0x35, 0x8(%rax)
movq 0x6e8(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x10(%rcx), %rax
jmp 0xa0491
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)
leaq 0x44b8a(%rip), %rcx     # 0xe4f65
movq %rcx, 0x10(%rax)
movq $0x18, 0x8(%rax)
movq (%rbx), %rcx
movq 0x10(%rcx), %rcx
movq 0x6e8(%rbx), %rdx
movq %rax, 0x8(%rdx)
movq 0x10(%rdx), %rax
movq 0x8(%rsp), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rcx, 0x8(%rax)
jmp 0xa019c
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)
leaq 0x44b0a(%rip), %rcx     # 0xe4f48
movq %rcx, 0x10(%rax)
movq $0x1c, 0x8(%rax)
movq 0x6e8(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x10(%rcx), %rax
movq 0x8(%rsp), %rcx
movq %rcx, 0x8(%rax)
movq 0x10(%rax), %rax
movq %r14, 0x8(%rax)
jmp 0xa019c
leaq 0x44a3e(%rip), %rax     # 0xe4eb4
movq %rax, 0x10(%rcx)
movq $0x2a, 0x8(%rcx)
movq 0x6e8(%rbx), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rax), %rax
movq 0x8(%rsp), %rcx
movq %rcx, 0x8(%rax)
movq 0x10(%rax), %rax
movq %r13, 0x8(%rax)
jmp 0xa019c