// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: g_is_provided
static s7_pointer g_is_provided(s7_scheme *sc, s7_pointer args)
    {
#define H_is_provided "(provided? symbol) returns #t if symbol is a member of the *features* list"
#define Q_is_provided s7_make_signature(sc, 2, sc->is_boolean_symbol, sc->is_symbol_symbol)
        s7_pointer sym, topf, x;

        sym = car(args);
        if (!is_symbol(sym))
            return(method_or_bust_one_arg(sc, sym, sc->is_provided_symbol, list_1(sc, sym), T_SYMBOL));

        /* here the *features* list is spread out (or can be anyway) along the curlet chain,
         *   so we need to travel back all the way to the top level checking each *features* list in turn.
         *   Since *features* grows via cons (newest first), we can stop the scan if we hit the shared
         *   top-level at least.
         */
        topf = slot_value(global_slot(sc->features_symbol));
        if (is_memq(sym, topf))
            return(sc->T);

        if (is_global(sc->features_symbol))
            return(sc->F);
        for (x = sc->envir; symbol_id(sc->features_symbol) < let_id(x); x = outlet(x));
        for (; is_let(x); x = outlet(x))
        {
            s7_pointer y;
            for (y = let_slots(x); tis_slot(y); y = next_slot(y))
                if (slot_symbol(y) == sc->features_symbol)
                {
                    if ((slot_value(y) != topf) &&
                            (is_memq(sym, slot_value(y))))
                        return(sc->T);
                }
        }
        return(sc->F);
    }

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rax
movzbl (%rax), %eax
cmpl $0xa, %eax
je 0x69eff
movq 0x68(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x68(%rsp), %rax
movq 0x1168(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x68(%rsp), %rax
movq 0x110(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x68(%rsp), %rax
movq 0x90(%rax), %rax
movq 0x68(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x69e81
movq 0x68(%rsp), %rdi
callq 0xc670
movq 0x68(%rsp), %rcx
movq 0x90(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x90(%rcx)
movq -0x8(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq $0x200001, (%rax)       # imm = 0x200001
movq 0x18(%rsp), %rdx
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdi
movq 0x38(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x30(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x40(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rcx
movl $0xa, %r8d
callq 0xcfd30
movq %rax, 0x70(%rsp)
jmp 0x6a065
movq 0x68(%rsp), %rax
movq 0xee0(%rax), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0x2aff0
testb $0x1, %al
jne 0x69f2d
jmp 0x69f43
movq 0x68(%rsp), %rax
movq 0x118(%rax), %rax
movq %rax, 0x70(%rsp)
jmp 0x6a065
movq 0x68(%rsp), %rax
movq 0xee0(%rax), %rax
movq (%rax), %rax
andq $0x10000, %rax          # imm = 0x10000
cmpq $0x0, %rax
je 0x69f74
movq 0x68(%rsp), %rax
movq 0x120(%rax), %rax
movq %rax, 0x70(%rsp)
jmp 0x6a065
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x68(%rsp), %rax
movq 0xee0(%rax), %rax
movq 0x20(%rax), %rax
movq 0x48(%rsp), %rcx
cmpq 0x18(%rcx), %rax
jge 0x69faf
jmp 0x69f9f
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x48(%rsp)
jmp 0x69f82
jmp 0x69fb1
movq 0x48(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1c, %eax
jne 0x6a054
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
je 0x6a03f
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x68(%rsp), %rcx
cmpq 0xee0(%rcx), %rax
jne 0x6a02d
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
cmpq 0x50(%rsp), %rax
je 0x6a02b
movq 0x58(%rsp), %rdi
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rsi
callq 0x2aff0
testb $0x1, %al
jne 0x6a018
jmp 0x6a02b
movq 0x68(%rsp), %rax
movq 0x118(%rax), %rax
movq %rax, 0x70(%rsp)
jmp 0x6a065
jmp 0x6a02d
jmp 0x6a02f
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x20(%rsp)
jmp 0x69fd0
jmp 0x6a041
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x48(%rsp)
jmp 0x69fb1
movq 0x68(%rsp), %rax
movq 0x120(%rax), %rax
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rax
addq $0x78, %rsp
retq
nop