// File: /workspace/github_cpp_makefile_star2_O2/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, 0x8(%rsp)
movq 0x10(%rsi), %rsi
subq 0x8(%rbx), %rsi
addq $-0x2, %rsi
movq %rdx, %rdi
callq 0x11960
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %r12
incq %rcx
decq %r12
leaq 0x3bd0e(%rip), %r14     # 0xabb0c
leaq 0x18(%rsp), %rbp
movb $0x1, %al
cmpq %r12, %rcx
je 0x6ff50
leaq 0x1(%rcx), %r13
movq %r13, 0x10(%rsp)
movzbl (%rcx), %edx
cmpl $0x5c, %edx
je 0x6fe33
cmpl $0x22, %edx
je 0x6ff50
movsbl %dl, %esi
movq %r15, %rdi
jmp 0x6ff0c
cmpq %r12, %r13
je 0x6ff19
leaq 0x2(%rcx), %r13
movq %r13, 0x10(%rsp)
movzbl 0x1(%rcx), %eax
leal -0x6e(%rax), %ecx
cmpl $0x7, %ecx
jbe 0x6fe88
cmpl $0x66, %eax
je 0x6fef1
cmpl $0x2f, %eax
je 0x6feff
cmpl $0x5c, %eax
je 0x6fef8
cmpl $0x62, %eax
je 0x6ff06
cmpl $0x22, %eax
jne 0x6ff5f
movq %r15, %rdi
pushq $0x22
jmp 0x6ff0b
movslq (%r14,%rcx,4), %rax
addq %r14, %rax
jmpq *%rax
movq %r15, %rdi
pushq $0xa
jmp 0x6ff0b
movq %r15, %rdi
pushq $0xd
jmp 0x6ff0b
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
leaq 0x10(%rsp), %rdx
movq %r12, %rcx
leaq 0x4(%rsp), %r8
callq 0x70584
testb %al, %al
je 0x6ff4e
movl 0x4(%rsp), %esi
movq %rbp, %rdi
callq 0x706b8
movq %r15, %rdi
movq %rbp, %rsi
callq 0x11bd0
movq %rbp, %rdi
callq 0x11270
movq 0x10(%rsp), %rcx
jmp 0x6fe03
movq %r15, %rdi
pushq $0x9
jmp 0x6ff0b
movq %r15, %rdi
pushq $0xc
jmp 0x6ff0b
movq %r15, %rdi
pushq $0x5c
jmp 0x6ff0b
movq %r15, %rdi
pushq $0x2f
jmp 0x6ff0b
movq %r15, %rdi
pushq $0x8
popq %rsi
callq 0x114e0
movq %r13, %rcx
jmp 0x6fe03
leaq 0x3c1e8(%rip), %rsi     # 0xac108
leaq 0x18(%rsp), %rdi
leaq 0x4(%rsp), %rdx
callq 0x196d0
leaq 0x18(%rsp), %rsi
movq 0x8(%rsp), %rdi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x6f02c
leaq 0x18(%rsp), %rdi
callq 0x11270
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3c1c2(%rip), %rsi     # 0xac128
leaq 0x18(%rsp), %rdi
leaq 0x4(%rsp), %rdx
callq 0x196d0
leaq 0x18(%rsp), %rsi
movq 0x8(%rsp), %rdi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x6f02c
jmp 0x6ff44
jmp 0x6ff97
jmp 0x6ff92
jmp 0x6ff97
movq %rax, %rbx
jmp 0x6ffa4
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x11270
movq %rbx, %rdi
callq 0x11a80