// File: /workspace/github_c_makefile_star2_O3/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 $0xc8, %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 0xf34ce
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 $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8050
movq 0x80(%rdx), %rax
testq %rax, %rax
je 0xf3540
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 $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
cmpl $0x2, %ecx
jne 0xf35cf
movq 0x78(%rdx), %rax
testq %rax, %rax
je 0xf35cf
cmpq $0x0, 0x50(%rdx)
je 0xf35cf
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), %rsi
movq %rax, 0x4d8(%r14)
testq %r15, %r15
movq %rsi, 0x38(%rsp)
je 0xf3a15
testb $0x20, 0x6(%rbp)
je 0xf3a15
testb $0x2, 0x2(%rbp)
je 0xf3a15
movslq 0xc(%r15), %rax
testq %rax, %rax
jle 0xf3a15
movq (%r15), %rdx
xorl %ecx, %ecx
cmpq %rbp, (%rdx,%rcx,8)
je 0xf3661
incq %rcx
cmpq %rcx, %rax
jne 0xf35b8
jmp 0xf3a15
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
leaq 0x27633(%rip), %rsi     # 0x11ac11
movl $0x2, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq *0x10(%rax)
movq 0x8(%rbp), %rax
movq 0x8(%rbx), %rcx
movq 0x48(%rcx), %r8
movq 0x8d8(%r14), %rcx
movq (%rcx,%rax,8), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rdx
movq 0x10(%rax), %rsi
movq %r14, %rdi
movq %rbx, %rcx
callq *0x10(%r8)
leaq 0x27595(%rip), %rdx     # 0x11abb5
leaq 0x40(%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 $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x20(%r15), %rax
movl (%rax,%rcx,4), %eax
testl %eax, %eax
je 0xf3a15
movl %eax, %r13d
negl %r13d
cmovsl %eax, %r13d
movq 0x48(%r15), %rax
cmpb $0x0, (%rax,%r13)
jne 0xf3b0d
cmpq %rbx, 0x28(%r15)
je 0xf3b0d
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq %r14, %rdi
movl $0x28, %esi
movq %rbx, %rdx
callq *0x8(%rax)
movq 0x8(%rbp), %rax
movq 0x8(%rbx), %rcx
movq 0x48(%rcx), %r8
movq 0x8d8(%r14), %rcx
movq (%rcx,%rax,8), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rdx
movq 0x10(%rax), %rsi
movq %r14, %rdi
movq %rbx, %rcx
callq *0x10(%r8)
cmpb $0x1, (%r12)
jne 0xf3ae6
movabsq $0x100000000000015, %rax # imm = 0x100000000000015
leaq 0xb6f(%r14), %rcx
movq %rcx, 0x10(%rsp)
leaq 0xb8f(%r14), %rcx
movq %rcx, 0x28(%rsp)
leaq 0x22e36(%rip), %rbp     # 0x116540
addq $0xea, %rax
movq %rax, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movq 0x8(%r12), %r8
movzbl (%r8), %eax
leaq 0x5ec12(%rip), %rcx     # 0x152340
cmpb $0x1, (%rax,%rcx)
jne 0xf3882
cmpb $0x15, %al
jne 0xf3747
testb $0x1, 0x7(%r8)
jne 0xf3882
movq %r8, 0x30(%rsp)
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movl $0x3, %edx
movq %r14, %rdi
leaq 0x18557(%rip), %rsi     # 0x10bcba
movq %rbx, %rcx
callq *0x10(%rax)
movb $0x0, 0xb6f(%r14)
movq 0x10(%rsp), %rcx
movq %r13, %rsi
movabsq $-0x3333333333333333, %r8 # imm = 0xCCCCCCCCCCCCCCCD
movq %rsi, %rax
mulq %r8
shrq $0x3, %rdx
leaq (%rdx,%rdx), %rax
leaq (%rax,%rax,4), %rax
movq %rsi, %rdi
subq %rax, %rdi
movb (%rbp,%rdi), %al
movb %al, -0x1(%rcx)
decq %rcx
cmpq $0x9, %rsi
movq %rdx, %rsi
ja 0xf3783
movq 0x28(%rsp), %r8
movb $0x0, (%r8)
movq 0x18(%rsp), %rsi
movabsq $0x6666666666666667, %r9 # imm = 0x6666666666666667
movq %rsi, %rax
imulq %r9
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x2, %rdx
addq %rax, %rdx
leaq (%rdx,%rdx), %rax
leaq (%rax,%rax,4), %rax
movq %rsi, %rdi
subq %rax, %rdi
movb (%rbp,%rdi), %al
movb %al, -0x1(%r8)
decq %r8
addq $0x9, %rsi
cmpq $0x12, %rsi
movq %rdx, %rsi
ja 0xf37c6
movq $0x0, (%rsp)
leaq 0x40(%rsp), %rdi
leaq 0x26d90(%rip), %rsi     # 0x11a5a4
movq %rcx, %rdx
leaq 0x23321(%rip), %rcx     # 0x116b3f
leaq 0x26f90(%rip), %r9      # 0x11a7b5
xorl %eax, %eax
callq 0xc442
movq 0x28(%r15), %rcx
movq 0x8(%rcx), %rdx
movq 0x48(%rdx), %r8
movslq %eax, %rdx
movq %r14, %rdi
leaq 0x40(%rsp), %rsi
callq *0x10(%r8)
movq 0x30(%rsp), %rsi
movq (%rsi), %rax
btl $0x11, %eax
jae 0xf3987
movslq 0xc(%r15), %rcx
testq %rcx, %rcx
jle 0xf3987
movq (%r15), %rdi
xorl %edx, %edx
cmpq %rsi, (%rdi,%rdx,8)
je 0xf38f7
incq %rdx
cmpq %rdx, %rcx
jne 0xf386b
jmp 0xf3987
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq %r14, %rdi
movl $0x20, %esi
movq %rbx, %rdx
movq %r8, %rbp
callq *0x8(%rax)
movzbl (%rbp), %eax
leaq 0x5ea9a(%rip), %rcx     # 0x152340
cmpb $0x1, (%rax,%rcx)
jne 0xf38cf
cmpl $0x15, %eax
jne 0xf38b7
testb $0x1, 0x7(%rbp)
jne 0xf38cf
movq %r14, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movl $0x2, %ecx
movq %r15, %r8
callq 0x9596b
jmp 0xf38eb
movq %r14, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movl $0x2, %ecx
movq %r15, %r8
leaq 0x5ea99(%rip), %r9      # 0x152380
callq *(%r9,%rax,8)
leaq 0x22c4e(%rip), %rbp     # 0x116540
jmp 0xf39fb
movq 0x20(%r15), %rcx
movl (%rcx,%rdx,4), %ecx
testl %ecx, %ecx
je 0xf3987
movl %ecx, %esi
negl %esi
cmovsl %ecx, %esi
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx)
movabsq $-0x3333333333333333, %r8 # imm = 0xCCCCCCCCCCCCCCCD
movq %rsi, %rax
mulq %r8
shrq $0x3, %rdx
leaq (%rdx,%rdx), %rax
leaq (%rax,%rax,4), %rax
movq %rsi, %rdi
subq %rax, %rdi
movb (%rbp,%rdi), %al
movb %al, -0x1(%rcx)
decq %rcx
cmpq $0x9, %rsi
movq %rdx, %rsi
ja 0xf391f
leaq 0x40(%rsp), %rdi
leaq 0x26f15(%rip), %rsi     # 0x11a86b
movq %rcx, %rdx
leaq 0x26c58(%rip), %rcx     # 0x11a5b8
xorl %r8d, %r8d
xorl %eax, %eax
callq 0xc442
movq 0x28(%r15), %rcx
movq 0x8(%rcx), %rdx
movq 0x48(%rdx), %r8
movslq %eax, %rdx
movq %r14, %rdi
leaq 0x40(%rsp), %rsi
callq *0x10(%r8)
jmp 0xf39fb
movzbl %al, %r9d
andq 0x20(%rsp), %rax
movabsq $0x100000000000015, %rcx # imm = 0x100000000000015
cmpq %rcx, %rax
je 0xf39c3
leaq 0x5e99a(%rip), %rax     # 0x152340
cmpb $0x0, (%r9,%rax)
je 0xf39c3
movq 0x28(%r15), %rdx
movq %r14, %rdi
movl $0x2, %ecx
movq %r15, %r8
callq 0x9596b
jmp 0xf39dd
movq 0x28(%r15), %rdx
movq %r14, %rdi
movl $0x2, %ecx
movq %r15, %r8
leaq 0x5e9a7(%rip), %rax     # 0x152380
callq *(%rax,%r9,8)
movq 0x28(%r15), %rcx
movq 0x8(%rcx), %rax
movq 0x48(%rax), %rax
movl $0x2, %edx
movq %r14, %rdi
leaq 0x26be1(%rip), %rsi     # 0x11a5d9
callq *0x10(%rax)
incq 0x18(%rsp)
movq 0x10(%r12), %r12
cmpb $0x1, (%r12)
je 0xf371e
jmp 0xf3ae6
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq %r14, %rdi
movl $0x28, %esi
movq %rbx, %rdx
callq *0x8(%rax)
movq 0x8(%rbp), %rax
movq 0x8(%rbx), %rcx
movq 0x48(%rcx), %r8
movq 0x8d8(%r14), %rcx
movq (%rcx,%rax,8), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rdx
movq 0x10(%rax), %rsi
movq %r14, %rdi
movq %rbx, %rcx
callq *0x10(%r8)
cmpb $0x1, (%r12)
jne 0xf3ae6
leaq 0x5e916(%rip), %rbp     # 0x152380
movq 0x8(%r12), %r13
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq %r14, %rdi
movl $0x20, %esi
movq %rbx, %rdx
callq *0x8(%rax)
movzbl (%r13), %eax
testq %r15, %r15
je 0xf3ac5
leaq 0x5e8aa(%rip), %rcx     # 0x152340
cmpb $0x1, (%rax,%rcx)
jne 0xf3ac5
cmpl $0x15, %eax
jne 0xf3aad
movl $0x15, %eax
testb $0x1, 0x7(%r13)
jne 0xf3ac5
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
movl $0x2, %ecx
movq %r15, %r8
callq 0x9596b
jmp 0xf3ada
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
movl $0x2, %ecx
movq %r15, %r8
callq *(%rbp,%rax,8)
movq 0x10(%r12), %r12
cmpb $0x1, (%r12)
je 0xf3a6a
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq %r14, %rdi
movl $0x29, %esi
movq %rbx, %rdx
callq *0x8(%rax)
movq 0x38(%rsp), %rax
movq %rax, 0x4d8(%r14)
jmp 0xf364f
leaq 0xb6f(%r14), %r8
movb $0x0, 0xb6f(%r14)
leaq 0x22a1d(%rip), %rcx     # 0x116540
movabsq $-0x3333333333333333, %rsi # imm = 0xCCCCCCCCCCCCCCCD
movq %r13, %rax
mulq %rsi
shrq $0x3, %rdx
leaq (%rdx,%rdx), %rax
leaq (%rax,%rax,4), %rax
movq %r13, %rdi
subq %rax, %rdi
movb (%rcx,%rdi), %al
movb %al, -0x1(%r8)
decq %r8
cmpq $0x9, %r13
movq %rdx, %r13
ja 0xf3b2d
leaq 0x26d0c(%rip), %rsi     # 0x11a86b
leaq 0x26fdb(%rip), %rcx     # 0x11ab41
leaq 0x40(%rsp), %r15
movq %r15, %rdi
movq %r8, %rdx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0xc442
movq 0x8(%rbx), %rcx
movq 0x48(%rcx), %r8
movslq %eax, %rdx
jmp 0xf3642