// File: tomfunkhouser[P]gaps/pkgs/RNBasics/json.cpp
// Function: Json::Value::Value(Json::Value const&)
Value::Value(Value const& other)
    : type_(other.type_), allocated_(false)
      ,
      comments_(0), start_(other.start_), limit_(other.limit_)
{
  switch (type_) {
  case nullValue:
  case intValue:
  case uintValue:
  case realValue:
  case booleanValue:
    value_ = other.value_;
    break;
  case stringValue:
    if (other.value_.string_ && other.allocated_) {
      unsigned len;
      char const* str;
      decodePrefixedString(other.allocated_, other.value_.string_,
          &len, &str);
      value_.string_ = duplicateAndPrefixStringValue(str, len);
      allocated_ = true;
    } else {
      value_.string_ = other.value_.string_;
      allocated_ = false;
    }
    break;
  case arrayValue:
  case objectValue:
    value_.map_ = new ObjectValues(*other.value_.map_);
    break;
  default:
    JSON_ASSERT_UNREACHABLE;
  }
  if (other.comments_) {
    comments_ = new CommentInfo[numberOfCommentPlacement];
    for (int comment = 0; comment < numberOfCommentPlacement; ++comment) {
      const CommentInfo& otherComment = other.comments_[comment];
      if (otherComment.comment_)
        comments_[comment].setComment(
            otherComment.comment_, strlen(otherComment.comment_));
    }
  }
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x88(%rsp), %rcx
movb 0x8(%rcx), %cl
movb %cl, 0x8(%rax)
movb 0x9(%rax), %cl
andb $-0x2, %cl
movb %cl, 0x9(%rax)
movq $0x0, 0x10(%rax)
movq 0x88(%rsp), %rcx
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rax)
movq 0x88(%rsp), %rcx
movq 0x20(%rcx), %rcx
movq %rcx, 0x20(%rax)
movzbl 0x8(%rax), %eax
movzwl %ax, %ecx
movl %ecx, 0x5c(%rsp)
subw $0x4, %ax
jb 0xed2a1
jmp 0xed276
movl 0x5c(%rsp), %eax
subl $0x4, %eax
je 0xed2b9
jmp 0xed281
movl 0x5c(%rsp), %eax
subl $0x5, %eax
je 0xed2a1
jmp 0xed28c
movl 0x5c(%rsp), %eax
addl $-0x6, %eax
subl $0x2, %eax
jb 0xed37d
jmp 0xed3d5
movq 0x50(%rsp), %rax
movq 0x88(%rsp), %rcx
movq (%rcx), %rcx
movq %rcx, (%rax)
jmp 0xed3d7
movq 0x88(%rsp), %rax
cmpq $0x0, (%rax)
je 0xed357
movq 0x88(%rsp), %rax
movw 0x8(%rax), %ax
shrw $0x8, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0xed357
movq 0x88(%rsp), %rax
movw 0x8(%rax), %ax
shrw $0x8, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
setne %al
movq 0x88(%rsp), %rcx
movq (%rcx), %rsi
movzbl %al, %edi
andl $0x1, %edi
leaq 0x84(%rsp), %rdx
leaq 0x78(%rsp), %rcx
callq 0xed560
movq 0x78(%rsp), %rdi
movl 0x84(%rsp), %esi
callq 0xecf00
movq %rax, %rcx
movq 0x50(%rsp), %rax
movq %rcx, (%rax)
movw 0x8(%rax), %cx
andw $0xfeff, %cx            # imm = 0xFEFF
orw $0x100, %cx             # imm = 0x100
movw %cx, 0x8(%rax)
jmp 0xed37b
movq 0x50(%rsp), %rax
movq 0x88(%rsp), %rcx
movq (%rcx), %rcx
movq %rcx, (%rax)
movw 0x8(%rax), %cx
andw $0xfeff, %cx            # imm = 0xFEFF
orw $0x0, %cx
movw %cx, 0x8(%rax)
jmp 0xed3d7
movl $0x30, %edi
callq 0x126d0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x48(%rsp)
movq 0x88(%rsp), %rax
movq (%rax), %rsi
callq 0xfa0e0
jmp 0xed3a4
movq 0x50(%rsp), %rax
movq 0x48(%rsp), %rcx
movq %rcx, (%rax)
jmp 0xed3d7
movq 0x48(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
movl $0x30, %esi
callq 0x126e0
jmp 0xed54a
jmp 0xed3d7
movq 0x88(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0xed542
movl $0x20, %edi
callq 0x12040
movq %rax, 0x28(%rsp)
movq $0x3, (%rax)
addq $0x8, %rax
movq %rax, 0x30(%rsp)
movq %rax, %rcx
addq $0x18, %rcx
movq %rcx, 0x38(%rsp)
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0xec4f0
jmp 0xed42b
movq 0x38(%rsp), %rcx
movq 0x20(%rsp), %rax
addq $0x8, %rax
cmpq %rcx, %rax
movq %rax, 0x40(%rsp)
jne 0xed41a
movq 0x50(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rax)
movl $0x0, 0x68(%rsp)
cmpl $0x3, 0x68(%rsp)
jge 0xed540
movq 0x88(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x68(%rsp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
cmpq $0x0, (%rax)
je 0xed52e
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x68(%rsp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x60(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x60(%rsp), %rax
movq (%rax), %rdi
callq 0x122b0
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq %rax, %rdx
callq 0xec560
jmp 0xed52e
movq 0x30(%rsp), %rcx
movq %rax, %rsi
movq 0x20(%rsp), %rax
movq %rsi, 0x70(%rsp)
movl %edx, 0x6c(%rsp)
cmpq %rax, %rcx
movq %rax, 0x8(%rsp)
je 0xed51d
movq 0x8(%rsp), %rdi
addq $-0x8, %rdi
movq %rdi, (%rsp)
callq 0xec510
movq 0x30(%rsp), %rcx
movq (%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x8(%rsp)
jne 0xed4f8
movq 0x28(%rsp), %rdi
movl $0x20, %esi
callq 0x12d80
jmp 0xed54a
jmp 0xed530
movl 0x68(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x68(%rsp)
jmp 0xed459
jmp 0xed542
addq $0x98, %rsp
retq
movq 0x70(%rsp), %rdi
callq 0x12c20
nopw %cs:(%rax,%rax)