// File: /workspace/github_c_makefile_star2_O3/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), %r15
movq 0x10(%rax), %r13
movq %r13, (%rdi)
cmpq %r15, %r13
je 0xcabd8
movq %rax, 0x10(%rsp)
xorl %ebp, %ebp
cmpb $0x1, (%r13)
movq %r15, %rax
movl $0x0, %r12d
movq %r13, %r14
jne 0xcab05
movq %r15, 0x8(%rsp)
xorl %r12d, %r12d
leaq -0x1995d(%rip), %r15    # 0xb1155
movq %r13, %r14
xorl %ebp, %ebp
movq 0x8(%rbx), %rdx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rcx
callq 0xaf535
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 0xcaab7
movq 0x110(%rbx), %rax
movq 0x8(%rsp), %r15
cmpq %rax, %r14
movq 0x10(%rsp), %r14
je 0xcab6f
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 0x4e66e(%rip), %rcx     # 0x1191a8
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 0x38dfa
movq (%rbx), %rcx
movq 0x20(%rcx), %rax
testq %rax, %rax
je 0xcab91
movq 0x10(%rcx), %rcx
cmpb $0x1, (%rcx)
jne 0xcab91
movq 0x10(%rcx), %rcx
cmpq 0x110(%rbx), %rcx
je 0xcabfe
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
jne 0xcac9c
movq (%rbx), %rax
testb $0x4, 0x6(%rax)
jne 0xcabe8
movw $0x28a, 0x4(%r14)       # imm = 0x28A
jmp 0xcac96
movq 0x118(%rbx), %rax
movq %rax, 0x20(%rbx)
jmp 0xcac9f
movq 0x10(%rax), %rax
testb $0x4, 0x6(%rax)
jne 0xcac63
movw $0x28b, 0x4(%r14)       # imm = 0x28B
jmp 0xcac96
leaq -0x193be(%rip), %rcx    # 0xb1847
cmpq %rcx, %rax
setne %cl
leaq 0x42a9(%rip), %rdx      # 0xceebb
cmpq %rdx, %rax
setne %al
testb %al, %cl
jne 0xcac85
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 0xcac9c
movq 0x10(%rax), %rax
testb $0x4, 0x6(%rax)
sete %al
cmpl $0x3, %r12d
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xcac9c
movw $0x28c, 0x4(%r14)       # imm = 0x28C
jmp 0xcac96
xorl %eax, %eax
testl %ebp, %ebp
setle %al
addl $0x287, %eax            # imm = 0x287
movw %ax, 0x4(%r14)
movw $0x201, (%r14)          # imm = 0x201
movq %r14, (%rbx)
cmpq %r15, %r13
sete %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq