// File: /workspace/github_c_makefile_star2_O1/BernardTatin[P]s7sh/s7.c
// Function: g_make_vector_1
static s7_pointer g_make_vector_1(s7_scheme *sc, s7_pointer args, s7_pointer caller)
                {
                    s7_int len;
                    s7_pointer x, fill, vec, typf;
                    int32_t result_type = T_VECTOR;

                    fill = sc->unspecified;
                    typf = sc->T;
                    x = car(args);
                    if (s7_is_integer(x))
                    {
                        len = s7_integer(x);
                        if (len < 0)
                            return(wrong_type_argument_with_type(sc, caller, 1, x, a_non_negative_integer_string));
                    }
                    else
                    {
                        if (!(is_pair(x)))
                            return(method_or_bust_with_type(sc, x, caller, args, wrap_string(sc, "an integer or a list of integers", 32), 1));

                        if (!s7_is_integer(car(x)))
                            return(wrong_type_argument_with_type(sc, caller, 1, car(x), wrap_string(sc, "each dimension should be an integer", 35)));
                        if (is_null(cdr(x)))
                            len = s7_integer(car(x));
                        else len = multivector_length(sc, x, caller);
                    }

                    if (is_pair(cdr(args)))
                    {
                        fill = cadr(args);
                        if (caller == sc->make_int_vector_symbol)
                            result_type = T_INT_VECTOR;
                        else
                        {
                            if (caller == sc->make_float_vector_symbol)
                                result_type = T_FLOAT_VECTOR;
                            else
                            {
                                if (caller == sc->make_byte_vector_symbol)
                                    result_type = T_BYTE_VECTOR;
                            }
                        }
                        if (is_pair(cddr(args)))
                        {
                            typf = caddr(args);
                            if ((!is_c_function(typf)) &&
                                    (!is_any_closure(typf)) &&
                                    (typf != sc->T))
                                return(wrong_type_argument_with_type(sc, caller, 3, typf, wrap_string(sc, "a built-in procedure, a closure or #t", 37)));
                            if (is_any_closure(typf))
                            {
                                if (!is_symbol(find_closure(sc, typf, closure_let(typf))))
                                    return(wrong_type_argument_with_type(sc, caller, 3, typf, wrap_string(sc, "type function must have a name", 30)));
                            }
                            else
                            {
                                if (is_c_function(typf))
                                {
                                    if (typf == slot_value(global_slot(sc->is_float_symbol)))
                                        result_type = T_FLOAT_VECTOR;
                                    else
                                    {
                                        if (typf == slot_value(global_slot(sc->is_integer_symbol)))
                                            result_type = (WITH_GMP) ? T_VECTOR : T_INT_VECTOR;
                                        else
                                        {
                                            if (typf == slot_value(global_slot(sc->is_byte_symbol)))
                                                result_type = T_BYTE_VECTOR;
                                            else
                                            {
                                                s7_pointer sig;
                                                if (!c_function_name(typf))
                                                    return(wrong_type_argument_with_type(sc, caller, 3, typf, wrap_string(sc, "type procedure must have a name", 31)));
                                                if (!c_function_marker(typf))
                                                    c_function_set_marker(typf, mark_vector_1);
                                                if (!c_function_symbol(typf))
                                                    c_function_symbol(typf) = make_symbol(sc, c_function_name(typf));
                                                sig = c_function_signature(typf);
                                                if ((sig != sc->pl_bt) &&
                                                        (is_pair(sig)))
                                                {
                                                    if ((car(sig) != sc->is_boolean_symbol) || (cadr(sig) != sc->T) || (!is_null(cddr(sig))))
                                                        return(wrong_type_argument_with_type(sc, caller, 3, typf, wrap_string(sc, "type is not a boolean procedure", 31)));
                                                }}}}}}}}
                    /* before making the new vector, if fill is specified and the vector is typed, we have to check for a type error.
                     *    otherwise we can end up with a vector whose elements are NULL, causing a segfault in the  gc.
                     */
                    if ((result_type == T_VECTOR) &&  /* don't put this after the make_vector_1! */
                            (!s7_is_boolean(typf)) &&
                            (s7_apply_function(sc, typf, set_plist_1(sc, fill)) == sc->F))
                        s7_wrong_type_arg_error(sc, "make-vector", 3, fill,
                                (is_c_function(typf)) ? c_function_name(typf) : symbol_name(find_closure(sc, typf, closure_let(typf))));

                    vec = make_vector_1(sc, len, NOT_FILLED, result_type);

                    if ((result_type == T_VECTOR) &&
                            (!s7_is_boolean(typf)))
                    {
                        set_typed_vector(vec);
                        typed_vector_set_typer(vec, typf);

                        if ((is_c_function(typf)) &&
                                (c_function_has_simple_elements(typf)))
                            set_has_simple_elements(vec);
                    }

                    s7_vector_fill(sc, vec, fill);

                    if ((is_pair(x)) &&
                            (is_pair(cdr(x))))
                        return(make_multivector(sc, vec, x));

                    add_vector(sc, vec);
                    return(vec);
                }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %rbx
