// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: read_string_constant
static s7_pointer read_string_constant(s7_scheme *sc, s7_pointer pt)
                {
                    /* sc->F => error
                     *   no check needed here for bad input port and so on
                     */
                    s7_int i = 0;

                    if (is_string_port(pt))
                    {
                        /* try the most common case first */
                        char *s, *start, *end;
                        start = (char *)(port_data(pt) + port_position(pt));
                        if (*start == '"')
                        {
                            port_position(pt)++;
                            return(make_empty_string(sc, 0, 0));
                        }

                        end = (char *)(port_data(pt) + port_data_size(pt));
                        s = strpbrk(start, "\"\n\\");
                        if ((!s) || (s >= end))                     /* can this read a huge string constant from a file? */
                        {
                            if (start == end)
                                sc->strbuf[0] = '\0';
                            else memcpy((void *)(sc->strbuf), (void *)start, (end - start > 8) ? 8 : (end - start));
                            sc->strbuf[8] = '\0';
                            return(sc->F);
                        }
                        if (*s == '"')
                        {
                            s7_int len;
                            len = s - start;
                            port_position(pt) += (len + 1);
                            return(make_string_with_length(sc, start, len));
                        }

                        for (; s < end; s++)
                        {
                            if (*s == '"')                         /* switch here no faster */
                            {
                                s7_int len;
                                len = s - start;
                                port_position(pt) += (len + 1);
                                return(make_string_with_length(sc, start, len));
                            }
                            if (*s == '\\')
                            {
                                /* all kinds of special cases here (resultant string is not the current string), so drop to loop below (setting "i") */
                                s7_int len;
                                len = (s7_int)(s - start);
                                if (len > 0)
                                {
                                    if (len >= sc->strbuf_size)
                                        resize_strbuf(sc, len);
                                    /* for (i = 0; i < len; i++) sc->strbuf[i] = port_data(pt)[port_position(pt)++]; */
                                    memcpy((void *)(sc->strbuf), (void *)(port_data(pt) + port_position(pt)), len);
                                    port_position(pt) += len;
                                }
                                i = len;
                                break;
                            }
                            else
                            {
                                if (*s == '\n')
                                    port_line_number(pt)++;
                            }
                        }
                    }

                    while (true)
                    {
                        /* splitting this check out and duplicating the loop was slower?!? */
                        int32_t c;
                        c = port_read_character(pt)(sc, pt);

                        switch (c)
                        {
                            case '\n':
                                port_line_number(pt)++;
                                sc->strbuf[i++] = (unsigned char)c;
                                break;

                            case EOF:
                                sc->strbuf[(i > 8) ? 8 : i] = '\0';
                                return(sc->F);

                            case '"':
                                return(make_string_with_length(sc, sc->strbuf, i));

                            case '\\':
                                c = inchar(pt);

                                switch (c)
                                {
                                    case EOF:
                                        sc->strbuf[(i > 8) ? 8 : i] = '\0';
                                        return(sc->F);

                                    case '\\': case '"': case '|':
                                        sc->strbuf[i++] = (unsigned char)c;
                                        break;

                                    case 'n': sc->strbuf[i++] = '\n'; break;
                                    case 't': sc->strbuf[i++] = '\t'; break;
                                    case 'r': sc->strbuf[i++] = '\r'; break;
                                    case '/': sc->strbuf[i++] = '/';  break;
                                    case 'b': sc->strbuf[i++] = (unsigned char)8;    break;
                                    case 'f': sc->strbuf[i++] = (unsigned char)12;   break;

                                    case 'x':
                                              i = read_x_char(sc, i, pt);
                                              break;

                                    default:	      /* if (!is_white_space(c)) */ /* changed 8-Apr-12 */
                                              if ((c != '\n') && (c != '\r')) /* i.e. line continuation via #\\ at end of line */
                                              {
                                                  s7_pointer result;
                                                  result = unknown_string_constant(sc, c);
                                                  if (s7_is_character(result))
                                                      sc->strbuf[i++] = character(result);
                                                  else return(result);
                                              }
                                              /* #f here would give confusing error message "end of input", so return #t=bad backslash.
                                               *     this is not optimal. It's easy to forget that backslash needs to be backslashed.
                                               * the white_space business half-implements Scheme's \<newline>...<eol>... or \<space>...<eol>...
                                               *   feature -- the characters after \ are flushed if they're all white space and include a newline.
                                               *   (string->number "1\   2") is 12??  Too bizarre.
                                               */
                                }
                                break;

                            default:
                                sc->strbuf[i++] = (unsigned char)c;
                                break;
                        }

                        if (i >= sc->strbuf_size)
                            resize_strbuf(sc, i);
                    }
                }

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0x98(%rsp)
movq %rsi, 0x90(%rsp)
movq $0x0, 0x88(%rsp)
movq 0x90(%rsp), %rax
movq 0x8(%rax), %rax
cmpl $0x1, 0x4(%rax)
jne 0x1988d8
movq 0x90(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x90(%rsp), %rcx
addq 0x20(%rcx), %rax
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0x198607
movq 0x90(%rsp), %rax
movq 0x20(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x20(%rax)
movq 0x98(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x146a0
movq %rax, 0xa0(%rsp)
jmp 0x198d81
movq 0x90(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x90(%rsp), %rcx
addq 0x18(%rcx), %rax
movq %rax, 0x70(%rsp)
movq 0x78(%rsp), %rdi
leaq 0x59017(%rip), %rsi     # 0x1f1647
callq 0x94f0
movq %rax, 0x80(%rsp)
cmpq $0x0, 0x80(%rsp)
je 0x19865b
movq 0x80(%rsp), %rax
cmpq 0x70(%rsp), %rax
jb 0x19870d
movq 0x78(%rsp), %rax
cmpq 0x70(%rsp), %rax
jne 0x19867b
movq 0x98(%rsp), %rax
movq 0x4b0(%rax), %rax
movb $0x0, (%rax)
jmp 0x1986de
movq 0x98(%rsp), %rax
movq 0x4b0(%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
subq %rcx, %rax
cmpq $0x8, %rax
jle 0x1986b8
movl $0x8, %eax
movq %rax, 0x30(%rsp)
jmp 0x1986ca
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
subq %rcx, %rax
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rdx
callq 0x93e0
movq 0x98(%rsp), %rax
movq 0x4b0(%rax), %rax
movb $0x0, 0x8(%rax)
movq 0x98(%rsp), %rax
movq 0x120(%rax), %rax
movq %rax, 0xa0(%rsp)
jmp 0x198d81
movq 0x80(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0x19876f
movq 0x80(%rsp), %rax
movq 0x78(%rsp), %rcx
subq %rcx, %rax
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rcx
addq $0x1, %rcx
movq 0x90(%rsp), %rax
addq 0x20(%rax), %rcx
movq %rcx, 0x20(%rax)
movq 0x98(%rsp), %rdi
movq 0x78(%rsp), %rsi
movq 0x68(%rsp), %rdx
callq 0x144d0
movq %rax, 0xa0(%rsp)
jmp 0x198d81
jmp 0x198771
movq 0x80(%rsp), %rax
cmpq 0x70(%rsp), %rax
jae 0x1988d6
movq 0x80(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0x1987e6
movq 0x80(%rsp), %rax
movq 0x78(%rsp), %rcx
subq %rcx, %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rcx
addq $0x1, %rcx
movq 0x90(%rsp), %rax
addq 0x20(%rax), %rcx
movq %rcx, 0x20(%rax)
movq 0x98(%rsp), %rdi
movq 0x78(%rsp), %rsi
movq 0x60(%rsp), %rdx
callq 0x144d0
movq %rax, 0xa0(%rsp)
jmp 0x198d81
movq 0x80(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x5c, %eax
jne 0x198894
movq 0x80(%rsp), %rax
movq 0x78(%rsp), %rcx
subq %rcx, %rax
movq %rax, 0x58(%rsp)
cmpq $0x0, 0x58(%rsp)
jle 0x198885
movq 0x58(%rsp), %rax
movq 0x98(%rsp), %rcx
cmpq 0x4a8(%rcx), %rax
jl 0x19883f
movq 0x98(%rsp), %rdi
movq 0x58(%rsp), %rsi
callq 0xce2e0
movq 0x98(%rsp), %rax
movq 0x4b0(%rax), %rdi
movq 0x90(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0x90(%rsp), %rax
addq 0x20(%rax), %rsi
movq 0x58(%rsp), %rdx
callq 0x93e0
movq 0x58(%rsp), %rcx
movq 0x90(%rsp), %rax
addq 0x20(%rax), %rcx
movq %rcx, 0x20(%rax)
movq 0x58(%rsp), %rax
movq %rax, 0x88(%rsp)
jmp 0x1988d6
movq 0x80(%rsp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
jne 0x1988b9
movq 0x90(%rsp), %rax
movq 0x8(%rax), %rax
movl 0x20(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x20(%rax)
jmp 0x1988bb
jmp 0x1988bd
movq 0x80(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x80(%rsp)
jmp 0x198771
jmp 0x1988d8
jmp 0x1988da
movq 0x90(%rsp), %rsi
movq 0x8(%rsi), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq 0x98(%rsp), %rdi
callq *%rax
movl %eax, 0x54(%rsp)
movl 0x54(%rsp), %eax
movl %eax, 0x2c(%rsp)
subl $-0x1, %eax
je 0x19897f
jmp 0x19890a
movl 0x2c(%rsp), %eax
subl $0xa, %eax
je 0x198936
jmp 0x198915
movl 0x2c(%rsp), %eax
subl $0x22, %eax
je 0x1989e1
jmp 0x198924
movl 0x2c(%rsp), %eax
subl $0x5c, %eax
je 0x198a12
jmp 0x198d1f
movq 0x90(%rsp), %rax
movq 0x8(%rax), %rax
movl 0x20(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x20(%rax)
movl 0x54(%rsp), %eax
movb %al, %dl
movq 0x98(%rsp), %rax
movq 0x4b0(%rax), %rax
movq 0x88(%rsp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x88(%rsp)
movb %dl, (%rax,%rcx)
jmp 0x198d4e
movq 0x98(%rsp), %rax
movq 0x4b0(%rax), %rax
movq %rax, 0x20(%rsp)
cmpq $0x8, 0x88(%rsp)
jle 0x1989aa
movl $0x8, %eax
movq %rax, 0x18(%rsp)
jmp 0x1989b7
movq 0x88(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %rcx
movb $0x0, (%rax,%rcx)
movq 0x98(%rsp), %rax
movq 0x120(%rax), %rax
movq %rax, 0xa0(%rsp)
jmp 0x198d81
movq 0x98(%rsp), %rdi
movq 0x98(%rsp), %rax
movq 0x4b0(%rax), %rsi
movq 0x88(%rsp), %rdx
callq 0x144d0
movq %rax, 0xa0(%rsp)
jmp 0x198d81
movq 0x90(%rsp), %rdi
callq 0xca3d0
movl %eax, 0x54(%rsp)
movl 0x54(%rsp), %eax
movl %eax, 0x14(%rsp)
subl $-0x1, %eax
je 0x198acb
jmp 0x198a36
movl 0x14(%rsp), %eax
subl $0x22, %eax
je 0x198b2a
jmp 0x198a45
movl 0x14(%rsp), %eax
subl $0x2f, %eax
je 0x198beb
jmp 0x198a54
movl 0x14(%rsp), %eax
subl $0x5c, %eax
je 0x198b2a
jmp 0x198a63
movl 0x14(%rsp), %eax
subl $0x62, %eax
je 0x198c1a
jmp 0x198a72
movl 0x14(%rsp), %eax
subl $0x66, %eax
je 0x198c49
jmp 0x198a81
movl 0x14(%rsp), %eax
subl $0x6e, %eax
je 0x198b5e
jmp 0x198a90
movl 0x14(%rsp), %eax
subl $0x72, %eax
je 0x198bbc
jmp 0x198a9f
movl 0x14(%rsp), %eax
subl $0x74, %eax
je 0x198b8d
jmp 0x198aae
movl 0x14(%rsp), %eax
subl $0x78, %eax
je 0x198c78
jmp 0x198abd
movl 0x14(%rsp), %eax
subl $0x7c, %eax
je 0x198b2a
jmp 0x198ca3
movq 0x98(%rsp), %rax
movq 0x4b0(%rax), %rax
movq %rax, 0x8(%rsp)
cmpq $0x8, 0x88(%rsp)
jle 0x198af5
movl $0x8, %eax
movq %rax, (%rsp)
jmp 0x198b01
movq 0x88(%rsp), %rax
movq %rax, (%rsp)
movq 0x8(%rsp), %rax
movq (%rsp), %rcx
movb $0x0, (%rax,%rcx)
movq 0x98(%rsp), %rax
movq 0x120(%rax), %rax
movq %rax, 0xa0(%rsp)
jmp 0x198d81
movl 0x54(%rsp), %eax
movb %al, %dl
movq 0x98(%rsp), %rax
movq 0x4b0(%rax), %rax
movq 0x88(%rsp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x88(%rsp)
movb %dl, (%rax,%rcx)
jmp 0x198d1d
movq 0x98(%rsp), %rax
movq 0x4b0(%rax), %rax
movq 0x88(%rsp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, 0x88(%rsp)
movb $0xa, (%rax,%rcx)
jmp 0x198d1d
movq 0x98(%rsp), %rax
movq 0x4b0(%rax), %rax
movq 0x88(%rsp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, 0x88(%rsp)
movb $0x9, (%rax,%rcx)
jmp 0x198d1d
movq 0x98(%rsp), %rax
movq 0x4b0(%rax), %rax
movq 0x88(%rsp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, 0x88(%rsp)
movb $0xd, (%rax,%rcx)
jmp 0x198d1d
movq 0x98(%rsp), %rax
movq 0x4b0(%rax), %rax
movq 0x88(%rsp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, 0x88(%rsp)
movb $0x2f, (%rax,%rcx)
jmp 0x198d1d
movq 0x98(%rsp), %rax
movq 0x4b0(%rax), %rax
movq 0x88(%rsp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, 0x88(%rsp)
movb $0x8, (%rax,%rcx)
jmp 0x198d1d
movq 0x98(%rsp), %rax
movq 0x4b0(%rax), %rax
movq 0x88(%rsp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, 0x88(%rsp)
movb $0xc, (%rax,%rcx)
jmp 0x198d1d
movq 0x98(%rsp), %rdi
movq 0x88(%rsp), %rax
movl %eax, %esi
movq 0x90(%rsp), %rdx
callq 0x198dd0
cltq
movq %rax, 0x88(%rsp)
jmp 0x198d1d
cmpl $0xa, 0x54(%rsp)
je 0x198d1b
cmpl $0xd, 0x54(%rsp)
je 0x198d1b
movq 0x98(%rsp), %rdi
movl 0x54(%rsp), %esi
callq 0x198fd0
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rdi
callq 0x14430
testb $0x1, %al
jne 0x198cd7
jmp 0x198d0a
movq 0x48(%rsp), %rax
movb 0x8(%rax), %dl
movq 0x98(%rsp), %rax
movq 0x4b0(%rax), %rax
movq 0x88(%rsp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x88(%rsp)
movb %dl, (%rax,%rcx)
jmp 0x198d19
movq 0x48(%rsp), %rax
movq %rax, 0xa0(%rsp)
jmp 0x198d81
jmp 0x198d1b
jmp 0x198d1d
jmp 0x198d4e
movl 0x54(%rsp), %eax
movb %al, %dl
movq 0x98(%rsp), %rax
movq 0x4b0(%rax), %rax
movq 0x88(%rsp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x88(%rsp)
movb %dl, (%rax,%rcx)
movq 0x88(%rsp), %rax
movq 0x98(%rsp), %rcx
cmpq 0x4a8(%rcx), %rax
jl 0x198d7c
movq 0x98(%rsp), %rdi
movq 0x88(%rsp), %rsi
callq 0xce2e0
jmp 0x1988da
movq 0xa0(%rsp), %rax
addq $0xa8, %rsp
retq
nopw %cs:(%rax,%rax)