// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/RNBasics/json.cpp
// Function: Json::Reader::decodeString(Json::Reader::Token&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool Reader::decodeString(Token& token, std::string& decoded) {
  decoded.reserve(static_cast<size_t>(token.end_ - token.start_ - 2));
  Location current = token.start_ + 1; // skip '"'
  Location end = token.end_ - 1;       // do not include '"'
  while (current != end) {
    Char c = *current++;
    if (c == '"')
      break;
    else if (c == '\\') {
      if (current == end)
        return addError("Empty escape sequence in string", token, current);
      Char escape = *current++;
      switch (escape) {
      case '"':
        decoded += '"';
        break;
      case '/':
        decoded += '/';
        break;
      case '\\':
        decoded += '\\';
        break;
      case 'b':
        decoded += '\b';
        break;
      case 'f':
        decoded += '\f';
        break;
      case 'n':
        decoded += '\n';
        break;
      case 'r':
        decoded += '\r';
        break;
      case 't':
        decoded += '\t';
        break;
      case 'u': {
        unsigned int unicode;
        if (!decodeUnicodeCodePoint(token, current, end, unicode))
          return false;
        decoded += codePointToUTF8(unicode);
      } break;
      default:
        return addError("Bad escape sequence in string", token, current);
      }
    } else {
      decoded += c;
    }
  }
  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rsi), %rsi
subq 0x8(%rbx), %rsi
addq $-0x2, %rsi
movq %rdx, %rdi
callq 0x11950
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %r12
incq %rax
decq %r12
movb $0x1, %bpl
cmpq %r12, %rax
je 0x79c3c
movq %r14, 0x20(%rsp)
leaq 0x45151(%rip), %r14     # 0xbebfc
leaq 0x1(%rax), %r13
movq %r13, 0x28(%rsp)
movzbl (%rax), %ecx
cmpl $0x5c, %ecx
je 0x79add
cmpl $0x22, %ecx
je 0x79c3c
movsbl %cl, %esi
movq %r15, %rdi
callq 0x114e0
movq %r13, %rax
cmpq %r12, %r13
jne 0x79aab
jmp 0x79c3c
cmpq %r12, %r13
je 0x79bee
leaq 0x2(%rax), %r13
movq %r13, 0x28(%rsp)
movzbl 0x1(%rax), %eax
cmpl $0x61, %eax
jg 0x79b15
cmpl $0x22, %eax
je 0x79b3a
cmpl $0x2f, %eax
je 0x79b30
cmpl $0x5c, %eax
jne 0x79c4d
movq %r15, %rdi
movl $0x5c, %esi
jmp 0x79acb
leal -0x6e(%rax), %ecx
cmpl $0x7, %ecx
ja 0x79b44
movslq (%r14,%rcx,4), %rax
addq %r14, %rax
jmpq *%rax
movq %r15, %rdi
movl $0xa, %esi
jmp 0x79acb
movq %r15, %rdi
movl $0x2f, %esi
jmp 0x79acb
movq %r15, %rdi
movl $0x22, %esi
jmp 0x79acb
cmpl $0x62, %eax
je 0x79be1
cmpl $0x66, %eax
jne 0x79c4d
movq %r15, %rdi
movl $0xc, %esi
jmp 0x79acb
movq 0x20(%rsp), %rdi
movq %rbx, %rsi
leaq 0x28(%rsp), %rdx
movq %r12, %rcx
leaq 0x34(%rsp), %r8
callq 0x7a58e
testb %al, %al
je 0x79c3a
movl 0x34(%rsp), %esi
movq %rsp, %rdi
callq 0x7a6f7
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r15, %rdi
callq 0x111e0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x79bbd
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x115c0
movq 0x28(%rsp), %r13
jmp 0x79ad0
movq %r15, %rdi
movl $0x9, %esi
jmp 0x79acb
movq %r15, %rdi
movl $0xd, %esi
jmp 0x79acb
movq %r15, %rdi
movl $0x8, %esi
jmp 0x79acb
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x455f8(%rip), %rsi     # 0xbf1f8
leaq 0x45610(%rip), %rdx     # 0xbf217
callq 0x1a88c
movq %rsp, %rsi
movq 0x20(%rsp), %rdi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x7894e
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x79c3a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x115c0
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x455b9(%rip), %rsi     # 0xbf218
leaq 0x455cf(%rip), %rdx     # 0xbf235
callq 0x1a88c
movq %rsp, %rsi
movq 0x20(%rsp), %rdi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x7894e
jmp 0x79c1f
jmp 0x79c8b
jmp 0x79c86
jmp 0x79c8b
movq %rax, %rbx
jmp 0x79ca9
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x79ca9
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x115c0
movq %rbx, %rdi
callq 0x11a60
nop