// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: c_object_to_port
static void c_object_to_port(s7_scheme *sc, s7_pointer obj, s7_pointer port, use_write_t use_write, shared_info *ci)
    {
#if (!DISABLE_DEPRECATED)
        if (c_object_print(sc, obj))
        {
            char *str;
            str = ((*(c_object_print(sc, obj)))(sc, c_object_value(obj)));
            port_display(port)(sc, str, port);
            free(str);
            return;
        }
#endif
        if (c_object_to_string(sc, obj))
            port_display(port)(sc, s7_string((*(c_object_to_string(sc, obj)))(sc, set_plist_2(sc, obj, (use_write == P_READABLE) ? sc->key_readable_symbol : sc->T))), port);
        else
        {
            if ((use_write == P_READABLE) &&
                    (c_object_to_list(sc, obj)) &&  /* to_list and (implicit) set are needed to reconstruct a cyclic c-object, as well as the maker (via type name) */
                    (c_object_set(sc, obj)))
            {
                s7_pointer obj_list, old_w, p;
                int32_t href;

                obj_list = ((*(c_object_to_list(sc, obj)))(sc, set_plist_1(sc, obj)));
                old_w = sc->w;
                sc->w = obj_list;

                if ((ci) &&
                        (is_cyclic(obj)) &&
                        ((href = peek_shared_ref(ci, obj)) != 0))
                {
                    int32_t i;
                    if (href < 0) href = -href;
                    if ((ci->defined[href]) || (port == ci->cycle_port))
                    {
                        int32_t nlen;
                        char buf[128];
                        nlen = catstrs_direct(buf, "<", pos_int_to_str_direct(sc, href), ">", NULL);
                        port_write_string(port)(sc, buf, nlen, port);
                        return;
                    }

                    port_write_character(port)(sc, '(', port);
                    c_object_name_to_port(sc, obj, port);
                    for (i = 0, p = obj_list; is_pair(p); i++, p = cdr(p))
                    {
                        s7_pointer val;
                        val = car(p);
                        if (has_structure(val))
                        {
                            char buf[128];
                            int32_t symref, len;

                            port_write_string(port)(sc, " #f", 3, port);
                            len = catstrs_direct(buf, "  (set! (<", pos_int_to_str_direct(sc, href), "> ", pos_int_to_str_direct_1(sc, i), ") ", NULL);
                            port_write_string(ci->cycle_port)(sc, buf, len, ci->cycle_port);

                            symref = peek_shared_ref(ci, val);
                            if (symref != 0)
                            {
                                if (symref < 0) symref = -symref;
                                len = catstrs_direct(buf, "<", pos_int_to_str_direct(sc, symref), ">)\n", NULL);
                                port_write_string(ci->cycle_port)(sc, buf, len, ci->cycle_port);
                            }
                            else
                            {
                                object_to_port_with_circle_check(sc, val, ci->cycle_port, P_READABLE, ci);
                                port_write_string(ci->cycle_port)(sc, ")\n", 2, ci->cycle_port);
                            }
                        }
                        else
                        {
                            port_write_character(port)(sc, ' ', port);
                            object_to_port_with_circle_check(sc, val, port, P_READABLE, ci);
                        }
                    }
                }
                else
                {
                    port_write_character(port)(sc, '(', port);
                    c_object_name_to_port(sc, obj, port);
                    for (p = obj_list; is_pair(p); p = cdr(p))
                    {
                        s7_pointer val;
                        val = car(p);
                        port_write_character(port)(sc, ' ', port);
                        object_to_port_with_circle_check(sc, val, port, P_READABLE, ci);
                    }
                }
                port_write_character(port)(sc, ')', port);
                sc->w = old_w;
            }
            else
            {
                char buf[128];
                int32_t nlen;
                port_write_string(port)(sc, "#<", 2, port);
                c_object_name_to_port(sc, obj, port);
                nlen = snprintf(buf, 128, " %p>", obj);
                port_write_string(port)(sc, buf, nlen, port);
            }
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, %rbx
movq %rsi, %rbp
movq %rdi, %r14
movq 0x8d8(%rdi), %rax
movq 0x8(%rsi), %rdx
movq (%rax,%rdx,8), %rdx
movq 0x40(%rdx), %rax
testq %rax, %rax
je 0xc19ad
movq 0x10(%rbp), %rsi
movq %r14, %rdi
callq *%rax
movq %rax, %r15
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq *0x40(%rax)
movq %r15, %rdi
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8050
movq 0x80(%rdx), %rax
testq %rax, %rax
je 0xc1a1f
movq 0x8(%rbx), %rdx
movq 0x48(%rdx), %rdx
movq 0x40(%rdx), %r15
leaq 0x118(%r14), %rdx
leaq 0x18a0(%r14), %rsi
cmpl $0x2, %ecx
cmoveq %rsi, %rdx
movq (%rdx), %rcx
movq 0x708(%r14), %rdx
movq %rbp, 0x8(%rdx)
movq 0x710(%r14), %rdx
movq %rcx, 0x8(%rdx)
movq 0x708(%r14), %rsi
movq %r14, %rdi
callq *%rax
movq 0x10(%rax), %rsi
movq %r14, %rdi
movq %rbx, %rdx
movq %r15, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
cmpl $0x2, %ecx
jne 0xc1cda
movq 0x78(%rdx), %rax
testq %rax, %rax
je 0xc1cda
cmpq $0x0, 0x50(%rdx)
je 0xc1cda
movq %r8, %r15
movq 0x700(%r14), %rcx
movq %rbp, 0x8(%rcx)
movq 0x700(%r14), %rsi
movq %r14, %rdi
callq *%rax
movq %rax, %r12
movq 0x4d8(%r14), %r13
movq %rax, 0x4d8(%r14)
testq %r15, %r15
je 0xc1d4b
testb $0x20, 0x6(%rbp)
je 0xc1d4b
movq %r15, %rdi
movq %rbp, %rsi
callq 0x7855f
testl %eax, %eax
je 0xc1d4b
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
movq 0x48(%r15), %rax
movq %rcx, 0x8(%rsp)
cmpb $0x0, (%rax,%rcx)
jne 0xc1e16
cmpq %rbx, 0x28(%r15)
je 0xc1e16
movq %r13, 0x10(%rsp)
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
pushq $0x28
popq %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq *0x8(%rax)
movq %r14, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0xc3717
leaq 0x5f85d(%rip), %rbp     # 0x121340
movq $0x0, 0x18(%rsp)
cmpb $0x1, (%r12)
jne 0xc1df1
movq 0x8(%r12), %r13
movzbl (%r13), %eax
cmpb $0x1, (%rax,%rbp)
jne 0xc1bff
cmpb $0x15, %al
jne 0xc1b1a
testb $0x1, 0x7(%r13)
jne 0xc1bff
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq %r14, %rdi
leaq 0x1612e(%rip), %rsi     # 0xd7c5a
pushq $0x3
popq %rdx
movq %rbx, %rcx
callq *0x10(%rax)
movq %r14, %rdi
movq 0x8(%rsp), %rsi
callq 0x91f9
movq %rax, %rbp
movq %r14, %rdi
movq 0x18(%rsp), %rsi
callq 0xc2437
andq $0x0, (%rsp)
leaq 0x20(%rsp), %rdi
leaq 0x249e1(%rip), %rsi     # 0xe6544
movq %rbp, %rdx
movq %rdi, %rbp
leaq 0x20f6f(%rip), %rcx     # 0xe2adf
movq %rax, %r8
leaq 0x24bdb(%rip), %r9      # 0xe6755
xorl %eax, %eax
callq 0xb3a5
movq 0x28(%r15), %rcx
movq 0x8(%rcx), %rdx
movq 0x48(%rdx), %r8
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq *0x10(%r8)
movq %r15, %rdi
movq %r13, %rsi
callq 0x7855f
testl %eax, %eax
je 0xc1c5f
movl %eax, %esi
negl %esi
cmovsl %eax, %esi
movq %r14, %rdi
callq 0x91f9
movq %rbp, %rdi
leaq 0x24c45(%rip), %rsi     # 0xe680b
movq %rax, %rdx
leaq 0x24988(%rip), %rcx     # 0xe6558
xorl %r8d, %r8d
xorl %eax, %eax
callq 0xb3a5
movq 0x28(%r15), %rcx
movq 0x8(%rcx), %rdx
movq 0x48(%rdx), %r8
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq *0x10(%r8)
leaq 0x5f746(%rip), %rbp     # 0x121340
jmp 0xc1ccb
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq %r14, %rdi
pushq $0x20
popq %rsi
movq %rbx, %rdx
callq *0x8(%rax)
movzbl (%r13), %eax
cmpb $0x1, (%rax,%rbp)
jne 0xc1c43
cmpl $0x15, %eax
jne 0xc1c2a
testb $0x1, 0x7(%r13)
jne 0xc1c43
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
pushq $0x2
popq %rcx
movq %r15, %r8
callq 0x77872
jmp 0xc1ccb
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
pushq $0x2
popq %rcx
movq %r15, %r8
leaq 0x5f727(%rip), %r9      # 0x121380
callq *(%r9,%rax,8)
jmp 0xc1ccb
movzbl (%r13), %eax
leaq 0x5f6d5(%rip), %rbp     # 0x121340
cmpb $0x1, (%rax,%rbp)
jne 0xc1c94
cmpl $0x15, %eax
jne 0xc1c7d
testb $0x1, 0x7(%r13)
jne 0xc1c94
movq 0x28(%r15), %rdx
movq %r14, %rdi
movq %r13, %rsi
pushq $0x2
popq %rcx
movq %r15, %r8
callq 0x77872
jmp 0xc1caf
movq 0x28(%r15), %rdx
movq %r14, %rdi
movq %r13, %rsi
pushq $0x2
popq %rcx
movq %r15, %r8
leaq 0x5f6d5(%rip), %r9      # 0x121380
callq *(%r9,%rax,8)
movq 0x28(%r15), %rcx
movq 0x8(%rcx), %rax
movq 0x48(%rax), %rax
movq %r14, %rdi
leaq 0x248b4(%rip), %rsi     # 0xe6579
pushq $0x2
popq %rdx
callq *0x10(%rax)
incq 0x18(%rsp)
movq 0x10(%r12), %r12
jmp 0xc1aec
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
leaq 0x24ec8(%rip), %rsi     # 0xe6bb1
pushq $0x2
popq %rdx
movq %r14, %rdi
movq %rbx, %rcx
callq *0x10(%rax)
movq %r14, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0xc3717
leaq 0x24e4b(%rip), %rdx     # 0xe6b55
leaq 0x20(%rsp), %r15
movl $0x80, %esi
movq %r15, %rdi
movq %rbp, %rcx
xorl %eax, %eax
callq 0x8210
movq 0x8(%rbx), %rcx
movq 0x48(%rcx), %r8
movslq %eax, %rdx
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rcx
callq *0x10(%r8)
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, 0x10(%rsp)
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
pushq $0x28
popq %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq *0x8(%rax)
movq %r14, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0xc3717
pushq $0x2
popq %r13
cmpb $0x1, (%r12)
jne 0xc1df1
movq 0x8(%r12), %rbp
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq %r14, %rdi
pushq $0x20
popq %rsi
movq %rbx, %rdx
callq *0x8(%rax)
movzbl (%rbp), %eax
testq %r15, %r15
je 0xc1dd0
leaq 0x5f59a(%rip), %rcx     # 0x121340
cmpb $0x1, (%rax,%rcx)
jne 0xc1dd0
cmpl $0x15, %eax
jne 0xc1dba
testb $0x1, 0x7(%rbp)
pushq $0x15
popq %rax
jne 0xc1dd0
movq %r14, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movl %r13d, %ecx
movq %r15, %r8
callq 0x77872
jmp 0xc1dea
movq %r14, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movl %r13d, %ecx
movq %r15, %r8
leaq 0x5f59a(%rip), %r9      # 0x121380
callq *(%r9,%rax,8)
movq 0x10(%r12), %r12
jmp 0xc1d76
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
pushq $0x29
popq %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq *0x8(%rax)
movq 0x10(%rsp), %rax
movq %rax, 0x4d8(%r14)
jmp 0xc1d39
movq %r14, %rdi
movq 0x8(%rsp), %rsi
callq 0x91f9
leaq 0x249e1(%rip), %rsi     # 0xe680b
leaq 0x24cb0(%rip), %rcx     # 0xe6ae1
leaq 0x20(%rsp), %r15
movq %r15, %rdi
movq %rax, %rdx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0xb3a5
movq 0x8(%rbx), %rcx
movq 0x48(%rcx), %r8
movslq %eax, %rdx
jmp 0xc1d2c