// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: s7_make_slot
s7_pointer s7_make_slot(s7_scheme *sc, s7_pointer env, s7_pointer symbol, s7_pointer value)
    {
        if ((!is_let(env)) ||
                (env == sc->rootlet))
        {
            s7_pointer ge, slot;
            if (is_immutable(sc->rootlet))
                return(immutable_object_error(sc, set_elist_2(sc, wrap_string(sc, "can't define '~S; rootlet is immutable", 38), symbol)));
            if ((sc->safety == NO_SAFETY) &&
                    (has_closure_let(value)))
                remove_function_from_heap(sc, value);

            /* first look for existing slot -- this is not always checked before calling s7_make_slot */
            if (is_slot(global_slot(symbol)))
            {
                slot = global_slot(symbol);
                symbol_increment_ctr(symbol);
                slot_set_value_with_hook(slot, value);
                return(slot);
            }

            ge = sc->rootlet;
            slot = make_permanent_slot(sc, symbol, value);
            rootlet_element(ge, sc->rootlet_entries++) = slot;
            if (sc->rootlet_entries >= vector_length(ge))
            {
                s7_int i, len;
                block_t *ob, *nb;
                vector_length(ge) *= 2;
                len = vector_length(ge);
                ob = rootlet_block(ge);
                nb = reallocate(sc, ob, len * sizeof(s7_pointer));
                block_info(nb) = NULL;
                rootlet_block(ge) = nb;
                rootlet_elements(ge) = (s7_pointer *)block_data(nb);
                for (i = sc->rootlet_entries; i < len; i++)
                    rootlet_element(ge, i) = sc->nil;
            }
            set_global_slot(symbol, slot);

            if (symbol_id(symbol) == 0)    /* never defined locally? */
            {
                if (!is_gensym(symbol))
                {
                    if (initial_slot(symbol) == sc->undefined)
                        set_initial_slot(symbol, make_permanent_slot(sc, symbol, value));
                }
                set_local_slot(symbol, slot);
                set_global(symbol);
            }
            symbol_increment_ctr(symbol);
            if (is_gensym(symbol))
                s7_remove_from_heap(sc, symbol);
            return(slot);
        }

        return(make_slot_1(sc, env, symbol, value));
        /* there are about the same number of frames as local variables -- this strikes me as surprising, but it holds up across a lot of code. */
    }

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movq %rdx, 0x48(%rsp)
movq %rcx, 0x40(%rsp)
movq 0x50(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1c, %eax
jne 0xb48c
movq 0x50(%rsp), %rax
movq 0x58(%rsp), %rcx
cmpq 0x150(%rcx), %rax
jne 0xb7d0
movq 0x58(%rsp), %rax
movq 0x150(%rax), %rax
movq (%rax), %rax
andq $0x1000000, %rax        # imm = 0x1000000
cmpq $0x0, %rax
je 0xb4f8
movq 0x58(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%rsp), %rax
movq %rax, (%rsp)
movq 0x58(%rsp), %rdi
leaq 0x1d662c(%rip), %rsi    # 0x1e1af2
movl $0x26, %edx
callq 0xb880
movq (%rsp), %rdi
movq %rax, %rsi
movq 0x48(%rsp), %rdx
callq 0xb830
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0xb800
movq %rax, 0x60(%rsp)
jmp 0xb7ee
movq 0x58(%rsp), %rax
cmpq $0x0, 0x6a0(%rax)
jne 0xb52d
movq 0x40(%rsp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x20af28(%rip), %rax    # 0x216440
testb $0x1, (%rax,%rcx)
je 0xb52d
movq 0x58(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0xb8f0
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movzbl (%rax), %eax
cmpl $0x20, %eax
jne 0xb5ad
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x48(%rsp), %rax
movl 0x28(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x28(%rax)
movq 0x58(%rsp), %rdi
movq 0x58(%rsp), %rax
movq 0x200(%rax), %rsi
callq 0xba20
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0xb58e
movq 0x58(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x40(%rsp), %rdx
callq 0xba60
jmp 0xb59c
movq 0x40(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x10(%rax)
jmp 0xb59e
movq 0x30(%rsp), %rax
movq %rax, 0x60(%rsp)
jmp 0xb7ee
movq 0x58(%rsp), %rax
movq 0x150(%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x58(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x40(%rsp), %rdx
callq 0xbb00
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdx
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x58(%rsp), %rsi
movq 0x160(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x160(%rsi)
movq %rdx, (%rax,%rcx,8)
movq 0x58(%rsp), %rax
movq 0x160(%rax), %rax
movq 0x38(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jl 0xb6e0
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rcx
shlq %rcx
movq %rcx, 0x8(%rax)
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x38(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x58(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
shlq $0x3, %rdx
callq 0xbb60
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq $0x0, 0x20(%rax)
movq 0x10(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x58(%rsp), %rax
movq 0x160(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
cmpq 0x20(%rsp), %rax
jge 0xb6de
movq 0x58(%rsp), %rax
movq 0x110(%rax), %rdx
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x28(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0xb6a4
jmp 0xb6e0
movq 0x30(%rsp), %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x48(%rsp), %rax
cmpq $0x0, 0x20(%rax)
jne 0xb793
movq 0x48(%rsp), %rax
movq (%rax), %rax
andq $0x20000000, %rax       # imm = 0x20000000
cmpq $0x0, %rax
jne 0xb75b
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rax), %rax
movq 0x20(%rax), %rax
movq 0x58(%rsp), %rcx
cmpq 0x128(%rcx), %rax
jne 0xb759
movq 0x58(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x40(%rsp), %rdx
callq 0xbb00
movq %rax, %rcx
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rax), %rax
movq %rcx, 0x20(%rax)
jmp 0xb75b
movq 0x30(%rsp), %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x48(%rsp), %rax
movq (%rax), %rax
andq $0x100000, %rax         # imm = 0x100000
cmpq $0x0, %rax
jne 0xb78f
movq 0x48(%rsp), %rax
movq (%rax), %rcx
orq $0x10000, %rcx          # imm = 0x10000
movq %rcx, (%rax)
jmp 0xb791
jmp 0xb793
movq 0x48(%rsp), %rax
movl 0x28(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x28(%rax)
movq 0x48(%rsp), %rax
movq (%rax), %rax
andq $0x20000000, %rax       # imm = 0x20000000
cmpq $0x0, %rax
je 0xb7c4
movq 0x58(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0xbbd0
movq 0x30(%rsp), %rax
movq %rax, 0x60(%rsp)
jmp 0xb7ee
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq 0x48(%rsp), %rdx
movq 0x40(%rsp), %rcx
callq 0xbec0
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
addq $0x68, %rsp
retq
nopl (%rax,%rax)