// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq %rdx, 0x50(%rsp)
movl %ecx, 0x4c(%rsp)
movq %r8, 0x40(%rsp)
movq 0x58(%rsp), %rax
movq (%rax), %rax
andq $0x40000000, %rax       # imm = 0x40000000
cmpq $0x0, %rax
je 0x1aa1ff
movq 0x60(%rsp), %rax
testb $0x1, 0x24c(%rax)
je 0x1aa1ff
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rax
movq 0x18(%rax), %rsi
movq 0x60(%rsp), %rax
movq 0x1380(%rax), %rdx
callq 0x98d0
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq 0x60(%rsp), %rcx
cmpq 0x128(%rcx), %rax
je 0x1aa1fd
movq 0x60(%rsp), %rax
movq %rax, (%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x60(%rsp), %rax
movq 0x110(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x60(%rsp), %rax
movq 0x90(%rax), %rax
movq 0x60(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x1aa153
movq 0x60(%rsp), %rdi
callq 0xc670
movq 0x60(%rsp), %rcx
movq 0x90(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x90(%rcx)
movq -0x8(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq $0x200001, (%rax)       # imm = 0x200001
movq 0x8(%rsp), %rsi
movq (%rsp), %rdi
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdx
callq 0xda50
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
cmpq $0x0, 0x8(%rax)
jle 0x1aa1fb
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0x60(%rsp), %rdi
movq 0x30(%rsp), %rcx
movq 0x10(%rcx), %rsi
movq 0x30(%rsp), %rcx
movq 0x8(%rcx), %rdx
movq 0x50(%rsp), %rcx
callq *%rax
jmp 0x1aa235
jmp 0x1aa1ff
cmpl $0x2, 0x4c(%rsp)
jne 0x1aa221
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq 0x40(%rsp), %rcx
callq 0x1b0320
jmp 0x1aa235
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
callq 0x1b0b10
addq $0x68, %rsp
retq
nopw (%rax,%rax)