// File: /workspace/github_c_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r12
movq %rdx, %r14
movq %rdi, %rbx
cmpb $0x1c, (%rsi)
jne 0xab08
cmpq %rsi, 0x150(%rbx)
je 0xab08
movq %rbx, %rdi
movq %r14, %rdx
movq %r12, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb169
movq 0x150(%rbx), %rax
testb $0x1, 0x3(%rax)
jne 0xab81
cmpq $0x0, 0x6a0(%rbx)
jne 0xab3c
movzbl (%r12), %eax
leaq 0x143de5(%rip), %rcx    # 0x14e910
cmpb $0x1, (%rax,%rcx)
jne 0xab3c
movq %rbx, %rdi
movq %r12, %rsi
callq 0xad1c
movq 0x10(%r14), %r15
cmpb $0x20, (%r15)
jne 0xabf6
incl 0x28(%r14)
movq 0x200(%rbx), %rax
movq 0x18e0(%rbx), %rsi
movq 0x18(%rax), %rdx
movq %rbx, %rdi
callq 0xcd2c
cmpb $0x1, (%rax)
jne 0xad13
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xadbc
jmp 0xabe4
movq 0x820(%rbx), %rax
movslq 0x7dc(%rbx), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%rbx)
leaq 0x108355(%rip), %rcx    # 0x112efa
movq %rcx, 0x10(%rax)
movq $0x26, 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 0xea8(%rbx), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3b366
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movabsq $0x4000000000000020, %r13 # imm = 0x4000000000000020
movq 0x150(%rbx), %rbp
movq %rbx, %rdi
callq 0xfa3b
movq %rax, %r15
movq %r13, (%rax)
movq %r14, 0x8(%rax)
movq %r12, 0x10(%rax)
movq 0x10(%rbp), %rax
movq 0x160(%rbx), %rcx
leaq 0x1(%rcx), %rsi
movq %rsi, 0x160(%rbx)
movq %r15, (%rax,%rcx,8)
movq 0x8(%rbp), %rdx
cmpq %rdx, %rsi
jl 0xac8e
leaq (%rdx,%rdx), %r13
movq %r13, 0x8(%rbp)
movq 0x18(%rbp), %rsi
shlq $0x4, %rdx
movq %rbx, %rdi
callq 0xae0f
movq $0x0, 0x20(%rax)
movq %rax, 0x18(%rbp)
movq (%rax), %rax
movq %rax, 0x10(%rbp)
movq 0x160(%rbx), %rax
cmpq %r13, %rax
jge 0xac8e
movq 0x110(%rbx), %rcx
movq 0x10(%rbp), %rdx
movq %rcx, (%rdx,%rax,8)
incq %rax
cmpq %rax, %r13
jne 0xac77
movq %r15, 0x10(%r14)
cmpq $0x0, 0x20(%r14)
jne 0xacf4
testb $0x20, 0x3(%r14)
jne 0xacde
movq 0x8(%r14), %rax
movq 0x20(%rax), %rax
movq 0x20(%rax), %rax
cmpq 0x128(%rbx), %rax
jne 0xacde
movq %rbx, %rdi
callq 0xfa3b
movabsq $0x4000000000000020, %rcx # imm = 0x4000000000000020
movq %rcx, (%rax)
movq %r14, 0x8(%rax)
movq %r12, 0x10(%rax)
movq 0x8(%r14), %rcx
movq 0x20(%rcx), %rcx
movq %rax, 0x20(%rcx)
movq %r15, 0x18(%r14)
movq (%r14), %rax
btl $0x14, %eax
jb 0xacf4
orq $0x10000, %rax          # imm = 0x10000
movq %rax, (%r14)
incl 0x28(%r14)
testb $0x20, 0x3(%r14)
je 0xabe4
movq %rbx, %rdi
movq %r14, %rsi
callq 0xae85
jmp 0xabe4
movq %r12, 0x10(%r15)
jmp 0xabe4