// File: /workspace/github_c_makefile_star2_O3/RodionGork[P]tinyscheme/scheme.c
// Function: readstrexp
static pointer readstrexp(scheme * sc) {
  char *p = sc->strbuff;
  int c, len;
  int c1 = 0;
  enum { st_ok, st_bsl, st_x1, st_x2, st_oct1, st_oct2 } state = st_ok;

  for (;;) {
    c = inchar(sc);
    if (c == EOF || !check_strbuff_size(sc, &p)) {
      return sc->F;
    }
    switch (state) {
    case st_ok:
      switch (c) {
      case '\\':
        state = st_bsl;
        break;
      case '"':
        *p = 0;
        return mk_counted_string(sc, sc->strbuff, p - sc->strbuff);
      default:
        char_to_utf8(c, p, &len);
        p += len;
        break;
      }
      break;
    case st_bsl:
      switch (c) {
      case '0':
      case '1':
      case '2':
      case '3':
      case '4':
      case '5':
      case '6':
      case '7':
        state = st_oct1;
        c1 = c - '0';
        break;
      case 'x':
      case 'X':
        state = st_x1;
        c1 = 0;
        break;
      case 'n':
        *p++ = '\n';
        state = st_ok;
        break;
      case 't':
        *p++ = '\t';
        state = st_ok;
        break;
      case 'r':
        *p++ = '\r';
        state = st_ok;
        break;
      case '"':
        *p++ = '"';
        state = st_ok;
        break;
      default:
        *p++ = c;
        state = st_ok;
        break;
      }
      break;
    case st_x1:
    case st_x2:
      c = toupper(c);
      if (c >= '0' && c <= 'F') {
        if (c <= '9') {
          c1 = (c1 << 4) + c - '0';
        } else {
          c1 = (c1 << 4) + c - 'A' + 10;
        }
        if (state == st_x1) {
          state = st_x2;
        } else {
          *p++ = c1;
          state = st_ok;
        }
      } else {
        return sc->F;
      }
      break;
    case st_oct1:
    case st_oct2:
      if (c < '0' || c > '7') {
        *p++ = c1;
        backchar(sc, c);
        state = st_ok;
      } else {
        if (state == st_oct2 && c1 >= 32)
          return sc->F;

        c1 = (c1 << 3) + (c - '0');

        if (state == st_oct1)
          state = st_oct2;
        else {
          *p++ = c1;
          state = st_ok;
        }
      }
      break;

    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0xea0(%rdi), %rax
movq %rax, 0x8(%rsp)
callq 0xb445
cmpl $-0x1, %eax
je 0xc828
movl %eax, %r12d
xorl %r13d, %r13d
leaq 0xdb9(%rip), %rbp       # 0xd404
xorl %r15d, %r15d
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0xc31c
testl %eax, %eax
je 0xc828
cmpl $0x5, %r13d
ja 0xc750
movl %r13d, %eax
movslq (%rbp,%rax,4), %rax
addq %rbp, %rax
jmpq *%rax
movl %r12d, %edi
callq 0x4060
leal -0x30(%rax), %ecx
cmpl $0x16, %ecx
ja 0xc828
shll $0x4, %r15d
leal -0x37(%r15), %ecx
addl $-0x30, %r15d
cmpl $0x3a, %eax
cmovael %ecx, %r15d
movl %r15d, %r14d
addl %eax, %r14d
cmpl $0x2, %r13d
jne 0xc6ff
movl $0x3, %r13d
jmp 0xc753
leal -0x38(%r12), %eax
cmpl $-0x9, %eax
ja 0xc6d9
movq 0x8(%rsp), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rsp)
movb %r15b, (%rax)
movl %r12d, 0x2c(%rbx)
jmp 0xc74d
cmpl $0x5, %r13d
jne 0xc6e9
cmpl $0x20, %r15d
jge 0xc828
leal (%r12,%r15,8), %r14d
addl $-0x30, %r14d
cmpl $0x4, %r13d
jne 0xc6ff
movl $0x5, %r13d
jmp 0xc753
movq 0x8(%rsp), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rsp)
movb %r14b, (%rax)
xorl %r13d, %r13d
jmp 0xc753
movl $0x1, %r13d
cmpl $0x5c, %r12d
je 0xc750
cmpl $0x22, %r12d
je 0xc83e
movq 0x8(%rsp), %r13
movl %r12d, %edi
movq %r13, %rsi
leaq 0x14(%rsp), %rdx
callq 0xc2a2
movslq 0x14(%rsp), %rax
addq %r13, %rax
movq %rax, 0x8(%rsp)
xorl %r13d, %r13d
movl %r15d, %r14d
movq %rbx, %rdi
callq 0xb445
movl %eax, %r12d
movl %r14d, %r15d
cmpl $-0x1, %eax
jne 0xc64e
jmp 0xc828
cmpl $0x57, %r12d
jg 0xc788
leal -0x30(%r12), %r14d
cmpl $0x8, %r14d
jae 0xc7ca
movl $0x4, %r13d
jmp 0xc753
movl $0x2, %r13d
xorl %r14d, %r14d
cmpl $0x71, %r12d
jle 0xc7ab
cmpl $0x72, %r12d
je 0xc7e6
cmpl $0x74, %r12d
je 0xc7fc
cmpl $0x78, %r12d
je 0xc753
jmp 0xc812
cmpl $0x58, %r12d
je 0xc753
cmpl $0x6e, %r12d
jne 0xc812
movq 0x8(%rsp), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rsp)
movb $0xa, (%rax)
jmp 0xc74d
cmpl $0x22, %r12d
jne 0xc812
movq 0x8(%rsp), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rsp)
movb $0x22, (%rax)
jmp 0xc74d
movq 0x8(%rsp), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rsp)
movb $0xd, (%rax)
jmp 0xc74d
movq 0x8(%rsp), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rsp)
movb $0x9, (%rax)
jmp 0xc74d
movq 0x8(%rsp), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rsp)
movb %r12b, (%rax)
jmp 0xc74d
movq 0xd0(%rbx), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rdx
movb $0x0, (%rdx)
movq 0xea0(%rbx), %rsi
subl %esi, %edx
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x47a7