// File: tomfunkhouser[P]gaps/pkgs/RNBasics/json.cpp
// Function: Json::OurReader::readToken(Json::OurReader::Token&)
bool OurReader::readToken(Token& token) {
  skipSpaces();
  token.start_ = current_;
  Char c = getNextChar();
  bool ok = true;
  switch (c) {
  case '{':
    token.type_ = tokenObjectBegin;
    break;
  case '}':
    token.type_ = tokenObjectEnd;
    break;
  case '[':
    token.type_ = tokenArrayBegin;
    break;
  case ']':
    token.type_ = tokenArrayEnd;
    break;
  case '"':
    token.type_ = tokenString;
    ok = readString();
    break;
  case '\'':
    if (features_.allowSingleQuotes_) {
    token.type_ = tokenString;
    ok = readStringSingleQuote();
    break;
    } // else continue
  case '/':
    token.type_ = tokenComment;
    ok = readComment();
    break;
  case '0':
  case '1':
  case '2':
  case '3':
  case '4':
  case '5':
  case '6':
  case '7':
  case '8':
  case '9':
    token.type_ = tokenNumber;
    readNumber(false);
    break;
  case '-':
    if (readNumber(true)) {
      token.type_ = tokenNumber;
    } else {
      token.type_ = tokenNegInf;
      ok = features_.allowSpecialFloats_ && match("nfinity", 7);
    }
    break;
  case 't':
    token.type_ = tokenTrue;
    ok = match("rue", 3);
    break;
  case 'f':
    token.type_ = tokenFalse;
    ok = match("alse", 4);
    break;
  case 'n':
    token.type_ = tokenNull;
    ok = match("ull", 3);
    break;
  case 'N':
    if (features_.allowSpecialFloats_) {
      token.type_ = tokenNaN;
      ok = match("aN", 2);
    } else {
      ok = false;
    }
    break;
  case 'I':
    if (features_.allowSpecialFloats_) {
      token.type_ = tokenPosInf;
      ok = match("nfinity", 7);
    } else {
      ok = false;
    }
    break;
  case ',':
    token.type_ = tokenArraySeparator;
    break;
  case ':':
    token.type_ = tokenMemberSeparator;
    break;
  case 0:
    token.type_ = tokenEndOfStream;
    break;
  default:
    ok = false;
    break;
  }
  if (!ok)
    token.type_ = tokenError;
  token.end_ = current_;
  return true;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0xe7070
movq 0x10(%rsp), %rdi
movq 0xd0(%rdi), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x8(%rax)
callq 0xe70f0
movb %al, 0x27(%rsp)
movb $0x1, 0x26(%rsp)
movsbl 0x27(%rsp), %eax
movl %eax, %ecx
movq %rcx, 0x18(%rsp)
subl $0x7d, %eax
ja 0xe7037
movq 0x18(%rsp), %rax
leaq 0x82e0b(%rip), %rcx     # 0x169bdc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x28(%rsp), %rax
movl $0x1, (%rax)
jmp 0xe703c
movq 0x28(%rsp), %rax
movl $0x2, (%rax)
jmp 0xe703c
movq 0x28(%rsp), %rax
movl $0x3, (%rax)
jmp 0xe703c
movq 0x28(%rsp), %rax
movl $0x4, (%rax)
jmp 0xe703c
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rax
movl $0x5, (%rax)
callq 0xe7140
andb $0x1, %al
movb %al, 0x26(%rsp)
jmp 0xe703c
movq 0x10(%rsp), %rax
testb $0x1, 0x110(%rax)
je 0xe6e68
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rax
movl $0x5, (%rax)
callq 0xe71b0
andb $0x1, %al
movb %al, 0x26(%rsp)
jmp 0xe703c
jmp 0xe6e6a
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rax
movl $0xf, (%rax)
callq 0xe7220
andb $0x1, %al
movb %al, 0x26(%rsp)
jmp 0xe703c
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rax
movl $0x6, (%rax)
xorl %esi, %esi
callq 0xe7330
jmp 0xe703c
movq 0x10(%rsp), %rdi
movl $0x1, %esi
callq 0xe7330
testb $0x1, %al
jne 0xe6ebb
jmp 0xe6ec8
movq 0x28(%rsp), %rax
movl $0x6, (%rax)
jmp 0xe6f0b
movq 0x10(%rsp), %rcx
movq 0x28(%rsp), %rax
movl $0xc, (%rax)
xorl %eax, %eax
testb $0x1, 0x113(%rcx)
movb %al, 0xf(%rsp)
je 0xe6f01
movq 0x10(%rsp), %rdi
leaq 0x83ce1(%rip), %rsi     # 0x16abd4
movl $0x7, %edx
callq 0xe7610
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
andb $0x1, %al
movb %al, 0x26(%rsp)
jmp 0xe703c
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rax
movl $0x7, (%rax)
leaq 0x837cc(%rip), %rsi     # 0x16a6f3
movl $0x3, %edx
callq 0xe7610
andb $0x1, %al
movb %al, 0x26(%rsp)
jmp 0xe703c
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rax
movl $0x8, (%rax)
leaq 0x837a5(%rip), %rsi     # 0x16a6f8
movl $0x4, %edx
callq 0xe7610
andb $0x1, %al
movb %al, 0x26(%rsp)
jmp 0xe703c
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rax
movl $0x9, (%rax)
leaq 0x83c4f(%rip), %rsi     # 0x16abce
movl $0x3, %edx
callq 0xe7610
andb $0x1, %al
movb %al, 0x26(%rsp)
jmp 0xe703c
movq 0x10(%rsp), %rax
testb $0x1, 0x113(%rax)
je 0xe6fcb
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rax
movl $0xa, (%rax)
leaq 0x83c11(%rip), %rsi     # 0x16abca
movl $0x2, %edx
callq 0xe7610
andb $0x1, %al
movb %al, 0x26(%rsp)
jmp 0xe6fd0
movb $0x0, 0x26(%rsp)
jmp 0xe703c
movq 0x10(%rsp), %rax
testb $0x1, 0x113(%rax)
je 0xe7009
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rax
movl $0xb, (%rax)
leaq 0x83bdd(%rip), %rsi     # 0x16abd4
movl $0x7, %edx
callq 0xe7610
andb $0x1, %al
movb %al, 0x26(%rsp)
jmp 0xe700e
movb $0x0, 0x26(%rsp)
jmp 0xe703c
movq 0x28(%rsp), %rax
movl $0xd, (%rax)
jmp 0xe703c
movq 0x28(%rsp), %rax
movl $0xe, (%rax)
jmp 0xe703c
movq 0x28(%rsp), %rax
movl $0x0, (%rax)
jmp 0xe703c
movb $0x0, 0x26(%rsp)
testb $0x1, 0x26(%rsp)
jne 0xe704e
movq 0x28(%rsp), %rax
movl $0x10, (%rax)
movq 0x10(%rsp), %rax
movq 0xd0(%rax), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x10(%rax)
movb $0x1, %al
andb $0x1, %al
addq $0x38, %rsp
retq
nopl (%rax)