// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: input_port_to_port
static void input_port_to_port(s7_scheme *sc, s7_pointer obj, s7_pointer port, use_write_t use_write, shared_info *ci)
    {
        if (obj == sc->standard_input)
            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, "(call-with-input-string \"\" (lambda (p) p))", 42, port);
                else
                {
                    if (is_function_port(obj))
                        port_write_string(port)(sc, "#<input-function-port>", 22, port);
                    else
                    {
                        if (is_file_port(obj))
                        {
                            char str[256];
                            int32_t nlen;
                            str[0] = '\0';
                            nlen = catstrs(str, 256, "(open-input-file \"", port_filename(obj), "\")", NULL);
                            port_write_string(port)(sc, str, nlen, port);
                        }
                        else
                        {
                            s7_int data_len;
                            data_len = port_data_size(obj) - port_position(obj);
                            if (data_len > 100)
                            {
                                const char *filename;
                                filename = (const char *)s7_port_filename(sc, obj);
                                if (filename)
                                {
#define DO_STR_LEN 1024
                                    char do_str[DO_STR_LEN];
                                    int32_t len;
                                    do_str[0] = '\0';
                                    if (port_position(obj) > 0)
                                    {
                                        len = catstrs(do_str, DO_STR_LEN, "(let ((port (open-input-file \"", filename, "\")))", NULL);
                                        port_write_string(port)(sc, do_str, len, port);
                                        do_str[0] = '\0';
                                        len = catstrs(do_str, DO_STR_LEN, " (do ((i 0 (+ i 1)) (c (read-char port) (read-char port))) ((= i ",
                                                pos_int_to_str_direct(sc, port_position(obj) - 1),
                                                ") port)))", NULL);
                                    }
                                    else len = catstrs(do_str, DO_STR_LEN, "(open-input-file \"", filename, "\")", NULL);
                                    port_write_string(port)(sc, do_str, len, port);
                                    return;
                                }
                            }
                            port_write_string(port)(sc, "(open-input-string ", 19, port);
                            /* not port_write_string here because there might be embedded double-quotes */
                            slashify_string_to_port(sc, port, (const char *)(port_data(obj) + port_position(obj)), port_data_size(obj) - port_position(obj), IN_QUOTES);
                            port_write_character(port)(sc, ')', port);
                        }
                    }
                }
            }
            else
            {
                if (is_string_port(obj))
                    port_write_string(port)(sc, "<input-string-port", 18, port);
                else
                {
                    if (is_file_port(obj))
                        port_write_string(port)(sc, "<input-file-port", 16, port);
                    else port_write_string(port)(sc, "<input-function-port", 20, port);
                }
                if (port_is_closed(obj))
                    port_write_string(port)(sc, " (closed)>", 10, port);
                else port_write_character(port)(sc, '>', port);
            }
        }
    }

