// File: /workspace/github_c_makefile_star2_O1/BernardTatin[P]s7sh/s7.c
// Function: optimize
static opt_t optimize(s7_scheme *sc, s7_pointer code, int32_t hop, s7_pointer e)
                {
                    s7_pointer x;
#if OPTIMIZE_PRINT
                    fprintf(stderr, "optimize: %s %s\n", DISPLAY_80(code), DISPLAY(e));
#endif
                    for (x = code; (is_pair(x)) && (!is_checked(x)); x = cdr(x))
                    {
                        s7_pointer obj;
                        obj = car(x);
                        set_checked(x);
                        if (is_pair(obj))
                        {
                            if (!is_checked(obj))
                            {
                                if (optimize_expression(sc, obj, hop, e, true) == OPT_OOPS)
                                {
                                    s7_pointer p;
                                    for (p = cdr(x); is_pair(p); p = cdr(p));
                                    if (!is_null(p))
                                        eval_error_no_return(sc, sc->syntax_error_symbol, "stray dot in function body: ~S", 30, code);
                                    return(OPT_OOPS);
                                }
                            }
                        }
                        else
                        {
                            /* new 22-Sep-19, but I don't think this saves anything over falling into trailers */
                            if (is_symbol(obj))
                                set_optimize_op(obj, (is_keyword(obj)) ? OP_CON : ((is_global(obj)) ? OP_GLOBAL_SYM : OP_SYM));
                            else set_optimize_op(obj, OP_CON);
                        }
                    }
                    if (!is_list(x))
                        eval_error_no_return(sc, sc->syntax_error_symbol, "stray dot in function body: ~S", 30, code);
                    return(OPT_F);
                }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movb (%rsi), %al
cmpb $0x1, %al
jne 0xea390
movq %rcx, %r15
movq (%r14), %rcx
btl $0x16, %ecx
jb 0xea390
movl %edx, %ebp
movq %r14, %r12
movq 0x8(%r12), %rsi
orq $0x400000, %rcx         # imm = 0x400000
movq %rcx, (%r12)
movzbl (%rsi), %ecx
movw $0x188, %ax             # imm = 0x188
cmpl $0xa, %ecx
je 0xea360
cmpl $0x1, %ecx
jne 0xea375
testb $0x40, 0x2(%rsi)
jne 0xea379
movq %rbx, %rdi
movl %ebp, %edx
movq %r15, %rcx
movl $0x1, %r8d
callq 0xe242a
cmpl $0x2, %eax
jne 0xea379
jmp 0xea403
testb $-0x80, 0x6(%rsi)
jne 0xea375
movb 0x2(%rsi), %al
andb $0x1, %al
cmpb $0x1, %al
movw $0x187, %ax             # imm = 0x187
sbbw $0x0, %ax
movw %ax, 0x4(%rsi)
movq 0x10(%r12), %r12
movb (%r12), %al
cmpb $0x1, %al
jne 0xea390
movq (%r12), %rcx
btl $0x16, %ecx
jae 0xea31c
decb %al
xorl %ebp, %ebp
cmpb $0x2, %al
jb 0xea3f8
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 0x36b6d(%rip), %rcx     # 0x120f30
movq %rcx, 0x10(%rax)
movq $0x1e, 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
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%r12), %r12
cmpb $0x1, (%r12)
je 0xea403
movl $0x2, %ebp
cmpq 0x110(%rbx), %r12
jne 0xea398
jmp 0xea3f8