// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x148, %rsp            # imm = 0x148
movq %rdi, 0x140(%rsp)
movq %rsi, 0x138(%rsp)
movq %rdx, 0x130(%rsp)
movl %ecx, 0x12c(%rsp)
movq %r8, 0x120(%rsp)
movq 0x140(%rsp), %rdi
movq 0x138(%rsp), %rsi
movq 0x130(%rsp), %rdx
movl 0x12c(%rsp), %ecx
callq 0x1ad990
cltq
movq %rax, 0x110(%rsp)
cmpq $0x0, 0x110(%rsp)
jge 0x1a156c
jmp 0x1a1cf2
movq 0x110(%rsp), %rax
movq 0x138(%rsp), %rcx
cmpq 0x8(%rcx), %rax
setl %al
andb $0x1, %al
movb %al, 0x107(%rsp)
cmpl $0x2, 0x12c(%rsp)
jne 0x1a15df
movq 0x138(%rsp), %rax
movq (%rax), %rax
andq $0x1000000, %rax        # imm = 0x1000000
cmpq $0x0, %rax
je 0x1a15df
movq 0x130(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0x140(%rsp), %rdi
movq 0x130(%rsp), %rcx
leaq 0x4d02c(%rip), %rsi     # 0x1ee604
movl $0xc, %edx
callq *%rax
cmpq $0x3e8, 0x110(%rsp) # imm = 0x3E8
jle 0x1a1777
movq 0x138(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x70(%rsp)
movq 0x138(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x68(%rsp)
movq $0x1, 0x118(%rsp)
movq 0x118(%rsp), %rax
cmpq 0x70(%rsp), %rax
jge 0x1a166d
movq 0x60(%rsp), %rax
movq 0x118(%rsp), %rcx
movq (%rax,%rcx,8), %rax
cmpq 0x68(%rsp), %rax
je 0x1a1655
jmp 0x1a166d
jmp 0x1a1657
movq 0x118(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x118(%rsp)
jmp 0x1a162c
movq 0x118(%rsp), %rax
cmpq 0x70(%rsp), %rax
jne 0x1a1775
movq 0x140(%rsp), %rdi
movq 0x138(%rsp), %rsi
movq 0x130(%rsp), %rdx
callq 0x1add70
movq 0x140(%rsp), %rdi
movq 0x138(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rsi
leaq 0x108(%rsp), %rdx
callq 0xc7240
movq %rax, 0x78(%rsp)
movq 0x130(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0x140(%rsp), %rdi
movq 0x78(%rsp), %rsi
movq 0x108(%rsp), %rdx
movq 0x130(%rsp), %rcx
callq *%rax
movq 0x130(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0x140(%rsp), %rdi
movq 0x130(%rsp), %rdx
movl $0x29, %esi
callq *%rax
cmpl $0x2, 0x12c(%rsp)
jne 0x1a1770
movq 0x138(%rsp), %rax
movq (%rax), %rax
andq $0x1000000, %rax        # imm = 0x1000000
cmpq $0x0, %rax
je 0x1a1770
movq 0x130(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0x140(%rsp), %rdi
movq 0x130(%rsp), %rdx
movl $0x29, %esi
callq *%rax
jmp 0x1a1cf2
jmp 0x1a1777
movq 0x138(%rsp), %rax
movq 0x18(%rax), %rax
cmpq $0x0, 0x20(%rax)
je 0x1a17a5
movq 0x138(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, 0x38(%rsp)
jmp 0x1a17b1
movl $0x1, %eax
movq %rax, 0x38(%rsp)
jmp 0x1a17b1
movq 0x38(%rsp), %rax
cmpq $0x1, %rax
jne 0x1a1bad
movq 0x130(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0x140(%rsp), %rdi
movq 0x130(%rsp), %rcx
leaq 0x50cb2(%rip), %rsi     # 0x1f249d
movl $0x3, %edx
callq *%rax
movq 0x130(%rsp), %rax
movq 0x8(%rax), %rax
cmpl $0x1, 0x4(%rax)
je 0x1a192e
movq 0x140(%rsp), %rdi
movq 0x138(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rsi
leaq 0x108(%rsp), %rdx
callq 0xc7240
movq %rax, 0x78(%rsp)
movq 0x130(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0x140(%rsp), %rdi
movq 0x78(%rsp), %rsi
movq 0x108(%rsp), %rdx
movq 0x130(%rsp), %rcx
callq *%rax
movq $0x1, 0x118(%rsp)
movq 0x118(%rsp), %rax
cmpq 0x110(%rsp), %rax
jge 0x1a1929
leaq 0x80(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x140(%rsp), %rdi
movq 0x138(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x118(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0xc70d0
movq 0x30(%rsp), %rdi
movq %rax, %rdx
leaq 0x50c15(%rip), %rsi     # 0x1f24dc
xorl %eax, %eax
movl %eax, %ecx
movb $0x0, %al
callq 0x10540
movq %rax, 0x108(%rsp)
movq 0x130(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0x140(%rsp), %rdi
leaq 0x80(%rsp), %rsi
movq 0x108(%rsp), %rdx
movq 0x130(%rsp), %rcx
callq *%rax
movq 0x118(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x118(%rsp)
jmp 0x1a1870
jmp 0x1a1b3f
movq 0x130(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x58(%rsp)
movq 0x130(%rsp), %rax
movq 0x18(%rax), %rax
subq $0x80, %rax
movq %rax, 0x50(%rsp)
movq 0x130(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x58(%rsp), %rax
cmpq 0x50(%rsp), %rax
jl 0x1a19bf
movq 0x140(%rsp), %rdi
movq 0x130(%rsp), %rsi
movq 0x130(%rsp), %rax
movq 0x18(%rax), %rdx
shlq %rdx
callq 0xcf4e0
movq 0x130(%rsp), %rax
movq 0x18(%rax), %rax
subq $0x80, %rax
movq %rax, 0x50(%rsp)
movq 0x130(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x140(%rsp), %rdi
movq 0x138(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rsi
leaq 0x108(%rsp), %rdx
callq 0xc7240
movq %rax, 0x78(%rsp)
movq 0x48(%rsp), %rdi
addq 0x58(%rsp), %rdi
movq 0x78(%rsp), %rsi
movq 0x108(%rsp), %rdx
callq 0x93e0
movq 0x108(%rsp), %rax
addq 0x58(%rsp), %rax
movq %rax, 0x58(%rsp)
movq $0x1, 0x118(%rsp)
movq 0x118(%rsp), %rax
cmpq 0x110(%rsp), %rax
jge 0x1a1b2e
movq 0x58(%rsp), %rax
cmpq 0x50(%rsp), %rax
jl 0x1a1a90
movq 0x140(%rsp), %rdi
movq 0x130(%rsp), %rsi
movq 0x130(%rsp), %rax
movq 0x18(%rax), %rdx
shlq %rdx
callq 0xcf4e0
movq 0x130(%rsp), %rax
movq 0x18(%rax), %rax
subq $0x80, %rax
movq %rax, 0x50(%rsp)
movq 0x130(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x48(%rsp)
leaq 0x80(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x140(%rsp), %rdi
movq 0x138(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x118(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0xc70d0
movq 0x28(%rsp), %rdi
movq %rax, %rdx
leaq 0x50a0b(%rip), %rsi     # 0x1f24dc
xorl %eax, %eax
movl %eax, %ecx
movb $0x0, %al
callq 0x10540
movq %rax, 0x108(%rsp)
movq 0x48(%rsp), %rdi
addq 0x58(%rsp), %rdi
leaq 0x80(%rsp), %rsi
movq 0x108(%rsp), %rdx
callq 0x93e0
movq 0x108(%rsp), %rax
addq 0x58(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x118(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x118(%rsp)
jmp 0x1a1a22
movq 0x58(%rsp), %rcx
movq 0x130(%rsp), %rax
movq %rcx, 0x20(%rax)
testb $0x1, 0x107(%rsp)
je 0x1a1b7d
movq 0x130(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0x140(%rsp), %rdi
movq 0x130(%rsp), %rcx
leaq 0x4ea94(%rip), %rsi     # 0x1f0608
movl $0x5, %edx
callq *%rax
jmp 0x1a1ba8
movq 0x130(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0x140(%rsp), %rdi
movq 0x130(%rsp), %rdx
movl $0x29, %esi
callq *%rax
jmp 0x1a1ca6
movb $0x0, 0x47(%rsp)
leaq 0x80(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x140(%rsp), %rdi
movq 0x138(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rsi
callq 0xae30
movq 0x20(%rsp), %rdi
movq %rax, %rdx
leaq 0x508b2(%rip), %rsi     # 0x1f24a1
leaq 0x4d83f(%rip), %rcx     # 0x1ef435
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0x10540
movq %rax, 0x108(%rsp)
movq 0x130(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0x140(%rsp), %rdi
leaq 0x80(%rsp), %rsi
movq 0x108(%rsp), %rdx
movq 0x130(%rsp), %rcx
callq *%rax
movq 0x140(%rsp), %rdi
movq 0x138(%rsp), %rsi
movq 0x130(%rsp), %rdx
movq 0x110(%rsp), %rax
movl %eax, %ecx
movq 0x138(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movl %eax, %r10d
xorl %r9d, %r9d
leaq 0x47(%rsp), %rax
xorl %r8d, %r8d
movl %r9d, %r8d
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
callq 0x1ae0b0
cmpl $0x2, 0x12c(%rsp)
jne 0x1a1cf2
movq 0x138(%rsp), %rax
movq (%rax), %rax
andq $0x1000000, %rax        # imm = 0x1000000
cmpq $0x0, %rax
je 0x1a1cf2
movq 0x130(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0x140(%rsp), %rdi
movq 0x130(%rsp), %rdx
movl $0x29, %esi
callq *%rax
addq $0x148, %rsp            # imm = 0x148
retq
nopw (%rax,%rax)