// File: /workspace/github_c_makefile_star2_O3/BernardTatin[P]s7sh/s7.c
// Function: bool_optimize_nw
static bool bool_optimize_nw(s7_scheme *sc, s7_pointer expr)
                {
                    s7_pointer car_x, head;

                    car_x = car(expr);
                    if (!is_pair(car_x)) /* wrap constants/symbols */
                        return(opt_bool_not_pair(sc, car_x));

                    head = car(car_x);
                    if (is_symbol(head))
                    {
                        s7_pointer s_func;
                        s7_int len;
                        len = s7_list_length(sc, car_x);

                        if ((is_syntactic_symbol(head)) ||
                                (is_syntactic_pair(car_x)))
                        {
                            if (head == sc->and_symbol)
                                return(opt_b_and(sc, car_x, len));
                            if (head == sc->or_symbol)
                                return(opt_b_or(sc, car_x, len));
                            return(return_false(sc, car_x, __func__, __LINE__));
                        }

                        if ((is_global(head)) ||
                                ((is_slot(global_slot(head))) &&
                                 (symbol_to_slot(sc, head) == global_slot(head))))
                            s_func = slot_value(global_slot(head));
                        else return(return_false(sc, car_x, __func__, __LINE__));

                        if (is_c_function(s_func))
                        {
                            if (symbol_id(head) != 0)             /* (float-vector? (block)) -- both safe c_funcs, but this is a method invocation */
                                return(return_false(sc, car_x, __func__, __LINE__));
                            switch (len)
                            {
                                case 2:
                                    return(b_idp_ok(sc, s_func, car_x, opt_arg_type(sc, cdr(car_x))));

                                case 3:
                                    {
                                        s7_b_pp_t bpf;
                                        s7_b_7pp_t bpf7 = NULL;
                                        bpf = s7_b_pp_function(s_func);
                                        if (!bpf) bpf7 = s7_b_7pp_function(s_func);
                                        if ((bpf) || (bpf7))
                                        {
                                            opt_info *opc;
                                            s7_pointer sig1, sig2, arg1, arg2;
                                            opc = alloc_opo(sc, car_x);

                                            arg1 = cadr(car_x);
                                            arg2 = caddr(car_x);
                                            sig1 = opt_arg_type(sc, cdr(car_x));
                                            sig2 = opt_arg_type(sc, cddr(car_x));

                                            if (sig2 == sc->is_integer_symbol)
                                            {
                                                int32_t cur_index;
                                                cur_index = sc->pc;

                                                if ((sig1 == sc->is_integer_symbol) &&
                                                        (b_ii_ok(sc, opc, s_func, car_x, arg1, arg2)))
                                                    return(true);
                                                pc_fallback(sc, cur_index);

                                                if ((is_symbol(arg2)) &&
                                                        (b_pi_ok(sc, opc, s_func, car_x, arg2)))
                                                    return(true);
                                                pc_fallback(sc, cur_index);
                                            }

                                            if ((sig1 == sc->is_float_symbol) &&
                                                    (sig2 == sc->is_float_symbol) &&
                                                    (b_dd_ok(sc, opc, s_func, car_x, arg1, arg2)))
                                                return(true);

                                            if (bpf)
                                                opc->v[3].b_pp_f = bpf;
                                            else opc->v[3].b_7pp_f = bpf7;
                                            return(b_pp_ok(sc, opc, s_func, car_x, arg1, arg2, bpf != NULL));
                                        }
                                    }
                                    break;

                                default:
                                    break;
                            }
                        }
                        else
                        {
                            if (is_macro(s_func))
                                return(return_false(sc, car_x, __func__, __LINE__));
                        }
                    }
                    return(return_false(sc, car_x, __func__, __LINE__));
                }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq 0x8(%rsi), %r14
