// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: string_to_port
static void string_to_port(s7_scheme *sc, s7_pointer obj, s7_pointer port, use_write_t use_write, shared_info *ignored)
    {
        if ((use_write == P_READABLE) &&
                (is_immutable_string(obj)))
            port_write_string(port)(sc, "(immutable! ", 12, port);

        if (string_length(obj) > 0)
        {
            /* since string_length is a scheme length, not C, this write can embed nulls from C's point of view */
            if (string_length(obj) > 1000) /* was 10000 28-Feb-18 */
            {
                size_t size;
                char buf[128];
                buf[0] = string_value(obj)[0];
                buf[1] = '\0';
                size = strspn((const char *)(string_value(obj) + 1), buf); /* if all #\null, this won't work */
                if (size == (size_t)(string_length(obj) - 1))
                {
                    int32_t nlen;
                    s7_pointer c;
                    c = chars[(int32_t)((uint8_t)(buf[0]))];
                    nlen = catstrs_direct(buf, "(make-string ", pos_int_to_str_direct(sc, string_length(obj)), " ", NULL);
                    port_write_string(port)(sc, buf, nlen, port);
                    port_write_string(port)(sc, character_name(c), character_name_length(c), port);
                    port_write_character(port)(sc, ')', port);
                    if ((use_write == P_READABLE) &&
                            (is_immutable_string(obj)))
                        port_write_character(port)(sc, ')', port);
                    return;
                }
            }
            if (use_write == P_DISPLAY)
                port_write_string(port)(sc, string_value(obj), string_length(obj), port);
            else
            {
                if (!string_needs_slashification(string_value(obj), string_length(obj)))
                {
                    port_write_character(port)(sc, '"', port);
                    port_write_string(port)(sc, string_value(obj), string_length(obj), port);
                    port_write_character(port)(sc, '"', port);
                }
                else slashify_string_to_port(sc, port, string_value(obj), string_length(obj), IN_QUOTES);
            }
        }
        else
        {
            if (use_write != P_DISPLAY)
                port_write_string(port)(sc, "\"\"", 2, port);
        }
        if ((use_write == P_READABLE) &&
                (is_immutable_string(obj)))
            port_write_character(port)(sc, ')', port);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
cmpl $0x2, %ecx
jne 0xc0a2e
testb $0x1, 0x3(%r15)
je 0xc0a2e
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
leaq 0x220c2(%rip), %rsi     # 0xe2ae4
pushq $0xc
popq %rdx
movq %r14, %rdi
movq %rbx, %rcx
callq *0x10(%rax)
movq 0x8(%r15), %r12
testq %r12, %r12
jle 0xc0b4d
cmpq $0x3e9, %r12            # imm = 0x3E9
jb 0xc0b1c
movq 0x10(%r15), %rdi
movzbl (%rdi), %r13d
movq %rsp, %rsi
movb %r13b, (%rsi)
movb $0x0, 0x1(%rsi)
incq %rdi
callq 0x82d0
leaq -0x1(%r12), %rcx
cmpq %rcx, %rax
jne 0xc0b1c
movq 0x58fe1(%rip), %rax     # 0x119a58
movq (%rax,%r13,8), %r13
movq %r14, %rdi
movq %r12, %rsi
callq 0x91f9
leaq 0x25faf(%rip), %rsi     # 0xe6a3c
leaq 0x25ac2(%rip), %rcx     # 0xe6556
movq %rsp, %r12
movq %r12, %rdi
movq %rax, %rdx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0xb3a5
movq 0x8(%rbx), %rcx
movq 0x48(%rcx), %r8
movslq %eax, %rdx
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rcx
callq *0x10(%r8)
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movslq 0xc(%r13), %rdx
addq $0x15, %r13
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rcx
callq *0x10(%rax)
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
pushq $0x29
popq %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq *0x8(%rax)
cmpl $0x2, %ebp
jne 0xc0bef
testb $0x1, 0x3(%r15)
je 0xc0bef
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
pushq $0x29
popq %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq *0x8(%rax)
jmp 0xc0bef
testl %ebp, %ebp
je 0xc0b72
movq 0x10(%r15), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0xc27f8
testb %al, %al
je 0xc0b9e
pushq $0x1
popq %r8
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %r12, %rcx
callq 0xc281e
jmp 0xc0be3
testl %ebp, %ebp
je 0xc0bef
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
leaq 0x25c4a(%rip), %rsi     # 0xe67ae
pushq $0x2
popq %rdx
movq %r14, %rdi
movq %rbx, %rcx
callq *0x10(%rax)
jmp 0xc0be3
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0x10(%r15), %rsi
movq %r14, %rdi
movq %r12, %rdx
movq %rbx, %rcx
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
pushq $0x22
popq %r12
movq %r14, %rdi
movl %r12d, %esi
movq %rbx, %rdx
callq *0x8(%rax)
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq 0x8(%r15), %rdx
movq 0x10(%r15), %rsi
movq %r14, %rdi
movq %rbx, %rcx
callq *0x10(%rax)
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq %r14, %rdi
movl %r12d, %esi
movq %rbx, %rdx
callq *0x8(%rax)
cmpl $0x2, %ebp
jne 0xc0bef
testb $0x1, 0x3(%r15)
jne 0xc0c01
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
pushq $0x29
popq %rsi
movq %r14, %rdi
movq %rbx, %rdx
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax