// File: /workspace/github_c_makefile_star2_O0/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:
subq $0xd8, %rsp
movq %rdi, 0xd0(%rsp)
movq %rsi, 0xc8(%rsp)
movq %rdx, 0xc0(%rsp)
movl %ecx, 0xbc(%rsp)
movq %r8, 0xb0(%rsp)
cmpl $0x2, 0xbc(%rsp)
jne 0x1a9c51
movq 0xc8(%rsp), %rax
movq (%rax), %rax
andq $0x1000000, %rax        # imm = 0x1000000
cmpq $0x0, %rax
je 0x1a9c51
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0xd0(%rsp), %rdi
movq 0xc0(%rsp), %rcx
leaq 0x449ba(%rip), %rsi     # 0x1ee604
movl $0xc, %edx
callq *%rax
movq 0xc8(%rsp), %rax
cmpq $0x0, 0x8(%rax)
jle 0x1a9f5e
movq 0xc8(%rsp), %rax
cmpq $0x3e8, 0x8(%rax)       # imm = 0x3E8
jle 0x1a9e1f
movq 0xc8(%rsp), %rax
movq 0x10(%rax), %rax
movb (%rax), %al
movb %al, 0x20(%rsp)
movb $0x0, 0x21(%rsp)
movq 0xc8(%rsp), %rax
movq 0x10(%rax), %rdi
addq $0x1, %rdi
leaq 0x20(%rsp), %rsi
callq 0x92d0
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rax
movq 0xc8(%rsp), %rcx
movq 0x8(%rcx), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jne 0x1a9e1d
movq 0x708ad(%rip), %rax     # 0x21a588
movzbl 0x20(%rsp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
leaq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0xd0(%rsp), %rdi
movq 0xc8(%rsp), %rax
movq 0x8(%rax), %rsi
callq 0xae30
movq 0x8(%rsp), %rdi
movq %rax, %rdx
leaq 0x48ca4(%rip), %rsi     # 0x1f29c2
leaq 0x487b7(%rip), %rcx     # 0x1f24dc
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0x10540
movl %eax, 0x1c(%rsp)
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0xd0(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movslq 0x1c(%rsp), %rdx
movq 0xc0(%rsp), %rcx
callq *%rax
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0xd0(%rsp), %rdi
movq 0x10(%rsp), %rsi
addq $0x8, %rsi
addq $0xd, %rsi
movq 0x10(%rsp), %rcx
movslq 0xc(%rcx), %rdx
movq 0xc0(%rsp), %rcx
callq *%rax
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0xd0(%rsp), %rdi
movq 0xc0(%rsp), %rdx
movl $0x29, %esi
callq *%rax
cmpl $0x2, 0xbc(%rsp)
jne 0x1a9e18
movq 0xc8(%rsp), %rax
movq (%rax), %rax
andq $0x1000000, %rax        # imm = 0x1000000
cmpq $0x0, %rax
je 0x1a9e18
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0xd0(%rsp), %rdi
movq 0xc0(%rsp), %rdx
movl $0x29, %esi
callq *%rax
jmp 0x1a9fe8
jmp 0x1a9e1f
cmpl $0x0, 0xbc(%rsp)
jne 0x1a9e6c
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0xd0(%rsp), %rdi
movq 0xc8(%rsp), %rcx
movq 0x10(%rcx), %rsi
movq 0xc8(%rsp), %rcx
movq 0x8(%rcx), %rdx
movq 0xc0(%rsp), %rcx
callq *%rax
jmp 0x1a9f5c
movq 0xc8(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0xc8(%rsp), %rax
movq 0x8(%rax), %rsi
callq 0x1aedf0
testb $0x1, %al
jne 0x1a9f27
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0xd0(%rsp), %rdi
movq 0xc0(%rsp), %rdx
movl $0x22, %esi
callq *%rax
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0xd0(%rsp), %rdi
movq 0xc8(%rsp), %rcx
movq 0x10(%rcx), %rsi
movq 0xc8(%rsp), %rcx
movq 0x8(%rcx), %rdx
movq 0xc0(%rsp), %rcx
callq *%rax
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0xd0(%rsp), %rdi
movq 0xc0(%rsp), %rdx
movl $0x22, %esi
callq *%rax
jmp 0x1a9f5a
movq 0xd0(%rsp), %rdi
movq 0xc0(%rsp), %rsi
movq 0xc8(%rsp), %rax
movq 0x10(%rax), %rdx
movq 0xc8(%rsp), %rax
movq 0x8(%rax), %rcx
movl $0x1, %r8d
callq 0x1aee60
jmp 0x1a9f5c
jmp 0x1a9f9c
cmpl $0x0, 0xbc(%rsp)
je 0x1a9f9a
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0xd0(%rsp), %rdi
movq 0xc0(%rsp), %rcx
leaq 0x487a1(%rip), %rsi     # 0x1f2734
movl $0x2, %edx
callq *%rax
jmp 0x1a9f9c
cmpl $0x2, 0xbc(%rsp)
jne 0x1a9fe8
movq 0xc8(%rsp), %rax
movq (%rax), %rax
andq $0x1000000, %rax        # imm = 0x1000000
cmpq $0x0, %rax
je 0x1a9fe8
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0xd0(%rsp), %rdi
movq 0xc0(%rsp), %rdx
movl $0x29, %esi
callq *%rax
addq $0xd8, %rsp
retq