// File: /workspace/github_c_makefile_star2_O3/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 0xf2f7f
movq %r8, %r14
testq %r8, %r8
je 0xf30be
testb $0x20, 0x6(%r15)
je 0xf30be
testb $0x2, 0x2(%r15)
je 0xf30be
movslq 0xc(%r14), %rax
testq %rax, %rax
jle 0xf30be
movq (%r14), %rdx
xorl %ecx, %ecx
cmpq %r15, (%rdx,%rcx,8)
je 0xf2fe4
incq %rcx
cmpq %rcx, %rax
jne 0xf2f6c
jmp 0xf30be
movq 0x10(%r15), %rax
cmpb $0xa, (%rax)
jne 0xf2fac
movq 0x8(%rax), %rax
movq 0x10(%rax), %rcx
movq 0x8(%r15), %r8
leaq 0x27c06(%rip), %rdx     # 0x11aba1
movq %rsp, %rdi
movl $0x80, %esi
xorl %eax, %eax
callq 0x8210
jmp 0xf2fc6
movq 0x8(%r15), %rcx
leaq 0x27bf3(%rip), %rdx     # 0x11abaa
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 0xf31fe
movq 0x20(%r14), %rax
movl (%rax,%rcx,4), %ebp
testl %ebp, %ebp
je 0xf30be
movq 0x8(%r12), %rax
movq 0x48(%rax), %rax
leaq 0x18cb8(%rip), %rsi     # 0x10bcbb
movl $0x2, %edx
movq %rbx, %rdi
movq %r12, %rcx
callq *0x10(%rax)
testb $0x40, 0x6(%r15)
jne 0xf31fe
movq 0x30(%r14), %rax
cmpq 0x120(%rbx), %rax
jne 0xf3044
movq %rbx, %rdi
callq 0xf75a
movq %rax, 0x30(%r14)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8b1e
movq %rax, 0x40(%r14)
negl %ebp
movq 0x8(%r15), %r8
leaq 0x27b34(%rip), %rdx     # 0x11ab85
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), %rax
cmpq 0x120(%rbx), %rax
jne 0xf3095
cmpq %rax, 0x18(%r15)
je 0xf3361
movslq 0xc(%r14), %rcx
testq %rcx, %rcx
jle 0xf3217
movq (%r14), %rsi
xorl %edx, %edx
cmpq %rax, (%rsi,%rdx,8)
je 0xf3210
incq %rdx
cmpq %rdx, %rcx
jne 0xf30a7
jmp 0xf3217
movq 0x8(%r15), %rcx
leaq 0x27ac9(%rip), %rdx     # 0x11ab92
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 0xf310b
cmpq %rax, 0x18(%r15)
je 0xf31e7
movq 0x8(%r12), %rax
movq 0x48(%rax), %rax
movq %rbx, %rdi
movl $0x20, %esi
movq %r12, %rdx
callq *0x8(%rax)
movq 0x10(%r15), %rsi
movzbl (%rsi), %eax
testq %r14, %r14
je 0xf3160
leaq 0x5f20b(%rip), %rcx     # 0x152340
cmpb $0x1, (%rax,%rcx)
jne 0xf3160
cmpl $0x15, %eax
jne 0xf314b
movl $0x15, %eax
testb $0x1, 0x7(%rsi)
jne 0xf3160
movq %rbx, %rdi
movq %r12, %rdx
movl $0x2, %ecx
movq %r14, %r8
callq 0x9596b
jmp 0xf3179
leaq 0x5f219(%rip), %r9      # 0x152380
movq %rbx, %rdi
movq %r12, %rdx
movl $0x2, %ecx
movq %r14, %r8
callq *(%r9,%rax,8)
movq 0x8(%r12), %rax
movq 0x48(%rax), %rax
movq %rbx, %rdi
movl $0x20, %esi
movq %r12, %rdx
callq *0x8(%rax)
movq 0x18(%r15), %rsi
movzbl (%rsi), %eax
testq %r14, %r14
je 0xf31ce
leaq 0x5f19d(%rip), %rcx     # 0x152340
cmpb $0x1, (%rax,%rcx)
jne 0xf31ce
cmpl $0x15, %eax
jne 0xf31b9
movl $0x15, %eax
testb $0x1, 0x7(%rsi)
jne 0xf31ce
movq %rbx, %rdi
movq %r12, %rdx
movl $0x2, %ecx
movq %r14, %r8
callq 0x9596b
jmp 0xf31e7
leaq 0x5f1ab(%rip), %r9      # 0x152380
movq %rbx, %rdi
movq %r12, %rdx
movl $0x2, %ecx
movq %r14, %r8
callq *(%r9,%rax,8)
movq 0x8(%r12), %rax
movq 0x48(%rax), %rax
movq %rbx, %rdi
movl $0x29, %esi
movq %r12, %rdx
callq *0x8(%rax)
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x20(%r14), %rax
negl (%rax,%rdx,4)
movq 0x30(%r14), %rdx
movq 0x8(%rdx), %rax
movq 0x48(%rax), %rax
movq %rbx, %rdi
movl $0x20, %esi
callq *0x8(%rax)
movq 0x10(%r15), %rsi
movzbl (%rsi), %eax
leaq 0x5f104(%rip), %r12     # 0x152340
cmpb $0x1, (%rax,%r12)
jne 0xf3264
cmpl $0x15, %eax
jne 0xf324e
testb $0x1, 0x7(%rsi)
jne 0xf3264
movq 0x30(%r14), %rdx
movq %rbx, %rdi
movl $0x2, %ecx
movq %r14, %r8
callq 0x9596b
jmp 0xf327e
leaq 0x5f115(%rip), %r9      # 0x152380
movq 0x30(%r14), %rdx
movq %rbx, %rdi
movl $0x2, %ecx
movq %r14, %r8
callq *(%r9,%rax,8)
movslq 0xc(%r14), %rcx
testq %rcx, %rcx
jle 0xf32a0
movq 0x10(%r15), %rdx
movq (%r14), %rax
xorl %esi, %esi
cmpq %rdx, (%rax,%rsi,8)
je 0xf32a6
incq %rsi
cmpq %rsi, %rcx
jne 0xf3290
jmp 0xf32b1
leaq 0x18(%r15), %r13
jmp 0xf32d8
movq 0x20(%r14), %rcx
negl (%rcx,%rsi,4)
movl 0xc(%r14), %ecx
leaq 0x18(%r15), %r13
testl %ecx, %ecx
jle 0xf32d8
movq 0x18(%r15), %rdx
movl %ecx, %esi
xorl %ecx, %ecx
cmpq %rdx, (%rax,%rcx,8)
je 0xf32d1
incq %rcx
cmpq %rcx, %rsi
jne 0xf32c1
jmp 0xf32d8
movq 0x20(%r14), %rax
negl (%rax,%rcx,4)
movq 0x30(%r14), %rdx
movq 0x8(%rdx), %rax
movq 0x48(%rax), %rax
movq %rbx, %rdi
movl $0x20, %esi
callq *0x8(%rax)
movq (%r13), %rsi
movzbl (%rsi), %eax
cmpb $0x1, (%rax,%r12)
jne 0xf331e
cmpl $0x15, %eax
jne 0xf3308
testb $0x1, 0x7(%rsi)
jne 0xf331e
movq 0x30(%r14), %rdx
movq %rbx, %rdi
movl $0x2, %ecx
movq %r14, %r8
callq 0x9596b
jmp 0xf3338
leaq 0x5f05b(%rip), %r9      # 0x152380
movq 0x30(%r14), %rdx
movq %rbx, %rdi
movl $0x2, %ecx
movq %r14, %r8
callq *(%r9,%rax,8)
movslq 0xc(%r14), %rax
testq %rax, %rax
jle 0xf3361
movq (%r13), %rdx
movq (%r14), %rsi
xorl %ecx, %ecx
cmpq %rdx, (%rsi,%rcx,8)
je 0xf335a
incq %rcx
cmpq %rcx, %rax
jne 0xf334a
jmp 0xf3361
movq 0x20(%r14), %rax
negl (%rax,%rcx,4)
movq 0x30(%r14), %rcx
movq 0x8(%rcx), %rax
movq 0x48(%rax), %rax
leaq 0x27264(%rip), %rsi     # 0x11a5d8
movl $0x3, %edx
movq %rbx, %rdi
callq *0x10(%rax)
orb $0x40, 0x6(%r15)
jmp 0xf31fe