// File: /workspace/github_c_makefile_star2_O3/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 %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 0xca6e2
movq 0x8(%rax), %rcx
movb (%rcx), %cl
decb %cl
cmpb $0x2, %cl
jae 0xca6e2
movq 0x10(%rax), %rcx
cmpb $0x1, (%rcx)
jne 0xca74d
incl 0xa88(%rbx)
jne 0xca5ab
movl $0x1, 0xa88(%rbx)
incl 0xa8c(%rbx)
movq 0x8(%rax), %rcx
movq 0x110(%rbx), %r8
cmpq %r8, %rcx
je 0xca8d4
movq $-0x112201, %rdx        # imm = 0xFFEEDDFF
cmpb $0x1, (%rcx)
jne 0xca81f
movq 0x8(%rcx), %rax
cmpb $0x1, (%rax)
jne 0xca786
movq 0x8(%rax), %rdi
cmpb $0xa, (%rdi)
jne 0xca786
movq (%rdi), %rsi
btl $0x18, %esi
jb 0xca7c2
btq $0x30, %rsi
jae 0xca640
movq 0x8(%rbx), %r9
movq 0x18(%r9), %r11
movq 0x20(%rdi), %r10
movl $0x18, %esi
cmpq %r10, %r11
je 0xca62b
jle 0xca622
movq 0x10(%r9), %r9
movq 0x18(%r9), %r11
cmpq %r11, %r10
jl 0xca615
cmpq %r10, %r11
jne 0xca6b4
movq (%rdi,%rsi), %r10
cmpb $0x20, (%r10)
jne 0xca640
testb $0x1, 0x3(%r10)
jne 0xca7c2
movq 0x10(%rax), %r9
cmpb $0x1, (%r9)
jne 0xca84f
cmpq %r8, 0x10(%r9)
jne 0xca895
movl 0xa88(%rbx), %eax
movq 0x8(%rdi), %rsi
cmpl %eax, 0x2c(%rdi)
jne 0xca67c
movq 0x20(%rsi), %r8
movl 0xc(%r8), %r8d
cmpl 0xa8c(%rbx), %r8d
je 0xca964
movl %eax, 0x2c(%rdi)
movl 0xa8c(%rbx), %eax
movq 0x20(%rsi), %rsi
movl %eax, 0xc(%rsi)
movq (%rdi), %rax
andq %rdx, %rax
orq $0x100000, %rax         # imm = 0x100000
movq %rax, (%rdi)
movq 0x10(%rcx), %rcx
movq 0x110(%rbx), %r8
cmpq %r8, %rcx
jne 0xca5c6
jmp 0xca8d1
movl $0x10, %esi
cmpb $0x1c, (%r9)
jne 0xca62b
movq 0x8(%r9), %r10
testq %r10, %r10
je 0xca6dc
cmpq %rdi, 0x8(%r10)
je 0xca62f
movq 0x18(%r10), %r10
jmp 0xca6c7
movq 0x10(%r9), %r9
jmp 0xca6b9
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 0x4e79a(%rip), %rcx     # 0x118ea7
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 %r14
popq %r15
popq %rbp
jmp 0x38dfa
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 0x4e752(%rip), %rcx     # 0x118eca
movq %rcx, 0x10(%rax)
movq $0x12, 0x8(%rax)
jmp 0xca719
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 0x4e74f(%rip), %rdx     # 0x118f00
movq %rdx, 0x10(%rcx)
movq $0x13, 0x8(%rcx)
jmp 0xca9ce
movq 0x1940(%rbx), %rsi
movq 0x820(%rbx), %rax
movslq 0x7dc(%rbx), %rdx
movq (%rax,%rdx,8), %rax
incl %edx
andl $0x7, %edx
movl %edx, 0x7dc(%rbx)
leaq 0x4dc2d(%rip), %rdx     # 0x11841a
movq %rdx, 0x10(%rax)
movq $0x22, 0x8(%rax)
movq 0x6e0(%rbx), %rdx
movq %rax, 0x8(%rdx)
movq 0x6e0(%rbx), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x8(%rax)
movq 0x6e0(%rbx), %rdx
jmp 0xca73b
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 0x4e693(%rip), %rcx     # 0x118edd
jmp 0xca70d
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 %r8, %r9
je 0xca9bb
leaq 0x4e6bb(%rip), %rdx     # 0x118f3f
movq %rdx, 0x10(%rcx)
movq $0x32, 0x8(%rcx)
jmp 0xca9ce
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 0x4e6b2(%rip), %rdx     # 0x118f72
movq %rdx, 0x10(%rcx)
movq $0x35, 0x8(%rcx)
jmp 0xca9ce
movq (%rbx), %rax
movq 0x10(%rax), %rsi
movq %rbx, %rdi
callq 0x39d6f
testb %al, %al
je 0xca906
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 %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 0x4e694(%rip), %rcx     # 0x118fc5
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 0xca734
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 0x4e619(%rip), %rcx     # 0x118fa8
movq %rcx, 0x10(%rax)
movq $0x1c, 0x8(%rax)
movq 0x6e8(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x10(%rcx), %rax
movq %r14, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rdi, 0x8(%rax)
jmp 0xca734
leaq 0x4e552(%rip), %rdx     # 0x118f14
movq %rdx, 0x10(%rcx)
movq $0x2a, 0x8(%rcx)
movq 0x6e8(%rbx), %rdx
movq %rcx, 0x8(%rdx)
movq 0x10(%rdx), %rcx
movq %r14, 0x8(%rcx)
movq 0x10(%rcx), %rcx
movq %rax, 0x8(%rcx)
jmp 0xca734