// File: tomfunkhouser[P]gaps/pkgs/RNBasics/json.cpp
// Function: Json::Reader::readToken(Json::Reader::Token&)
bool Reader::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 '/':
    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':
  case '-':
    token.type_ = tokenNumber;
    readNumber();
    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 ',':
    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 $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, (%rsp)
callq 0xe1d00
movq (%rsp), %rdi
movq 0xd0(%rdi), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
callq 0xe1d80
movb %al, 0x17(%rsp)
movb $0x1, 0x16(%rsp)
movsbl 0x17(%rsp), %eax
movl %eax, %ecx
movq %rcx, 0x8(%rsp)
subl $0x7d, %eax
ja 0xe1cbe
movq 0x8(%rsp), %rax
leaq 0x87cc9(%rip), %rcx     # 0x169848
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x18(%rsp), %rax
movl $0x1, (%rax)
jmp 0xe1cc3
movq 0x18(%rsp), %rax
movl $0x2, (%rax)
jmp 0xe1cc3
movq 0x18(%rsp), %rax
movl $0x3, (%rax)
jmp 0xe1cc3
movq 0x18(%rsp), %rax
movl $0x4, (%rax)
jmp 0xe1cc3
movq (%rsp), %rdi
movq 0x18(%rsp), %rax
movl $0x5, (%rax)
callq 0xe1dd0
andb $0x1, %al
movb %al, 0x16(%rsp)
jmp 0xe1cc3
movq (%rsp), %rdi
movq 0x18(%rsp), %rax
movl $0xc, (%rax)
callq 0xe1e40
andb $0x1, %al
movb %al, 0x16(%rsp)
jmp 0xe1cc3
movq (%rsp), %rdi
movq 0x18(%rsp), %rax
movl $0x6, (%rax)
callq 0xe1f50
jmp 0xe1cc3
movq (%rsp), %rdi
movq 0x18(%rsp), %rax
movl $0x7, (%rax)
leaq 0x88abe(%rip), %rsi     # 0x16a6f3
movl $0x3, %edx
callq 0xe21d0
andb $0x1, %al
movb %al, 0x16(%rsp)
jmp 0xe1cc3
movq (%rsp), %rdi
movq 0x18(%rsp), %rax
movl $0x8, (%rax)
leaq 0x88a9b(%rip), %rsi     # 0x16a6f8
movl $0x4, %edx
callq 0xe21d0
andb $0x1, %al
movb %al, 0x16(%rsp)
jmp 0xe1cc3
movq (%rsp), %rdi
movq 0x18(%rsp), %rax
movl $0x9, (%rax)
leaq 0x88f49(%rip), %rsi     # 0x16abce
movl $0x3, %edx
callq 0xe21d0
andb $0x1, %al
movb %al, 0x16(%rsp)
jmp 0xe1cc3
movq 0x18(%rsp), %rax
movl $0xa, (%rax)
jmp 0xe1cc3
movq 0x18(%rsp), %rax
movl $0xb, (%rax)
jmp 0xe1cc3
movq 0x18(%rsp), %rax
movl $0x0, (%rax)
jmp 0xe1cc3
movb $0x0, 0x16(%rsp)
testb $0x1, 0x16(%rsp)
jne 0xe1cd5
movq 0x18(%rsp), %rax
movl $0xd, (%rax)
movq (%rsp), %rax
movq 0xd0(%rax), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x10(%rax)
movb $0x1, %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)