// File: /workspace/github_c_makefile_star2_O1/BernardTatin[P]s7sh/s7.c
// Function: closure_to_port
static void closure_to_port(s7_scheme *sc, s7_pointer obj, s7_pointer port, use_write_t use_write, shared_info *ci)
    {
        if (has_active_methods(sc, obj))
        {
            /* look for object->string method else fallback on ordinary case.
             * can't use recursion on closure_let here because then the fallback name is #<let>.
             * this is tricky!: (display (openlet (with-let (mock-c-pointer 0) (lambda () 1))))
             *   calls object->string on the closure whose closure_let is the mock-c-pointer;
             *   it has an object->string method that clears mock-c-pointers and tries again...
             *   so, display methods need to use coverlet/openlet.
             */
            s7_pointer print_func;
            print_func = find_method(sc, closure_let(obj), sc->object_to_string_symbol);
            if (print_func != sc->undefined)
            {
                s7_pointer p;
                p = s7_apply_function(sc, print_func, list_1(sc, obj));
                if (string_length(p) > 0)
                    port_write_string(port)(sc, string_value(p), string_length(p), port);
                return;
            }
        }
        if (use_write == P_READABLE)
            write_closure_readably(sc, obj, port, ci);
        else write_closure_name(sc, obj, port);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, 0x20(%rsp)
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
testb $0x40, 0x3(%rsi)
je 0xfb3d2
cmpb $0x1, 0x24c(%rbx)
jne 0xfb3d2
movq 0x18(%r12), %rsi
movq 0x1380(%rbx), %rdx
movq %rbx, %rdi
callq 0x99ef
movq 0x128(%rbx), %r13
cmpq %r13, %rax
je 0xfb3d2
movq %rax, %r15
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %rsi
cmpq 0x98(%rbx), %rax
ja 0xfb37a
movq %rbx, %rdi
movq %rsi, (%rsp)
callq 0xb389
movq (%rsp), %rsi
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rdx
movq $0x200001, (%rdx)       # imm = 0x200001
movq %r12, 0x8(%rdx)
movq %rsi, 0x10(%rdx)
movq %rbx, %rdi
movq %r15, %rsi
callq 0xbd41
movq 0x8(%rax), %rdx
testq %rdx, %rdx
jle 0xfb3c9
movq 0x8(%r14), %rcx
movq 0x48(%rcx), %r8
movq 0x10(%rax), %rsi
movq %rbx, %rdi
movq %r14, %rcx
callq *0x10(%r8)
cmpq %r13, %r15
jne 0xfb9f2
cmpl $0x2, %ebp
jne 0xfb423
movq 0x10(%r12), %r15
cmpq $0x0, 0x6a0(%rbx)
jle 0xfb43f
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3b2ff
testb %al, %al
je 0xfb43f
movq 0x8(%r14), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
leaq 0x28592(%rip), %rsi     # 0x12399a
movl $0x20, %edx
movq %rbx, %rdi
movq %r14, %rcx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xfe1cc
movq %r15, (%rsp)
movq 0x8(%r12), %r15
cmpb $0xa, (%r15)
jne 0xfb495
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %r13
cmpq 0x98(%rbx), %rax
ja 0xfb46d
movq %rbx, %rdi
callq 0xb389
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movq $0x200001, (%rax)       # imm = 0x200001
movq %r15, 0x8(%rax)
movq %r13, 0x10(%rax)
movq %rax, %r15
movq 0x18(%r12), %rax
movq %rax, 0x10(%rsp)
movq 0x110(%rbx), %rdi
cmpq $0x0, 0x108(%rbx)
jns 0xfb583
movq 0xd0(%rbx), %rax
movq 0xf0(%rbx), %r13
leaq (,%r13,2), %rcx
movq %rcx, 0x8(%rsp)
movq 0x18(%rax), %rsi
movq %r13, %rbp
shlq $0x4, %rbp
movq %rdi, 0x18(%rsp)
movq %rbx, %rdi
movq %rbp, %rdx
callq 0xae0f
movq $0x0, 0x20(%rax)
movq 0xd0(%rbx), %rcx
movq %rax, 0x18(%rcx)
movq (%rax), %rax
movq 0xd0(%rbx), %rcx
movq %rax, 0x10(%rcx)
movq 0xd0(%rbx), %rax
movq 0x8(%rsp), %rcx
movq %rcx, 0x8(%rax)
movq %rcx, 0xf0(%rbx)
movq 0xe8(%rbx), %rdi
movq %rbp, %rsi
callq 0x9510
movq 0x18(%rsp), %rdi
movq %rax, 0xe8(%rbx)
cmpq 0x8(%rsp), %r13
jge 0xfb583
movq %r13, %rax
movq 0xd0(%rbx), %rcx
movq 0x140(%rbx), %rdx
movq 0x10(%rcx), %rcx
movq %rdx, (%rcx,%rax,8)
movq 0xe8(%rbx), %rcx
movq 0x108(%rbx), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, 0x108(%rbx)
movq %rax, 0x8(%rcx,%rdx,8)
incq %rax
decq %r13
jne 0xfb547
movq 0xd0(%rbx), %rax
movq 0xe8(%rbx), %rcx
movq 0x108(%rbx), %rdx
leaq -0x1(%rdx), %rsi
movq %rsi, 0x108(%rbx)
movq (%rcx,%rdx,8), %rbp
movq 0x10(%rax), %rax
movq %rdi, (%rax,%rbp,8)
movq %rbx, %rdi
movq (%rsp), %rsi
movq 0x10(%rsp), %r13
movq %r13, %rdx
movq %r15, %rcx
movq %rbp, %r8
callq 0xfe4cc
movq 0x16c8(%rbx), %rsi
movq %rbx, %rdi
movq %r13, %rdx
movq %r15, %rcx
movq %rbp, %r8
callq 0xfe6c5
movq 0x16d0(%rbx), %rsi
movq %rbx, %rdi
movq %r13, %rdx
movq %r15, %rcx
movq %rbp, %r8
callq 0xfe6c5
movq 0x16c0(%rbx), %rsi
movq %rbx, %rdi
movq %r13, %rdx
movq %r15, %rcx
movq %rbp, %r8
callq 0xfe6c5
movq 0x16d8(%rbx), %rsi
movq %rbx, %rdi
movq %r13, %rdx
movq %r15, %rcx
movq %rbp, %r8
callq 0xfe6c5
movzbl (%r12), %eax
leal -0x28(%rax), %ecx
cmpl $0x6, %ecx
jb 0xfb64d
leal -0x2f(%rax), %ecx
cmpl $0x5, %ecx
jae 0xfb6f7
movq 0x8(%r12), %rax
addq $0x30, %rax
jmp 0xfb652
leaq 0x20(%r12), %rax
movq (%rsp), %r13
movq (%rax), %rax
cmpb $0x28, (%rax)
jb 0xfb70e
movq 0x20(%r12), %r15
movzbl (%r15), %eax
leaq 0x5329e(%rip), %rcx     # 0x14e910
cmpb $0x1, (%rax,%rcx)
jne 0xfb711
movq %r15, 0x8(%rsp)
movq 0x8(%r15), %r15
cmpb $0xa, (%r15)
jne 0xfb6d6
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %r13
cmpq 0x98(%rbx), %rax
ja 0xfb6aa
movq %rbx, %rdi
callq 0xb389
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movq $0x200001, (%rax)       # imm = 0x200001
movq %r15, 0x8(%rax)
movq %r13, 0x10(%rax)
movq %rax, %r15
movq (%rsp), %r13
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rsi
movq %rbx, %rdi
movq 0x10(%rsp), %rdx
movq %r15, %rcx
movq %rax, %r15
movq %rbp, %r8
callq 0xfe4cc
jmp 0xfb711
cmpl $0x2e, %eax
movq (%rsp), %r13
jne 0xfb70e
movq 0x8(%r12), %rax
addq $0x30, %rax
jmp 0xfb656
xorl %r15d, %r15d
movq 0xd0(%rbx), %rax
movq 0x10(%rax), %rax
movq (%rax,%rbp,8), %rax
movq %rax, 0x10(%rsp)
cmpq 0x110(%rbx), %rax
je 0xfb891
movq %r15, 0x8(%rsp)
movq %rbp, 0x18(%rsp)
movq 0x8(%r14), %rax
movq 0x48(%rax), %rax
leaq 0x242d3(%rip), %rsi     # 0x11fa1e
movl $0x6, %edx
movq %rbx, %rdi
movq %r14, %rcx
callq *0x10(%rax)
movq 0x10(%rsp), %rax
cmpb $0x1, (%rax)
jne 0xfb866
leaq 0x5f472(%rip), %rbp     # 0x15abe0
movq 0x10(%rsp), %r15
movq 0x8(%r15), %r13
movq 0x10(%r13), %rax
movzbl (%rax), %ecx
cmpb $0x0, (%rcx,%rbp)
jne 0xfb858
leaq 0x5ebb1(%rip), %rdx     # 0x15a340
cmpb $0x1, (%rcx,%rdx)
jne 0xfb7b1
cmpl $0x15, %ecx
jne 0xfb7a0
testb $0x1, 0x7(%rax)
jne 0xfb7b1
movq 0x8(%r13), %rax
cmpq 0x16c8(%rbx), %rax
jne 0xfb858
movq 0x8(%r14), %rax
movq 0x48(%rax), %rax
movq %rbx, %rdi
movl $0x28, %esi
movq %r14, %rdx
callq *0x8(%rax)
movq 0x8(%r14), %rax
movq 0x48(%rax), %rax
movq 0x8(%r13), %rcx
movq 0x8(%rcx), %rcx
movq 0x8(%rcx), %rdx
movq 0x10(%rcx), %rsi
movq %rbx, %rdi
movq %r14, %rcx
callq *0x10(%rax)
movq 0x8(%r14), %rax
movq 0x48(%rax), %rax
movq %rbx, %rdi
movl $0x20, %esi
movq %r14, %rdx
callq *0x8(%rax)
movq 0x10(%r13), %rsi
movzbl (%rsi), %eax
movq %rbx, %rdi
movq %r14, %rdx
movl $0x2, %ecx
xorl %r8d, %r8d
leaq 0x5eb66(%rip), %r9      # 0x15a380
callq *(%r9,%rax,8)
movq 0x10(%r15), %rcx
movq 0x8(%r14), %rax
movq 0x48(%rax), %rax
cmpq 0x110(%rbx), %rcx
je 0xfb84a
movl $0x2, %edx
movq %rbx, %rdi
leaq 0x27e63(%rip), %rsi     # 0x1236a5
movq %r14, %rcx
callq *0x10(%rax)
jmp 0xfb858
movq %rbx, %rdi
movl $0x29, %esi
movq %r14, %rdx
callq *0x8(%rax)
movq 0x10(%r15), %r15
cmpb $0x1, (%r15)
je 0xfb773
movq 0x8(%r14), %rax
movq 0x48(%rax), %rax
leaq 0x27e30(%rip), %rsi     # 0x1236a5
movl $0x2, %edx
movq %rbx, %rdi
movq %r14, %rcx
callq *0x10(%rax)
movq 0x18(%rsp), %rbp
movq (%rsp), %r13
movq 0x8(%rsp), %r15
testq %r15, %r15
je 0xfb908
movq 0x8(%r14), %rax
movq 0x48(%rax), %rax
leaq 0x28116(%rip), %rsi     # 0x1239bb
movl $0xa, %edx
movq %rbx, %rdi
movq %r14, %rcx
callq *0x10(%rax)
movq 0x8(%r12), %rdx
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rcx
movq %r14, %r8
callq 0xfe537
movq 0x8(%r14), %rax
movq 0x48(%rax), %rax
movq %rbx, %rdi
movl $0x20, %esi
movq %r14, %rdx
callq *0x8(%rax)
movzbl (%r15), %eax
leaq 0x53026(%rip), %rcx     # 0x14e910
cmpb $0x1, (%rax,%rcx)
jne 0xfb920
movq 0x8(%r15), %rdx
movq 0x10(%r15), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %r8
callq 0xfe537
jmp 0xfb971
movq 0x8(%r12), %rdx
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rcx
movq %r14, %r8
callq 0xfe537
jmp 0xfb987
movq 0x20(%rsp), %r8
testq %r8, %r8
je 0xfb958
leaq 0x5ea0f(%rip), %rcx     # 0x15a340
cmpb $0x1, (%rax,%rcx)
jne 0xfb958
cmpl $0x15, %eax
jne 0xfb943
testb $0x1, 0x7(%r15)
jne 0xfb958
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl $0x2, %ecx
callq 0x9c033
jmp 0xfb971
leaq 0x5ea21(%rip), %r9      # 0x15a380
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl $0x2, %ecx
callq *(%r9,%rax,8)
movq 0x8(%r14), %rax
movq 0x48(%rax), %rax
movq %rbx, %rdi
movl $0x29, %esi
movq %r14, %rdx
callq *0x8(%rax)
movq 0x10(%rsp), %rax
cmpq 0x110(%rbx), %rax
je 0xfb9ab
movq 0x8(%r14), %rax
movq 0x48(%rax), %rax
movq %rbx, %rdi
movl $0x29, %esi
movq %r14, %rdx
callq *0x8(%rax)
cmpq %rbp, 0xf0(%rbx)
jle 0xfb9f2
movq 0xd0(%rbx), %rax
movq 0x140(%rbx), %rcx
movq 0x10(%rax), %rdx
cmpq %rcx, (%rdx,%rbp,8)
je 0xfb9ea
movq 0xe8(%rbx), %rdx
movq 0x108(%rbx), %rsi
leaq 0x1(%rsi), %rdi
movq %rdi, 0x108(%rbx)
movq %rbp, 0x8(%rdx,%rsi,8)
movq 0x10(%rax), %rax
movq %rcx, (%rax,%rbp,8)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq