// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: output_port_to_port
static void output_port_to_port(s7_scheme *sc, s7_pointer obj, s7_pointer port, use_write_t use_write, shared_info *ci)
    {
        if ((obj == sc->standard_output) ||
                (obj == sc->standard_error))
            port_write_string(port)(sc, port_filename(obj), port_filename_length(obj), port);
        else
        {
            if (use_write == P_READABLE)
            {
                if (port_is_closed(obj))
                    port_write_string(port)(sc, "(let ((p (open-output-string))) (close-output-port p) p)", 56, port);
                else
                {
                    if (is_string_port(obj))
                    {
                        port_write_string(port)(sc, "(let ((p (open-output-string)))", 31, port);
                        if (port_position(obj) > 0)
                        {
                            port_write_string(port)(sc, " (display ", 10, port);
                            slashify_string_to_port(sc, port, (const char *)port_data(obj), port_position(obj), IN_QUOTES);
                            port_write_string(port)(sc, " p)", 3, port);
                        }
                        port_write_string(port)(sc, " p)", 3, port);
                    }
                    else
                    {
                        char str[256];
                        int32_t nlen;
                        str[0] = '\0';
                        nlen = catstrs(str, 256, "(open-output-file \"", port_filename(obj), "\" \"a\")", NULL);
                        port_write_string(port)(sc, str, nlen, port);
                    }
                }
            }
            else
            {
                if (is_string_port(obj))
                    port_write_string(port)(sc, "<output-string-port", 19, port);
                else
                {
                    if (is_file_port(obj))
                        port_write_string(port)(sc, "<output-file-port", 17, port);
                    else port_write_string(port)(sc, "<output-function-port", 21, port);
                }
                if (port_is_closed(obj))
                    port_write_string(port)(sc, " (closed)>", 10, port);
                else port_write_character(port)(sc, '>', port);
            }
        }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
cmpq %rsi, 0x1d0(%rdi)
je 0xc045b
cmpq %r15, 0x1d8(%r14)
je 0xc045b
movq 0x8(%r15), %rax
cmpl $0x2, %ecx
jne 0xc0478
cmpb $0x1, 0x2(%rax)
jne 0xc04a6
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
leaq 0x26504(%rip), %rsi     # 0xe6958
pushq $0x38
jmp 0xc0572
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%r15), %rcx
movq 0x10(%rcx), %rsi
movq 0x30(%rcx), %rdx
jmp 0xc0573
movl 0x4(%rax), %ecx
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
testl %ecx, %ecx
je 0xc0536
cmpl $0x1, %ecx
jne 0xc0541
leaq 0x26538(%rip), %rsi     # 0xe69d7
pushq $0x13
jmp 0xc054a
cmpl $0x1, 0x4(%rax)
jne 0xc05a2
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
leaq 0x264d2(%rip), %rsi     # 0xe6991
pushq $0x1f
popq %rdx
movq %r14, %rdi
movq %rbx, %rcx
callq *0x10(%rax)
cmpq $0x0, 0x20(%r15)
jle 0xc051f
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
leaq 0x264d0(%rip), %rsi     # 0xe69b1
pushq $0xa
popq %rdx
movq %r14, %rdi
movq %rbx, %rcx
callq *0x10(%rax)
movq 0x10(%r15), %rdx
movq 0x20(%r15), %rcx
pushq $0x1
popq %r8
movq %r14, %rdi
movq %rbx, %rsi
callq 0xc281e
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
leaq 0x2647a(%rip), %rsi     # 0xe698d
pushq $0x3
popq %rdx
movq %r14, %rdi
movq %rbx, %rcx
callq *0x10(%rax)
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
leaq 0x2645b(%rip), %rsi     # 0xe698d
pushq $0x3
jmp 0xc0572
leaq 0x264ae(%rip), %rsi     # 0xe69eb
pushq $0x11
jmp 0xc054a
leaq 0x264b5(%rip), %rsi     # 0xe69fd
pushq $0x15
popq %rdx
movq %r14, %rdi
movq %rbx, %rcx
callq *%rax
movq 0x8(%r15), %rcx
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
cmpb $0x1, 0x2(%rcx)
jne 0xc0587
movq 0x10(%rax), %rax
leaq 0x263dd(%rip), %rsi     # 0xe694d
pushq $0xa
popq %rdx
movq %r14, %rdi
movq %rbx, %rcx
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %r15
jmpq *%rax
movq 0x8(%rax), %rax
pushq $0x3e
popq %rsi
movq %r14, %rdi
movq %rbx, %rdx
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %r15
jmpq *%rax
movq %rsp, %r15
movb $0x0, (%r15)
movq 0x10(%rax), %rcx
leaq 0x26408(%rip), %rdx     # 0xe69bc
leaq 0x26415(%rip), %r8      # 0xe69d0
movl $0x100, %esi            # imm = 0x100
movq %r15, %rdi
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x90f7
movq 0x8(%rbx), %rcx
movq 0x48(%rcx), %r8
movslq %eax, %rdx
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rcx
callq *0x10(%r8)
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %r15
retq