// File: /workspace/github_c_makefile_star2_O2/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, %r12
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r14
testb $0x40, 0x3(%rsi)
je 0xc0d31
cmpb $0x1, 0x24c(%r14)
jne 0xc0d31
movq 0x18(%r13), %rsi
movq 0x1380(%r14), %rdx
movq %r14, %rdi
callq 0x888f
cmpq 0x128(%r14), %rax
je 0xc0d31
movq %rax, %r15
movq 0x90(%r14), %rax
movq 0x110(%r14), %r12
cmpq 0x98(%r14), %rax
ja 0xc0cd4
movq %r14, %rdi
callq 0x9c27
movq 0x90(%r14), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%r14)
movq -0x8(%rax), %rdx
movq $0x200001, (%rdx)       # imm = 0x200001
movq %r13, 0x8(%rdx)
movq %r12, 0x10(%rdx)
movq %r14, %rdi
movq %r15, %rsi
callq 0xa34c
movq 0x8(%rax), %rdx
testq %rdx, %rdx
jle 0xc11cf
movq 0x8(%rbx), %rcx
movq 0x48(%rcx), %rcx
movq 0x10(%rcx), %r8
movq 0x10(%rax), %rsi
movq %r14, %rdi
movq %rbx, %rcx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%r8
cmpl $0x2, %ebp
jne 0xc0d7f
movq 0x10(%r13), %rbp
cmpq $0x0, 0x6a0(%r14)
jle 0xc0d9b
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2cd63
testb %al, %al
je 0xc0d9b
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
leaq 0x25ce4(%rip), %rsi     # 0xe6a4a
pushq $0x20
popq %rdx
movq %r14, %rdi
movq %rbx, %rcx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xc3174
movq %r12, (%rsp)
movq 0x8(%r13), %r12
cmpb $0xa, (%r12)
movq %rbp, 0x18(%rsp)
jne 0xc0df6
movq 0x90(%r14), %rax
movq 0x110(%r14), %r15
cmpq 0x98(%r14), %rax
ja 0xc0dd5
movq %r14, %rdi
callq 0x9c27
movq 0x90(%r14), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%r14)
movq -0x8(%rax), %rax
movq $0x200001, (%rax)       # imm = 0x200001
movq %r12, 0x8(%rax)
movq %r15, 0x10(%rax)
movq %rax, %r12
movq 0x18(%r13), %r15
movq 0x110(%r14), %rsi
movq %r14, %rdi
callq 0x89a9
movq %rax, %rbp
movq %r14, %rdi
movq 0x18(%rsp), %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %rax, %r8
callq 0xc3450
movq 0x16c8(%r14), %rsi
movq %r14, %rdi
movq %r15, %rdx
movq %r12, %rcx
movq %rbp, %r8
callq 0xc363e
movq 0x16d0(%r14), %rsi
movq %r14, %rdi
movq %r15, %rdx
movq %r12, %rcx
movq %rbp, %r8
callq 0xc363e
movq 0x16c0(%r14), %rsi
movq %r14, %rdi
movq %r15, %rdx
movq %r12, %rcx
movq %rbp, %r8
callq 0xc363e
movq 0x16d8(%r14), %rsi
movq %r14, %rdi
movq %r15, %rdx
movq %r12, %rcx
movq %rbp, %r8
callq 0xc363e
movq %r13, %rdi
callq 0x3205a
leaq 0x54a7f(%rip), %rcx     # 0x115910
testb %al, %al
je 0xc0f2d
movq 0x20(%r13), %r12
movzbl (%r12), %eax
cmpb $0x1, (%rax,%rcx)
jne 0xc0f30
movq %r12, 0x10(%rsp)
movq 0x8(%r12), %r12
cmpb $0xa, (%r12)
jne 0xc0f0e
movq %rbp, 0x8(%rsp)
movq 0x90(%r14), %rax
movq 0x110(%r14), %rbp
cmpq 0x98(%r14), %rax
ja 0xc0ee8
movq %r14, %rdi
callq 0x9c27
movq 0x90(%r14), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%r14)
movq -0x8(%rax), %rax
movq $0x200001, (%rax)       # imm = 0x200001
movq %r12, 0x8(%rax)
movq %rbp, 0x10(%rax)
movq %rax, %r12
movq 0x8(%rsp), %rbp
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rsi
movq %r14, %rdi
movq %r15, %rdx
movq %r12, %rcx
movq %rax, %r12
movq %rbp, %r8
callq 0xc3450
jmp 0xc0f30
xorl %r12d, %r12d
movq (%rsp), %r15
movq 0xd0(%r14), %rax
movq 0x10(%rax), %rax
movq (%rax,%rbp,8), %rax
movq %rax, 0x20(%rsp)
cmpq 0x110(%r14), %rax
je 0xc10a1
movq %r12, 0x10(%rsp)
movq %rbp, 0x8(%rsp)
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
leaq 0x21b60(%rip), %rsi     # 0xe2ace
pushq $0x6
popq %rdx
movq %r14, %rdi
movq %rbx, %rcx
callq *0x10(%rax)
leaq 0x60c5f(%rip), %rbp     # 0x121be0
movq 0x20(%rsp), %r12
cmpb $0x1, (%r12)
jne 0xc1078
movq 0x8(%r12), %r15
movq 0x10(%r15), %rax
movzbl (%rax), %ecx
cmpb $0x0, (%rcx,%rbp)
jne 0xc106e
leaq 0x60392(%rip), %rdx     # 0x121340
cmpb $0x1, (%rcx,%rdx)
jne 0xc0fd0
cmpl $0x15, %ecx
jne 0xc0fbf
testb $0x1, 0x7(%rax)
jne 0xc0fd0
movq 0x8(%r15), %rax
cmpq 0x16c8(%r14), %rax
jne 0xc106e
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq %r14, %rdi
pushq $0x28
popq %rsi
movq %rbx, %rdx
callq *0x8(%rax)
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq 0x8(%r15), %rcx
movq 0x8(%rcx), %rcx
movq 0x8(%rcx), %rdx
movq 0x10(%rcx), %rsi
movq %r14, %rdi
movq %rbx, %rcx
callq *0x10(%rax)
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq %r14, %rdi
pushq $0x20
popq %rsi
movq %rbx, %rdx
callq *0x8(%rax)
movq 0x10(%r15), %rsi
movzbl (%rsi), %eax
movq %r14, %rdi
movq %rbx, %rdx
pushq $0x2
popq %rcx
xorl %r8d, %r8d
leaq 0x6034d(%rip), %r9      # 0x121380
callq *(%r9,%rax,8)
movq 0x10(%r12), %rcx
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
cmpq 0x110(%r14), %rcx
je 0xc1062
movq %r14, %rdi
leaq 0x256fe(%rip), %rsi     # 0xe6755
pushq $0x2
popq %rdx
movq %rbx, %rcx
callq *0x10(%rax)
jmp 0xc106e
movq %r14, %rdi
pushq $0x29
popq %rsi
movq %rbx, %rdx
callq *0x8(%rax)
movq 0x10(%r12), %r12
jmp 0xc0f86
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
leaq 0x256ce(%rip), %rsi     # 0xe6755
pushq $0x2
popq %rdx
movq %r14, %rdi
movq %rbx, %rcx
callq *0x10(%rax)
movq (%rsp), %r15
movq 0x8(%rsp), %rbp
movq 0x10(%rsp), %r12
testq %r12, %r12
je 0xc1118
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
leaq 0x259b6(%rip), %rsi     # 0xe6a6b
pushq $0xa
popq %rdx
movq %r14, %rdi
movq %rbx, %rcx
callq *0x10(%rax)
movq 0x8(%r13), %rdx
movq %r14, %rdi
movq %r13, %rsi
movq 0x18(%rsp), %rcx
movq %rbx, %r8
callq 0xc34bb
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
pushq $0x20
popq %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq *0x8(%rax)
movzbl (%r12), %eax
leaq 0x54818(%rip), %rcx     # 0x115910
cmpb $0x1, (%rax,%rcx)
jne 0xc1131
movq 0x8(%r12), %rdx
movq 0x10(%r12), %rcx
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %r8
callq 0xc34bb
jmp 0xc1180
movq 0x8(%r13), %rdx
movq %r14, %rdi
movq %r13, %rsi
movq 0x18(%rsp), %rcx
movq %rbx, %r8
callq 0xc34bb
jmp 0xc1194
testq %r15, %r15
je 0xc1166
leaq 0x60203(%rip), %rcx     # 0x121340
cmpb $0x1, (%rax,%rcx)
jne 0xc1166
cmpl $0x15, %eax
jne 0xc1150
testb $0x1, 0x7(%r12)
jne 0xc1166
pushq $0x2
popq %rcx
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %r15, %r8
callq 0x77872
jmp 0xc1180
leaq 0x60213(%rip), %r9      # 0x121380
pushq $0x2
popq %rcx
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %r15, %r8
callq *(%r9,%rax,8)
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
pushq $0x29
popq %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq *0x8(%rax)
movq 0x20(%rsp), %rax
cmpq 0x110(%r14), %rax
je 0xc11b6
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
pushq $0x29
popq %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq *0x8(%rax)
movq %r14, %rdi
movq %rbp, %rsi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8b00
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq