// File: /workspace/github_c_makefile_star2_O1/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 0xfa923
cmpq %r15, 0x1d8(%r14)
je 0xfa923
movq 0x8(%r15), %rax
cmpl $0x2, %ecx
jne 0xfa94f
cmpb $0x1, 0x2(%rax)
jne 0xfa980
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
leaq 0x28f8c(%rip), %rsi     # 0x1238a8
movl $0x38, %edx
jmp 0xfa93b
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%r15), %rcx
movq 0x10(%rcx), %rsi
movq 0x30(%rcx), %rdx
movq %r14, %rdi
movq %rbx, %rcx
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %r15
jmpq *%rax
movl 0x4(%rax), %ecx
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
testl %ecx, %ecx
je 0xfaa1e
cmpl $0x1, %ecx
jne 0xfaa2c
leaq 0x28fb1(%rip), %rsi     # 0x123927
movl $0x13, %edx
jmp 0xfaa38
cmpl $0x1, 0x4(%rax)
jne 0xfaa84
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
leaq 0x28f48(%rip), %rsi     # 0x1238e1
movl $0x1f, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq *0x10(%rax)
cmpq $0x0, 0x20(%r15)
jle 0xfaa01
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
leaq 0x28f44(%rip), %rsi     # 0x123901
movl $0xa, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq *0x10(%rax)
movq 0x10(%r15), %rdx
movq 0x20(%r15), %rcx
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %r8d
callq 0xfd6c4
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
leaq 0x28eea(%rip), %rsi     # 0x1238dd
movl $0x3, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq *0x10(%rax)
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
leaq 0x28ec9(%rip), %rsi     # 0x1238dd
movl $0x3, %edx
jmp 0xfa93b
leaq 0x28f16(%rip), %rsi     # 0x12393b
movl $0x11, %edx
jmp 0xfaa38
leaq 0x28f1a(%rip), %rsi     # 0x12394d
movl $0x15, %edx
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 0xfaa67
movq 0x10(%rax), %rax
leaq 0x28e40(%rip), %rsi     # 0x12389d
movl $0xa, %edx
jmp 0xfa93b
movq 0x8(%rax), %rax
movq %r14, %rdi
movl $0x3e, %esi
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 0x28e76(%rip), %rdx     # 0x12390c
leaq 0x28e83(%rip), %r8      # 0x123920
movl $0x100, %esi            # imm = 0x100
movq %r15, %rdi
xorl %r9d, %r9d
xorl %eax, %eax
callq 0xa4d7
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