// File: tomfunkhouser[P]gaps/pkgs/RNBasics/json.cpp
// Function: Json::Value::asUInt() const
Value::UInt Value::asUInt() const {
  switch (type_) {
  case intValue:
    JSON_ASSERT_MESSAGE(isUInt(), "LargestInt out of UInt range");
    return UInt(value_.int_);
  case uintValue:
    JSON_ASSERT_MESSAGE(isUInt(), "LargestUInt out of UInt range");
    return UInt(value_.uint_);
  case realValue:
    JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt),
                        "double out of UInt range");
    return UInt(value_.real_);
  case nullValue:
    return 0;
  case booleanValue:
    return value_.bool_ ? 1 : 0;
  default:
    break;
  }
  JSON_FAIL_MESSAGE("Value is not convertible to UInt.");
}

// Assembly:
subq $0x6b8, %rsp            # imm = 0x6B8
movq %rdi, 0x6a8(%rsp)
movq 0x6a8(%rsp), %rax
movq %rax, 0x28(%rsp)
movzbl 0x8(%rax), %eax
movzwl %ax, %ecx
movq %rcx, 0x30(%rsp)
subw $0x5, %ax
ja 0xee5e8
movq 0x30(%rsp), %rax
leaq 0x7bc76(%rip), %rcx     # 0x169fb4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x28(%rsp), %rdi
callq 0xee6a0
testb $0x1, %al
jne 0xee3ff
leaq 0x530(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x12980
movq 0x20(%rsp), %rdi
leaq 0x7c41a(%rip), %rsi     # 0x16a791
callq 0x126b0
jmp 0xee37e
leaq 0x500(%rsp), %rdi
leaq 0x530(%rsp), %rsi
callq 0x12700
jmp 0xee395
leaq 0x500(%rsp), %rdi
callq 0xec480
jmp 0xee3a4
leaq 0x500(%rsp), %rdi
callq 0x12430
callq 0x12380
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x528(%rsp)
movl %eax, 0x524(%rsp)
jmp 0xee3ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x528(%rsp)
movl %eax, 0x524(%rsp)
leaq 0x500(%rsp), %rdi
callq 0x12430
leaq 0x530(%rsp), %rdi
callq 0x121a0
jmp 0xee687
movq 0x28(%rsp), %rax
movq (%rax), %rax
movl %eax, 0x6b4(%rsp)
jmp 0xee678
movq 0x28(%rsp), %rdi
callq 0xee6a0
testb $0x1, %al
jne 0xee4cb
leaq 0x388(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x12980
movq 0x18(%rsp), %rdi
leaq 0x7c36b(%rip), %rsi     # 0x16a7ae
callq 0x126b0
jmp 0xee44a
leaq 0x368(%rsp), %rdi
leaq 0x388(%rsp), %rsi
callq 0x12700
jmp 0xee461
leaq 0x368(%rsp), %rdi
callq 0xec480
jmp 0xee470
leaq 0x368(%rsp), %rdi
callq 0x12430
callq 0x12380
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x528(%rsp)
movl %eax, 0x524(%rsp)
jmp 0xee4b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x528(%rsp)
movl %eax, 0x524(%rsp)
leaq 0x368(%rsp), %rdi
callq 0x12430
leaq 0x388(%rsp), %rdi
callq 0x121a0
jmp 0xee687
movq 0x28(%rsp), %rax
movq (%rax), %rax
movl %eax, 0x6b4(%rsp)
jmp 0xee678
movq 0x28(%rsp), %rax
movsd (%rax), %xmm0
xorl %edi, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xee790
testb $0x1, %al
jne 0xee5a2
leaq 0x1f0(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x12980
movq 0x10(%rsp), %rdi
leaq 0x7c2b2(%rip), %rsi     # 0x16a7cc
callq 0x126b0
jmp 0xee521
leaq 0x1d0(%rsp), %rdi
leaq 0x1f0(%rsp), %rsi
callq 0x12700
jmp 0xee538
leaq 0x1d0(%rsp), %rdi
callq 0xec480
jmp 0xee547
leaq 0x1d0(%rsp), %rdi
callq 0x12430
callq 0x12380
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x528(%rsp)
movl %eax, 0x524(%rsp)
jmp 0xee590
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x528(%rsp)
movl %eax, 0x524(%rsp)
leaq 0x1d0(%rsp), %rdi
callq 0x12430
leaq 0x1f0(%rsp), %rdi
callq 0x121a0
jmp 0xee687
movq 0x28(%rsp), %rax
cvttsd2si (%rax), %rax
movl %eax, 0x6b4(%rsp)
jmp 0xee678
movl $0x0, 0x6b4(%rsp)
jmp 0xee678
movq 0x28(%rsp), %rax
movb (%rax), %dl
xorl %eax, %eax
movl $0x1, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, 0x6b4(%rsp)
jmp 0xee678
jmp 0xee5ea
leaq 0x58(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x12980
movq 0x8(%rsp), %rdi
leaq 0x7c1e0(%rip), %rsi     # 0x16a7e5
callq 0x126b0
jmp 0xee60c
leaq 0x38(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x12700
jmp 0xee61d
leaq 0x38(%rsp), %rdi
callq 0xec480
jmp 0xee629
leaq 0x38(%rsp), %rdi
callq 0x12430
callq 0x12380
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x528(%rsp)
movl %eax, 0x524(%rsp)
jmp 0xee66c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x528(%rsp)
movl %eax, 0x524(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x12430
leaq 0x58(%rsp), %rdi
callq 0x121a0
jmp 0xee687
movl 0x6b4(%rsp), %eax
addq $0x6b8, %rsp            # imm = 0x6B8
retq
movq 0x528(%rsp), %rdi
callq 0x12c20
nopw %cs:(%rax,%rax)