// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: check_and
static bool check_and(s7_scheme *sc)
                {
                    /* this and check_or and check_if may not be called -- optimize_syntax can short-circuit it to return fx* choices */
                    s7_pointer p, form;
                    int32_t any_nils = 0, len;

                    form = sc->code;
                    sc->code = cdr(sc->code);

                    if (is_null(sc->code))
                    {
                        sc->value = sc->T;
                        return(true);
                    }
                    for (len = 0, p = sc->code; is_pair(p); p = cdr(p), len++)
                    {
                        s7_function callee;
                        callee = fx_choose(sc, p, sc->envir, let_symbol_is_safe);  /* c_callee can be nil! */
                        if (!callee)
                            any_nils++;
                        set_c_call_checked(p, callee);
                    }

                    if (is_not_null(p))                                    /* (and . 1) (and #t . 1) */
                        eval_error_no_return(sc, sc->syntax_error_symbol, "and: stray dot?: ~A", 19, form);

                    if ((c_callee(sc->code)) &&
                            (is_proper_list_1(sc, cdr(sc->code))))
                    {
                        if ((c_callee(sc->code) == fx_is_pair_s) || (c_callee(sc->code) == fx_is_pair_t))
                        {
                            pair_set_syntax_op(form, OP_AND_PAIR_P);
                            set_opt3_sym(form, cadar(sc->code));
                            set_opt2_con(form, cadr(sc->code));
                        }
                        else pair_set_syntax_op(form, (any_nils > 0) ? OP_AND_AP : OP_AND_SAFE_AA);
                    }
                    else
                    {
                        pair_set_syntax_op(form, (any_nils > 0) ? OP_AND_P : OP_AND_N);
                        if ((any_nils == 1) && (len > 2))
                        {
                            if (!has_fx(sc->code))
                                pair_set_syntax_op(form, OP_AND_SAFE_P1);
                            else
                            {
                                if (!has_fx(cdr(sc->code)))
                                    pair_set_syntax_op(form, OP_AND_SAFE_P2);
                                else
                                {
                                    if ((!has_fx(cddr(sc->code))) && (len == 3))
                                        pair_set_syntax_op(form, OP_AND_SAFE_P3);
                                }}}}
                    sc->code = form;
                    return(false);
                }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq (%rdi), %rbp
movq 0x110(%rdi), %rdx
movq 0x10(%rbp), %r15
movq %r15, (%rdi)
cmpq %rdx, %r15
je 0xa0669
movq %rdx, 0x8(%rsp)
xorl %r13d, %r13d
leaq -0x12da5(%rip), %r14    # 0x8d79b
xorl %r12d, %r12d
movq %r15, 0x10(%rsp)
cmpb $0x1, (%r15)
jne 0xa058d
movq 0x8(%rbx), %rdx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rcx
callq 0x8c0ba
xorl %ecx, %ecx
xorl %edx, %edx
testq %rax, %rax
setne %cl
sete %dl
addl %edx, %r13d
movq %rax, 0x20(%r15)
movzwl 0x6(%r15), %eax
andl $-0x5, %eax
leal (%rax,%rcx,4), %eax
movw %ax, 0x6(%r15)
movq 0x10(%r15), %r15
incl %r12d
jmp 0xa0548
cmpq 0x110(%rbx), %r15
je 0xa05f6
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 0x44b87(%rip), %rcx     # 0xe5148
movq %rcx, 0x10(%rax)
movq $0x13, 0x8(%rax)
movq 0x6e0(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x6e0(%rbx), %rax
movq 0x10(%rax), %rax
movq %rbp, 0x8(%rax)
movq 0x6e0(%rbx), %rdx
movq %rbx, %rdi
callq 0x2cdc0
movq (%rbx), %rcx
movq 0x20(%rcx), %rax
testq %rax, %rax
movq 0x10(%rsp), %r15
je 0xa061d
movq 0x10(%rcx), %rcx
cmpb $0x1, (%rcx)
jne 0xa061d
movq 0x10(%rcx), %rcx
cmpq 0x110(%rbx), %rcx
je 0xa068e
testl %r13d, %r13d
movl $0x290, %eax            # imm = 0x290
movl $0x285, %ecx            # imm = 0x285
cmovel %eax, %ecx
movw %cx, 0x4(%rbp)
movw $0x201, (%rbp)          # imm = 0x201
cmpl $0x1, %r13d
sete %al
cmpl $0x3, %r12d
setae %cl
andb %al, %cl
cmpb $0x1, %cl
movq 0x8(%rsp), %rdx
jne 0xa0735
movq (%rbx), %rax
testb $0x4, 0x6(%rax)
jne 0xa0679
movw $0x28a, 0x4(%rbp)       # imm = 0x28A
jmp 0xa0714
movq 0x118(%rbx), %rax
movq %rax, 0x20(%rbx)
jmp 0xa0738
movq 0x10(%rax), %rax
testb $0x4, 0x6(%rax)
jne 0xa06f5
movw $0x28b, 0x4(%rbp)       # imm = 0x28B
jmp 0xa0714
leaq -0x12ad6(%rip), %rcx    # 0x8dbbf
cmpq %rcx, %rax
setne %cl
leaq 0x39db(%rip), %rdx      # 0xa407d
cmpq %rdx, %rax
setne %al
testb %al, %cl
jne 0xa071c
movw $0x289, 0x4(%rbp)       # imm = 0x289
movq $-0x10000, %rax         # imm = 0xFFFF0000
andq (%rbp), %rax
orq $0x201, %rax            # imm = 0x201
movq %rax, (%rbp)
movq (%rbx), %rcx
movq 0x8(%rcx), %rcx
movq 0x10(%rcx), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, 0x28(%rbp)
andq $-0x4fdff, %rax         # imm = 0xFFFB0201
movq %rax, (%rbp)
movq (%rbx), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x20(%rbp)
jmp 0xa0730
movq 0x10(%rax), %rax
testb $0x4, 0x6(%rax)
sete %al
cmpl $0x3, %r12d
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xa0735
movw $0x28c, 0x4(%rbp)       # imm = 0x28C
movw $0x201, (%rbp)          # imm = 0x201
jmp 0xa0735
xorl %eax, %eax
cmpl $0x1, %r13d
adcw $0x287, %ax             # imm = 0x287
movw %ax, 0x4(%rbp)
movw $0x201, (%rbp)          # imm = 0x201
movq 0x8(%rsp), %rdx
movq %rbp, (%rbx)
cmpq %rdx, %r15
sete %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq