// File: tomfunkhouser[P]gaps/pkgs/RNBasics/json.cpp
// Function: Json::OurReader::readObject(Json::OurReader::Token&)
bool OurReader::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);
    }
    if (name.length() >= (1U<<30)) throwRuntimeError("keylength >= 2^30");
    if (features_.rejectDupKeys_ && currentValue().isMember(name)) {
      std::string msg = "Duplicate key: '" + name + "'";
      return addErrorAndRecover(
          msg, tokenName, 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 $0x288, %rsp            # imm = 0x288
movq %rdi, 0x278(%rsp)
movq %rsi, 0x270(%rsp)
movq 0x278(%rsp), %rax
movq %rax, 0x80(%rsp)
leaq 0x238(%rsp), %rdi
callq 0x129f0
leaq 0x210(%rsp), %rdi
movl $0x7, %esi
callq 0xecc20
jmp 0xe5d78
movq 0x80(%rsp), %rdi
callq 0xe5d10
movq %rax, 0x78(%rsp)
jmp 0xe5d8c
movq 0x78(%rsp), %rdi
leaq 0x210(%rsp), %rsi
callq 0xe1a10
jmp 0xe5da0
movq 0x80(%rsp), %rdi
callq 0xe5d10
movq %rax, 0x70(%rsp)
jmp 0xe5db4
movq 0x70(%rsp), %rdi
movq 0x80(%rsp), %rax
movq 0x270(%rsp), %rcx
movq 0x8(%rcx), %rsi
movq 0xc0(%rax), %rax
subq %rax, %rsi
callq 0xe1b00
jmp 0xe5dde
jmp 0xe5de0
movq 0x80(%rsp), %rdi
leaq 0x258(%rsp), %rsi
callq 0xe6d70
movb %al, 0x6f(%rsp)
jmp 0xe5dfb
movb 0x6f(%rsp), %al
testb $0x1, %al
jne 0xe5e08
jmp 0xe65e8
movb $0x1, 0x203(%rsp)
xorl %eax, %eax
cmpl $0xf, 0x258(%rsp)
movb %al, 0x6e(%rsp)
jne 0xe5e2b
movb 0x203(%rsp), %al
movb %al, 0x6e(%rsp)
movb 0x6e(%rsp), %al
testb $0x1, %al
jne 0xe5e35
jmp 0xe5e91
movq 0x80(%rsp), %rdi
leaq 0x258(%rsp), %rsi
callq 0xe6d70
movb %al, 0x6d(%rsp)
jmp 0xe5e50
movb 0x6d(%rsp), %al
andb $0x1, %al
movb %al, 0x203(%rsp)
jmp 0xe5e10
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x208(%rsp)
movl %eax, 0x204(%rsp)
jmp 0xe66ef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x208(%rsp)
movl %eax, 0x204(%rsp)
jmp 0xe66e2
testb $0x1, 0x203(%rsp)
jne 0xe5ea0
jmp 0xe65e8
cmpl $0x2, 0x258(%rsp)
jne 0xe5ed5
leaq 0x238(%rsp), %rdi
callq 0x12ba0
testb $0x1, %al
jne 0xe5ebd
jmp 0xe5ed5
movb $0x1, 0x287(%rsp)
movl $0x1, 0x1fc(%rsp)
jmp 0xe66b7
leaq 0x81723(%rip), %rsi     # 0x1675ff
leaq 0x238(%rsp), %rdi
callq 0x129a0
jmp 0xe5eeb
cmpl $0x5, 0x258(%rsp)
jne 0xe5f5c
movq 0x80(%rsp), %rdi
leaq 0x258(%rsp), %rsi
leaq 0x238(%rsp), %rdx
callq 0xe7880
movb %al, 0x6c(%rsp)
jmp 0xe5f18
movb 0x6c(%rsp), %al
testb $0x1, %al
jne 0xe5f57
jmp 0xe5f22
movq 0x80(%rsp), %rdi
movl $0x2, %esi
callq 0xe7ce0
movb %al, 0x6b(%rsp)
jmp 0xe5f3a
movb 0x6b(%rsp), %al
andb $0x1, %al
movb %al, 0x287(%rsp)
movl $0x1, 0x1fc(%rsp)
jmp 0xe66b7
jmp 0xe6080
cmpl $0x6, 0x258(%rsp)
jne 0xe6079
movq 0x80(%rsp), %rax
testb $0x1, 0x10f(%rax)
je 0xe6079
leaq 0x1d0(%rsp), %rdi
xorl %esi, %esi
callq 0xecc20
jmp 0xe5f90
movq 0x80(%rsp), %rdi
leaq 0x258(%rsp), %rsi
leaq 0x1d0(%rsp), %rdx
callq 0xe7d60
movb %al, 0x6a(%rsp)
jmp 0xe5fb3
movb 0x6a(%rsp), %al
testb $0x1, %al
jne 0xe6015
jmp 0xe5fbd
movq 0x80(%rsp), %rdi
movl $0x2, %esi
callq 0xe7ce0
movb %al, 0x69(%rsp)
jmp 0xe5fd5
movb 0x69(%rsp), %al
andb $0x1, %al
movb %al, 0x287(%rsp)
movl $0x1, 0x1fc(%rsp)
jmp 0xe6059
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x208(%rsp)
movl %eax, 0x204(%rsp)
leaq 0x1d0(%rsp), %rdi
callq 0xed680
jmp 0xe66e2
leaq 0x1b0(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0xe2e90
jmp 0xe602c
leaq 0x238(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
callq 0x128a0
leaq 0x1b0(%rsp), %rdi
callq 0x12430
movl $0x0, 0x1fc(%rsp)
leaq 0x1d0(%rsp), %rdi
callq 0xed680
movl 0x1fc(%rsp), %eax
testl %eax, %eax
jne 0xe66b7
jmp 0xe6077
jmp 0xe607e
jmp 0xe65e8
jmp 0xe6080
movq 0x80(%rsp), %rdi
leaq 0x198(%rsp), %rsi
callq 0xe6d70
movb %al, 0x68(%rsp)
jmp 0xe609b
movb 0x68(%rsp), %al
testb $0x1, %al
jne 0xe60a5
jmp 0xe60b3
cmpl $0xe, 0x198(%rsp)
je 0xe6188
leaq 0x177(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0x12c30
movq 0x60(%rsp), %rdx
leaq 0x8422c(%rip), %rsi     # 0x16a2fd
leaq 0x178(%rsp), %rdi
callq 0x22830
jmp 0xe60e0
movq 0x80(%rsp), %rdi
leaq 0x178(%rsp), %rsi
leaq 0x198(%rsp), %rdx
movl $0x2, %ecx
callq 0xe80d0
movb %al, 0x5f(%rsp)
jmp 0xe6108
movb 0x5f(%rsp), %al
andb $0x1, %al
movb %al, 0x287(%rsp)
leaq 0x178(%rsp), %rdi
callq 0x12430
leaq 0x177(%rsp), %rdi
callq 0x12760
movl $0x1, 0x1fc(%rsp)
jmp 0xe66b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x208(%rsp)
movl %eax, 0x204(%rsp)
jmp 0xe6176
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x208(%rsp)
movl %eax, 0x204(%rsp)
leaq 0x178(%rsp), %rdi
callq 0x12430
leaq 0x177(%rsp), %rdi
callq 0x12760
jmp 0xe66e2
leaq 0x238(%rsp), %rdi
callq 0x12a90
cmpq $0x40000000, %rax       # imm = 0x40000000
jb 0xe6242
leaq 0x14f(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0x12c30
movq 0x50(%rsp), %rdx
leaq 0x8438b(%rip), %rsi     # 0x16a54a
leaq 0x150(%rsp), %rdi
callq 0x22830
jmp 0xe61ce
leaq 0x150(%rsp), %rdi
callq 0xe0b60
jmp 0xe61dd
leaq 0x150(%rsp), %rdi
callq 0x12430
leaq 0x14f(%rsp), %rdi
callq 0x12760
jmp 0xe6242
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x208(%rsp)
movl %eax, 0x204(%rsp)
jmp 0xe6230
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x208(%rsp)
movl %eax, 0x204(%rsp)
leaq 0x150(%rsp), %rdi
callq 0x12430
leaq 0x14f(%rsp), %rdi
callq 0x12760
jmp 0xe66e2
movq 0x80(%rsp), %rax
testb $0x1, 0x112(%rax)
je 0xe6377
movq 0x80(%rsp), %rdi
callq 0xe5d10
movq %rax, 0x48(%rsp)
jmp 0xe626b
movq 0x48(%rsp), %rdi
leaq 0x238(%rsp), %rsi
callq 0xe8120
movb %al, 0x47(%rsp)
jmp 0xe6283
movb 0x47(%rsp), %al
testb $0x1, %al
jne 0xe6290
jmp 0xe6377
leaq 0x842c5(%rip), %rsi     # 0x16a55c
leaq 0x108(%rsp), %rdi
leaq 0x238(%rsp), %rdx
callq 0xf95c0
jmp 0xe62ae
leaq 0x842b6(%rip), %rdx     # 0x16a56b
leaq 0x128(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x228f0
jmp 0xe62cc
leaq 0x108(%rsp), %rdi
callq 0x12430
movq 0x80(%rsp), %rdi
leaq 0x128(%rsp), %rsi
leaq 0x258(%rsp), %rdx
movl $0x2, %ecx
callq 0xe80d0
movb %al, 0x46(%rsp)
jmp 0xe6301
movb 0x46(%rsp), %al
andb $0x1, %al
movb %al, 0x287(%rsp)
movl $0x1, 0x1fc(%rsp)
leaq 0x128(%rsp), %rdi
callq 0x12430
jmp 0xe66b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x208(%rsp)
movl %eax, 0x204(%rsp)
leaq 0x108(%rsp), %rdi
callq 0x12430
jmp 0xe66e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x208(%rsp)
movl %eax, 0x204(%rsp)
leaq 0x128(%rsp), %rdi
callq 0x12430
jmp 0xe66e2
movq 0x80(%rsp), %rdi
callq 0xe5d10
movq %rax, 0x38(%rsp)
jmp 0xe638b
movq 0x38(%rsp), %rdi
leaq 0x238(%rsp), %rsi
callq 0xe3230
movq %rax, 0x30(%rsp)
jmp 0xe63a4
movq 0x80(%rsp), %rdi
movq 0x30(%rsp), %rax
movq %rax, 0x100(%rsp)
movq 0x100(%rsp), %rax
movq %rax, 0xf8(%rsp)
leaq 0xf8(%rsp), %rsi
callq 0xf92f0
jmp 0xe63d8
movq 0x80(%rsp), %rdi
callq 0xe5120
movb %al, 0x2f(%rsp)
jmp 0xe63eb
movq 0x80(%rsp), %rdi
movb 0x2f(%rsp), %al
andb $0x1, %al
movb %al, 0xf7(%rsp)
callq 0xf92e0
jmp 0xe6407
testb $0x1, 0xf7(%rsp)
jne 0xe6446
movq 0x80(%rsp), %rdi
movl $0x2, %esi
callq 0xe7ce0
movb %al, 0x2e(%rsp)
jmp 0xe6429
movb 0x2e(%rsp), %al
andb $0x1, %al
movb %al, 0x287(%rsp)
movl $0x1, 0x1fc(%rsp)
jmp 0xe66b7
movq 0x80(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0xe6d70
movb %al, 0x2d(%rsp)
jmp 0xe6461
movb 0x2d(%rsp), %al
testb $0x1, %al
jne 0xe646b
jmp 0xe6495
cmpl $0x2, 0xd8(%rsp)
je 0xe656a
cmpl $0xd, 0xd8(%rsp)
je 0xe656a
cmpl $0xf, 0xd8(%rsp)
je 0xe656a
leaq 0xb7(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x12c30
movq 0x20(%rsp), %rdx
leaq 0x83e6f(%rip), %rsi     # 0x16a322
leaq 0xb8(%rsp), %rdi
callq 0x22830
jmp 0xe64c2
movq 0x80(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
leaq 0xd8(%rsp), %rdx
movl $0x2, %ecx
callq 0xe80d0
movb %al, 0x1f(%rsp)
jmp 0xe64ea
movb 0x1f(%rsp), %al
andb $0x1, %al
movb %al, 0x287(%rsp)
leaq 0xb8(%rsp), %rdi
callq 0x12430
leaq 0xb7(%rsp), %rdi
callq 0x12760
movl $0x1, 0x1fc(%rsp)
jmp 0xe66b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x208(%rsp)
movl %eax, 0x204(%rsp)
jmp 0xe6558
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x208(%rsp)
movl %eax, 0x204(%rsp)
leaq 0xb8(%rsp), %rdi
callq 0x12430
leaq 0xb7(%rsp), %rdi
callq 0x12760
jmp 0xe66e2
movb $0x1, 0xb6(%rsp)
xorl %eax, %eax
cmpl $0xf, 0xd8(%rsp)
movb %al, 0x1e(%rsp)
jne 0xe658d
movb 0xb6(%rsp), %al
movb %al, 0x1e(%rsp)
movb 0x1e(%rsp), %al
testb $0x1, %al
jne 0xe6597
jmp 0xe65c1
movq 0x80(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0xe6d70
movb %al, 0x1d(%rsp)
jmp 0xe65b2
movb 0x1d(%rsp), %al
andb $0x1, %al
movb %al, 0xb6(%rsp)
jmp 0xe6572
cmpl $0x2, 0xd8(%rsp)
jne 0xe65e3
movb $0x1, 0x287(%rsp)
movl $0x1, 0x1fc(%rsp)
jmp 0xe66b7
jmp 0xe5de0
leaq 0x8f(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x12c30
movq 0x10(%rsp), %rdx
leaq 0x83d45(%rip), %rsi     # 0x16a34b
leaq 0x90(%rsp), %rdi
callq 0x22830
jmp 0xe6615
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rsi
leaq 0x258(%rsp), %rdx
movl $0x2, %ecx
callq 0xe80d0
movb %al, 0xf(%rsp)
jmp 0xe663d
movb 0xf(%rsp), %al
andb $0x1, %al
movb %al, 0x287(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x12430
leaq 0x8f(%rsp), %rdi
callq 0x12760
movl $0x1, 0x1fc(%rsp)
jmp 0xe66b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x208(%rsp)
movl %eax, 0x204(%rsp)
jmp 0xe66a8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x208(%rsp)
movl %eax, 0x204(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x12430
leaq 0x8f(%rsp), %rdi
callq 0x12760
jmp 0xe66e2
leaq 0x210(%rsp), %rdi
callq 0xed680
leaq 0x238(%rsp), %rdi
callq 0x12430
movb 0x287(%rsp), %al
andb $0x1, %al
addq $0x288, %rsp            # imm = 0x288
retq
leaq 0x210(%rsp), %rdi
callq 0xed680
leaq 0x238(%rsp), %rdi
callq 0x12430
movq 0x208(%rsp), %rdi
callq 0x12c20
nopl (%rax)