// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RNBasics/json.cpp
// Function: Json::OurReader::decodeDouble(Json::OurReader::Token&, Json::Value&)
bool OurReader::decodeDouble(Token& token, Value& decoded) {
  double value = 0;
  const int bufferSize = 32;
  int count;
  ptrdiff_t const length = token.end_ - token.start_;

  // Sanity check to avoid buffer overflow exploits.
  if (length < 0) {
    return addError("Unable to parse token length", token);
  }
  size_t const ulength = static_cast<size_t>(length);

  // Avoid using a string constant for the format control string given to
  // sscanf, as this can cause hard to debug crashes on OS X. See here for more
  // info:
  //
  //     http://developer.apple.com/library/mac/#DOCUMENTATION/DeveloperTools/gcc-4.0.1/gcc/Incompatibilities.html
  char format[] = "%lf";

  if (length <= bufferSize) {
    Char buffer[bufferSize + 1];
    memcpy(buffer, token.start_, ulength);
    buffer[length] = 0;
    count = sscanf(buffer, format, &value);
  } else {
    std::string buffer(token.start_, token.end_);
    count = sscanf(buffer.c_str(), format, &value);
  }

  if (count != 1)
    return addError("'" + std::string(token.start_, token.end_) +
                        "' is not a number.",
                    token);
  decoded = value;
  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq $0x0, 0x28(%rsp)
movq 0x8(%rsi), %rsi
movq 0x10(%rbx), %rdx
movq %rdx, %r12
subq %rsi, %r12
js 0x7ea3f
cmpq $0x20, %r12
jg 0x7ea85
movq %rsp, %r13
movq %r13, %rdi
movq %r12, %rdx
callq 0x114b0
movb $0x0, (%rsp,%r12)
leaq 0x41727(%rip), %rsi     # 0xc0150
leaq 0x28(%rsp), %rdx
movq %r13, %rdi
xorl %eax, %eax
callq 0x11590
movl %eax, %ebp
jmp 0x7eac8
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x4295e(%rip), %rsi     # 0xc13ad
leaq 0x42973(%rip), %rdx     # 0xc13c9
movq %rsp, %rdi
callq 0x1ab58
movq %rsp, %rsi
movq %r14, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x7cff8
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x7ec94
movq 0x10(%rsp), %rsi
jmp 0x7ec8c
leaq 0x10(%rsp), %r13
movq %r13, -0x10(%r13)
movq %rsp, %r12
movq %r12, %rdi
callq 0x1ab58
movq (%r12), %rdi
leaq 0x416ac(%rip), %rsi     # 0xc0150
leaq 0x28(%rsp), %rdx
xorl %eax, %eax
callq 0x11590
movl %eax, %ebp
movq (%r12), %rdi
cmpq %r13, %rdi
je 0x7eac8
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x115c0
cmpl $0x1, %ebp
jne 0x7eb6d
movl $0xfffffe00, %eax       # imm = 0xFFFFFE00
leaq 0x70(%rsp), %rdi
andl 0x8(%rdi), %eax
movsd 0x28(%rsp), %xmm0
leal 0x3(%rax), %ecx
movw %cx, 0x8(%rdi)
xorps %xmm1, %xmm1
movups %xmm1, 0x10(%rdi)
movq $0x0, 0x20(%rdi)
movsd %xmm0, (%rdi)
movzwl 0x8(%r15), %ecx
movzbl %cl, %edx
movl %ecx, %esi
andl $0xff00, %esi           # imm = 0xFF00
orl $0x3, %esi
movw %si, 0x8(%r15)
orl %eax, %edx
movw %dx, 0x8(%rdi)
movq (%r15), %rax
movq (%rdi), %r8
movq %r8, (%r15)
movq %rax, (%rdi)
andl $0xfe03, %esi           # imm = 0xFE03
movw %si, 0x8(%r15)
andl $0x100, %ecx            # imm = 0x100
orl %edx, %ecx
movw %cx, 0x8(%rdi)
movq 0x10(%r15), %rax
movq 0x10(%rdi), %rcx
movq %rcx, 0x10(%r15)
movq %rax, 0x10(%rdi)
movups 0x18(%r15), %xmm0
movups 0x18(%rdi), %xmm1
movups %xmm1, 0x18(%r15)
movups %xmm0, 0x18(%rdi)
callq 0x82500
movb $0x1, %al
jmp 0x7ec96
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
leaq 0x60(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x50(%rsp), %rdi
callq 0x1ab58
leaq 0x4281c(%rip), %rcx     # 0xc13ab
leaq 0x50(%rsp), %rdi
movl $0x1, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x116c0
leaq 0x40(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7ebcb
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x7ebd3
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0x30(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x425df(%rip), %rsi     # 0xc11d5
callq 0x11b60
leaq 0x10(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7ec21
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x7ec29
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rsp, %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r14, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x7cff8
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x7ec66
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x115c0
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x7ec7d
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x115c0
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0x7ec94
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x115c0
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x7ecc6
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x115c0
jmp 0x7ecc6
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x7ece2
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x115c0
jmp 0x7ece2
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0x7ed13
movq 0x60(%rsp), %rsi
jmp 0x7ed06
jmp 0x7ed10
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x7ed13
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x115c0
jmp 0x7ed13
movq %rax, %rbx
movq %rbx, %rdi
callq 0x11a70
nop