// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: g_symbol_table
static s7_pointer g_symbol_table(s7_scheme *sc, s7_pointer args)
    {
#define H_symbol_table "(symbol-table) returns a vector containing the current symbol-table symbols"
#define Q_symbol_table s7_make_signature(sc, 1, sc->is_vector_symbol)

        s7_pointer lst, x;
        s7_pointer *els;
        int32_t i, j, syms = 0;

        /* this can't be optimized by returning the actual symbol-table (a vector of lists), because
         *    gensyms can cause the table's lists and symbols to change at any time.  This wreaks havoc
         *    on traversals like for-each.  So, symbol-table returns a snap-shot of the table contents
         *    at the time it is called, and we call gc before making the list.  I suppose the next step
         *    is to check that we have room, and increase the heap here if necessary!
         *
         *    (define (for-each-symbol func num) (for-each (lambda (sym) (if (> num 0) (for-each-symbol func (- num 1)) (func sym))) (symbol-table)))
         *    (for-each-symbol (lambda (sym) (gensym) 1))
         */

        for (i = 0; i < SYMBOL_TABLE_SIZE; i++)
            for (x = vector_element(sc->symbol_table, i); is_not_null(x); x = cdr(x))
                syms++;
        sc->w = make_simple_vector(sc, syms);
        els = vector_elements(sc->w);

        for (i = 0, j = 0; i < SYMBOL_TABLE_SIZE; i++)
            for (x = vector_element(sc->symbol_table, i); is_not_null(x); x = cdr(x))
                els[j++] = car(x);

        lst = sc->w;
        sc->w = sc->nil;
        return(lst);
    }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movl $0x0, 0x4(%rsp)
movl $0x0, 0xc(%rsp)
cmpl $0x7fed, 0xc(%rsp)      # imm = 0x7FED
jge 0x669a3
movq 0x30(%rsp), %rax
movq 0x148(%rax), %rax
movq 0x10(%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq 0x30(%rsp), %rcx
cmpq 0x110(%rcx), %rax
je 0x66994
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x18(%rsp)
jmp 0x66966
jmp 0x66996
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x6693e
movq 0x30(%rsp), %rdi
movslq 0x4(%rsp), %rsi
callq 0x34da0
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x4d8(%rax)
movq 0x30(%rsp), %rax
movq 0x4d8(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
cmpl $0x7fed, 0xc(%rsp)      # imm = 0x7FED
jge 0x66a62
movq 0x30(%rsp), %rax
movq 0x148(%rax), %rax
movq 0x10(%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq 0x30(%rsp), %rcx
cmpq 0x110(%rcx), %rax
je 0x66a53
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdx
movq 0x10(%rsp), %rax
movl 0x8(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x8(%rsp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x18(%rsp)
jmp 0x66a0e
jmp 0x66a55
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x669e6
movq 0x30(%rsp), %rax
movq 0x4d8(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq 0x110(%rax), %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x4d8(%rax)
movq 0x20(%rsp), %rax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)