// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: int_vector_to_port
static void int_vector_to_port(s7_scheme *sc, s7_pointer vect, s7_pointer port, use_write_t use_write, shared_info *ignored)
    {
        s7_int i, len, plen;
        bool too_long;
        char buf[128];
        char *p;

        len = print_vector_length(sc, vect, port, use_write);
        if (len < 0) return;
        too_long = (len < vector_length(vect));

        if ((use_write == P_READABLE) &&
                (is_immutable_vector(vect)))
            port_write_string(port)(sc, "(immutable! ", 12, port);

        if (len > 1000)
        {
            s7_int vlen;
            s7_int first;
            s7_int *els;
            vlen = vector_length(vect);
            els = int_vector_ints(vect);
            first = els[0];
            for (i = 1; i < vlen; i++)
                if (els[i] != first)
                    break;
            if (i == vlen)
            {
                make_vector_to_port(sc, vect, port);
                p = integer_to_string(sc, int_vector(vect, 0), &plen);
                port_write_string(port)(sc, p, plen, port);
                port_write_character(port)(sc, ')', port);
                if ((use_write == P_READABLE) &&
                        (is_immutable_vector(vect)))
                    port_write_character(port)(sc, ')', port);
                return;
            }
        }

        if (vector_rank(vect) == 1)
        {
            port_write_string(port)(sc, "#i(", 3, port);
            if (!is_string_port(port))
            {
                p = integer_to_string(sc, int_vector(vect, 0), &plen);
                port_write_string(port)(sc, p, plen, port);
                for (i = 1; i < len; i++)
                {
                    plen = catstrs_direct(buf, " ", integer_to_string_no_length(sc, int_vector(vect, i)), NULL);
                    port_write_string(port)(sc, buf, plen, port);
                }
            }
            else
            {
                /* an experiment */
                s7_int new_len, next_len;
                uint8_t *dbuf;
                new_len = port_position(port);
                next_len = port_data_size(port) - 128;
                dbuf = port_data(port);

                if (new_len >= next_len)
                {
                    resize_port_data(sc, port, port_data_size(port) * 2);
                    next_len = port_data_size(port) - 128;
                    dbuf = port_data(port);
                }
                p = integer_to_string(sc, int_vector(vect, 0), &plen);
                memcpy((void *)(dbuf + new_len), (void *)p, plen);
                new_len += plen;
                for (i = 1; i < len; i++)
                {
                    if (new_len >= next_len)
                    {
                        resize_port_data(sc, port, port_data_size(port) * 2);
                        next_len = port_data_size(port) - 128;
                        dbuf = port_data(port);
                    }
                    plen = catstrs_direct(buf, " ", integer_to_string_no_length(sc, int_vector(vect, i)), NULL);
                    memcpy((void *)(dbuf + new_len), (void *)buf, plen);
                    new_len += plen;
                }
                port_position(port) = new_len;
            }

            if (too_long)
                port_write_string(port)(sc, " ...)", 5, port);
            else port_write_character(port)(sc, ')', port);
        }
        else
        {
            bool last = false;
            plen = catstrs_direct(buf, "#i", pos_int_to_str_direct(sc, vector_ndims(vect)), "d", NULL);
            port_write_string(port)(sc, buf, plen, port);
            multivector_to_port(sc, vect, port, len, 0, 0, vector_ndims(vect), &last, P_DISPLAY, NULL);
        }

        if ((use_write == P_READABLE) &&
                (is_immutable_vector(vect)))
            port_write_character(port)(sc, ')', port);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movl %ecx, %r13d
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
callq 0xc1eec
testl %eax, %eax
js 0xbd062
movl %eax, %ebp
movq %r14, (%rsp)
movq 0x8(%r14), %r14
cmpl $0x2, %r13d
jne 0xbccd6
movq (%rsp), %rax
testb $0x1, 0x3(%rax)
je 0xbccd6
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
leaq 0x25e1a(%rip), %rsi     # 0xe2ae4
pushq $0xc
popq %rdx
movq %r12, %rdi
movq %rbx, %rcx
callq *0x10(%rax)
cmpl $0x3e9, %ebp            # imm = 0x3E9
jb 0xbcdad
movq (%rsp), %rcx
movq 0x8(%rcx), %rax
movq 0x10(%rcx), %rdx
movq (%rdx), %rsi
cmpq $0x2, %rax
pushq $0x1
popq %rdi
movq %rdi, %rcx
cmovgeq %rax, %rcx
cmpq %rax, %rdi
jge 0xbcd12
cmpq %rsi, (%rdx,%rdi,8)
jne 0xbcd0f
incq %rdi
jmp 0xbccff
movq %rdi, %rcx
cmpq %rax, %rcx
jne 0xbcdad
movq %r12, %rdi
movq (%rsp), %r15
movq %r15, %rsi
movq %rbx, %rdx
callq 0xc2073
movq 0x10(%r15), %rax
movq (%rax), %rsi
leaq 0x8(%rsp), %r14
movq %r12, %rdi
movq %r14, %rdx
callq 0x73b88
movq 0x8(%rbx), %rcx
movq 0x48(%rcx), %r8
movq (%r14), %rdx
movq %r12, %rdi
movq %rax, %rsi
movq %rbx, %rcx
callq *0x10(%r8)
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
pushq $0x29
popq %rsi
movq %r12, %rdi
movq %rbx, %rdx
callq *0x8(%rax)
cmpl $0x2, %r13d
jne 0xbd062
testb $0x1, 0x3(%r15)
je 0xbd062
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
pushq $0x29
popq %rsi
movq %r12, %rdi
movq %rbx, %rdx
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
movq (%rsp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
testq %rax, %rax
je 0xbcdcc
movq 0x10(%rax), %rsi
cmpq $0x1, %rsi
jne 0xbcfc2
movq %r14, 0x28(%rsp)
movl %r13d, 0x14(%rsp)
movslq %ebp, %rax
movq %rax, 0x20(%rsp)
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
leaq 0x2972a(%rip), %rsi     # 0xe6517
pushq $0x3
popq %rdx
movq %r12, %rdi
movq %rbx, %rcx
callq *0x10(%rax)
movq 0x8(%rbx), %rax
cmpl $0x1, 0x4(%rax)
jne 0xbcef4
movq 0x18(%rbx), %rdx
movq 0x20(%rbx), %r14
leaq -0x80(%rdx), %r13
cmpq %r13, %r14
movq (%rsp), %rbp
jl 0xbce32
addq %rdx, %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x772c3
movq 0x18(%rbx), %r13
addq $-0x80, %r13
movq 0x10(%rbx), %r15
movq 0x10(%rbp), %rax
movq (%rax), %rsi
leaq 0x8(%rsp), %rbp
movq %r12, 0x18(%rsp)
movq %r12, %rdi
movq %rbp, %rdx
callq 0x73b88
leaq (%r15,%r14), %rdi
movq (%rbp), %r12
movq %rax, %rsi
movq %r12, %rdx
callq 0x83e0
addq %r14, %r12
pushq $0x1
popq %r14
cmpq 0x20(%rsp), %r14
jge 0xbcf7d
cmpq %r13, %r12
jl 0xbce9c
movq 0x18(%rbx), %rdx
addq %rdx, %rdx
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0x772c3
movq 0x10(%rbx), %r15
movq 0x18(%rbx), %r13
addq $-0x80, %r13
movq (%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r14,8), %rsi
movq 0x18(%rsp), %rdi
callq 0x73af1
movq %rbx, %rbp
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
leaq 0x29692(%rip), %rsi     # 0xe6556
movq %rax, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xb3a5
movq %rax, 0x8(%rsp)
leaq (%r15,%r12), %rdi
movq %rbx, %rsi
movq %rbp, %rbx
movq %rax, %rdx
callq 0x83e0
addq 0x8(%rsp), %r12
incq %r14
jmp 0xbce6c
pushq $0x1
popq %r14
movq (%rsp), %rbp
movq 0x10(%rbp), %rax
movq (%rax), %rsi
leaq 0x8(%rsp), %r15
movq %r12, %rdi
movq %r15, %rdx
callq 0x73b88
movq 0x8(%rbx), %rcx
movq 0x48(%rcx), %r8
movq (%r15), %rdx
movq %r12, %rdi
movq %rax, %rsi
movq %rbx, %rcx
callq *0x10(%r8)
leaq 0x29624(%rip), %r15     # 0xe6556
leaq 0x30(%rsp), %r13
cmpq 0x20(%rsp), %r14
jge 0xbcf86
movq 0x10(%rbp), %rax
movq (%rax,%r14,8), %rsi
movq %r12, %rdi
callq 0x73af1
movq %r13, %rdi
movq %r15, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xb3a5
movq 0x8(%rbx), %rcx
movq 0x48(%rcx), %r8
movq %r12, %rdi
movq %r13, %rsi
movq %rax, %rdx
movq %rbx, %rcx
callq *0x10(%r8)
incq %r14
jmp 0xbcf37
movq %r12, 0x20(%rbx)
movq 0x18(%rsp), %r12
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq 0x20(%rsp), %rcx
cmpq %rcx, 0x28(%rsp)
jle 0xbcfaf
leaq 0x276ef(%rip), %rsi     # 0xe4690
pushq $0x5
popq %rdx
movq %r12, %rdi
movq %rbx, %rcx
callq *0x10(%rax)
jmp 0xbcfbb
pushq $0x29
popq %rsi
movq %r12, %rdi
movq %rbx, %rdx
callq *0x8(%rax)
movl 0x14(%rsp), %r15d
jmp 0xbd03e
leaq 0x8(%rsp), %r14
movb $0x0, (%r14)
movq %r12, %rdi
callq 0x91f9
leaq 0x29541(%rip), %rsi     # 0xe651b
leaq 0x266f0(%rip), %rcx     # 0xe36d1
movl %r13d, %r15d
leaq 0x30(%rsp), %r13
movq %r13, %rdi
movq %rax, %rdx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0xb3a5
movq 0x8(%rbx), %rcx
movq 0x48(%rcx), %r8
movq %r12, %rdi
movq %r13, %rsi
movq %rax, %rdx
movq %rbx, %rcx
callq *0x10(%r8)
movq (%rsp), %rsi
movq 0x18(%rsi), %rax
movq 0x20(%rax), %rax
movl 0x10(%rax), %eax
movq %r12, %rdi
movq %rbx, %rdx
movl %ebp, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq $0x0
pushq $0x0
pushq %r14
pushq %rax
callq 0xc21db
addq $0x20, %rsp
cmpl $0x2, %r15d
movq (%rsp), %rax
jne 0xbd062
testb $0x1, 0x3(%rax)
je 0xbd062
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
pushq $0x29
popq %rsi
movq %r12, %rdi
movq %rbx, %rdx
callq *0x8(%rax)
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq