// File: tomfunkhouser[P]gaps/pkgs/RNBasics/json.cpp
// Function: Json::Value::resolveReference(char const*, char const*)
Value& Value::resolveReference(char const* key, char const* cend)
{
  JSON_ASSERT_MESSAGE(
      type_ == nullValue || type_ == objectValue,
      "in Json::Value::resolveReference(key, end): requires objectValue");
  if (type_ == nullValue)
    *this = Value(objectValue);
  CZString actualKey(
      key, static_cast<unsigned>(cend-key), CZString::duplicateOnCopy);
  ObjectValues::iterator it = value_.map_->lower_bound(actualKey);
  if (it != value_.map_->end() && (*it).first == actualKey)
    return (*it).second;

  ObjectValues::value_type defaultValue(actualKey, nullRef);
  it = value_.map_->insert(it, defaultValue);
  Value& value = (*it).second;
  return value;
}

// Assembly:
subq $0x2a8, %rsp            # imm = 0x2A8
movq %rdi, 0x298(%rsp)
movq %rsi, 0x290(%rsp)
movq %rdx, 0x288(%rsp)
movq 0x298(%rsp), %rax
movq %rax, 0x38(%rsp)
movw 0x8(%rax), %ax
andw $0xff, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0xf076f
movq 0x38(%rsp), %rax
movw 0x8(%rax), %ax
andw $0xff, %ax
movzwl %ax, %eax
cmpl $0x7, %eax
je 0xf076f
leaq 0x110(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x12980
movq 0x30(%rsp), %rdi
leaq 0x7a3dd(%rip), %rsi     # 0x16aac4
callq 0x126b0
jmp 0xf06ee
leaq 0xe0(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x12700
jmp 0xf0705
leaq 0xe0(%rsp), %rdi
callq 0xec480
jmp 0xf0714
leaq 0xe0(%rsp), %rdi
callq 0x12430
callq 0x12380
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x108(%rsp)
movl %eax, 0x104(%rsp)
jmp 0xf075d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x108(%rsp)
movl %eax, 0x104(%rsp)
leaq 0xe0(%rsp), %rdi
callq 0x12430
leaq 0x110(%rsp), %rdi
callq 0x121a0
jmp 0xf09c5
movq 0x38(%rsp), %rax
movw 0x8(%rax), %ax
andw $0xff, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
jne 0xf07e1
leaq 0xb8(%rsp), %rdi
movq %rdi, 0x28(%rsp)
movl $0x7, %esi
callq 0xecc20
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0xe3700
jmp 0xf07ac
leaq 0xb8(%rsp), %rdi
callq 0xed680
jmp 0xf07e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x108(%rsp)
movl %eax, 0x104(%rsp)
leaq 0xb8(%rsp), %rdi
callq 0xed680
jmp 0xf09c5
movq 0x290(%rsp), %rsi
movl 0x288(%rsp), %edx
movl %esi, %eax
subl %eax, %edx
leaq 0xa8(%rsp), %rdi
movq %rdi, 0x18(%rsp)
movl $0x2, %ecx
callq 0xec860
movq 0x38(%rsp), %rax
movq 0x18(%rsp), %rsi
movq (%rax), %rdi
callq 0xfa390
movq %rax, 0x20(%rsp)
jmp 0xf0824
movq 0x38(%rsp), %rax
movq 0x20(%rsp), %rcx
movq %rcx, 0xa0(%rsp)
movq (%rax), %rdi
callq 0xfa2a0
movq %rax, 0x98(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xf9f50
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x17(%rsp)
jne 0xf086a
jmp 0xf088b
leaq 0xa0(%rsp), %rdi
callq 0xf9f90
movq %rax, %rdi
leaq 0xa8(%rsp), %rsi
callq 0xecb80
movb %al, 0x17(%rsp)
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0xf0895
jmp 0xf08d7
leaq 0xa0(%rsp), %rdi
callq 0xf9f90
addq $0x10, %rax
movq %rax, 0x2a0(%rsp)
movl $0x1, 0x94(%rsp)
jmp 0xf099b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x108(%rsp)
movl %eax, 0x104(%rsp)
jmp 0xf09b8
movq 0xbfc42(%rip), %rdx     # 0x1b0520
leaq 0x58(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0xfa3c0
jmp 0xf08f2
movq 0x38(%rsp), %rax
movq (%rax), %rax
movq %rax, (%rsp)
leaq 0x48(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0xfa2d0
movq (%rsp), %rdi
movq 0x48(%rsp), %rsi
leaq 0x58(%rsp), %rdx
callq 0xfa430
movq %rax, 0x8(%rsp)
jmp 0xf092a
movq 0x8(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0xa0(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0xf9f90
addq $0x10, %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x2a0(%rsp)
movl $0x1, 0x94(%rsp)
leaq 0x58(%rsp), %rdi
callq 0xfa470
jmp 0xf099b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x108(%rsp)
movl %eax, 0x104(%rsp)
leaq 0x58(%rsp), %rdi
callq 0xfa470
jmp 0xf09b8
leaq 0xa8(%rsp), %rdi
callq 0xec9f0
movq 0x2a0(%rsp), %rax
addq $0x2a8, %rsp            # imm = 0x2A8
retq
leaq 0xa8(%rsp), %rdi
callq 0xec9f0
movq 0x108(%rsp), %rdi
callq 0x12c20
nopw %cs:(%rax,%rax)