// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: c_pointer_to_port
static void c_pointer_to_port(s7_scheme *sc, s7_pointer obj, s7_pointer port, use_write_t use_write, shared_info *ci)
    {
        int32_t nlen;
        char buf[128];
        /* c-pointer is special because we can't set the type or info fields from scheme except via the c-pointer function */

        if (use_write == P_READABLE)
        {
            int32_t ref;
            if ((ci) &&
                    (is_cyclic(obj)) &&
                    ((ref = peek_shared_ref(ci, obj)) != 0))
            {
                port_write_string(port)(sc, "#f", 2, port);

                if (!is_cyclic_set(obj))
                {
                    if (ci->init_port == sc->F)
                    {
                        ci->init_port = s7_open_output_string(sc);
                        ci->init_loc = s7_gc_protect_1(sc, ci->init_port);
                    }
                    nlen = snprintf(buf, 128, "  (set! <%d> (c-pointer %" print_pointer, -ref, (intptr_t)c_pointer(obj));
                    port_write_string(ci->init_port)(sc, buf, nlen, ci->init_port);

                    if ((c_pointer_type(obj) != sc->F) ||
                            (c_pointer_info(obj) != sc->F))
                    {
                        flip_ref(ci, c_pointer_type(obj));

                        port_write_character(ci->init_port)(sc, ' ', ci->init_port);
                        object_to_port_with_circle_check(sc, c_pointer_type(obj), ci->init_port, use_write, ci);

                        flip_ref(ci, c_pointer_type(obj));
                        flip_ref(ci, c_pointer_info(obj));

                        port_write_character(ci->init_port)(sc, ' ', ci->init_port);
                        object_to_port_with_circle_check(sc, c_pointer_info(obj), ci->init_port, use_write, ci);

                        flip_ref(ci, c_pointer_info(obj));
                    }
                    port_write_string(ci->init_port)(sc, "))\n", 3, ci->init_port);
                    set_cyclic_set(obj);
                }
            }
            else
            {
                nlen = snprintf(buf, 128, "(c-pointer %" print_pointer, (intptr_t)c_pointer(obj));
                port_write_string(port)(sc, buf, nlen, port);
                if ((c_pointer_type(obj) != sc->F) ||
                        (c_pointer_info(obj) != sc->F))
                {
                    port_write_character(port)(sc, ' ', port);
                    object_to_port_with_circle_check(sc, c_pointer_type(obj), port, use_write, ci);
                    port_write_character(port)(sc, ' ', port);
                    object_to_port_with_circle_check(sc, c_pointer_info(obj), port, use_write, ci);
                }
                port_write_character(port)(sc, ')', port);
            }
        }
        else
        {
            if (is_symbol(c_pointer_type(obj)))
                nlen = snprintf(buf, 128, "#<%s %p>", symbol_name(c_pointer_type(obj)), c_pointer(obj));
            else nlen = snprintf(buf, 128, "#<c_pointer %p>", c_pointer(obj));
            port_write_string(port)(sc, buf, nlen, port);
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
cmpl $0x2, %ecx
jne 0xc1608
movq %r8, %r14
testq %r8, %r8
je 0xc163c
testb $0x20, 0x6(%r15)
je 0xc163c
movq %r14, %rdi
movq %r15, %rsi
callq 0x7855f
testl %eax, %eax
je 0xc163c
movl %eax, %ebp
movq 0x8(%r12), %rax
movq 0x48(%rax), %rax
leaq 0x1673f(%rip), %rsi     # 0xd7c5b
pushq $0x2
popq %rdx
movq %rbx, %rdi
movq %r12, %rcx
callq *0x10(%rax)
testb $0x40, 0x6(%r15)
jne 0xc17a2
movq 0x30(%r14), %rax
cmpq 0x120(%rbx), %rax
jne 0xc155b
movq %rbx, %rdi
callq 0xdc08
movq %rax, 0x30(%r14)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x89a9
movq %rax, 0x40(%r14)
negl %ebp
movq 0x8(%r15), %r8
leaq 0x255bd(%rip), %rdx     # 0xe6b25
movq %rsp, %r12
movl $0x80, %esi
movq %r12, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x8210
movq 0x30(%r14), %rcx
movq 0x8(%rcx), %rdx
movq 0x48(%rdx), %r8
movslq %eax, %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq *0x10(%r8)
movq 0x10(%r15), %rsi
cmpq 0x120(%rbx), %rsi
jne 0xc15ac
cmpq %rsi, 0x18(%r15)
je 0xc184a
movq %r14, %rdi
callq 0x77c75
movq 0x30(%r14), %rdx
movq 0x8(%rdx), %rax
movq 0x48(%rax), %rax
pushq $0x20
popq %rsi
movq %rbx, %rdi
callq *0x8(%rax)
movq 0x10(%r15), %rsi
movzbl (%rsi), %eax
leaq 0x5fd69(%rip), %r12     # 0x121340
cmpb $0x1, (%rax,%r12)
jne 0xc17b4
cmpl $0x15, %eax
jne 0xc15f1
testb $0x1, 0x7(%rsi)
jne 0xc17b4
movq 0x30(%r14), %rdx
pushq $0x2
popq %rcx
movq %rbx, %rdi
movq %r14, %r8
callq 0x77872
jmp 0xc17cc
movq 0x10(%r15), %rax
cmpb $0xa, (%rax)
jne 0xc16d5
movq 0x8(%rax), %rax
movq 0x10(%rax), %rcx
movq 0x8(%r15), %r8
leaq 0x25519(%rip), %rdx     # 0xe6b41
movq %rsp, %rdi
movl $0x80, %esi
xorl %eax, %eax
callq 0x8210
jmp 0xc16ef
movq 0x8(%r15), %rcx
leaq 0x254eb(%rip), %rdx     # 0xe6b32
movq %rsp, %r13
movl $0x80, %esi
movq %r13, %rdi
xorl %eax, %eax
callq 0x8210
movq 0x8(%r12), %rcx
movq 0x48(%rcx), %r8
movslq %eax, %rdx
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rcx
callq *0x10(%r8)
movq 0x10(%r15), %rax
cmpq 0x120(%rbx), %rax
jne 0xc1689
cmpq %rax, 0x18(%r15)
je 0xc178d
movq 0x8(%r12), %rax
movq 0x48(%rax), %rax
pushq $0x20
popq %rsi
movq %rbx, %rdi
movq %r12, %rdx
callq *0x8(%rax)
movq 0x10(%r15), %rsi
movzbl (%rsi), %eax
testq %r14, %r14
je 0xc1710
leaq 0x5fc8f(%rip), %rcx     # 0x121340
cmpb $0x1, (%rax,%rcx)
jne 0xc1710
cmpl $0x15, %eax
jne 0xc16c2
testb $0x1, 0x7(%rsi)
jne 0xc170d
pushq $0x2
popq %rcx
movq %rbx, %rdi
movq %r12, %rdx
movq %r14, %r8
callq 0x77872
jmp 0xc1727
movq 0x8(%r15), %rcx
leaq 0x2546a(%rip), %rdx     # 0xe6b4a
movq %rsp, %rdi
movl $0x80, %esi
xorl %eax, %eax
callq 0x8210
movq 0x8(%r12), %rcx
movq 0x48(%rcx), %r8
movslq %eax, %rdx
movq %rsp, %rsi
movq %rbx, %rdi
movq %r12, %rcx
callq *0x10(%r8)
jmp 0xc17a2
pushq $0x15
popq %rax
leaq 0x5fc69(%rip), %r9      # 0x121380
pushq $0x2
popq %rcx
movq %rbx, %rdi
movq %r12, %rdx
movq %r14, %r8
callq *(%r9,%rax,8)
movq 0x8(%r12), %rax
movq 0x48(%rax), %rax
pushq $0x20
popq %rsi
movq %rbx, %rdi
movq %r12, %rdx
callq *0x8(%rax)
movq 0x18(%r15), %rsi
movzbl (%rsi), %eax
testq %r14, %r14
je 0xc1776
leaq 0x5fbf1(%rip), %rcx     # 0x121340
cmpb $0x1, (%rax,%rcx)
jne 0xc1776
cmpl $0x15, %eax
jne 0xc1760
testb $0x1, 0x7(%rsi)
jne 0xc1773
pushq $0x2
popq %rcx
movq %rbx, %rdi
movq %r12, %rdx
movq %r14, %r8
callq 0x77872
jmp 0xc178d
pushq $0x15
popq %rax
leaq 0x5fc03(%rip), %r9      # 0x121380
pushq $0x2
popq %rcx
movq %rbx, %rdi
movq %r12, %rdx
movq %r14, %r8
callq *(%r9,%rax,8)
movq 0x8(%r12), %rax
movq 0x48(%rax), %rax
pushq $0x29
popq %rsi
movq %rbx, %rdi
movq %r12, %rdx
callq *0x8(%rax)
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5fbc5(%rip), %r9      # 0x121380
movq 0x30(%r14), %rdx
pushq $0x2
popq %rcx
movq %rbx, %rdi
movq %r14, %r8
callq *(%r9,%rax,8)
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x77c75
movq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0x77c75
movq 0x30(%r14), %rdx
movq 0x8(%rdx), %rax
movq 0x48(%rax), %rax
pushq $0x20
popq %rsi
movq %rbx, %rdi
callq *0x8(%rax)
movq 0x18(%r15), %rsi
movzbl (%rsi), %eax
cmpb $0x1, (%rax,%r12)
jne 0xc1826
cmpl $0x15, %eax
jne 0xc1812
testb $0x1, 0x7(%rsi)
jne 0xc1826
movq 0x30(%r14), %rdx
pushq $0x2
popq %rcx
movq %rbx, %rdi
movq %r14, %r8
callq 0x77872
jmp 0xc183e
leaq 0x5fb53(%rip), %r9      # 0x121380
movq 0x30(%r14), %rdx
pushq $0x2
popq %rcx
movq %rbx, %rdi
movq %r14, %r8
callq *(%r9,%rax,8)
movq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0x77c75
movq 0x30(%r14), %rcx
movq 0x8(%rcx), %rax
movq 0x48(%rax), %rax
leaq 0x24d1b(%rip), %rsi     # 0xe6578
pushq $0x3
popq %rdx
movq %rbx, %rdi
callq *0x10(%rax)
orb $0x40, 0x6(%r15)
jmp 0xc17a2