// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq 0xea0(%rax), %rax
movq %rax, 0x30(%rsp)
movl $0x0, 0x24(%rsp)
movl $0x0, 0x20(%rsp)
movq 0x38(%rsp), %rdi
callq 0x13a70
movl %eax, 0x2c(%rsp)
cmpl $-0x1, 0x2c(%rsp)
je 0x16573
movq 0x38(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x159b0
cmpl $0x0, %eax
jne 0x16589
movq 0x38(%rsp), %rax
movq 0xd0(%rax), %rax
movq %rax, 0x40(%rsp)
jmp 0x1687f
movl 0x20(%rsp), %eax
movq %rax, 0x18(%rsp)
subq $0x5, %rax
ja 0x1687a
movq 0x18(%rsp), %rax
leaq 0xf94(%rip), %rcx       # 0x1753c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x2c(%rsp), %eax
movl %eax, 0x14(%rsp)
subl $0x22, %eax
je 0x165d5
jmp 0x165c0
movl 0x14(%rsp), %eax
subl $0x5c, %eax
jne 0x16613
jmp 0x165cb
movl $0x1, 0x20(%rsp)
jmp 0x1663a
movq 0x30(%rsp), %rax
movb $0x0, (%rax)
movq 0x38(%rsp), %rdi
movq 0x38(%rsp), %rax
movq 0xea0(%rax), %rsi
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
movq 0xea0(%rcx), %rcx
subq %rcx, %rax
movl %eax, %edx
callq 0x4c10
movq %rax, 0x40(%rsp)
jmp 0x1687f
movl 0x2c(%rsp), %edi
movq 0x30(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x15830
movl 0x28(%rsp), %ecx
movq 0x30(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x30(%rsp)
jmp 0x1687a
movl 0x2c(%rsp), %eax
addl $-0x22, %eax
movl %eax, %ecx
movq %rcx, 0x8(%rsp)
subl $0x56, %eax
ja 0x16710
movq 0x8(%rsp), %rax
leaq 0xef2(%rip), %rcx       # 0x17554
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x4, 0x20(%rsp)
movl 0x2c(%rsp), %eax
subl $0x30, %eax
movl %eax, 0x24(%rsp)
jmp 0x16731
movl $0x2, 0x20(%rsp)
movl $0x0, 0x24(%rsp)
jmp 0x16731
movq 0x30(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x30(%rsp)
movb $0xa, (%rax)
movl $0x0, 0x20(%rsp)
jmp 0x16731
movq 0x30(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x30(%rsp)
movb $0x9, (%rax)
movl $0x0, 0x20(%rsp)
jmp 0x16731
movq 0x30(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x30(%rsp)
movb $0xd, (%rax)
movl $0x0, 0x20(%rsp)
jmp 0x16731
movq 0x30(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x30(%rsp)
movb $0x22, (%rax)
movl $0x0, 0x20(%rsp)
jmp 0x16731
movl 0x2c(%rsp), %eax
movb %al, %cl
movq 0x30(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x30(%rsp)
movb %cl, (%rax)
movl $0x0, 0x20(%rsp)
jmp 0x1687a
movl 0x2c(%rsp), %edi
callq 0x4050
movl %eax, 0x2c(%rsp)
cmpl $0x30, 0x2c(%rsp)
jl 0x167b5
cmpl $0x46, 0x2c(%rsp)
jg 0x167b5
cmpl $0x39, 0x2c(%rsp)
jg 0x1676c
movl 0x24(%rsp), %eax
shll $0x4, %eax
addl 0x2c(%rsp), %eax
subl $0x30, %eax
movl %eax, 0x24(%rsp)
jmp 0x16781
movl 0x24(%rsp), %eax
shll $0x4, %eax
addl 0x2c(%rsp), %eax
subl $0x41, %eax
addl $0xa, %eax
movl %eax, 0x24(%rsp)
cmpl $0x2, 0x20(%rsp)
jne 0x16792
movl $0x3, 0x20(%rsp)
jmp 0x167b3
movl 0x24(%rsp), %eax
movb %al, %cl
movq 0x30(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x30(%rsp)
movb %cl, (%rax)
movl $0x0, 0x20(%rsp)
jmp 0x167cb
movq 0x38(%rsp), %rax
movq 0xd0(%rax), %rax
movq %rax, 0x40(%rsp)
jmp 0x1687f
jmp 0x1687a
cmpl $0x30, 0x2c(%rsp)
jl 0x167de
cmpl $0x37, 0x2c(%rsp)
jle 0x1680f
movl 0x24(%rsp), %eax
movb %al, %cl
movq 0x30(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x30(%rsp)
movb %cl, (%rax)
movq 0x38(%rsp), %rdi
movl 0x2c(%rsp), %esi
callq 0x13b90
movl $0x0, 0x20(%rsp)
jmp 0x16878
cmpl $0x5, 0x20(%rsp)
jne 0x16830
cmpl $0x20, 0x24(%rsp)
jl 0x16830
movq 0x38(%rsp), %rax
movq 0xd0(%rax), %rax
movq %rax, 0x40(%rsp)
jmp 0x1687f
movl 0x24(%rsp), %eax
shll $0x3, %eax
movl 0x2c(%rsp), %ecx
subl $0x30, %ecx
addl %ecx, %eax
movl %eax, 0x24(%rsp)
cmpl $0x4, 0x20(%rsp)
jne 0x16855
movl $0x5, 0x20(%rsp)
jmp 0x16876
movl 0x24(%rsp), %eax
movb %al, %cl
movq 0x30(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x30(%rsp)
movb %cl, (%rax)
movl $0x0, 0x20(%rsp)
jmp 0x16878
jmp 0x1687a
jmp 0x1654a
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
nopl (%rax)