// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: byte_vector_to_port
static void byte_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;
            uint8_t first;
            uint8_t *els;
            vlen = vector_length(vect);
            els = byte_vector_bytes(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, byte_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, "#u(", 3, port);
            p = integer_to_string(sc, byte_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, byte_vector(vect, i)), NULL);
                port_write_string(port)(sc, buf, plen, port);
            }
            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, "#u", 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 $0xa8, %rsp
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, (%rsp)
callq 0xc1eec
testl %eax, %eax
js 0xbd350
movl %eax, %r12d
movq 0x8(%r13), %r14
cmpl $0x2, %ebp
jne 0xbd0cd
testb $0x1, 0x3(%r13)
je 0xbd0cd
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
leaq 0x25a24(%rip), %rsi     # 0xe2ae4
pushq $0xc
popq %rdx
movq (%rsp), %rdi
movq %rbx, %rcx
callq *0x10(%rax)
cmpl $0x3e9, %r12d           # imm = 0x3E9
jb 0xbd1a2
movq 0x8(%r13), %rax
movq 0x10(%r13), %rdx
movb (%rdx), %sil
cmpq $0x2, %rax
pushq $0x1
popq %rdi
movq %rdi, %rcx
cmovgeq %rax, %rcx
cmpq %rax, %rdi
jge 0xbd106
cmpb %sil, (%rdx,%rdi)
jne 0xbd103
incq %rdi
jmp 0xbd0f3
movq %rdi, %rcx
cmpq %rax, %rcx
jne 0xbd1a2
movq (%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0xc2073
movq 0x10(%r13), %rax
movzbl (%rax), %esi
leaq 0x10(%rsp), %r12
movq %r14, %rdi
movq %r12, %rdx
callq 0x73b88
movq 0x8(%rbx), %rcx
movq 0x48(%rcx), %r8
movq (%r12), %rdx
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rcx
callq *0x10(%r8)
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
pushq $0x29
popq %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq *0x8(%rax)
cmpl $0x2, %ebp
jne 0xbd350
testb $0x1, 0x3(%r13)
je 0xbd350
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
pushq $0x29
popq %rsi
movq (%rsp), %rdi
movq %rbx, %rdx
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
movl %ebp, 0xc(%rsp)
movq 0x18(%r13), %rax
movq 0x20(%rax), %rax
testq %rax, %rax
je 0xbd1c1
movq 0x10(%rax), %rsi
cmpq $0x1, %rsi
jne 0xbd2ab
movq %r14, 0x18(%rsp)
movslq %r12d, %rbp
pushq $0x1
popq %r15
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
leaq 0x29342(%rip), %rsi     # 0xe651e
pushq $0x3
popq %rdx
movq (%rsp), %r12
movq %r12, %rdi
movq %rbx, %rcx
callq *0x10(%rax)
movq %r13, %r14
movq 0x10(%r13), %rax
movzbl (%rax), %esi
leaq 0x10(%rsp), %r13
movq %r12, %rdi
movq %r13, %rdx
callq 0x73b88
movq 0x8(%rbx), %rcx
movq 0x48(%rcx), %r8
movq (%r13), %rdx
movq %r12, %rdi
movq %rax, %rsi
movq %rbx, %rcx
callq *0x10(%r8)
leaq 0x20(%rsp), %r13
movq (%rsp), %r12
cmpq %rbp, %r15
jge 0xbd271
movq 0x10(%r14), %rax
movzbl (%rax,%r15), %esi
movq %r12, %rdi
callq 0x73af1
movq %r13, %rdi
leaq 0x2930e(%rip), %rsi     # 0xe6556
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 %r15
jmp 0xbd228
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
cmpq %rbp, 0x18(%rsp)
jle 0xbd299
leaq 0x27409(%rip), %rsi     # 0xe4690
pushq $0x5
popq %rdx
movq (%rsp), %rdi
movq %rbx, %rcx
callq *0x10(%rax)
jmp 0xbd32b
pushq $0x29
popq %rsi
movq (%rsp), %rdi
movq %rbx, %rdx
callq *0x8(%rax)
jmp 0xbd32b
leaq 0x10(%rsp), %r15
movb $0x0, (%r15)
movq (%rsp), %rbp
movq %rbp, %rdi
callq 0x91f9
leaq 0x2925b(%rip), %rsi     # 0xe6522
leaq 0x26403(%rip), %rcx     # 0xe36d1
movq %r13, %r14
leaq 0x20(%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 %rbp, %rdi
movq %r13, %rsi
movq %rax, %rdx
movq %rbx, %rcx
callq *0x10(%r8)
movq 0x18(%r14), %rax
movq 0x20(%rax), %rax
movl 0x10(%rax), %eax
movq %rbp, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movl %r12d, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq $0x0
pushq $0x0
pushq %r15
pushq %rax
callq 0xc21db
addq $0x20, %rsp
movl 0xc(%rsp), %eax
cmpl $0x2, %eax
jne 0xbd350
testb $0x1, 0x3(%r14)
je 0xbd350
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
pushq $0x29
popq %rsi
movq (%rsp), %rdi
movq %rbx, %rdx
callq *0x8(%rax)
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq