// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: port_to_let
static s7_pointer port_to_let(s7_scheme *sc, s7_pointer obj) /* note the underbars! */
                {
                    s7_pointer let;
                    if (!sc->function_symbol)
                        sc->function_symbol = make_symbol(sc, "function");
                    if (!sc->file_symbol)
                    {
                        sc->file_symbol = make_symbol(sc, "file");
                        sc->line_symbol = make_symbol(sc, "line");
                    }
                    if (!sc->data_symbol)
                    {
                        sc->data_symbol = make_symbol(sc, "data");
                        sc->port_type_symbol = make_symbol(sc, "port-type");
                        sc->closed_symbol = make_symbol(sc, "closed");
                        sc->file_info_symbol = make_symbol(sc, "file-info");
                        if (!sc->position_symbol) sc->position_symbol = make_symbol(sc, "position");
                    }
                    let = g_local_inlet(sc, 10, sc->value_symbol, obj,
                            /* obj as 'value means it will say "(closed)" when subsequently the let is displayed */
                            sc->type_symbol, (is_input_port(obj)) ? sc->is_input_port_symbol : sc->is_output_port_symbol,
                            sc->port_type_symbol, (is_string_port(obj)) ? sc->string_symbol : ((is_file_port(obj)) ? sc->file_symbol : sc->function_symbol),
                            sc->closed_symbol, s7_make_boolean(sc, port_is_closed(obj)),
                            sc->is_immutable_symbol, s7_make_boolean(sc, is_immutable_port(obj)));
                    push_stack_no_let_no_code(sc, OP_GC_PROTECT, let);
                    if (is_file_port(obj))
                    {
                        s7_varlet(sc, let, sc->file_symbol, g_port_filename(sc, set_plist_1(sc, obj)));
                        if (is_input_port(obj))
                            s7_varlet(sc, let, sc->line_symbol, g_port_line_number(sc, set_plist_1(sc, obj)));
#if (!MS_WINDOWS)
                        if ((!port_is_closed(obj)) && (obj != sc->standard_error) && (obj != sc->standard_input) && (obj != sc->standard_output))
                        {
                            struct stat sb;
                            s7_varlet(sc, let, sc->file_symbol, make_integer(sc, fileno(port_file(obj))));
                            if (fstat(fileno(port_file(obj)), &sb) != -1)
                            {
                                char c1[64], c2[64], str[512];
                                int bytes;
                                strftime(c1, 64, "%a %d-%b-%Y %H:%M", localtime(&sb.st_atime));
                                strftime(c2, 64, "%a %d-%b-%Y %H:%M", localtime(&sb.st_mtime));
                                bytes = snprintf(str, 512, "mode: #o%d, links: %ld, owner uid: %d gid: %d, size: %ld bytes, last file access: %s, last file modification: %s",
                                        sb.st_mode,
                                        (long)sb.st_nlink,
                                        (int)sb.st_uid, (int)sb.st_gid,
                                        (long)sb.st_size,
                                        c1, c2);
                                s7_varlet(sc, let, sc->file_info_symbol, make_string_with_length(sc, (const char *)str, bytes));
                            }
                        }
#endif
                    }
                    if ((is_string_port(obj)) && /* file port might not have a data buffer */
                            (port_data(obj)) &&
                            (port_data_size(obj) > 0))
                    {
                        s7_varlet(sc, let, sc->length_symbol, s7_make_integer(sc, port_data_size(obj)));
                        s7_varlet(sc, let, sc->position_symbol, s7_make_integer(sc, port_position(obj)));
                        /* I think port_data need not be null-terminated, but s7_make_string assumes it is:
                         *   both valgrind and lib*san complain about the uninitialized data during strlen.
                         */
                        if (port_position(obj) < sc->max_string_length)
                            s7_varlet(sc, let, sc->data_symbol, make_string_with_length(sc, (const char *)port_data(obj), port_position(obj)));
                    }
                    unstack(sc);
                    return(let);
                }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x4b0, %rsp            # imm = 0x4B0
movq %rdi, 0x4a8(%rsp)
movq %rsi, 0x4a0(%rsp)
movq 0x4a8(%rsp), %rax
cmpq $0x0, 0x1de0(%rax)
jne 0x1c7624
movq 0x4a8(%rsp), %rdi
leaq 0x2c5c7(%rip), %rsi     # 0x1f3bd4
callq 0xb400
movq %rax, %rcx
movq 0x4a8(%rsp), %rax
movq %rcx, 0x1de0(%rax)
movq 0x4a8(%rsp), %rax
cmpq $0x0, 0x1e00(%rax)
jne 0x1c7682
movq 0x4a8(%rsp), %rdi
leaq 0x1e790(%rip), %rsi     # 0x1e5dd5
callq 0xb400
movq %rax, %rcx
movq 0x4a8(%rsp), %rax
movq %rcx, 0x1e00(%rax)
movq 0x4a8(%rsp), %rdi
leaq 0x1dfbd(%rip), %rsi     # 0x1e5628
callq 0xb400
movq %rax, %rcx
movq 0x4a8(%rsp), %rax
movq %rcx, 0x1e10(%rax)
movq 0x4a8(%rsp), %rax
cmpq $0x0, 0x1d80(%rax)
jne 0x1c776a
movq 0x4a8(%rsp), %rdi
leaq 0x2bd41(%rip), %rsi     # 0x1f33e8
callq 0xb400
movq %rax, %rcx
movq 0x4a8(%rsp), %rax
movq %rcx, 0x1d80(%rax)
movq 0x4a8(%rsp), %rdi
leaq 0x2c11f(%rip), %rsi     # 0x1f37ec
callq 0xb400
movq %rax, %rcx
movq 0x4a8(%rsp), %rax
movq %rcx, 0x1df8(%rax)
movq 0x4a8(%rsp), %rdi
leaq 0x2c103(%rip), %rsi     # 0x1f37f6
callq 0xb400
movq %rax, %rcx
movq 0x4a8(%rsp), %rax
movq %rcx, 0x1e68(%rax)
movq 0x4a8(%rsp), %rdi
leaq 0x2a35e(%rip), %rsi     # 0x1f1a77
callq 0xb400
movq %rax, %rcx
movq 0x4a8(%rsp), %rax
movq %rcx, 0x1e08(%rax)
movq 0x4a8(%rsp), %rax
cmpq $0x0, 0x1dc8(%rax)
jne 0x1c7768
movq 0x4a8(%rsp), %rdi
leaq 0x2b81d(%rip), %rsi     # 0x1f2f6e
callq 0xb400
movq %rax, %rcx
movq 0x4a8(%rsp), %rax
movq %rcx, 0x1dc8(%rax)
jmp 0x1c776a
movq 0x4a8(%rsp), %rax
movq %rax, 0x138(%rsp)
movq 0x4a8(%rsp), %rax
movq 0x18b8(%rax), %rax
movq %rax, 0x140(%rsp)
movq 0x4a0(%rsp), %rax
movq %rax, 0x148(%rsp)
movq 0x4a8(%rsp), %rax
movq 0x18c0(%rax), %rax
movq %rax, 0x150(%rsp)
movq 0x4a0(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x23, %eax
jne 0x1c77e1
movq 0x4a8(%rsp), %rax
movq 0x10c0(%rax), %rax
movq %rax, 0x130(%rsp)
jmp 0x1c77f8
movq 0x4a8(%rsp), %rax
movq 0x1138(%rax), %rax
movq %rax, 0x130(%rsp)
movq 0x130(%rsp), %rax
movq %rax, 0x120(%rsp)
movq 0x4a8(%rsp), %rax
movq 0x1df8(%rax), %rax
movq %rax, 0x128(%rsp)
movq 0x4a0(%rsp), %rax
movq 0x8(%rax), %rax
cmpl $0x1, 0x4(%rax)
jne 0x1c784a
movq 0x4a8(%rsp), %rax
movq 0x1558(%rax), %rax
movq %rax, 0x118(%rsp)
jmp 0x1c789c
movq 0x4a0(%rsp), %rax
movq 0x8(%rax), %rax
cmpl $0x0, 0x4(%rax)
jne 0x1c7875
movq 0x4a8(%rsp), %rax
movq 0x1e00(%rax), %rax
movq %rax, 0x110(%rsp)
jmp 0x1c788c
movq 0x4a8(%rsp), %rax
movq 0x1de0(%rax), %rax
movq %rax, 0x110(%rsp)
movq 0x110(%rsp), %rax
movq %rax, 0x118(%rsp)
movq 0x128(%rsp), %r15
movq 0x118(%rsp), %r14
movq 0x4a8(%rsp), %rax
movq 0x1e68(%rax), %rbx
movq 0x4a8(%rsp), %rdi
movq 0x4a0(%rsp), %rax
movq 0x8(%rax), %rax
movb 0x2(%rax), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x9c10
movq %rax, 0x100(%rsp)
movq 0x4a8(%rsp), %rax
movq 0x10a8(%rax), %rax
movq %rax, 0x108(%rsp)
movq 0x4a8(%rsp), %rdi
movq 0x4a0(%rsp), %rax
movq (%rax), %rax
andq $0x1000000, %rax        # imm = 0x1000000
cmpq $0x0, %rax
setne %al
movzbl %al, %esi
andl $0x1, %esi
callq 0x9c10
movq 0x138(%rsp), %rdi
movq 0x140(%rsp), %rdx
movq 0x148(%rsp), %rcx
movq 0x150(%rsp), %r8
movq 0x120(%rsp), %r9
movq 0x100(%rsp), %r11
movq 0x108(%rsp), %r10
movl $0xa, %esi
movq %r15, (%rsp)
movq %r14, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movq %r11, 0x18(%rsp)
movq %r10, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movb $0x0, %al
callq 0x1c4750
movq %rax, 0x498(%rsp)
movq 0x498(%rsp), %rcx
movq 0x4a8(%rsp), %rax
movq 0x50(%rax), %rax
movq %rcx, 0x10(%rax)
movq 0x4a8(%rsp), %rax
movq 0x50(%rax), %rax
movl $0x1, %ecx
movq %rcx, 0x18(%rax)
movq 0x4a8(%rsp), %rax
movq 0x50(%rax), %rcx
addq $0x20, %rcx
movq %rcx, 0x50(%rax)
movq 0x4a0(%rsp), %rax
movq 0x8(%rax), %rax
cmpl $0x0, 0x4(%rax)
jne 0x1c7e5c
movq 0x4a8(%rsp), %rax
movq %rax, 0xe8(%rsp)
movq 0x498(%rsp), %rax
movq %rax, 0xf0(%rsp)
movq 0x4a8(%rsp), %rax
movq 0x1e00(%rax), %rax
movq %rax, 0xf8(%rsp)
movq 0x4a8(%rsp), %rax
movq %rax, 0xe0(%rsp)
movq 0x4a8(%rsp), %rdi
movq 0x4a0(%rsp), %rsi
callq 0x35ea0
movq 0xe0(%rsp), %rdi
movq %rax, %rsi
callq 0x6ae80
movq 0xe8(%rsp), %rdi
movq 0xf0(%rsp), %rsi
movq 0xf8(%rsp), %rdx
movq %rax, %rcx
callq 0xc040
movq 0x4a0(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x23, %eax
jne 0x1c7b12
movq 0x4a8(%rsp), %rax
movq %rax, 0xc8(%rsp)
movq 0x498(%rsp), %rax
movq %rax, 0xd0(%rsp)
movq 0x4a8(%rsp), %rax
movq 0x1e10(%rax), %rax
movq %rax, 0xd8(%rsp)
movq 0x4a8(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0x4a8(%rsp), %rdi
movq 0x4a0(%rsp), %rsi
callq 0x35ea0
movq 0xc0(%rsp), %rdi
movq %rax, %rsi
callq 0x6ae20
movq 0xc8(%rsp), %rdi
movq 0xd0(%rsp), %rsi
movq 0xd8(%rsp), %rdx
movq %rax, %rcx
callq 0xc040
movq 0x4a0(%rsp), %rax
movq 0x8(%rax), %rax
testb $0x1, 0x2(%rax)
jne 0x1c7e5a
movq 0x4a0(%rsp), %rax
movq 0x4a8(%rsp), %rcx
cmpq 0x1d8(%rcx), %rax
je 0x1c7e5a
movq 0x4a0(%rsp), %rax
movq 0x4a8(%rsp), %rcx
cmpq 0x1c8(%rcx), %rax
je 0x1c7e5a
movq 0x4a0(%rsp), %rax
movq 0x4a8(%rsp), %rcx
cmpq 0x1d0(%rcx), %rax
je 0x1c7e5a
movq 0x4a8(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0x498(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0x4a8(%rsp), %rax
movq 0x1e00(%rax), %rax
movq %rax, 0xb8(%rsp)
movq 0x4a0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x9420
cltq
movq %rax, 0x400(%rsp)
movq 0x400(%rsp), %rax
andq $-0x800, %rax           # imm = 0xF800
cmpq $0x0, %rax
jne 0x1c7c09
movq 0x400(%rsp), %rcx
leaq 0x4e888(%rip), %rax     # 0x216480
movq (%rax,%rcx,8), %rax
movq %rax, 0xa0(%rsp)
jmp 0x1c7ca4
jmp 0x1c7c0b
movq 0x4a8(%rsp), %rax
movq 0x90(%rax), %rax
movq 0x4a8(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x1c7c38
movq 0x4a8(%rsp), %rdi
callq 0xc670
movq 0x4a8(%rsp), %rcx
movq 0x90(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x90(%rcx)
movq -0x8(%rax), %rax
movq %rax, 0x3f0(%rsp)
movq 0x3f0(%rsp), %rax
movq $0xb, (%rax)
movq 0x400(%rsp), %rcx
movq 0x3f0(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x3f0(%rsp), %rax
movq %rax, 0x3e8(%rsp)
movq 0x3e8(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0xb8(%rsp), %rdx
movq 0xb0(%rsp), %rsi
movq 0xa8(%rsp), %rdi
movq 0xa0(%rsp), %rax
movq %rax, 0x3f8(%rsp)
movq 0x3f8(%rsp), %rcx
callq 0xc040
movq 0x4a0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x9420
movl %eax, %edi
leaq 0x408(%rsp), %rsi
callq 0x96e0
cmpl $-0x1, %eax
je 0x1c7e58
leaq 0x3a0(%rsp), %rax
movq %rax, 0x78(%rsp)
leaq 0x408(%rsp), %rdi
addq $0x48, %rdi
callq 0x9060
movq 0x78(%rsp), %rdi
movq %rax, %rcx
movl $0x40, %esi
leaq 0x2bac5(%rip), %rdx     # 0x1f37fd
callq 0x9540
leaq 0x360(%rsp), %rax
movq %rax, 0x80(%rsp)
leaq 0x408(%rsp), %rdi
addq $0x58, %rdi
callq 0x9060
movq 0x80(%rsp), %rdi
movq %rax, %rcx
movl $0x40, %esi
leaq 0x2ba88(%rip), %rdx     # 0x1f37fd
callq 0x9540
leaq 0x160(%rsp), %rdi
movl 0x420(%rsp), %ecx
movq 0x418(%rsp), %r8
movl 0x424(%rsp), %r9d
movl 0x428(%rsp), %ebx
movq 0x438(%rsp), %r11
leaq 0x3a0(%rsp), %r10
leaq 0x360(%rsp), %rax
movl $0x200, %esi            # imm = 0x200
leaq 0x2ba4b(%rip), %rdx     # 0x1f380f
movl %ebx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movb $0x0, %al
callq 0x9210
movl %eax, 0x15c(%rsp)
movq 0x4a8(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0x498(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x4a8(%rsp), %rax
movq 0x1e08(%rax), %rax
movq %rax, 0x98(%rsp)
movq 0x4a8(%rsp), %rdi
leaq 0x160(%rsp), %rsi
movslq 0x15c(%rsp), %rdx
callq 0x144d0
movq 0x88(%rsp), %rdi
movq 0x90(%rsp), %rsi
movq 0x98(%rsp), %rdx
movq %rax, %rcx
callq 0xc040
jmp 0x1c7e5a
jmp 0x1c7e5c
movq 0x4a0(%rsp), %rax
movq 0x8(%rax), %rax
cmpl $0x1, 0x4(%rax)
jne 0x1c7fdd
movq 0x4a0(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x1c7fdd
movq 0x4a0(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jle 0x1c7fdd
movq 0x4a8(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x498(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x4a8(%rsp), %rax
movq 0x1218(%rax), %rax
movq %rax, 0x58(%rsp)
movq 0x4a8(%rsp), %rdi
movq 0x4a0(%rsp), %rax
movq 0x18(%rax), %rsi
callq 0x120f0
movq 0x48(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq %rax, %rcx
callq 0xc040
movq 0x4a8(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x498(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x4a8(%rsp), %rax
movq 0x1dc8(%rax), %rax
movq %rax, 0x70(%rsp)
movq 0x4a8(%rsp), %rdi
movq 0x4a0(%rsp), %rax
movq 0x20(%rax), %rsi
callq 0x120f0
movq 0x60(%rsp), %rdi
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq %rax, %rcx
callq 0xc040
movq 0x4a0(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x4a8(%rsp), %rcx
cmpq 0x2a8(%rcx), %rax
jge 0x1c7fdb
movq 0x4a8(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x498(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x4a8(%rsp), %rax
movq 0x1d80(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x4a8(%rsp), %rdi
movq 0x4a0(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0x4a0(%rsp), %rax
movq 0x20(%rax), %rdx
callq 0x144d0
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq %rax, %rcx
callq 0xc040
jmp 0x1c7fdd
movq 0x4a8(%rsp), %rax
movq 0x50(%rax), %rcx
addq $-0x20, %rcx
movq %rcx, 0x50(%rax)
movq 0x498(%rsp), %rax
addq $0x4b0, %rsp            # imm = 0x4B0
popq %rbx
popq %r14
popq %r15
retq
nopw %cs:(%rax,%rax)