// File: /workspace/github_c_makefile_star2_O1/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), %rax
movq 0x110(%rdi), %rdx
movq 0x10(%rax), %r13
movq %r13, (%rdi)
cmpq %rdx, %r13
je 0xd3376
movq %rax, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
xorl %ebp, %ebp
cmpb $0x1, (%r13)
movl $0x0, %r12d
movq %r13, %r14
jne 0xd329a
xorl %r12d, %r12d
leaq -0x1b0cb(%rip), %r15    # 0xb8188
movq %r13, %r14
xorl %ebp, %ebp
movq 0x8(%rbx), %rdx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rcx
callq 0xb69b9
xorl %ecx, %ecx
xorl %edx, %edx
testq %rax, %rax
setne %cl
sete %dl
addl %edx, %ebp
movq %rax, 0x20(%r14)
movzwl 0x6(%r14), %eax
andl $-0x5, %eax
leal (%rax,%rcx,4), %eax
movw %ax, 0x6(%r14)
movq 0x10(%r14), %r14
incl %r12d
cmpb $0x1, (%r14)
je 0xd3258
cmpq 0x110(%rbx), %r14
movq 0x10(%rsp), %r14
je 0xd3308
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 0x4edc5(%rip), %rcx     # 0x122098
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 %r14, 0x8(%rax)
movq 0x6e0(%rbx), %rdx
movq %rbx, %rdi
callq 0x3b366
movq (%rbx), %rcx
movq 0x20(%rcx), %rax
testq %rax, %rax
je 0xd332a
movq 0x10(%rcx), %rcx
cmpb $0x1, (%rcx)
jne 0xd332a
movq 0x10(%rcx), %rcx
cmpq 0x110(%rbx), %rcx
je 0xd339c
testl %ebp, %ebp
movl $0x285, %eax            # imm = 0x285
movl $0x290, %ecx            # imm = 0x290
cmovgl %eax, %ecx
movw %cx, 0x4(%r14)
movw $0x201, (%r14)          # imm = 0x201
cmpl $0x1, %ebp
sete %al
cmpl $0x3, %r12d
setae %cl
andb %al, %cl
cmpb $0x1, %cl
movq 0x8(%rsp), %rdx
jne 0xd3445
movq (%rbx), %rax
testb $0x4, 0x6(%rax)
jne 0xd3386
movw $0x28a, 0x4(%r14)       # imm = 0x28A
jmp 0xd3421
movq 0x118(%rbx), %rax
movq %rax, 0x20(%rbx)
jmp 0xd3448
movq 0x10(%rax), %rax
testb $0x4, 0x6(%rax)
jne 0xd3401
movw $0x28b, 0x4(%r14)       # imm = 0x28B
jmp 0xd3421
leaq -0x1aab1(%rip), %rcx    # 0xb88f2
cmpq %rcx, %rax
setne %cl
leaq 0x4161(%rip), %rdx      # 0xd7511
cmpq %rdx, %rax
setne %al
testb %al, %cl
jne 0xd3429
movw $0x289, 0x4(%r14)       # imm = 0x289
movq $-0x10000, %rax         # imm = 0xFFFF0000
andq (%r14), %rax
orq $0x201, %rax            # imm = 0x201
movq %rax, (%r14)
movq (%rbx), %rcx
movq 0x8(%rcx), %rcx
movq 0x10(%rcx), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, 0x28(%r14)
andq $-0x4fdff, %rax         # imm = 0xFFFB0201
movq %rax, (%r14)
movq (%rbx), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x20(%r14)
jmp 0xd3440
movq 0x10(%rax), %rax
testb $0x4, 0x6(%rax)
sete %al
cmpl $0x3, %r12d
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xd3445
movw $0x28c, 0x4(%r14)       # imm = 0x28C
movw $0x201, (%r14)          # imm = 0x201
jmp 0xd3445
xorl %eax, %eax
testl %ebp, %ebp
setle %al
addl $0x287, %eax            # imm = 0x287
movw %ax, 0x4(%r14)
movw $0x201, (%r14)          # imm = 0x201
movq 0x8(%rsp), %rdx
movq %r14, (%rbx)
cmpq %rdx, %r13
sete %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq