// File: tomfunkhouser[P]gaps/pkgs/RNBasics/json.cpp
// Function: Json::Reader::readObject(Json::Reader::Token&)
bool Reader::readObject(Token& tokenStart) {
  Token tokenName;
  std::string name;
  Value init(objectValue);
  currentValue().swapPayload(init);
  currentValue().setOffsetStart(tokenStart.start_ - begin_);
  while (readToken(tokenName)) {
    bool initialTokenOk = true;
    while (tokenName.type_ == tokenComment && initialTokenOk)
      initialTokenOk = readToken(tokenName);
    if (!initialTokenOk)
      break;
    if (tokenName.type_ == tokenObjectEnd && name.empty()) // empty object
      return true;
    name = "";
    if (tokenName.type_ == tokenString) {
      if (!decodeString(tokenName, name))
        return recoverFromError(tokenObjectEnd);
    } else if (tokenName.type_ == tokenNumber && features_.allowNumericKeys_) {
      Value numberName;
      if (!decodeNumber(tokenName, numberName))
        return recoverFromError(tokenObjectEnd);
      name = numberName.asString();
    } else {
      break;
    }

    Token colon;
    if (!readToken(colon) || colon.type_ != tokenMemberSeparator) {
      return addErrorAndRecover(
          "Missing ':' after object member name", colon, tokenObjectEnd);
    }
    Value& value = currentValue()[name];
    nodes_.push(&value);
    bool ok = readValue();
    nodes_.pop();
    if (!ok) // error already set
      return recoverFromError(tokenObjectEnd);

    Token comma;
    if (!readToken(comma) ||
        (comma.type_ != tokenObjectEnd && comma.type_ != tokenArraySeparator &&
         comma.type_ != tokenComment)) {
      return addErrorAndRecover(
          "Missing ',' or '}' in object declaration", comma, tokenObjectEnd);
    }
    bool finalizeTokenOk = true;
    while (comma.type_ == tokenComment && finalizeTokenOk)
      finalizeTokenOk = readToken(comma);
    if (comma.type_ == tokenObjectEnd)
      return true;
  }
  return addErrorAndRecover(
      "Missing '}' or object member name", tokenName, tokenObjectEnd);
}

// Assembly:
subq $0x208, %rsp            # imm = 0x208
movq %rdi, 0x1f8(%rsp)
movq %rsi, 0x1f0(%rsp)
movq 0x1f8(%rsp), %rax
movq %rax, 0x68(%rsp)
leaq 0x1b8(%rsp), %rdi
callq 0x129f0
leaq 0x190(%rsp), %rdi
movl $0x7, %esi
callq 0xecc20
jmp 0xe0c35
movq 0x68(%rsp), %rdi
callq 0xe0bd0
movq %rax, 0x60(%rsp)
jmp 0xe0c46
movq 0x60(%rsp), %rdi
leaq 0x190(%rsp), %rsi
callq 0xe1a10
jmp 0xe0c5a
movq 0x68(%rsp), %rdi
callq 0xe0bd0
movq %rax, 0x58(%rsp)
jmp 0xe0c6b
movq 0x58(%rsp), %rdi
movq 0x68(%rsp), %rax
movq 0x1f0(%rsp), %rcx
movq 0x8(%rcx), %rsi
movq 0xc0(%rax), %rax
subq %rax, %rsi
callq 0xe1b00
jmp 0xe0c92
jmp 0xe0c94
movq 0x68(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
callq 0xe1b20
movb %al, 0x57(%rsp)
jmp 0xe0cac
movb 0x57(%rsp), %al
testb $0x1, %al
jne 0xe0cb9
jmp 0xe127a
movb $0x1, 0x183(%rsp)
xorl %eax, %eax
cmpl $0xc, 0x1d8(%rsp)
movb %al, 0x56(%rsp)
jne 0xe0cdc
movb 0x183(%rsp), %al
movb %al, 0x56(%rsp)
movb 0x56(%rsp), %al
testb $0x1, %al
jne 0xe0ce6
jmp 0xe0d3f
movq 0x68(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
callq 0xe1b20
movb %al, 0x55(%rsp)
jmp 0xe0cfe
movb 0x55(%rsp), %al
andb $0x1, %al
movb %al, 0x183(%rsp)
jmp 0xe0cc1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
jmp 0xe1369
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
jmp 0xe135c
testb $0x1, 0x183(%rsp)
jne 0xe0d4e
jmp 0xe127a
cmpl $0x2, 0x1d8(%rsp)
jne 0xe0d83
leaq 0x1b8(%rsp), %rdi
callq 0x12ba0
testb $0x1, %al
jne 0xe0d6b
jmp 0xe0d83
movb $0x1, 0x207(%rsp)
movl $0x1, 0x17c(%rsp)
jmp 0xe1331
leaq 0x86875(%rip), %rsi     # 0x1675ff
leaq 0x1b8(%rsp), %rdi
callq 0x129a0
jmp 0xe0d99
cmpl $0x5, 0x1d8(%rsp)
jne 0xe0e04
movq 0x68(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
leaq 0x1b8(%rsp), %rdx
callq 0xe25c0
movb %al, 0x54(%rsp)
jmp 0xe0dc3
movb 0x54(%rsp), %al
testb $0x1, %al
jne 0xe0dff
jmp 0xe0dcd
movq 0x68(%rsp), %rdi
movl $0x2, %esi
callq 0xe2a20
movb %al, 0x53(%rsp)
jmp 0xe0de2
movb 0x53(%rsp), %al
andb $0x1, %al
movb %al, 0x207(%rsp)
movl $0x1, 0x17c(%rsp)
jmp 0xe1331
jmp 0xe0f1f
cmpl $0x6, 0x1d8(%rsp)
jne 0xe0f18
movq 0x68(%rsp), %rax
testb $0x1, 0x10b(%rax)
je 0xe0f18
leaq 0x150(%rsp), %rdi
xorl %esi, %esi
callq 0xecc20
jmp 0xe0e35
movq 0x68(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
leaq 0x150(%rsp), %rdx
callq 0xe2aa0
movb %al, 0x52(%rsp)
jmp 0xe0e55
movb 0x52(%rsp), %al
testb $0x1, %al
jne 0xe0eb4
jmp 0xe0e5f
movq 0x68(%rsp), %rdi
movl $0x2, %esi
callq 0xe2a20
movb %al, 0x51(%rsp)
jmp 0xe0e74
movb 0x51(%rsp), %al
andb $0x1, %al
movb %al, 0x207(%rsp)
movl $0x1, 0x17c(%rsp)
jmp 0xe0ef8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
leaq 0x150(%rsp), %rdi
callq 0xed680
jmp 0xe135c
leaq 0x130(%rsp), %rdi
leaq 0x150(%rsp), %rsi
callq 0xe2e90
jmp 0xe0ecb
leaq 0x1b8(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0x128a0
leaq 0x130(%rsp), %rdi
callq 0x12430
movl $0x0, 0x17c(%rsp)
leaq 0x150(%rsp), %rdi
callq 0xed680
movl 0x17c(%rsp), %eax
testl %eax, %eax
jne 0xe1331
jmp 0xe0f16
jmp 0xe0f1d
jmp 0xe127a
jmp 0xe0f1f
movq 0x68(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0xe1b20
movb %al, 0x50(%rsp)
jmp 0xe0f37
movb 0x50(%rsp), %al
testb $0x1, %al
jne 0xe0f41
jmp 0xe0f4f
cmpl $0xb, 0x118(%rsp)
je 0xe1021
leaq 0xf7(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x12c30
movq 0x48(%rsp), %rdx
leaq 0x89390(%rip), %rsi     # 0x16a2fd
leaq 0xf8(%rsp), %rdi
callq 0x22830
jmp 0xe0f7c
movq 0x68(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
leaq 0x118(%rsp), %rdx
movl $0x2, %ecx
callq 0xe31e0
movb %al, 0x47(%rsp)
jmp 0xe0fa1
movb 0x47(%rsp), %al
andb $0x1, %al
movb %al, 0x207(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x12430
leaq 0xf7(%rsp), %rdi
callq 0x12760
movl $0x1, 0x17c(%rsp)
jmp 0xe1331
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
jmp 0xe100f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x12430
leaq 0xf7(%rsp), %rdi
callq 0x12760
jmp 0xe135c
movq 0x68(%rsp), %rdi
callq 0xe0bd0
movq %rax, 0x38(%rsp)
jmp 0xe1032
movq 0x38(%rsp), %rdi
leaq 0x1b8(%rsp), %rsi
callq 0xe3230
movq %rax, 0x30(%rsp)
jmp 0xe104b
movq 0x68(%rsp), %rdi
movq 0x30(%rsp), %rax
movq %rax, 0xe8(%rsp)
movq 0xe8(%rsp), %rax
movq %rax, 0xe0(%rsp)
leaq 0xe0(%rsp), %rsi
callq 0xf92f0
jmp 0xe107c
movq 0x68(%rsp), %rdi
callq 0xe01e0
movb %al, 0x2f(%rsp)
jmp 0xe108c
movq 0x68(%rsp), %rdi
movb 0x2f(%rsp), %al
andb $0x1, %al
movb %al, 0xdf(%rsp)
callq 0xf92e0
jmp 0xe10a5
testb $0x1, 0xdf(%rsp)
jne 0xe10e1
movq 0x68(%rsp), %rdi
movl $0x2, %esi
callq 0xe2a20
movb %al, 0x2e(%rsp)
jmp 0xe10c4
movb 0x2e(%rsp), %al
andb $0x1, %al
movb %al, 0x207(%rsp)
movl $0x1, 0x17c(%rsp)
jmp 0xe1331
movq 0x68(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0xe1b20
movb %al, 0x2d(%rsp)
jmp 0xe10f9
movb 0x2d(%rsp), %al
testb $0x1, %al
jne 0xe1103
jmp 0xe112d
cmpl $0x2, 0xc0(%rsp)
je 0xe11ff
cmpl $0xa, 0xc0(%rsp)
je 0xe11ff
cmpl $0xc, 0xc0(%rsp)
je 0xe11ff
leaq 0x9f(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x12c30
movq 0x20(%rsp), %rdx
leaq 0x891d7(%rip), %rsi     # 0x16a322
leaq 0xa0(%rsp), %rdi
callq 0x22830
jmp 0xe115a
movq 0x68(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
movl $0x2, %ecx
callq 0xe31e0
movb %al, 0x1f(%rsp)
jmp 0xe117f
movb 0x1f(%rsp), %al
andb $0x1, %al
movb %al, 0x207(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x12430
leaq 0x9f(%rsp), %rdi
callq 0x12760
movl $0x1, 0x17c(%rsp)
jmp 0xe1331
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
jmp 0xe11ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x12430
leaq 0x9f(%rsp), %rdi
callq 0x12760
jmp 0xe135c
movb $0x1, 0x9e(%rsp)
xorl %eax, %eax
cmpl $0xc, 0xc0(%rsp)
movb %al, 0x1e(%rsp)
jne 0xe1222
movb 0x9e(%rsp), %al
movb %al, 0x1e(%rsp)
movb 0x1e(%rsp), %al
testb $0x1, %al
jne 0xe122c
jmp 0xe1253
movq 0x68(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0xe1b20
movb %al, 0x1d(%rsp)
jmp 0xe1244
movb 0x1d(%rsp), %al
andb $0x1, %al
movb %al, 0x9e(%rsp)
jmp 0xe1207
cmpl $0x2, 0xc0(%rsp)
jne 0xe1275
movb $0x1, 0x207(%rsp)
movl $0x1, 0x17c(%rsp)
jmp 0xe1331
jmp 0xe0c94
leaq 0x77(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x12c30
movq 0x10(%rsp), %rdx
leaq 0x890b6(%rip), %rsi     # 0x16a34b
leaq 0x78(%rsp), %rdi
callq 0x22830
jmp 0xe12a1
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rsi
leaq 0x1d8(%rsp), %rdx
movl $0x2, %ecx
callq 0xe31e0
movb %al, 0xf(%rsp)
jmp 0xe12c3
movb 0xf(%rsp), %al
andb $0x1, %al
movb %al, 0x207(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x12430
leaq 0x77(%rsp), %rdi
callq 0x12760
movl $0x1, 0x17c(%rsp)
jmp 0xe1331
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
jmp 0xe1325
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x12430
leaq 0x77(%rsp), %rdi
callq 0x12760
jmp 0xe135c
leaq 0x190(%rsp), %rdi
callq 0xed680
leaq 0x1b8(%rsp), %rdi
callq 0x12430
movb 0x207(%rsp), %al
andb $0x1, %al
addq $0x208, %rsp            # imm = 0x208
retq
leaq 0x190(%rsp), %rdi
callq 0xed680
leaq 0x1b8(%rsp), %rdi
callq 0x12430
movq 0x188(%rsp), %rdi
callq 0x12c20
nopw %cs:(%rax,%rax)