movzbl (%r14), %eax
cmpl $0x1, %eax
je 0xa9dce
cmpl $0xa, %eax
je 0xa9d55
cmpl $0x7, %eax
jne 0xa9e6f
movslq 0x2258(%rbx), %rax
cmpq $0x100, %rax            # imm = 0x100
jge 0xaa097
leal 0x1(%rax), %ecx
movl %ecx, 0x2258(%rbx)
movq 0x2260(%rbx,%rax,8), %rax
movq $0x0, 0x38(%rax)
cmpq %r14, 0x120(%rbx)
leaq 0x1338(%rip), %rcx      # 0xab075
leaq 0x1334(%rip), %rdx      # 0xab078
cmoveq %rcx, %rdx
movq %rdx, (%rax)
movq $0x1, 0x60(%rax)
jmp 0xa9dc7
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0xa56a4
testq %rax, %rax
je 0xa9e6f
movq 0x10(%rax), %rcx
cmpb $0x7, (%rcx)
jne 0xa9e6f
movslq 0x2258(%rbx), %rcx
cmpq $0x100, %rcx            # imm = 0x100
jge 0xaa097
leal 0x1(%rcx), %edx
movl %edx, 0x2258(%rbx)
movq 0x2260(%rbx,%rcx,8), %rcx
movq $0x0, 0x38(%rcx)
movq %rax, 0x8(%rcx)
leaq 0x12cc(%rip), %rax      # 0xab07b
movq %rax, (%rcx)
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, 0x60(%rcx)
movl $0x0, 0x70(%rcx)
movb $0x1, %al
jmp 0xa9e71
movq 0x8(%r14), %r13
cmpb $0xa, (%r13)
jne 0xa9e6f
movq %rbx, %rdi
movq %r14, %rsi
callq 0x39d0d
movq %rax, %r12
cmpw $0x20a, (%r13)          # imm = 0x20A
je 0xa9dfc
cmpw $0x201, (%r14)          # imm = 0x201
jne 0xa9e3c
cmpq 0x1820(%rbx), %r13
je 0xa9e1b
cmpq 0x1828(%rbx), %r13
jne 0xa9e6f
movq %rbx, %rdi
movq %r14, %rsi
movl %r12d, %edx
xorl %ecx, %ecx
jmp 0xa9e29
movq %rbx, %rdi
movq %r14, %rsi
movl %r12d, %edx
movl $0x1, %ecx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xab092
movq 0x10(%r13), %r15
testb $0x1, 0x2(%r13)
jne 0xa9e5e
cmpb $0x20, (%r15)
jne 0xa9e6f
movq 0x8(%rbx), %rdi
movq %r13, %rsi
callq 0xbe33
cmpq %r15, %rax
jne 0xa9e6f
movq 0x10(%r15), %r15
cmpb $0x30, (%r15)
jb 0xa9e6f
cmpq $0x0, 0x20(%r13)
je 0xa9e80
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x3, %r12
je 0xa9eb7
cmpq $0x2, %r12
jne 0xa9e6f
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0xa844a
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rax, %rcx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xaa0c2
movq 0x8(%r15), %rax
movq 0x20(%rax), %rcx
testq %rcx, %rcx
je 0xa9e6f
movq %rcx, %rax
cmpl $0x1d, (%rax)
je 0xa9ed7
movq 0x10(%rax), %rax
testq %rax, %rax
jne 0xa9ec7
jmp 0xa9ef7
movq 0x8(%rax), %rax
testq %rax, %rax
je 0xa9ef7
movq %rax, 0x20(%rsp)
movb $0x1, %al
movq %rax, 0x30(%rsp)
movq $0x0, 0x28(%rsp)
jmp 0xa9f39
testq %rcx, %rcx
je 0xa9e6f
xorl %eax, %eax
cmpl $0x1e, (%rcx)
je 0xa9f15
movq 0x10(%rcx), %rcx
testq %rcx, %rcx
jne 0xa9f02
jmp 0xa9e71
movq 0x8(%rcx), %rax
testq %rax, %rax
je 0xa9e6f
movq %rax, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
movq $0x0, 0x20(%rsp)
movslq 0x2258(%rbx), %rax
cmpq $0x100, %rax            # imm = 0x100
jge 0xaa097
leal 0x1(%rax), %ecx
movl %ecx, 0x2258(%rbx)
movq 0x2260(%rbx,%rax,8), %r12
movq $0x0, 0x38(%r12)
movq 0x10(%r14), %rsi
movq 0x8(%rsi), %rax
movq %rax, 0x18(%rsp)
movq 0x10(%rsi), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
callq 0xa844a
movq %rax, %r13
movq 0x10(%r14), %rax
movq 0x10(%rax), %rsi
movq %rbx, %rdi
callq 0xa844a
movq %rax, %rbp
cmpq 0x10d0(%rbx), %rax
jne 0xaa021
movl 0x2258(%rbx), %ecx
cmpq %rbp, %r13
jne 0xa9fe1
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movl %ecx, 0xc(%rsp)
movq %r14, %rcx
movq 0x18(%rsp), %r8
movq 0x10(%rsp), %r9
callq 0xaa4f5
movl %eax, %ecx
movb $0x1, %al
testb %cl, %cl
movl 0xc(%rsp), %ecx
jne 0xa9e71
movl %ecx, 0x2258(%rbx)
movq 0x10(%rsp), %rax
cmpb $0xa, (%rax)
jne 0xaa01b
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movl %ecx, 0xc(%rsp)
movq %r14, %rcx
movq 0x10(%rsp), %r8
callq 0xaa878
movl %eax, %ecx
movb $0x1, %al
testb %cl, %cl
movl 0xc(%rsp), %ecx
jne 0xa9e71
movl %ecx, 0x2258(%rbx)
movq 0x11e0(%rbx), %rax
xorq %rax, %r13
xorq %rax, %rbp
orq %r13, %rbp
jne 0xaa05a
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
movq 0x18(%rsp), %r8
movq 0x10(%rsp), %r9
callq 0xaa946
movl %eax, %ecx
movb $0x1, %al
testb %cl, %cl
jne 0xa9e71
movq 0x30(%rsp), %rax
testb %al, %al
movq 0x28(%rsp), %rcx
cmovneq 0x20(%rsp), %rcx
movq %rcx, 0x18(%r12)
movzbl %al, %eax
movl %eax, (%rsp)
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
movq 0x18(%rsp), %r8
movq 0x10(%rsp), %r9
callq 0xaac05
jmp 0xa9e71
addq $0x2190, %rbx           # imm = 0x2190
movq %rbx, %rdi
movl $0x1, %esi
callq 0x8530