// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: make_vector_1
static s7_pointer make_vector_1(s7_scheme *sc, s7_int len, bool filled, uint8_t typ)
                {
                    s7_pointer x;

                    if (len < 0)
                        return(wrong_type_argument_with_type(sc, sc->make_vector_symbol, 1, wrap_integer1(sc, len), a_non_negative_integer_string));
                    if (len > sc->max_vector_length)
                        return(out_of_range(sc, sc->make_vector_symbol, small_int(1), wrap_integer1(sc, len), its_too_large_string));

                    /* this has to follow the error checks! (else garbage in free_heap temps portion confuses GC when "vector" is finalized) */

                    new_cell(sc, x, typ | T_SAFE_PROCEDURE);
                    vector_length(x) = len;
                    if (len == 0)
                    {
                        vector_block(x) = mallocate_vector(sc, 0);
                        vector_elements(x) = NULL;
                        if (typ == T_VECTOR) set_has_simple_elements(x);
                    }
                    else
                    {
                        block_t *b;
                        if (typ == T_VECTOR)
                        {
                            b = mallocate_vector(sc, len * sizeof(s7_pointer));
                            vector_block(x) = b;
                            vector_elements(x) = (s7_pointer *)block_data(b);
                            vector_getter(x) = default_vector_getter;
                            vector_setter(x) = default_vector_setter;
                            if (filled)
                                s7_vector_fill(sc, x, sc->nil);
                        }
                        else
                        {
                            if (typ == T_FLOAT_VECTOR)
                            {
                                b = mallocate_vector(sc, len * sizeof(s7_double));
                                vector_block(x) = b;
                                float_vector_floats(x) = (s7_double *)block_data(b);
                                if (filled)
                                {
                                    if (STEP_8(len))
                                        memclr64((void *)vector_elements(x), len * sizeof(s7_double));
                                    else memclr((void *)vector_elements(x), len * sizeof(s7_double));
                                }
                                vector_getter(x) = float_vector_getter;
                                vector_setter(x) = float_vector_setter;
                            }
                            else
                            {
                                if (typ == T_INT_VECTOR)
                                {
                                    b = mallocate_vector(sc, len * sizeof(s7_int));
                                    vector_block(x) = b;
                                    int_vector_ints(x) = (s7_int *)block_data(b);
                                    if (filled)
                                    {
                                        if (STEP_8(len))
                                            memclr64((void *)vector_elements(x), len * sizeof(s7_int));
                                        else memclr((void *)vector_elements(x), len * sizeof(s7_int));
                                    }
                                    vector_getter(x) = int_vector_getter;
                                    vector_setter(x) = int_vector_setter;
                                }
                                else
                                {
#if S7_DEBUGGING
                                    if (typ != T_BYTE_VECTOR)
                                        fprintf(stderr, "%s: typ=%d\n", __func__, (int)typ);
#endif
                                    b = mallocate(sc, len);
                                    vector_block(x) = b;
                                    byte_vector_bytes(x) = (uint8_t *)block_data(b);
                                    vector_getter(x) = byte_vector_getter;
                                    vector_setter(x) = byte_vector_setter;
                                    if (filled)
                                    {
                                        if (STEP_8(len))
                                            memclr64((void *)(byte_vector_bytes(x)), len);
                                        else memclr((void *)(byte_vector_bytes(x)), len);
                                    }}}}}
                    vector_set_dimension_info(x, NULL);
                    return(x);
                }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
testq %rsi, %rsi
js 0x2e4f9
cmpq %r14, 0x2a0(%r15)
jge 0x2e53b
movq 0x1318(%r15), %rax
movq 0x8(%rax), %rsi
movq 0xe7488(%rip), %rdx     # 0x115958
movq 0x1f00(%r15), %rax
movq %r14, 0x8(%rax)
movq 0x1f00(%r15), %rcx
movq 0xeb557(%rip), %r8      # 0x119a40
movq %r15, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xcb8f
movq 0x1318(%r15), %rax
movq 0x8(%rax), %rsi
movq 0xe744d(%rip), %rdx     # 0x115958
movq 0x1f00(%r15), %rax
movq %r14, 0x8(%rax)
movq 0x1f00(%r15), %rcx
movq 0x140(%r15), %r8
movq 0xf36ad(%rip), %r9      # 0x121bd8
movq %r15, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x9bbb
movl %ecx, %r12d
movl %edx, %ebp
movq 0x90(%r15), %rax
cmpq 0x98(%r15), %rax
ja 0x2e55f
movq %r15, %rdi
callq 0x9c27
movq 0x90(%r15), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%r15)
movq -0x8(%rax), %rbx
movzbl %r12b, %eax
leaq 0x200000(%rax), %rcx
movq %rcx, (%rbx)
movq %r14, 0x8(%rbx)
testq %r14, %r14
je 0x2e5ed
cmpb $0x17, %r12b
je 0x2e64a
cmpl $0x16, %eax
je 0x2e613
cmpl $0x15, %eax
jne 0x2e67d
shlq $0x3, %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x2e974
movq %rax, 0x18(%rbx)
movq (%rax), %rax
movq %rax, 0x10(%rbx)
leaq 0x1b386(%rip), %rax     # 0x49944
movq %rax, 0x20(%rbx)
leaq 0x1b384(%rip), %rax     # 0x4994d
movq %rax, 0x28(%rbx)
testb %bpl, %bpl
je 0x2e6f2
movq 0x110(%r15), %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2ea29
jmp 0x2e6f2
movq %r15, %rdi
xorl %esi, %esi
callq 0x2e974
movq %rax, 0x18(%rbx)
andq $0x0, 0x10(%rbx)
cmpb $0x15, %r12b
jne 0x2e6f2
orb $0x1, 0x7(%rbx)
jmp 0x2e6f2
leaq (,%r14,8), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x2e974
movq %rax, 0x18(%rbx)
movq (%rax), %rdi
movq %rdi, 0x10(%rbx)
testb %bpl, %bpl
je 0x2e6c3
movq %r12, %rsi
testb $0x7, %r14b
je 0x2e6be
callq 0x78377
jmp 0x2e6c3
leaq (,%r14,8), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x2e974
movq %rax, 0x18(%rbx)
movq (%rax), %rdi
movq %rdi, 0x10(%rbx)
testb %bpl, %bpl
je 0x2e6dc
movq %r12, %rsi
testb $0x7, %r14b
je 0x2e6d7
callq 0x78377
jmp 0x2e6dc
movq %r15, %rdi
movq %r14, %rsi
callq 0x9037
movq %rax, 0x18(%rbx)
movq (%rax), %rdi
movq %rdi, 0x10(%rbx)
leaq 0x4c87e(%rip), %rax     # 0x7af18
movq %rax, 0x20(%rbx)
leaq 0x4c887(%rip), %rax     # 0x7af2c
movq %rax, 0x28(%rbx)
testb %bpl, %bpl
je 0x2e6f2
movq %r14, %rsi
testb $0x7, %r14b
je 0x2e707
callq 0x78377
jmp 0x2e6f2
callq 0x7ae55
leaq 0x4c7b3(%rip), %rax     # 0x7ae7d
movq %rax, 0x20(%rbx)
leaq 0x4c80e(%rip), %rax     # 0x7aee3
jmp 0x2e6ee
callq 0x7ae55
leaq 0x2ab(%rip), %rax       # 0x2e98e
movq %rax, 0x20(%rbx)
leaq 0x2fd(%rip), %rax       # 0x2e9eb
movq %rax, 0x28(%rbx)
movq 0x18(%rbx), %rax
andq $0x0, 0x20(%rax)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x7ae55
jmp 0x2e6f2