// File: tomfunkhouser[P]gaps/pkgs/RNBasics/json.cpp
// Function: Json::Value::operator<(Json::Value const&) const
bool Value::operator<(const Value& other) const {
  int typeDelta = type_ - other.type_;
  if (typeDelta)
    return typeDelta < 0 ? true : false;
  switch (type_) {
  case nullValue:
    return false;
  case intValue:
    return value_.int_ < other.value_.int_;
  case uintValue:
    return value_.uint_ < other.value_.uint_;
  case realValue:
    return value_.real_ < other.value_.real_;
  case booleanValue:
    return value_.bool_ < other.value_.bool_;
  case stringValue:
  {
    if ((value_.string_ == 0) || (other.value_.string_ == 0)) {
      if (other.value_.string_) return true;
      else return false;
    }
    unsigned this_len;
    unsigned other_len;
    char const* this_str;
    char const* other_str;
    decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);
    decodePrefixedString(other.allocated_, other.value_.string_, &other_len, &other_str);
    unsigned min_len = std::min(this_len, other_len);
    int comp = memcmp(this_str, other_str, min_len);
    if (comp < 0) return true;
    if (comp > 0) return false;
    return (this_len < other_len);
  }
  case arrayValue:
  case objectValue: {
    int delta = int(value_.map_->size() - other.value_.map_->size());
    if (delta)
      return delta < 0;
    return (*value_.map_) < (*other.value_.map_);
  }
  default:
    JSON_ASSERT_UNREACHABLE;
  }
  return false; // unreachable
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x18(%rsp)
movw 0x8(%rax), %ax
andw $0xff, %ax
movzwl %ax, %eax
movq 0x50(%rsp), %rcx
movw 0x8(%rcx), %cx
andw $0xff, %cx
movzwl %cx, %ecx
subl %ecx, %eax
movl %eax, 0x4c(%rsp)
cmpl $0x0, 0x4c(%rsp)
je 0xed8b3
movl 0x4c(%rsp), %eax
sarl $0x1f, %eax
andb $0x1, %al
movb %al, 0x67(%rsp)
jmp 0xedadd
movq 0x18(%rsp), %rax
movzbl 0x8(%rax), %eax
movzwl %ax, %ecx
movq %rcx, 0x10(%rsp)
subw $0x7, %ax
ja 0xedad6
movq 0x10(%rsp), %rax
leaq 0x7c69a(%rip), %rcx     # 0x169f74
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x0, 0x67(%rsp)
jmp 0xedadd
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq 0x50(%rsp), %rcx
cmpq (%rcx), %rax
setl %al
andb $0x1, %al
movb %al, 0x67(%rsp)
jmp 0xedadd
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq 0x50(%rsp), %rcx
cmpq (%rcx), %rax
setb %al
andb $0x1, %al
movb %al, 0x67(%rsp)
jmp 0xedadd
movq 0x18(%rsp), %rax
movsd (%rax), %xmm1
movq 0x50(%rsp), %rax
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
seta %al
andb $0x1, %al
movb %al, 0x67(%rsp)
jmp 0xedadd
movq 0x18(%rsp), %rax
movb (%rax), %al
andb $0x1, %al
movzbl %al, %eax
movq 0x50(%rsp), %rcx
movb (%rcx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
setl %al
andb $0x1, %al
movb %al, 0x67(%rsp)
jmp 0xedadd
movq 0x18(%rsp), %rax
cmpq $0x0, (%rax)
je 0xed98c
movq 0x50(%rsp), %rax
cmpq $0x0, (%rax)
jne 0xed9ab
movq 0x50(%rsp), %rax
cmpq $0x0, (%rax)
je 0xed9a1
movb $0x1, 0x67(%rsp)
jmp 0xedadd
movb $0x0, 0x67(%rsp)
jmp 0xedadd
movq 0x18(%rsp), %rcx
movw 0x8(%rcx), %ax
shrw $0x8, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
setne %al
movq (%rcx), %rsi
movzbl %al, %edi
andl $0x1, %edi
leaq 0x48(%rsp), %rdx
leaq 0x38(%rsp), %rcx
callq 0xed560
movq 0x50(%rsp), %rax
movw 0x8(%rax), %ax
shrw $0x8, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
setne %al
movq 0x50(%rsp), %rcx
movq (%rcx), %rsi
movzbl %al, %edi
andl $0x1, %edi
leaq 0x44(%rsp), %rdx
leaq 0x30(%rsp), %rcx
callq 0xed560
leaq 0x48(%rsp), %rdi
leaq 0x44(%rsp), %rsi
callq 0xfa080
movl (%rax), %eax
movl %eax, 0x2c(%rsp)
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
movl 0x2c(%rsp), %eax
movl %eax, %edx
callq 0x122d0
movl %eax, 0x28(%rsp)
cmpl $0x0, 0x28(%rsp)
jge 0xeda53
movb $0x1, 0x67(%rsp)
jmp 0xedadd
cmpl $0x0, 0x28(%rsp)
jle 0xeda61
movb $0x0, 0x67(%rsp)
jmp 0xedadd
movl 0x48(%rsp), %eax
cmpl 0x44(%rsp), %eax
setb %al
andb $0x1, %al
movb %al, 0x67(%rsp)
jmp 0xedadd
movq 0x18(%rsp), %rax
movq (%rax), %rdi
callq 0xfa1e0
movq %rax, 0x8(%rsp)
movq 0x50(%rsp), %rax
movq (%rax), %rdi
callq 0xfa1e0
movq %rax, %rcx
movq 0x8(%rsp), %rax
subq %rcx, %rax
movl %eax, 0x24(%rsp)
cmpl $0x0, 0x24(%rsp)
je 0xedab9
cmpl $0x0, 0x24(%rsp)
setl %al
andb $0x1, %al
movb %al, 0x67(%rsp)
jmp 0xedadd
movq 0x18(%rsp), %rax
movq (%rax), %rdi
movq 0x50(%rsp), %rax
movq (%rax), %rsi
callq 0xfa1f0
andb $0x1, %al
movb %al, 0x67(%rsp)
jmp 0xedadd
jmp 0xedad8
movb $0x0, 0x67(%rsp)
movb 0x67(%rsp), %al
andb $0x1, %al
addq $0x68, %rsp
retq
nopl (%rax,%rax)