// Assembly:
subq $0x558, %rsp            # imm = 0x558
movq %rdi, 0x550(%rsp)
movq %rsi, 0x548(%rsp)
movq %rdx, 0x540(%rsp)
movl %ecx, 0x53c(%rsp)
movq %r8, 0x530(%rsp)
movq 0x548(%rsp), %rax
movq 0x550(%rsp), %rcx
cmpq 0x1c8(%rcx), %rax
jne 0x1a8c82
movq 0x540(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0x550(%rsp), %rdi
movq 0x548(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq 0x10(%rcx), %rsi
movq 0x548(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq 0x30(%rcx), %rdx
movq 0x540(%rsp), %rcx
callq *%rax
jmp 0x1a9130
cmpl $0x2, 0x53c(%rsp)
jne 0x1a8ffb
movq 0x548(%rsp), %rax
movq 0x8(%rax), %rax
testb $0x1, 0x2(%rax)
je 0x1a8cd9
movq 0x540(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0x550(%rsp), %rdi
movq 0x540(%rsp), %rcx
leaq 0x49b07(%rip), %rsi     # 0x1f27d4
movl $0x2a, %edx
callq *%rax
jmp 0x1a8ff6
movq 0x548(%rsp), %rax
movq 0x8(%rax), %rax
cmpl $0x2, 0x4(%rax)
jne 0x1a8d22
movq 0x540(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0x550(%rsp), %rdi
movq 0x540(%rsp), %rcx
leaq 0x49ae9(%rip), %rsi     # 0x1f27ff
movl $0x16, %edx
callq *%rax
jmp 0x1a8ff4
movq 0x548(%rsp), %rax
movq 0x8(%rax), %rax
cmpl $0x0, 0x4(%rax)
jne 0x1a8db9
movb $0x0, 0x430(%rsp)
leaq 0x430(%rsp), %rdi
movq 0x548(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rcx
movl $0x100, %esi            # imm = 0x100
leaq 0x49abe(%rip), %rdx     # 0x1f2822
leaq 0x4b781(%rip), %r8      # 0x1f44ec
xorl %eax, %eax
movl %eax, %r9d
movb $0x0, %al
callq 0xabd0
movl %eax, 0x42c(%rsp)
movq 0x540(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0x550(%rsp), %rdi
leaq 0x430(%rsp), %rsi
movslq 0x42c(%rsp), %rdx
movq 0x540(%rsp), %rcx
callq *%rax
jmp 0x1a8ff2
movq 0x548(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x548(%rsp), %rcx
subq 0x20(%rcx), %rax
movq %rax, 0x420(%rsp)
cmpq $0x64, 0x420(%rsp)
jle 0x1a8f4a
movq 0x550(%rsp), %rdi
movq 0x548(%rsp), %rsi
callq 0x14b20
movq %rax, 0x418(%rsp)
cmpq $0x0, 0x418(%rsp)
je 0x1a8f48
movb $0x0, 0x10(%rsp)
movq 0x548(%rsp), %rax
cmpq $0x0, 0x20(%rax)
jle 0x1a8ee3
leaq 0x10(%rsp), %rdi
movq 0x418(%rsp), %rcx
movl $0x400, %esi            # imm = 0x400
leaq 0x499d1(%rip), %rdx     # 0x1f2816
leaq 0x499e9(%rip), %r8      # 0x1f2835
xorl %eax, %eax
movl %eax, %r9d
movb $0x0, %al
callq 0xabd0
movl %eax, 0xc(%rsp)
movq 0x540(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0x550(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movslq 0xc(%rsp), %rdx
movq 0x540(%rsp), %rcx
callq *%rax
movb $0x0, 0x10(%rsp)
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x550(%rsp), %rdi
movq 0x548(%rsp), %rax
movq 0x20(%rax), %rsi
subq $0x1, %rsi
callq 0xae30
movq (%rsp), %rdi
movq %rax, %rcx
movl $0x400, %esi            # imm = 0x400
leaq 0x49970(%rip), %rdx     # 0x1f283a
leaq 0x499ab(%rip), %r8      # 0x1f287c
xorl %eax, %eax
movl %eax, %r9d
movb $0x0, %al
callq 0xabd0
movl %eax, 0xc(%rsp)
jmp 0x1a8f13
leaq 0x10(%rsp), %rdi
movq 0x418(%rsp), %rcx
movl $0x400, %esi            # imm = 0x400
leaq 0x49926(%rip), %rdx     # 0x1f2822
leaq 0x4b5e9(%rip), %r8      # 0x1f44ec
xorl %eax, %eax
movl %eax, %r9d
movb $0x0, %al
callq 0xabd0
movl %eax, 0xc(%rsp)
movq 0x540(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0x550(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movslq 0xc(%rsp), %rdx
movq 0x540(%rsp), %rcx
callq *%rax
jmp 0x1a9130
jmp 0x1a8f4a
movq 0x540(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0x550(%rsp), %rdi
movq 0x540(%rsp), %rcx
leaq 0x49911(%rip), %rsi     # 0x1f2886
movl $0x13, %edx
callq *%rax
movq 0x550(%rsp), %rdi
movq 0x540(%rsp), %rsi
movq 0x548(%rsp), %rax
movq 0x10(%rax), %rdx
movq 0x548(%rsp), %rax
addq 0x20(%rax), %rdx
movq 0x548(%rsp), %rax
movq 0x18(%rax), %rcx
movq 0x548(%rsp), %rax
subq 0x20(%rax), %rcx
movl $0x1, %r8d
callq 0x1aee60
movq 0x540(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0x550(%rsp), %rdi
movq 0x540(%rsp), %rdx
movl $0x29, %esi
callq *%rax
jmp 0x1a8ff4
jmp 0x1a8ff6
jmp 0x1a912e
movq 0x548(%rsp), %rax
movq 0x8(%rax), %rax
cmpl $0x1, 0x4(%rax)
jne 0x1a9041
movq 0x540(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0x550(%rsp), %rdi
movq 0x540(%rsp), %rcx
leaq 0x49862(%rip), %rsi     # 0x1f289a
movl $0x12, %edx
callq *%rax
jmp 0x1a90bb
movq 0x548(%rsp), %rax
movq 0x8(%rax), %rax
cmpl $0x0, 0x4(%rax)
jne 0x1a9087
movq 0x540(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0x550(%rsp), %rdi
movq 0x540(%rsp), %rcx
leaq 0x4982f(%rip), %rsi     # 0x1f28ad
movl $0x10, %edx
callq *%rax
jmp 0x1a90b9
movq 0x540(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0x550(%rsp), %rdi
movq 0x540(%rsp), %rcx
leaq 0x4980c(%rip), %rsi     # 0x1f28be
movl $0x14, %edx
callq *%rax
jmp 0x1a90bb
movq 0x548(%rsp), %rax
movq 0x8(%rax), %rax
testb $0x1, 0x2(%rax)
je 0x1a9101
movq 0x540(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0x550(%rsp), %rdi
movq 0x540(%rsp), %rcx
leaq 0x497db(%rip), %rsi     # 0x1f28d3
movl $0xa, %edx
callq *%rax
jmp 0x1a912c
movq 0x540(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0x550(%rsp), %rdi
movq 0x540(%rsp), %rdx
movl $0x3e, %esi
callq *%rax
jmp 0x1a912e
jmp 0x1a9130
addq $0x558, %rsp            # imm = 0x558
retq
nopl (%rax,%rax)