movq 0x118(%rdi), %r15
movq 0x130(%rdi), %r12
movq 0x8(%rsi), %r14
movzbl (%r14), %eax
cmpl $0x1, %eax
je 0x3ed85
cmpl $0xb, %eax
jne 0x3edb5
movq 0x8(%r14), %r8
testq %r8, %r8
jns 0x3ee68
movq 0x8(%r13), %rsi
movq 0x10fbec(%rip), %rdx    # 0x14e958
movq 0x140(%rbx), %r8
movq 0x11be5e(%rip), %r9     # 0x15abd8
movq %rbx, %rdi
movq %r14, %rcx
jmp 0x3ee51
movq 0x8(%r14), %rcx
cmpb $0xb, (%rcx)
jne 0x3ee0b
movq 0x10(%r14), %rax
cmpq 0x110(%rbx), %rax
je 0x3ee64
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0xa061f
movq %rax, %r8
jmp 0x3ee68
movq 0x820(%rbx), %rax
movslq 0x7dc(%rbx), %rcx
movq (%rax,%rcx,8), %r8
leal 0x1(%rcx), %eax
andl $0x7, %eax
movl %eax, 0x7dc(%rbx)
leaq 0xe124e(%rip), %rax     # 0x120028
movq %rax, 0x10(%r8)
movq $0x20, 0x8(%r8)
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %rbp, %rcx
movl $0x1, %r9d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf3da
movq 0x8(%r13), %rsi
movq 0x10fb42(%rip), %rdx    # 0x14e958
movq 0x140(%rbx), %r8
movq 0x820(%rbx), %rax
movslq 0x7dc(%rbx), %rdi
movq (%rax,%rdi,8), %r9
leal 0x1(%rdi), %eax
andl $0x7, %eax
movl %eax, 0x7dc(%rbx)
leaq 0xe1207(%rip), %rax     # 0x120049
movq %rax, 0x10(%r9)
movq $0x23, 0x8(%r9)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb31d
movq 0x8(%rcx), %r8
movq 0x10(%rbp), %rax
movl $0x15, %ebp
cmpb $0x1, (%rax)
jne 0x3f113
cmpq %r13, 0x12f0(%rbx)
je 0x3eea0
cmpq %r13, 0x12d8(%rbx)
je 0x3eea7
xorl %ecx, %ecx
cmpq %r13, 0x12d0(%rbx)
sete %cl
leal (%rcx,%rcx,2), %ebp
addl $0x15, %ebp
jmp 0x3eeac
movl $0x16, %ebp
jmp 0x3eeac
movl $0x17, %ebp
movq 0x8(%rax), %r12
movq 0x10(%rax), %rax
cmpb $0x1, (%rax)
jne 0x3f113
movq 0x8(%rax), %r15
movzbl (%r15), %eax
cmpq $0x2f, %rax
ja 0x3ef29
leaq 0x11bd0e(%rip), %rcx    # 0x15abe0
cmpb $0x0, (%rax,%rcx)
jne 0x3ef29
cmpq 0x118(%rbx), %r15
je 0x3ef29
movq 0x8(%r13), %rsi
movq 0x10fa7c(%rip), %rdx    # 0x14e968
movq 0x140(%rbx), %r8
movq 0x820(%rbx), %rax
movslq 0x7dc(%rbx), %rcx
movq (%rax,%rcx,8), %r9
leal 0x1(%rcx), %eax
andl $0x7, %eax
movl %eax, 0x7dc(%rbx)
leaq 0xe1155(%rip), %rax     # 0x12006d
movq %rax, 0x10(%r9)
movq $0x25, 0x8(%r9)
jmp 0x3f08e
leaq 0x11bcb0(%rip), %rcx    # 0x15abe0
cmpb $0x1, (%rax,%rcx)
jne 0x3ef5b
movq %r8, (%rsp)
movq 0x18(%r15), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa05a7
cmpb $0xa, (%rax)
jne 0x3f04b
movq (%rsp), %r8
jmp 0x3f113
cmpb $0x30, %al
jb 0x3f113
movq 0x11e0(%rbx), %rax
movq 0x10(%rax), %rax
cmpq 0x10(%rax), %r15
je 0x3f099
movq 0x10d0(%rbx), %rax
movq 0x10(%rax), %rax
cmpq 0x10(%rax), %r15
je 0x3f0a0
movq 0xfe0(%rbx), %rax
movq 0x10(%rax), %rax
cmpq 0x10(%rax), %r15
je 0x3f0a7
movq 0x8(%r15), %rax
cmpq $0x0, (%rax)
je 0x3f0b0
cmpq $0x0, 0x60(%rax)
jne 0x3efc2
leaq 0x22a87(%rip), %rcx     # 0x61a45
movq %rcx, 0x60(%rax)
movq 0x8(%r15), %rax
cmpq $0x0, 0x58(%rax)
jne 0x3efe8
movq (%rax), %rsi
movq %rbx, %rdi
movq %r8, (%rsp)
callq 0xaa9f
movq (%rsp), %r8
movq 0x8(%r15), %rcx
movq %rax, 0x58(%rcx)
movq 0x8(%r15), %rax
movq 0x38(%rax), %rdx
movb $0x1, %al
cmpq 0x1a20(%rbx), %rdx
je 0x3f0ae
cmpb $0x1, (%rdx)
jne 0x3f0ae
movq 0x8(%rdx), %rsi
leaq 0xe109f(%rip), %rcx     # 0x1200b2
cmpq 0xfd8(%rbx), %rsi
movq %r8, (%rsp)
jne 0x3f0bb
movq 0x10(%rdx), %rdx
movq 0x8(%rdx), %rsi
cmpq 0x118(%rbx), %rsi
jne 0x3f0bb
movq 0x10(%rdx), %rdx
cmpq 0x110(%rbx), %rdx
jne 0x3f0bb
jmp 0x3f107
movq 0x8(%r13), %rsi
movq 0x10f912(%rip), %rdx    # 0x14e968
movq 0x140(%rbx), %r8
movq 0x820(%rbx), %rax
movslq 0x7dc(%rbx), %rcx
movq (%rax,%rcx,8), %r9
leal 0x1(%rcx), %eax
andl $0x7, %eax
movl %eax, 0x7dc(%rbx)
leaq 0xe1011(%rip), %rax     # 0x120093
movq %rax, 0x10(%r9)
movq $0x1e, 0x8(%r9)
movq %rbx, %rdi
movq %r15, %rcx
jmp 0x3ee51
movl $0x17, %ebp
jmp 0x3f113
movl $0x16, %ebp
jmp 0x3f113
movl $0x18, %ebp
jmp 0x3f113
jmp 0x3f10b
movq %r8, (%rsp)
leaq 0xe59cf(%rip), %rcx     # 0x124a8a
movq 0x8(%r13), %rsi
movq 0x10f8a2(%rip), %rdx    # 0x14e968
movq 0x140(%rbx), %r8
movq 0x820(%rbx), %rax
movslq 0x7dc(%rbx), %rdi
movq (%rax,%rdi,8), %r9
leal 0x1(%rdi), %eax
andl $0x7, %eax
movl %eax, 0x7dc(%rbx)
movq %rcx, 0x10(%r9)
movq $0x1f, 0x8(%r9)
movq %rbx, %rdi
movq %r15, %rcx
callq 0xb31d
movq %rax, %r13
xorl %eax, %eax
movq (%rsp), %r8
testb %al, %al
je 0x3f2e3
cmpl $0x15, %ebp
jne 0x3f18a
cmpb $0x7, (%r15)
je 0x3f18a
movq 0x700(%rbx), %rax
movq %r12, 0x8(%rax)
movq 0x700(%rbx), %rdx
movq %rbx, %rdi
movq %r15, %rsi
movq %r8, %r13
callq 0xbd41
movq %r13, %r8
cmpq 0x120(%rbx), %rax
jne 0x3f18a
cmpb $0x30, (%r15)
jb 0x3f156
movq 0x8(%r15), %rax
jmp 0x3f16d
movq 0x18(%r15), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa05a7
movq 0x8(%rax), %rax
addq $0x10, %rax
movq (%rax), %r8
leaq 0xdc184(%rip), %rsi     # 0x11b2fb
movl $0x3, %edx
movq %rbx, %rdi
movq %r12, %rcx
callq 0xe25f
movq %r13, %r8
movq %rbx, %rdi
movq %r8, %rsi
xorl %edx, %edx
movl %ebp, %ecx
callq 0x3ccdf
movq %rax, %r13
cmpl $0x15, %ebp
jne 0x3f1d1
cmpb $0x7, (%r15)
je 0x3f1d1
movzwl 0x6(%r13), %eax
movl %eax, %ecx
orl $0x2, %ecx
movw %cx, 0x6(%r13)
movq %r15, 0x28(%r13)
cmpb $0x30, (%r15)
jb 0x3f1d1
testb $0x1, 0x7(%r15)
je 0x3f1d1
orl $0x102, %eax            # imm = 0x102
movw %ax, 0x6(%r13)
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x3d67b
cmpb $0x1, (%r14)
jne 0x3f2a8
movq 0x10(%r14), %rax
cmpb $0x1, (%rax)
jne 0x3f2a8
movq $-0x1, %r15
movl $0x1, %r12d
xorl %ebp, %ebp
xorl %esi, %esi
movq %r14, %rax
movq 0x10(%rax), %rax
addq $0x2, %r15
incq %r12
addq $0x10, %rsi
addq $0x8, %rbp
cmpb $0x1, (%rax)
je 0x3f20a
movq %rbx, %rdi
callq 0xa305
leaq -0x1(%r12), %rcx
movq %rcx, 0x10(%rax)
movq (%rax), %rcx
addq %rcx, %rbp
movq %rbp, 0x18(%rax)
movb $0x0, 0xc(%rax)
movq 0x110(%rbx), %rdx
cmpq %r14, %rdx
je 0x3f271
movq %rcx, %rsi
movq 0x8(%r14), %rdi
cmpb $0xb, (%rdi)
jne 0x3f25f
movq 0x8(%rdi), %rdi
jmp 0x3f261
xorl %edi, %edi
movq %rdi, (%rsi)
movq 0x10(%r14), %r14
addq $0x8, %rsi
cmpq %rdx, %r14
jne 0x3f250
movl $0x1, %edx
movq %rdx, (%rcx,%r15,8)
imulq -0x10(%rcx,%r12,8), %rdx
decq %r12
decq %r15
cmpq $0x1, %r12
jg 0x3f276
movq 0x120(%rbx), %rcx
movq %rcx, 0x20(%rax)
movq 0x18(%r13), %rcx
movq %rax, 0x20(%rcx)
movq 0x790(%rbx), %rbx
jmp 0x3f2af
movq 0x740(%rbx), %rbx
movq 0x8(%rbx), %rsi
cmpq %rsi, 0x10(%rbx)
jne 0x3f2d0
leaq (%rsi,%rsi), %rax
movq %rax, 0x8(%rbx)
movq (%rbx), %rdi
shlq $0x4, %rsi
callq 0x9510
movq %rax, (%rbx)
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%rbx)
movq %r13, (%rax,%rcx,8)
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq