// File: /workspace/github_c_makefile_star2_O1/BernardTatin[P]s7sh/s7.c
// Function: multivector_to_port
static int32_t multivector_to_port(s7_scheme *sc, s7_pointer vec, s7_pointer port,
            int32_t out_len, int32_t flat_ref, int32_t dimension, int32_t dimensions, bool *last,
            use_write_t use_write, shared_info *ci)
    {
        int32_t i;
        if (use_write != P_READABLE)
        {
            if (*last)
                port_write_string(port)(sc, " (", 2, port);
            else port_write_character(port)(sc, '(', port);
            (*last) = false;
        }

        for (i = 0; i < vector_dimension(vec, dimension); i++)
        {
            if (dimension == (dimensions - 1))
            {
                if (flat_ref < out_len)
                {
                    object_to_port_with_circle_check(sc, vector_getter(vec)(sc, vec, flat_ref), port, NOT_P_DISPLAY(use_write), ci);

                    if (use_write == P_READABLE)
                        port_write_string(port)(sc, ") ", 2, port);
                    flat_ref++;
                }
                else
                {
                    port_write_string(port)(sc, "...)", 4, port);
                    return(flat_ref);
                }
                if ((use_write != P_READABLE) &&
                        (i < (vector_dimension(vec, dimension) - 1)))
                    port_write_character(port)(sc, ' ', port);
            }
            else
            {
                if (flat_ref < out_len)
                    flat_ref = multivector_to_port(sc, vec, port, out_len, flat_ref, dimension + 1, dimensions, last, NOT_P_DISPLAY(use_write), ci);
                else
                {
                    port_write_string(port)(sc, "...)", 4, port);
                    return(flat_ref);
                }
            }
        }
        if (use_write != P_READABLE)
            port_write_character(port)(sc, ')', port);
        (*last) = true;
        return(flat_ref);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, %ebp
movl %r8d, %ebx
movl %ecx, 0xc(%rsp)
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r15
movq 0x68(%rsp), %rcx
movq 0x8(%rdx), %rax
movq 0x48(%rax), %rax
cmpb $0x1, (%rcx)
jne 0xfcf79
leaq 0x265c9(%rip), %rsi     # 0x123532
movl $0x2, %edx
movq %r15, %rdi
movq %r14, %rcx
callq *0x10(%rax)
jmp 0xfcf87
movq %r15, %rdi
movl $0x28, %esi
movq %r14, %rdx
callq *0x8(%rax)
movq 0x68(%rsp), %rax
movb $0x0, (%rax)
movslq %ebp, %r12
movq 0x18(%r13), %rax
movq 0x20(%rax), %rax
movq (%rax), %rax
cmpq $0x0, (%rax,%r12,8)
jle 0xfd0cc
movl 0x70(%rsp), %eax
movl 0x60(%rsp), %ecx
decl %ecx
movl %ecx, 0x1c(%rsp)
cmpl $0x1, %eax
adcl $0x0, %eax
movq %rax, 0x10(%rsp)
movq %rbp, 0x20(%rsp)
leal 0x1(%rbp), %eax
movl %eax, 0x18(%rsp)
xorl %ebp, %ebp
movl 0x1c(%rsp), %eax
cmpl 0x20(%rsp), %eax
jne 0xfd02c
cmpl 0xc(%rsp), %ebx
jge 0xfd0ec
movslq %ebx, %rdx
movq %r15, %rdi
movq %r13, %rsi
callq *0x20(%r13)
movq %rax, %rsi
cmpq $0x0, 0x78(%rsp)
je 0xfd067
movzbl (%rsi), %eax
leaq 0x5d33b(%rip), %rcx     # 0x15a340
cmpb $0x1, (%rax,%rcx)
jne 0xfd067
cmpb $0x15, %al
jne 0xfd015
testb $0x1, 0x7(%rsi)
jne 0xfd067
movq %r15, %rdi
movq %r14, %rdx
movq 0x10(%rsp), %rcx
movq 0x78(%rsp), %r8
callq 0x9c033
jmp 0xfd085
movl 0xc(%rsp), %ecx
cmpl %ecx, %ebx
jge 0xfd0ec
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
movl %ebx, %r8d
movl 0x18(%rsp), %r9d
pushq 0x78(%rsp)
pushq 0x18(%rsp)
pushq 0x78(%rsp)
movl 0x78(%rsp), %eax
pushq %rax
callq 0xfcf2f
addq $0x20, %rsp
movl %eax, %ebx
jmp 0xfd0b4
movzbl (%rsi), %eax
movq %r15, %rdi
movq %r14, %rdx
movq 0x10(%rsp), %rcx
movq 0x78(%rsp), %r8
leaq 0x5d2ff(%rip), %r9      # 0x15a380
callq *(%r9,%rax,8)
incl %ebx
movq 0x18(%r13), %rax
movq 0x20(%rax), %rax
movq (%rax), %rax
movq (%rax,%r12,8), %rax
decq %rax
cmpq %rbp, %rax
jle 0xfd0b4
movq 0x8(%r14), %rax
movq 0x48(%rax), %rax
movq %r15, %rdi
movl $0x20, %esi
movq %r14, %rdx
callq *0x8(%rax)
incq %rbp
movq 0x18(%r13), %rax
movq 0x20(%rax), %rax
movq (%rax), %rax
cmpq %rbp, (%rax,%r12,8)
jg 0xfcfcf
movq 0x8(%r14), %rax
movq 0x48(%rax), %rax
movq %r15, %rdi
movl $0x29, %esi
movq %r14, %rdx
callq *0x8(%rax)
movq 0x68(%rsp), %rax
movb $0x1, (%rax)
jmp 0xfd109
movq 0x8(%r14), %rax
movq 0x48(%rax), %rax
leaq 0x244e6(%rip), %rsi     # 0x1215e1
movl $0x4, %edx
movq %r15, %rdi
movq %r14, %rcx
callq *0x10(%rax)
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq