// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: slashify_string_to_port
static void slashify_string_to_port(s7_scheme *sc, s7_pointer port, const char *p, s7_int len, bool quoted)
    {
        uint8_t *pcur, *pend, *pstart = NULL;

        if (len == 0)
        {
            if (quoted)
                port_write_string(port)(sc, "\"\"", 2, port);
            return;
        }
        pend = (uint8_t *)(p + len);

        /* what about the trailing nulls? Guile writes them out (as does s7 currently)
         *    but that is not ideal.  I'd like to use ~S for error messages, so that
         *    strings are clearly identified via the double-quotes, but this way of
         *    writing them is ugly:
         *      (let ((str (make-string 8 #\null))) (set! (str 0) #\a) str) -> "a\x00\x00\x00\x00\x00\x00\x00"
         *    but it would be misleading to omit them because:
         *      (let ((str (make-string 8 #\null))) (set! (str 0) #\a) (string-append str "bc")) -> "a\x00\x00\x00\x00\x00\x00\x00bc"
         * also it is problematic to use sc->print_length here because
         *    it is normally (say) 8 which truncates just about every string.  In CL, *print-length*
         *    does not affect strings, symbols, or bit-vectors.  But if the string is enormous,
         *    this function can bring us to a complete halt, which is annoying if it is the error
         *    handler that is trying to write the string.  I think if port is sc->error_port, I'll
         *    truncate strings to some reasonable size -- (*s7* 'max-format-length) maybe.
         */
        if ((len > sc->max_format_length) &&
                (port == sc->error_port))
            len = sc->max_format_length;
        if (quoted) port_write_character(port)(sc, '"', port);
        for (pcur = (uint8_t *)p; pcur < pend; pcur++)
        {
            if (slashify_table[*pcur])
            {
                if (pstart) pstart++; else pstart = (uint8_t *)p;
                if (pstart != pcur)
                {
                    port_write_string(port)(sc, (char *)pstart, pcur - pstart, port);
                    pstart = pcur;
                }
                port_write_character(port)(sc, '\\', port);
                switch (*pcur)
                {
                    case '"':   port_write_character(port)(sc, '"', port);   break;
                    case '\\':  port_write_character(port)(sc, '\\', port);  break;
                    case '\'':  port_write_character(port)(sc, '\'', port);  break;
                    case '\t':  port_write_character(port)(sc, 't', port);   break;
                    case '\r':  port_write_character(port)(sc, 'r', port);   break;
                    case '\b':  port_write_character(port)(sc, 'b', port);   break;
                    case '\f':  port_write_character(port)(sc, 'f', port);   break;
                    case '\?':  port_write_character(port)(sc, '?', port);   break;
                    case 'x':   port_write_character(port)(sc, 'x', port);   break;
                    default:
                                {
                                    s7_int n;
                                    port_write_character(port)(sc, 'x', port);
                                    n = (s7_int)(*pcur);
                                    if (n < 16)
                                        port_write_character(port)(sc, '0', port);
                                    else port_write_character(port)(sc, dignum[(n / 16) % 16], port);
                                    port_write_character(port)(sc, dignum[n % 16], port);
                                    port_write_character(port)(sc, ';', port);
                                }
                                break;
                }
            }
        }
        if (!pstart)
            port_write_string(port)(sc, (char *)p, len, port);
        else
        {
            pstart++;
            if (pstart != pcur)
                port_write_string(port)(sc, (char *)pstart, pcur - pstart, port);
        }
        if (quoted) port_write_character(port)(sc, '"', port);
    }

// Assembly:
subq $0x68, %rsp
movb %r8b, %al
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq %rdx, 0x50(%rsp)
movq %rcx, 0x48(%rsp)
andb $0x1, %al
movb %al, 0x47(%rsp)
movq $0x0, 0x28(%rsp)
cmpq $0x0, 0x48(%rsp)
jne 0x1aeec7
testb $0x1, 0x47(%rsp)
je 0x1aeec2
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rcx
leaq 0x43879(%rip), %rsi     # 0x1f2734
movl $0x2, %edx
callq *%rax
jmp 0x1af39b
movq 0x50(%rsp), %rax
addq 0x48(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x48(%rsp), %rax
movq 0x60(%rsp), %rcx
cmpq 0x2c0(%rcx), %rax
jle 0x1aef0d
movq 0x58(%rsp), %rax
movq 0x60(%rsp), %rcx
cmpq 0x190(%rcx), %rax
jne 0x1aef0d
movq 0x60(%rsp), %rax
movq 0x2c0(%rax), %rax
movq %rax, 0x48(%rsp)
testb $0x1, 0x47(%rsp)
je 0x1aef36
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rdx
movl $0x22, %esi
callq *%rax
movq 0x50(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
cmpq 0x30(%rsp), %rax
jae 0x1af2f6
movq 0x760a1(%rip), %rax     # 0x224ff8
movq 0x38(%rsp), %rcx
movzbl (%rcx), %ecx
testb $0x1, (%rax,%rcx)
je 0x1af2e1
cmpq $0x0, 0x28(%rsp)
je 0x1aef81
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x1aef8b
movq 0x50(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
cmpq 0x38(%rsp), %rax
je 0x1aefd0
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0x60(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq 0x28(%rsp), %rcx
subq %rcx, %rdx
movq 0x58(%rsp), %rcx
callq *%rax
movq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x58(%rsp), %rdx
movq 0x8(%rdx), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0x60(%rsp), %rdi
movl $0x5c, %esi
callq *%rax
movq 0x38(%rsp), %rax
movzbl (%rax), %eax
movl %eax, 0x1c(%rsp)
subl $0x8, %eax
je 0x1af136
jmp 0x1af004
movl 0x1c(%rsp), %eax
subl $0x9, %eax
je 0x1af0e8
jmp 0x1af013
movl 0x1c(%rsp), %eax
subl $0xc, %eax
je 0x1af15d
jmp 0x1af022
movl 0x1c(%rsp), %eax
subl $0xd, %eax
je 0x1af10f
jmp 0x1af031
movl 0x1c(%rsp), %eax
subl $0x22, %eax
je 0x1af073
jmp 0x1af03c
movl 0x1c(%rsp), %eax
subl $0x27, %eax
je 0x1af0c1
jmp 0x1af047
movl 0x1c(%rsp), %eax
subl $0x3f, %eax
je 0x1af184
jmp 0x1af056
movl 0x1c(%rsp), %eax
subl $0x5c, %eax
je 0x1af09a
jmp 0x1af061
movl 0x1c(%rsp), %eax
subl $0x78, %eax
je 0x1af1ab
jmp 0x1af1d2
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rdx
movl $0x22, %esi
callq *%rax
jmp 0x1af2df
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rdx
movl $0x5c, %esi
callq *%rax
jmp 0x1af2df
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rdx
movl $0x27, %esi
callq *%rax
jmp 0x1af2df
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rdx
movl $0x74, %esi
callq *%rax
jmp 0x1af2df
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rdx
movl $0x72, %esi
callq *%rax
jmp 0x1af2df
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rdx
movl $0x62, %esi
callq *%rax
jmp 0x1af2df
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rdx
movl $0x66, %esi
callq *%rax
jmp 0x1af2df
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rdx
movl $0x3f, %esi
callq *%rax
jmp 0x1af2df
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rdx
movl $0x78, %esi
callq *%rax
jmp 0x1af2df
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rdx
movl $0x78, %esi
callq *%rax
movq 0x38(%rsp), %rax
movzbl (%rax), %eax
movq %rax, 0x20(%rsp)
cmpq $0x10, 0x20(%rsp)
jge 0x1af22d
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rdx
movl $0x30, %esi
callq *%rax
jmp 0x1af27a
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x60(%rsp), %rdi
movq 0x20(%rsp), %rax
movl $0x10, %ecx
cqto
idivq %rcx
movl $0x10, %ecx
cqto
idivq %rcx
movq 0x10(%rsp), %rax
leaq 0x323d3(%rip), %rcx     # 0x1e1640
movb (%rcx,%rdx), %cl
movq 0x58(%rsp), %rdx
movzbl %cl, %esi
callq *%rax
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x60(%rsp), %rdi
movq 0x20(%rsp), %rax
movl $0x10, %ecx
cqto
idivq %rcx
movq 0x8(%rsp), %rax
leaq 0x32390(%rip), %rcx     # 0x1e1640
movb (%rcx,%rdx), %cl
movq 0x58(%rsp), %rdx
movzbl %cl, %esi
callq *%rax
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rdx
movl $0x3b, %esi
callq *%rax
jmp 0x1af2e1
jmp 0x1af2e3
movq 0x38(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
jmp 0x1aef40
cmpq $0x0, 0x28(%rsp)
jne 0x1af327
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0x60(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq 0x48(%rsp), %rdx
movq 0x58(%rsp), %rcx
callq *%rax
jmp 0x1af372
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
cmpq 0x38(%rsp), %rax
je 0x1af370
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq 0x60(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq 0x28(%rsp), %rcx
subq %rcx, %rdx
movq 0x58(%rsp), %rcx
callq *%rax
jmp 0x1af372
testb $0x1, 0x47(%rsp)
je 0x1af39b
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rdx
movl $0x22, %esi
callq *%rax
addq $0x68, %rsp
retq