// File: /workspace/github_c_makefile_star2_O1/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 $0x98, %rsp
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
cmpl $0x2, %ecx
jne 0xfb073
testb $0x1, 0x3(%r15)
je 0xfb073
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
leaq 0x249cf(%rip), %rsi     # 0x11fa34
movl $0xc, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq *0x10(%rax)
movq 0x8(%r15), %r12
testq %r12, %r12
jle 0xfb21b
cmpq $0x3e9, %r12            # imm = 0x3E9
jl 0xfb1c2
movq 0x10(%r15), %rdi
movzbl (%rdi), %r13d
leaq 0x10(%rsp), %rsi
movb %r13b, (%rsi)
movb $0x0, 0x1(%rsi)
incq %rdi
callq 0x92d0
leaq -0x1(%r12), %rcx
cmpq %rcx, %rax
jne 0xfb1c2
movq %rcx, (%rsp)
movq %rax, 0x8(%rsp)
movq 0x57991(%rip), %rax     # 0x152a58
movq (%rax,%r13,8), %r13
leaq 0xb6f(%r14), %r8
movb $0x0, 0xb6f(%r14)
leaq 0x2434f(%rip), %rcx     # 0x11f430
movabsq $0x6666666666666667, %rsi # imm = 0x6666666666666667
movq %r12, %rax
imulq %rsi
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x2, %rdx
addq %rax, %rdx
leaq (%rdx,%rdx), %rax
leaq (%rax,%rax,4), %rax
movq %r12, %rdi
subq %rax, %rdi
movb (%rcx,%rdi), %al
movb %al, -0x1(%r8)
decq %r8
addq $0x9, %r12
cmpq $0x12, %r12
movq %rdx, %r12
ja 0xfb0eb
leaq 0x28861(%rip), %rsi     # 0x12398c
leaq 0x28374(%rip), %rcx     # 0x1234a6
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %r8, %rdx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0xd1cb
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
movq %r14, %rdi
movl $0x29, %esi
movq %rbx, %rdx
callq *0x8(%rax)
cmpl $0x2, %ebp
jne 0xfb1b3
testb $0x1, 0x3(%r15)
je 0xfb1b3
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq %r14, %rdi
movl $0x29, %esi
movq %rbx, %rdx
callq *0x8(%rax)
movq (%rsp), %rax
cmpq %rax, 0x8(%rsp)
je 0xfb2b7
testl %ebp, %ebp
je 0xfb235
movq 0x8(%r15), %rcx
movq 0x10(%r15), %rdx
testq %rcx, %rcx
setg %al
jle 0xfb204
movzbl (%rdx), %edi
leaq 0x62b80(%rip), %rsi     # 0x15dd60
cmpb $0x0, (%rdi,%rsi)
jne 0xfb204
leaq (%rdx,%rcx), %rdi
leaq 0x1(%rdx), %r8
cmpq %rdi, %r8
setb %al
jae 0xfb204
movzbl (%r8), %r9d
incq %r8
cmpb $0x1, (%r9,%rsi)
jne 0xfb1ee
testb %al, %al
je 0xfb250
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %r8d
callq 0xfd6c4
jmp 0xfb295
testl %ebp, %ebp
je 0xfb295
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
leaq 0x284d0(%rip), %rsi     # 0x1236fe
movl $0x2, %edx
jmp 0xfb245
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)
jmp 0xfb295
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq %r14, %rdi
movl $0x22, %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 $0x22, %esi
movq %rbx, %rdx
callq *0x8(%rax)
cmpl $0x2, %ebp
jne 0xfb2b7
testb $0x1, 0x3(%r15)
je 0xfb2b7
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rax
movq %r14, %rdi
movl $0x29, %esi
movq %rbx, %rdx
callq *0x8(%rax)
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq