// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: find_uncomplicated_symbol
static inline s7_pointer find_uncomplicated_symbol(s7_scheme *sc, s7_pointer symbol, s7_pointer e)
                {
                    s7_pointer x;
                    int64_t id;
#if OPTIMIZE_PRINT
                    fprintf(stderr, "  find %s in %s (in list: %d)\n", DISPLAY(symbol), DISPLAY(e), symbol_is_in_list(sc, symbol));
#endif
                    if ((symbol_is_in_list(sc, symbol)) &&
                            (let_memq(symbol, e)))   /* it's probably a local variable reference */
                        return(sc->nil);

                    if (is_global(symbol))
                        return(global_slot(symbol));

                    /* see 59108 (OP_DEFINE_* in optimize_syntax) -- keyword version of name is used if a definition is
                     *   contingent on some run-time decision, so we're looking here for local defines that might not happen.
                     *   s7test.scm has a test case using acos.
                     */
                    if ((has_keyword(symbol)) &&
                            (symbol_is_in_list(sc, symbol_to_keyword(sc, symbol))))
                        return(sc->nil);

                    id = symbol_id(symbol);
                    for (x = sc->envir; id < let_id(x); x = outlet(x));
                    for (; is_let(x); x = outlet(x))
                    {
                        s7_pointer y;
                        if (let_id(x) == id)
                            return(local_slot(symbol));

                        for (y = let_slots(x); tis_slot(y); y = next_slot(y))
                            if (slot_symbol(y) == symbol)
                                return(y);
                    }

                    return(global_slot(symbol)); /* it's no longer global perhaps (local definition now inaccessible) */
                }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq 0x20(%rsp), %rax
movl 0x2c(%rax), %eax
movq 0x28(%rsp), %rcx
cmpl 0xa88(%rcx), %eax
jne 0x1788f0
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rax), %rax
movl 0xc(%rax), %eax
movq 0x28(%rsp), %rcx
cmpl 0xa8c(%rcx), %eax
jne 0x1788f0
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x17ffd0
testb $0x1, %al
jne 0x1788da
jmp 0x1788f0
movq 0x28(%rsp), %rax
movq 0x110(%rax), %rax
movq %rax, 0x30(%rsp)
jmp 0x178a52
movq 0x20(%rsp), %rax
movq (%rax), %rax
andq $0x10000, %rax          # imm = 0x10000
cmpq $0x0, %rax
je 0x178917
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x30(%rsp)
jmp 0x178a52
movq 0x20(%rsp), %rax
movq (%rax), %rax
andq $0x4000000, %rax        # imm = 0x4000000
cmpq $0x0, %rax
je 0x178987
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x3a0c0
movl 0x2c(%rax), %eax
movq 0x28(%rsp), %rcx
cmpl 0xa88(%rcx), %eax
jne 0x178987
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x3a0c0
movq 0x8(%rax), %rax
movq 0x20(%rax), %rax
movl 0xc(%rax), %eax
movq 0x28(%rsp), %rcx
cmpl 0xa8c(%rcx), %eax
jne 0x178987
movq 0x28(%rsp), %rax
movq 0x110(%rax), %rax
movq %rax, 0x30(%rsp)
jmp 0x178a52
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
cmpq 0x18(%rcx), %rax
jge 0x1789c5
jmp 0x1789b5
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0x1789a3
jmp 0x1789c7
movq 0x10(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1c, %eax
jne 0x178a44
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
cmpq 0x8(%rsp), %rax
jne 0x1789f4
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x30(%rsp)
jmp 0x178a52
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
je 0x178a32
movq (%rsp), %rax
movq 0x8(%rax), %rax
cmpq 0x20(%rsp), %rax
jne 0x178a22
movq (%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x178a52
jmp 0x178a24
movq (%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, (%rsp)
jmp 0x178a01
jmp 0x178a34
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0x1789c7
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax)