// File: /workspace/github_c_makefile_star2_O2/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 $0x18, %rsp
movl %r9d, 0x4(%rsp)
movl %r8d, %ebx
movl %ecx, (%rsp)
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r15
movl 0x60(%rsp), %r12d
movq 0x58(%rsp), %rcx
movq 0x8(%rdx), %rax
movq 0x48(%rax), %rax
cmpb $0x1, (%rcx)
jne 0xc2229
leaq 0x243c7(%rip), %rsi     # 0xe65e2
pushq $0x2
popq %rdx
movq %r15, %rdi
movq %r14, %rcx
callq *0x10(%rax)
jmp 0xc2235
pushq $0x28
popq %rsi
movq %r15, %rdi
movq %r14, %rdx
callq *0x8(%rax)
movq 0x58(%rsp), %rax
movb $0x0, (%rax)
movslq 0x4(%rsp), %rbp
movl 0x50(%rsp), %eax
decl %eax
movl %eax, 0x14(%rsp)
leal 0x1(%rbp), %eax
movl %eax, 0x10(%rsp)
cmpl $0x1, %r12d
adcl $0x0, %r12d
movq %r12, 0x8(%rsp)
xorl %r12d, %r12d
movq 0x18(%r13), %rax
movq 0x20(%rax), %rax
movq (%rax), %rax
cmpq %r12, (%rax,%rbp,8)
jle 0xc2369
movl 0x14(%rsp), %eax
cmpl 0x4(%rsp), %eax
jne 0xc22dc
cmpl (%rsp), %ebx
jge 0xc2387
movslq %ebx, %rdx
movq %r15, %rdi
movq %r13, %rsi
callq *0x20(%r13)
movzbl (%rax), %r9d
cmpq $0x0, 0x68(%rsp)
je 0xc2316
leaq 0x5f095(%rip), %rcx     # 0x121340
cmpb $0x1, (%r9,%rcx)
jne 0xc2316
cmpl $0x15, %r9d
jne 0xc22c2
testb $0x1, 0x7(%rax)
pushq $0x15
popq %r9
jne 0xc2316
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %rdx
movq 0x8(%rsp), %rcx
movq 0x68(%rsp), %r8
callq 0x77872
jmp 0xc2334
movl (%rsp), %ecx
cmpl %ecx, %ebx
jge 0xc2387
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
movl %ebx, %r8d
movl 0x10(%rsp), %r9d
pushq 0x68(%rsp)
pushq 0x10(%rsp)
pushq 0x68(%rsp)
movl 0x68(%rsp), %eax
pushq %rax
callq 0xc21db
addq $0x20, %rsp
movl %eax, %ebx
jmp 0xc2361
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %rdx
movq 0x8(%rsp), %rcx
movq 0x68(%rsp), %r8
leaq 0x5f050(%rip), %rax     # 0x121380
callq *(%rax,%r9,8)
incl %ebx
movq 0x18(%r13), %rax
movq 0x20(%rax), %rax
movq (%rax), %rax
movq (%rax,%rbp,8), %rax
decq %rax
cmpq %r12, %rax
jle 0xc2361
movq 0x8(%r14), %rax
movq 0x48(%rax), %rax
movq %r15, %rdi
pushq $0x20
popq %rsi
movq %r14, %rdx
callq *0x8(%rax)
incq %r12
jmp 0xc2263
movq 0x8(%r14), %rax
movq 0x48(%rax), %rax
pushq $0x29
popq %rsi
movq %r15, %rdi
movq %r14, %rdx
callq *0x8(%rax)
movq 0x58(%rsp), %rax
movb $0x1, (%rax)
jmp 0xc23a2
movq 0x8(%r14), %rax
movq 0x48(%rax), %rax
leaq 0x222fb(%rip), %rsi     # 0xe4691
pushq $0x4
popq %rdx
movq %r15, %rdi
movq %r14, %rcx
callq *0x10(%rax)
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq