// File: /workspace/github_c_makefile_star2_O1/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
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movq (%rdi), %r15
movq 0x10(%r15), %rax
movq %rax, (%rdi)
movl %ebp, %ecx
xorb $0x1, %cl
movzbl %cl, %ecx
movq 0x1878(%rdi,%rcx,8), %r14
cmpb $0x1, (%rax)
jne 0xd2e7f
movq 0x8(%rax), %rcx
movb (%rcx), %cl
decb %cl
cmpb $0x2, %cl
jae 0xd2e7f
movq 0x10(%rax), %rcx
cmpb $0x1, (%rcx)
jne 0xd2eee
incl 0xa88(%rbx)
jne 0xd2cf1
movl $0x1, 0xa88(%rbx)
incl 0xa8c(%rbx)
movq 0x8(%rax), %rdx
movq 0x110(%rbx), %r9
cmpq %r9, %rdx
je 0xd2e42
leaq 0x6e8(%rbx), %rax
leaq 0x6e0(%rbx), %rcx
movq %rcx, (%rsp)
movq $-0x112201, %rsi        # imm = 0xFFEEDDFF
cmpb $0x1, (%rdx)
jne 0xd3016
movq 0x8(%rdx), %rcx
cmpb $0x1, (%rcx)
jne 0xd2f85
movq 0x8(%rcx), %r8
cmpb $0xa, (%r8)
jne 0xd2f85
testb $0x1, 0x3(%r8)
jne 0xd2fc1
testb $0x1, 0x6(%r8)
je 0xd2dcf
movq 0x8(%rbx), %r11
movq 0x18(%r11), %rdi
movq 0x20(%r8), %r12
movl $0x18, %r10d
cmpq %r12, %rdi
je 0xd2db8
jle 0xd2d7a
movq 0x10(%r11), %r11
movq 0x18(%r11), %rdi
cmpq %rdi, %r12
jl 0xd2d6d
cmpq %r12, %rdi
je 0xd2db8
movl $0x10, %r10d
cmpb $0x1c, (%r11)
jne 0xd2db8
movq 0x8(%r11), %r13
testq %r13, %r13
sete %dil
je 0xd2da9
cmpq %r8, 0x8(%r13)
je 0xd2da4
movq 0x18(%r13), %r13
jmp 0xd2d8f
xorl %edi, %edi
movq %r13, %r12
testb %dil, %dil
je 0xd2dbc
movq 0x10(%r11), %r11
cmpb $0x1c, (%r11)
je 0xd2d8b
movq (%r8,%r10), %r12
cmpb $0x20, (%r12)
jne 0xd2dcf
testb $0x1, 0x3(%r12)
jne 0xd2fc1
movq 0x10(%rcx), %rdi
cmpb $0x1, (%rdi)
jne 0xd3068
cmpq %r9, 0x10(%rdi)
jne 0xd30ad
movl 0xa88(%rbx), %ecx
cmpl %ecx, 0x2c(%r8)
jne 0xd2e09
movq 0x8(%r8), %rdi
movq 0x20(%rdi), %rdi
movl 0xc(%rdi), %edi
cmpl 0xa8c(%rbx), %edi
je 0xd30e9
movl %ecx, 0x2c(%r8)
movl 0xa8c(%rbx), %ecx
movq 0x8(%r8), %rdi
movq 0x20(%rdi), %rdi
movl %ecx, 0xc(%rdi)
movq (%r8), %rcx
andq %rsi, %rcx
orq $0x100000, %rcx         # imm = 0x100000
movq %rcx, (%r8)
movq 0x10(%rdx), %rdx
movq 0x110(%rbx), %r9
cmpq %r9, %rdx
jne 0xd2d1e
movq (%rbx), %rax
movq 0x10(%rax), %rsi
movq %rbx, %rdi
callq 0x3c2fb
testb %al, %al
je 0xd2f27
movzbl %bpl, %eax
xorl $0x235, %eax            # imm = 0x235
movw %ax, 0x4(%r15)
movw $0x201, (%r15)          # imm = 0x201
movq %r15, (%rbx)
addq $0x8, %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 0x4eeed(%rip), %rcx     # 0x121d97
movq %rcx, 0x10(%rax)
movq $0x22, 0x8(%rax)
movq 0x6e8(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x10(%rcx), %rax
movq %r14, 0x8(%rax)
movq 0x10(%rax), %rax
movq %r15, 0x8(%rax)
movq 0x6e8(%rbx), %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3b366
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 0x4eea1(%rip), %rcx     # 0x121dba
movq %rcx, 0x10(%rax)
movq $0x12, 0x8(%rax)
jmp 0xd2eb6
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 0x4ef63(%rip), %rcx     # 0x121eb5
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 %r14, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rcx, 0x8(%rax)
jmp 0xd2ed1
movq 0x1918(%rbx), %rsi
movq 0x820(%rbx), %rdx
movslq 0x7dc(%rbx), %rdi
movq (%rdx,%rdi,8), %rdx
incl %edi
andl $0x7, %edi
movl %edi, 0x7dc(%rbx)
leaq 0x4ee40(%rip), %rdi     # 0x121df0
movq %rdi, 0x10(%rdx)
movq $0x13, 0x8(%rdx)
jmp 0xd316f
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 0x4e31e(%rip), %rcx     # 0x12130a
movq %rcx, 0x10(%rax)
movq $0x22, 0x8(%rax)
movq 0x6e0(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x6e0(%rbx), %r9
movq %rdx, %rcx
movq (%rsp), %rax
jmp 0xd3182
movq 0x1918(%rbx), %rsi
movq 0x820(%rbx), %rcx
movslq 0x7dc(%rbx), %rdx
movq (%rcx,%rdx,8), %rcx
incl %edx
andl $0x7, %edx
movl %edx, 0x7dc(%rbx)
leaq 0x4ed8c(%rip), %rdx     # 0x121dcd
movq %rdx, 0x10(%rcx)
movq $0x22, 0x8(%rcx)
movq 0x6e8(%rbx), %rdx
movq %rcx, 0x8(%rdx)
movq 0x10(%rdx), %r9
movq %r14, 0x8(%r9)
movq %r15, %rcx
jmp 0xd3182
cmpq %r9, %rdi
je 0xd3138
movq 0x1918(%rbx), %rsi
movq 0x820(%rbx), %rdx
movslq 0x7dc(%rbx), %rdi
movq (%rdx,%rdi,8), %rdx
incl %edi
andl $0x7, %edi
movl %edi, 0x7dc(%rbx)
leaq 0x4ed93(%rip), %rdi     # 0x121e2f
movq %rdi, 0x10(%rdx)
movq $0x32, 0x8(%rdx)
jmp 0xd316f
movq 0x1918(%rbx), %rsi
movq 0x820(%rbx), %rdx
movslq 0x7dc(%rbx), %rdi
movq (%rdx,%rdi,8), %rdx
incl %edi
andl $0x7, %edi
movl %edi, 0x7dc(%rbx)
leaq 0x4ed8a(%rip), %rdi     # 0x121e62
movq %rdi, 0x10(%rdx)
movq $0x35, 0x8(%rdx)
jmp 0xd316f
movq 0x1918(%rbx), %rsi
movq 0x820(%rbx), %rcx
movslq 0x7dc(%rbx), %rdx
movq (%rcx,%rdx,8), %rcx
incl %edx
andl $0x7, %edx
movl %edx, 0x7dc(%rbx)
leaq 0x4ed84(%rip), %rdx     # 0x121e98
movq %rdx, 0x10(%rcx)
movq $0x1c, 0x8(%rcx)
movq 0x6e8(%rbx), %rdx
movq %rcx, 0x8(%rdx)
movq 0x10(%rdx), %r9
movq %r14, 0x8(%r9)
movq %r8, %rcx
jmp 0xd3182
movq 0x1918(%rbx), %rsi
movq 0x820(%rbx), %rdx
movslq 0x7dc(%rbx), %rdi
movq (%rdx,%rdi,8), %rdx
incl %edi
andl $0x7, %edi
movl %edi, 0x7dc(%rbx)
leaq 0x4eca1(%rip), %rdi     # 0x121e04
movq %rdi, 0x10(%rdx)
movq $0x2a, 0x8(%rdx)
movq 0x6e8(%rbx), %rdi
movq %rdx, 0x8(%rdi)
movq 0x10(%rdi), %r9
movq %r14, 0x8(%r9)
movq 0x10(%r9), %rdx
movq %rcx, 0x8(%rdx)
movq (%rax), %rdx
jmp 0xd2ed8