// File: /workspace/github_c_makefile_star2_O1/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 0xfbd50
movq %r8, %r14
testq %r8, %r8
je 0xfbe92
testb $0x20, 0x6(%r15)
je 0xfbe92
xorl %ebp, %ebp
testb $0x2, 0x2(%r15)
je 0xfbdbc
movslq 0xc(%r14), %rax
testq %rax, %rax
jle 0xfbdbc
movq (%r14), %rdx
xorl %ecx, %ecx
cmpq %r15, (%rdx,%rcx,8)
je 0xfbdb5
incq %rcx
cmpq %rcx, %rax
jne 0xfbd3e
xorl %ebp, %ebp
jmp 0xfbdbc
movq 0x10(%r15), %rax
cmpb $0xa, (%rax)
jne 0xfbd7d
movq 0x8(%rax), %rax
movq 0x10(%rax), %rcx
movq 0x8(%r15), %r8
leaq 0x27d25(%rip), %rdx     # 0x123a91
movq %rsp, %rdi
movl $0x80, %esi
xorl %eax, %eax
callq 0x9210
jmp 0xfbd97
movq 0x8(%r15), %rcx
leaq 0x27d12(%rip), %rdx     # 0x123a9a
movq %rsp, %rdi
movl $0x80, %esi
xorl %eax, %eax
callq 0x9210
movq 0x8(%r12), %rcx
movq 0x48(%rcx), %r8
movslq %eax, %rdx
movq %rsp, %rsi
movq %rbx, %rdi
movq %r12, %rcx
callq *0x10(%r8)
jmp 0xfbfcc
movq 0x20(%r14), %rax
movl (%rax,%rcx,4), %ebp
testl %ebp, %ebp
je 0xfbe92
movq 0x8(%r12), %rax
movq 0x48(%rax), %rax
leaq 0x18dd7(%rip), %rsi     # 0x114bab
movl $0x2, %edx
movq %rbx, %rdi
movq %r12, %rcx
callq *0x10(%rax)
testb $0x40, 0x6(%r15)
jne 0xfbfcc
movq 0x30(%r14), %rax
cmpq 0x120(%rbx), %rax
jne 0xfbe15
movq %rbx, %rdi
callq 0x1055d
movq %rax, 0x30(%r14)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x9b10
movq %rax, 0x40(%r14)
negl %ebp
movq 0x8(%r15), %r8
leaq 0x27c53(%rip), %rdx     # 0x123a75
movq %rsp, %r12
movl $0x80, %esi
movq %r12, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x9210
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
movq 0x120(%rbx), %rcx
cmpq %rcx, %rax
jne 0xfbe69
cmpq %rcx, 0x18(%r15)
je 0xfc124
movslq 0xc(%r14), %rcx
testq %rcx, %rcx
jle 0xfbfe5
movq (%r14), %rsi
xorl %edx, %edx
cmpq %rax, (%rsi,%rdx,8)
je 0xfbfde
incq %rdx
cmpq %rdx, %rcx
jne 0xfbe7b
jmp 0xfbfe5
movq 0x8(%r15), %rcx
leaq 0x27be5(%rip), %rdx     # 0x123a82
movq %rsp, %r13
movl $0x80, %esi
movq %r13, %rdi
xorl %eax, %eax
callq 0x9210
movq 0x8(%r12), %rcx
movq 0x48(%rcx), %r8
movslq %eax, %rdx
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rcx
callq *0x10(%r8)
movq 0x120(%rbx), %rax
cmpq %rax, 0x10(%r15)
jne 0xfbedf
cmpq %rax, 0x18(%r15)
je 0xfbfb5
movq 0x8(%r12), %rax
movq 0x48(%rax), %rax
movq %rbx, %rdi
movl $0x20, %esi
movq %r12, %rdx
callq *0x8(%rax)
movq 0x10(%r15), %rsi
testq %r14, %r14
je 0xfbf2e
movzbl (%rsi), %eax
leaq 0x5e437(%rip), %rcx     # 0x15a340
cmpb $0x1, (%rax,%rcx)
jne 0xfbf2e
cmpb $0x15, %al
jne 0xfbf19
testb $0x1, 0x7(%rsi)
jne 0xfbf2e
movq %rbx, %rdi
movq %r12, %rdx
movl $0x2, %ecx
movq %r14, %r8
callq 0x9c033
jmp 0xfbf4a
movzbl (%rsi), %eax
leaq 0x5e448(%rip), %r9      # 0x15a380
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
testq %r14, %r14
je 0xfbf99
movzbl (%rsi), %eax
leaq 0x5e3cc(%rip), %rcx     # 0x15a340
cmpb $0x1, (%rax,%rcx)
jne 0xfbf99
cmpb $0x15, %al
jne 0xfbf84
testb $0x1, 0x7(%rsi)
jne 0xfbf99
movq %rbx, %rdi
movq %r12, %rdx
movl $0x2, %ecx
movq %r14, %r8
callq 0x9c033
jmp 0xfbfb5
movzbl (%rsi), %eax
leaq 0x5e3dd(%rip), %r9      # 0x15a380
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 0x5e336(%rip), %r12     # 0x15a340
cmpb $0x1, (%rax,%r12)
jne 0xfc032
cmpl $0x15, %eax
jne 0xfc01c
testb $0x1, 0x7(%rsi)
jne 0xfc032
movq 0x30(%r14), %rdx
movq %rbx, %rdi
movl $0x2, %ecx
movq %r14, %r8
callq 0x9c033
jmp 0xfc04c
leaq 0x5e347(%rip), %r9      # 0x15a380
movq 0x30(%r14), %rdx
movq %rbx, %rdi
movl $0x2, %ecx
movq %r14, %r8
callq *(%r9,%rax,8)
movq (%r14), %rax
movslq 0xc(%r14), %rcx
testq %rcx, %rcx
jle 0xfc075
movq 0x10(%r15), %rsi
xorl %edx, %edx
cmpq %rsi, (%rax,%rdx,8)
je 0xfc06e
incq %rdx
cmpq %rdx, %rcx
jne 0xfc05e
jmp 0xfc075
movq 0x20(%r14), %rcx
negl (%rcx,%rdx,4)
movslq 0xc(%r14), %rcx
testq %rcx, %rcx
jle 0xfc09b
movq 0x18(%r15), %rsi
xorl %edx, %edx
cmpq %rsi, (%rax,%rdx,8)
je 0xfc094
incq %rdx
cmpq %rdx, %rcx
jne 0xfc084
jmp 0xfc09b
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 0x18(%r15), %rsi
movzbl (%rsi), %eax
cmpb $0x1, (%rax,%r12)
jne 0xfc0e1
cmpl $0x15, %eax
jne 0xfc0cb
testb $0x1, 0x7(%rsi)
jne 0xfc0e1
movq 0x30(%r14), %rdx
movq %rbx, %rdi
movl $0x2, %ecx
movq %r14, %r8
callq 0x9c033
jmp 0xfc0fb
leaq 0x5e298(%rip), %r9      # 0x15a380
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 0xfc124
movq 0x18(%r15), %rdx
movq (%r14), %rsi
xorl %ecx, %ecx
cmpq %rdx, (%rsi,%rcx,8)
je 0xfc11d
incq %rcx
cmpq %rcx, %rax
jne 0xfc10d
jmp 0xfc124
movq 0x20(%r14), %rax
negl (%rax,%rcx,4)
movq 0x30(%r14), %rcx
movq 0x8(%rcx), %rax
movq 0x48(%rax), %rax
leaq 0x27391(%rip), %rsi     # 0x1234c8
movl $0x3, %edx
movq %rbx, %rdi
callq *0x10(%rax)
orb $0x40, 0x6(%r15)
jmp 0xfbfcc