// File: /workspace/github_cpp_makefile_star2_O3/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 0x7d12f
cmpq $0x20, %r12
ja 0x7d175
movq %rsp, %r13
movq %r13, %rdi
movq %r12, %rdx
callq 0x114b0
movb $0x0, (%rsp,%r12)
leaq 0x41037(%rip), %rsi     # 0xbe150
leaq 0x28(%rsp), %rdx
movq %r13, %rdi
xorl %eax, %eax
callq 0x11590
movl %eax, %ebp
jmp 0x7d1b8
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x4227e(%rip), %rsi     # 0xbf3bd
leaq 0x42293(%rip), %rdx     # 0xbf3d9
movq %rsp, %rdi
callq 0x1a88c
movq %rsp, %rsi
movq %r14, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x7b978
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x7d345
movq 0x10(%rsp), %rsi
jmp 0x7d33d
leaq 0x10(%rsp), %r13
movq %r13, -0x10(%r13)
movq %rsp, %r12
movq %r12, %rdi
callq 0x1a88c
movq (%r12), %rdi
leaq 0x40fbc(%rip), %rsi     # 0xbe150
leaq 0x28(%rsp), %rdx
xorl %eax, %eax
callq 0x11590
movl %eax, %ebp
movq (%r12), %rdi
cmpq %r13, %rdi
je 0x7d1b8
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x115c0
cmpl $0x1, %ebp
jne 0x7d21e
movsd 0x28(%rsp), %xmm0
movzwl 0x8(%r15), %eax
movq (%r15), %rcx
movsd %xmm0, (%r15)
leaq 0x70(%rsp), %rdi
movq %rcx, (%rdi)
movl %eax, %ecx
andl $0xfe00, %ecx           # imm = 0xFE00
orl $0x3, %ecx
movw %cx, 0x8(%r15)
andl $0x1ff, %eax            # imm = 0x1FF
movw %ax, 0x8(%rdi)
movq 0x10(%r15), %rax
movq $0x0, 0x10(%r15)
movq %rax, 0x10(%rdi)
movups 0x18(%r15), %xmm0
xorps %xmm1, %xmm1
movups %xmm1, 0x18(%r15)
movups %xmm0, 0x18(%rdi)
callq 0x80736
movb $0x1, %al
jmp 0x7d347
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
leaq 0x60(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x50(%rsp), %rdi
callq 0x1a88c
leaq 0x4217b(%rip), %rcx     # 0xbf3bb
leaq 0x50(%rsp), %rdi
movl $0x1, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x116b0
leaq 0x40(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7d27c
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x7d284
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 0x41f3e(%rip), %rsi     # 0xbf1e5
callq 0x11b50
leaq 0x10(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7d2d2
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x7d2da
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 0x7b978
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x7d317
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x115c0
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x7d32e
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x115c0
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0x7d345
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 0x7d377
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x115c0
jmp 0x7d377
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x7d393
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x115c0
jmp 0x7d393
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0x7d3c4
movq 0x60(%rsp), %rsi
jmp 0x7d3b7
jmp 0x7d3c1
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x7d3c4
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x115c0
jmp 0x7d3c4
movq %rax, %rbx
movq %rbx, %rdi
callq 0x11a60