// File: /workspace/github_cpp_makefile_star2_O2/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 $0xa8, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
andq $0x0, 0x8(%rsp)
movq 0x8(%rsi), %rsi
movq 0x10(%rbx), %rdx
movq %rdx, %r12
subq %rsi, %r12
js 0x72656
cmpq $0x20, %r12
ja 0x72688
leaq 0x10(%rsp), %r13
movq %r13, %rdi
movq %r12, %rdx
callq 0x114b0
movb $0x0, 0x10(%rsp,%r12)
leaq 0x38a1d(%rip), %rsi     # 0xab060
leaq 0x8(%rsp), %rdx
movq %r13, %rdi
xorl %eax, %eax
callq 0x11590
movl %eax, %ebp
jmp 0x726bf
leaq 0x39c70(%rip), %rsi     # 0xac2cd
leaq 0x10(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0x196d0
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x7146e
leaq 0x10(%rsp), %rdi
jmp 0x72771
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x199fe
movq (%r12), %rdi
leaq 0x389b7(%rip), %rsi     # 0xab060
leaq 0x8(%rsp), %rdx
xorl %eax, %eax
callq 0x11590
movl %eax, %ebp
movq %r12, %rdi
callq 0x11270
cmpl $0x1, %ebp
jne 0x726ff
movsd 0x8(%rsp), %xmm0
leaq 0x80(%rsp), %rbx
movw $0x3, 0x8(%rbx)
xorps %xmm1, %xmm1
movups %xmm1, 0x10(%rbx)
andq $0x0, 0x20(%rbx)
movsd %xmm0, (%rbx)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x74c68
movq %rbx, %rdi
callq 0x74cb0
movb $0x1, %al
jmp 0x72778
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x40(%rsp), %rdi
callq 0x199fe
leaq 0x39baa(%rip), %rsi     # 0xac2cb
leaq 0x60(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x79e4e
leaq 0x399be(%rip), %rdx     # 0xac0f5
leaq 0x10(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x1970b
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x7146e
leaq 0x10(%rsp), %rdi
callq 0x11270
leaq 0x60(%rsp), %rdi
callq 0x11270
leaq 0x40(%rsp), %rdi
callq 0x11270
xorl %eax, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x11270
jmp 0x7279c
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x11270
jmp 0x727ab
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
jmp 0x727bc
jmp 0x727c3
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x11270
jmp 0x727c6
movq %rax, %rbx
movq %rbx, %rdi
callq 0x11a80