// File: DoubleString[P]RtConverter/src/Json/json_reader.cpp
// Function: Json::Reader::readValue()
bool Reader::readValue() {
  // readValue() may call itself only if it calls readObject() or ReadArray().
  // These methods execute nodes_.push() just before and nodes_.pop)() just
  // after calling readValue(). parse() executes one nodes_.push(), so > instead
  // of >=.
  if (nodes_.size() > stackLimit_g)
    throwRuntimeError("Exceeded stackLimit in readValue().");

  Token token;
  skipCommentTokens(token);
  bool successful = true;

  if (collectComments_ && !commentsBefore_.empty()) {
    currentValue().setComment(commentsBefore_, commentBefore);
    commentsBefore_.clear();
  }

  switch (token.type_) {
  case tokenObjectBegin:
    successful = readObject(token);
    currentValue().setOffsetLimit(current_ - begin_);
    break;
  case tokenArrayBegin:
    successful = readArray(token);
    currentValue().setOffsetLimit(current_ - begin_);
    break;
  case tokenNumber:
    successful = decodeNumber(token);
    break;
  case tokenString:
    successful = decodeString(token);
    break;
  case tokenTrue: {
    Value v(true);
    currentValue().swapPayload(v);
    currentValue().setOffsetStart(token.start_ - begin_);
    currentValue().setOffsetLimit(token.end_ - begin_);
  } break;
  case tokenFalse: {
    Value v(false);
    currentValue().swapPayload(v);
    currentValue().setOffsetStart(token.start_ - begin_);
    currentValue().setOffsetLimit(token.end_ - begin_);
  } break;
  case tokenNull: {
    Value v;
    currentValue().swapPayload(v);
    currentValue().setOffsetStart(token.start_ - begin_);
    currentValue().setOffsetLimit(token.end_ - begin_);
  } break;
  case tokenArraySeparator:
  case tokenObjectEnd:
  case tokenArrayEnd:
    if (features_.allowDroppedNullPlaceholders_) {
      // "Un-read" the current token and mark the current value as a null
      // token.
      current_--;
      Value v;
      currentValue().swapPayload(v);
      currentValue().setOffsetStart(current_ - begin_ - 1);
      currentValue().setOffsetLimit(current_ - begin_);
      break;
    } // Else, fall through...
  default:
    currentValue().setOffsetStart(token.start_ - begin_);
    currentValue().setOffsetLimit(token.end_ - begin_);
    return addError("Syntax error: value, object or array expected.", token);
  }

  if (collectComments_) {
    lastValueEnd_ = current_;
    lastValue_ = &currentValue();
  }

  return successful;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1c0, %rsp            # imm = 0x1C0
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x14550
cmpq $0x3e8, %rax            # imm = 0x3E8
jbe 0xaabc
leaq -0x31(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x9d30
movq -0x140(%rbp), %rdx
leaq 0xb0cfd(%rip), %rsi     # 0xbb772
leaq -0x30(%rbp), %rdi
callq 0x9a30
jmp 0xaa80
leaq -0x30(%rbp), %rdi
callq 0x1db90
jmp 0xaa8b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xaaae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x9480
leaq -0x31(%rbp), %rdi
callq 0x97e0
jmp 0xb0fc
movq -0x138(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xb110
movq -0x138(%rbp), %rax
movb $0x1, -0x61(%rbp)
testb $0x1, 0x10c(%rax)
je 0xab2e
movq -0x138(%rbp), %rdi
addq $0xe8, %rdi
callq 0x9c50
testb $0x1, %al
jne 0xab2e
movq -0x138(%rbp), %rdi
callq 0xb200
movq -0x138(%rbp), %rsi
movq %rax, %rdi
addq $0xe8, %rsi
xorl %edx, %edx
callq 0x24440
movq -0x138(%rbp), %rdi
addq $0xe8, %rdi
callq 0x99d0
movl -0x60(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x148(%rbp)
subl $0x9, %eax
ja 0xafae
movq -0x148(%rbp), %rax
leaq 0xb04b1(%rip), %rcx     # 0xbb004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x138(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xb220
movq -0x138(%rbp), %rdi
andb $0x1, %al
movb %al, -0x61(%rbp)
callq 0xb200
movq %rax, %rdi
movq -0x138(%rbp), %rax
movq 0xd0(%rax), %rsi
movq 0xc0(%rax), %rax
subq %rax, %rsi
callq 0x245e0
jmp 0xb0ab
movq -0x138(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xb9c0
movq -0x138(%rbp), %rdi
andb $0x1, %al
movb %al, -0x61(%rbp)
callq 0xb200
movq %rax, %rdi
movq -0x138(%rbp), %rax
movq 0xd0(%rax), %rsi
movq 0xc0(%rax), %rax
subq %rax, %rsi
callq 0x245e0
jmp 0xb0ab
movq -0x138(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xbd40
andb $0x1, %al
movb %al, -0x61(%rbp)
jmp 0xb0ab
movq -0x138(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xbe60
andb $0x1, %al
movb %al, -0x61(%rbp)
jmp 0xb0ab
leaq -0x90(%rbp), %rdi
movl $0x1, %esi
callq 0x1ec10
movq -0x138(%rbp), %rdi
callq 0xb200
movq %rax, -0x150(%rbp)
jmp 0xac42
movq -0x150(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x1f1e0
jmp 0xac57
movq -0x138(%rbp), %rdi
callq 0xb200
movq %rax, -0x158(%rbp)
jmp 0xac6c
movq -0x158(%rbp), %rdi
movq -0x138(%rbp), %rax
movq -0x58(%rbp), %rsi
movq 0xc0(%rax), %rax
subq %rax, %rsi
callq 0x245c0
jmp 0xac8f
movq -0x138(%rbp), %rdi
callq 0xb200
movq %rax, -0x160(%rbp)
jmp 0xaca4
movq -0x160(%rbp), %rdi
movq -0x138(%rbp), %rax
movq -0x50(%rbp), %rsi
movq 0xc0(%rax), %rax
subq %rax, %rsi
callq 0x245e0
jmp 0xacc7
leaq -0x90(%rbp), %rdi
callq 0x1f050
jmp 0xb0ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x1f050
jmp 0xb0fc
leaq -0xb8(%rbp), %rdi
xorl %esi, %esi
callq 0x1ec10
movq -0x138(%rbp), %rdi
callq 0xb200
movq %rax, -0x168(%rbp)
jmp 0xad18
movq -0x168(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x1f1e0
jmp 0xad2d
movq -0x138(%rbp), %rdi
callq 0xb200
movq %rax, -0x170(%rbp)
jmp 0xad42
movq -0x170(%rbp), %rdi
movq -0x138(%rbp), %rax
movq -0x58(%rbp), %rsi
movq 0xc0(%rax), %rax
subq %rax, %rsi
callq 0x245c0
jmp 0xad65
movq -0x138(%rbp), %rdi
callq 0xb200
movq %rax, -0x178(%rbp)
jmp 0xad7a
movq -0x178(%rbp), %rdi
movq -0x138(%rbp), %rax
movq -0x50(%rbp), %rsi
movq 0xc0(%rax), %rax
subq %rax, %rsi
callq 0x245e0
jmp 0xad9d
leaq -0xb8(%rbp), %rdi
callq 0x1f050
jmp 0xb0ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x1f050
jmp 0xb0fc
leaq -0xe0(%rbp), %rdi
xorl %esi, %esi
callq 0x1e5c0
movq -0x138(%rbp), %rdi
callq 0xb200
movq %rax, -0x180(%rbp)
jmp 0xadee
movq -0x180(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x1f1e0
jmp 0xae03
movq -0x138(%rbp), %rdi
callq 0xb200
movq %rax, -0x188(%rbp)
jmp 0xae18
movq -0x188(%rbp), %rdi
movq -0x138(%rbp), %rax
movq -0x58(%rbp), %rsi
movq 0xc0(%rax), %rax
subq %rax, %rsi
callq 0x245c0
jmp 0xae3b
movq -0x138(%rbp), %rdi
callq 0xb200
movq %rax, -0x190(%rbp)
jmp 0xae50
movq -0x190(%rbp), %rdi
movq -0x138(%rbp), %rax
movq -0x50(%rbp), %rsi
movq 0xc0(%rax), %rax
subq %rax, %rsi
callq 0x245e0
jmp 0xae73
leaq -0xe0(%rbp), %rdi
callq 0x1f050
jmp 0xb0ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x1f050
jmp 0xb0fc
movq -0x138(%rbp), %rax
testb $0x1, 0x10a(%rax)
je 0xafac
movq -0x138(%rbp), %rax
movq 0xd0(%rax), %rcx
decq %rcx
movq %rcx, 0xd0(%rax)
leaq -0x108(%rbp), %rdi
xorl %esi, %esi
callq 0x1e5c0
movq -0x138(%rbp), %rdi
callq 0xb200
movq %rax, -0x198(%rbp)
jmp 0xaef0
movq -0x198(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x1f1e0
jmp 0xaf05
movq -0x138(%rbp), %rdi
callq 0xb200
movq %rax, -0x1a0(%rbp)
jmp 0xaf1a
movq -0x1a0(%rbp), %rdi
movq -0x138(%rbp), %rax
movq 0xc0(%rax), %rsi
movq 0xd0(%rax), %rax
notq %rsi
addq %rax, %rsi
callq 0x245c0
jmp 0xaf43
movq -0x138(%rbp), %rdi
callq 0xb200
movq %rax, -0x1a8(%rbp)
jmp 0xaf58
movq -0x1a8(%rbp), %rdi
movq -0x138(%rbp), %rcx
movq 0xc0(%rcx), %rax
movq 0xd0(%rcx), %rsi
subq %rax, %rsi
callq 0x245e0
jmp 0xaf7e
leaq -0x108(%rbp), %rdi
callq 0x1f050
jmp 0xb0ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x1f050
jmp 0xb0fc
jmp 0xafae
movq -0x138(%rbp), %rdi
callq 0xb200
movq %rax, %rdi
movq -0x138(%rbp), %rax
movq -0x58(%rbp), %rsi
movq 0xc0(%rax), %rax
subq %rax, %rsi
callq 0x245c0
movq -0x138(%rbp), %rdi
callq 0xb200
movq %rax, %rdi
movq -0x138(%rbp), %rax
movq -0x50(%rbp), %rsi
movq 0xc0(%rax), %rax
subq %rax, %rsi
callq 0x245e0
leaq -0x129(%rbp), %rdi
movq %rdi, -0x1b0(%rbp)
callq 0x9d30
movq -0x1b0(%rbp), %rdx
leaq 0xb0775(%rip), %rsi     # 0xbb796
leaq -0x128(%rbp), %rdi
callq 0x9a30
jmp 0xb02f
movq -0x138(%rbp), %rdi
xorl %eax, %eax
movl %eax, %ecx
leaq -0x128(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0xb160
movb %al, -0x1b1(%rbp)
jmp 0xb052
movb -0x1b1(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x9480
leaq -0x129(%rbp), %rdi
callq 0x97e0
jmp 0xb0ee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xb09d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x9480
leaq -0x129(%rbp), %rdi
callq 0x97e0
jmp 0xb0fc
movq -0x138(%rbp), %rax
testb $0x1, 0x10c(%rax)
je 0xb0e6
movq -0x138(%rbp), %rdi
movq 0xd0(%rdi), %rax
movq %rax, 0xd8(%rdi)
callq 0xb200
movq %rax, %rcx
movq -0x138(%rbp), %rax
movq %rcx, 0xe0(%rax)
movb -0x61(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x9d20
nopw %cs:(%rax,%rax)