// File: /workspace/github_c_makefile_star2_O1/BernardTatin[P]s7sh/s7.c
// Function: g_make_int_vector
static s7_pointer g_make_int_vector(s7_scheme *sc, s7_pointer args)
                {
#define H_make_int_vector "(make-int-vector len (init 0)) returns an int-vector."
#define Q_make_int_vector s7_make_signature(sc, 3, sc->is_int_vector_symbol, s7_make_signature(sc, 2, sc->is_integer_symbol, sc->is_pair_symbol), sc->is_integer_symbol)

                    s7_int len;
                    s7_pointer x, p;
                    block_t *arr;

                    p = car(args);
                    if ((is_pair(cdr(args))) ||
                            (!s7_is_integer(p)))
                    {
                        s7_pointer init;
                        if (is_pair(cdr(args)))
                        {
                            init = cadr(args);
                            if (!s7_is_integer(init))
                                return(method_or_bust(sc, init, sc->make_int_vector_symbol, args, T_INTEGER, 2));
                        }
                        else init = small_int(0);
                        if (s7_is_integer(p))
                            len = s7_integer(p);
                        else
                        {
                            if (!is_pair(p))
                                return(method_or_bust_with_type(sc, p, sc->make_int_vector_symbol, args, wrap_string(sc, "an integer or a list of integers", 32), 1));
                            len = multivector_length(sc, p, sc->make_int_vector_symbol);
                        }
                        x = make_vector_1(sc, len, NOT_FILLED, T_INT_VECTOR);
                        int_vector_fill(sc, x, s7_integer(init));
                        if (s7_is_integer(p))
                        {
                            add_vector(sc, x);
                            return(x);
                        }
                        return(make_multivector(sc, x, p));
                    }

                    len = s7_integer(p);
                    if (len < 0)
                        return(wrong_type_argument_with_type(sc, sc->make_int_vector_symbol, 1, p, a_non_negative_integer_string));
                    if (len > sc->max_vector_length)
                        return(out_of_range(sc, sc->make_int_vector_symbol, small_int(1), p, its_too_large_string));

                    arr = mallocate_vector(sc, len * sizeof(s7_int));
                    new_cell(sc, x, T_INT_VECTOR | T_SAFE_PROCEDURE);
                    vector_length(x) = len;
                    vector_block(x) = arr;
                    int_vector_ints(x) = (s7_int *)block_data(arr);
                    if (len > 0)
                    {
                        if (STEP_8(len))
                            memclr64((void *)int_vector_ints(x), len * sizeof(s7_int));
                        else memclr((void *)int_vector_ints(x), len * sizeof(s7_int));
                    }
                    vector_set_dimension_info(x, NULL);
                    vector_getter(x) = int_vector_getter;
                    vector_setter(x) = int_vector_setter;

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

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rcx
movq %rdi, %rbx
movq 0x8(%rsi), %r15
movq 0x10(%rsi), %rax
movb (%rax), %dl
cmpb $0x1, %dl
jne 0x81521
movq 0x8(%rax), %r12
cmpb $0xb, (%r12)
je 0x815af
movq 0x12f0(%rbx), %rdx
movq %rbx, %rdi
movq %r12, %rsi
movl $0xb, %r8d
movl $0x2, %r9d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xf1ae
cmpb $0xb, (%r15)
jne 0x8159f
movq 0x8(%r15), %r13
testq %r13, %r13
js 0x8171a
cmpq 0x2a0(%rbx), %r13
jle 0x8174e
movq 0x12f0(%rbx), %rax
movq 0x8(%rax), %rax
movq 0xcd405(%rip), %rcx     # 0x14e958
movq 0xd14e6(%rip), %rdx     # 0x152a40
movq 0x1ee8(%rbx), %rsi
movq 0x10(%rsi), %rsi
movq %rax, 0x8(%rsi)
movq 0x10(%rsi), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rax), %rax
movq %r15, 0x8(%rax)
movq 0x10(%rax), %rax
movq %rdx, 0x8(%rax)
movq 0x1948(%rbx), %r14
movq 0x1ee8(%rbx), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3b366
jmp 0x818c7
cmpb $0x1, %dl
je 0x814eb
movq 0xcd3a1(%rip), %r12     # 0x14e950
movzbl (%r15), %eax
cmpl $0x1, %eax
je 0x815c7
cmpl $0xb, %eax
jne 0x816c8
movq 0x8(%r15), %rsi
jmp 0x815dc
movq 0x12f0(%rbx), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa061f
movq %rax, %rsi
xorl %r13d, %r13d
movq %rbx, %rdi
xorl %edx, %edx
movl $0x16, %ecx
callq 0x3ccdf
movq %rax, %r14
cmpb $0xb, (%r12)
jne 0x815fd
movq 0x8(%r12), %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0xa0344
movzbl (%r15), %eax
cmpl $0xb, %eax
je 0x8188c
xorl %r13d, %r13d
cmpl $0x1, %eax
jne 0x8162c
movq %r15, %rax
incq %r13
movq 0x10(%rax), %rax
cmpb $0x1, (%rax)
je 0x81620
movq %r13, %r12
shlq $0x4, %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0xa305
movq %r13, 0x10(%rax)
movq (%rax), %rcx
leaq (%rcx,%r13,8), %rdx
movq %rdx, 0x18(%rax)
movb $0x0, 0xc(%rax)
movq 0x110(%rbx), %rdx
cmpq %r15, %rdx
je 0x81681
movq %rcx, %rsi
movq 0x8(%r15), %rdi
cmpb $0xb, (%rdi)
jne 0x8166f
movq 0x8(%rdi), %rdi
jmp 0x81671
xorl %edi, %edi
movq %rdi, (%rsi)
movq 0x10(%r15), %r15
addq $0x8, %rsi
cmpq %rdx, %r15
jne 0x81660
testq %r13, %r13
jle 0x816a9
incq %r13
addq $-0x8, %r12
movl $0x1, %edx
movq %rdx, (%rcx,%r12)
imulq -0x10(%rcx,%r13,8), %rdx
decq %r13
addq $-0x8, %r12
cmpq $0x1, %r13
jg 0x81692
movq 0x120(%rbx), %rcx
movq %rcx, 0x20(%rax)
movq 0x18(%r14), %rcx
movq %rax, 0x20(%rcx)
movq 0x790(%rbx), %rbx
jmp 0x81893
movq 0x12f0(%rbx), %rdx
movq 0x820(%rbx), %rax
movslq 0x7dc(%rbx), %rsi
movq (%rax,%rsi,8), %r8
leal 0x1(%rsi), %eax
andl $0x7, %eax
movl %eax, 0x7dc(%rbx)
leaq 0x9e934(%rip), %rax     # 0x120028
movq %rax, 0x10(%r8)
movq $0x20, 0x8(%r8)
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %r9d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xf3da
movq 0x12f0(%rbx), %rax
movq 0x8(%rax), %rsi
movq 0xcd22c(%rip), %rdx     # 0x14e958
movq 0x140(%rbx), %r8
movq 0xd949e(%rip), %r9      # 0x15abd8
movq %rbx, %rdi
movq %r15, %rcx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xb31d
leaq (,%r13,8), %r15
testq %r15, %r15
jle 0x8176b
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa305
movq %rax, %r12
jmp 0x817d8
cmpq $0x0, 0x838(%rbx)
jne 0x817b1
movl $0x2800, %edi           # imm = 0x2800
callq 0x9480
movq %rax, 0x838(%rbx)
addq $0x28, %rax
movl $0xff, %ecx
movq %rax, -0x10(%rax)
movl $0x0, -0x20(%rax)
addq $0x28, %rax
decl %ecx
jne 0x8178f
movq $0x0, -0x10(%rax)
movl $0x0, -0x20(%rax)
movq 0x838(%rbx), %r12
movq 0x18(%r12), %rax
movq %rax, 0x838(%rbx)
movl $0x0, 0x8(%r12)
xorl %eax, %eax
movq %rax, (%r12)
movq %rax, 0x20(%r12)
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x817f0
movq %rbx, %rdi
callq 0xb389
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %r14
movq $0x200016, (%r14)       # imm = 0x200016
movq %r13, 0x8(%r14)
movq %r12, 0x18(%r14)
movq (%r12), %rdi
movq %rdi, 0x10(%r14)
testq %r13, %r13
je 0x8186a
testb $0x7, %r13b
je 0x81834
testq %r15, %r15
je 0x8186a
xorl %esi, %esi
movq %r15, %rdx
jmp 0x81865
testq %r15, %r15
je 0x8186a
movabsq $0x1ffffffffffffff8, %rax # imm = 0x1FFFFFFFFFFFFFF8
andq %rax, %r13
cmpq $0x9, %r13
movl $0x8, %eax
cmovaeq %r13, %rax
leaq -0x8(,%rax,8), %rdx
andq $-0x40, %rdx
addq $0x40, %rdx
xorl %esi, %esi
callq 0x9270
movq 0x18(%r14), %rax
movq $0x0, 0x20(%rax)
leaq 0x1e884(%rip), %rax     # 0xa0101
movq %rax, 0x20(%r14)
leaq 0x1e8df(%rip), %rax     # 0xa0167
movq %rax, 0x28(%r14)
movq 0x740(%rbx), %rbx
movq 0x8(%rbx), %rsi
cmpq %rsi, 0x10(%rbx)
jne 0x818b4
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 %r14, (%rax,%rcx,8)
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq