// File: zeeev[P]DASVC/bamtools/src/third_party/jsoncpp/json_reader.cpp
// Function: Json::Reader::decodeNumber(Json::Reader::Token&)
bool 
Reader::decodeNumber( Token &token )
{
   bool isDouble = false;
   for ( Location inspect = token.start_; inspect != token.end_; ++inspect )
   {
      isDouble = isDouble  
                 ||  in( *inspect, '.', 'e', 'E', '+' )  
                 ||  ( *inspect == '-'  &&  inspect != token.start_ );
   }
   if ( isDouble )
      return decodeDouble( token );
   // Attempts to parse the number as an integer. If the number is
   // larger than the maximum supported value of an integer then
   // we decode the number as a double.
   Location current = token.start_;
   bool isNegative = *current == '-';
   if ( isNegative )
      ++current;
   Value::UInt maxIntegerValue = isNegative ? Value::UInt(-Value::minInt) 
                                            : Value::maxUInt;
   Value::UInt threshold = maxIntegerValue / 10;
   Value::UInt lastDigitThreshold = maxIntegerValue % 10;
   assert( lastDigitThreshold >=0  &&  lastDigitThreshold <= 9 );
   Value::UInt value = 0;
   while ( current < token.end_ )
   {
      Char c = *current++;
      if ( c < '0'  ||  c > '9' )
         return addError( "'" + std::string( token.start_, token.end_ ) + "' is not a number.", token );
      Value::UInt digit(c - '0');
      if ( value >= threshold )
      {
         // If the current digit is not the last one, or if it is
         // greater than the last digit of the maximum integer value,
         // the parse the number as a double.
         if ( current != token.end_  ||  digit > lastDigitThreshold )
         {
            return decodeDouble( token );
         }
      }
      value = value * 10 + digit;
   }
   if ( isNegative )
      currentValue() = -Value::Int( value );
   else if ( value <= Value::UInt(Value::maxInt) )
      currentValue() = Value::Int( value );
   else
      currentValue() = value;
   return true;
}

// Assembly:
subq $0x178, %rsp            # imm = 0x178
movq %rdi, 0x168(%rsp)
movq %rsi, 0x160(%rsp)
movq 0x168(%rsp), %rax
movq %rax, 0x48(%rsp)
movb $0x0, 0x15f(%rsp)
movq 0x160(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x150(%rsp)
movq 0x150(%rsp), %rax
movq 0x160(%rsp), %rcx
cmpq 0x10(%rcx), %rax
je 0x11796b
movb $0x1, %al
testb $0x1, 0x15f(%rsp)
movb %al, 0x47(%rsp)
jne 0x117945
movq 0x150(%rsp), %rax
movl $0x2e, %esi
movl $0x65, %edx
movl $0x45, %ecx
movl $0x2b, %r8d
movsbl (%rax), %edi
callq 0x1190a0
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, 0x47(%rsp)
jne 0x117945
movq 0x150(%rsp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x2d, %ecx
movb %al, 0x46(%rsp)
jne 0x11793d
movq 0x150(%rsp), %rax
movq 0x160(%rsp), %rcx
cmpq 0x8(%rcx), %rax
setne %al
movb %al, 0x46(%rsp)
movb 0x46(%rsp), %al
movb %al, 0x47(%rsp)
movb 0x47(%rsp), %al
andb $0x1, %al
movb %al, 0x15f(%rsp)
movq 0x150(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x150(%rsp)
jmp 0x1178b0
testb $0x1, 0x15f(%rsp)
je 0x117995
movq 0x48(%rsp), %rdi
movq 0x160(%rsp), %rsi
callq 0x119110
andb $0x1, %al
movb %al, 0x177(%rsp)
jmp 0x117e36
movq 0x160(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x148(%rsp)
movq 0x148(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
sete %al
andb $0x1, %al
movb %al, 0x147(%rsp)
testb $0x1, 0x147(%rsp)
je 0x1179e1
movq 0x148(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x148(%rsp)
testb $0x1, 0x147(%rsp)
je 0x1179fe
xorl %eax, %eax
leaq 0x1d06c(%rip), %rcx     # 0x134a60
subq (%rcx), %rax
movq %rax, 0x38(%rsp)
jmp 0x117a0d
leaq 0x1d06b(%rip), %rax     # 0x134a70
movq (%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x138(%rsp)
movq 0x138(%rsp), %rax
movl $0xa, %ecx
xorl %edx, %edx
divq %rcx
movq %rax, 0x130(%rsp)
movq 0x138(%rsp), %rax
movl $0xa, %ecx
xorl %edx, %edx
divq %rcx
movq %rdx, 0x128(%rsp)
movq $0x0, 0x120(%rsp)
movq 0x148(%rsp), %rax
movq 0x160(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x117cd2
movq 0x148(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x148(%rsp)
movb (%rax), %al
movb %al, 0x11f(%rsp)
movsbl 0x11f(%rsp), %eax
cmpl $0x30, %eax
jl 0x117ab2
movsbl 0x11f(%rsp), %eax
cmpl $0x39, %eax
jle 0x117c43
movq 0x160(%rsp), %rax
movq 0x8(%rax), %rcx
movq %rcx, 0x20(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x28(%rsp)
leaq 0xb7(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x86da0
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rcx
leaq 0xb8(%rsp), %rdi
callq 0x11a670
jmp 0x117afc
leaq 0x1906d(%rip), %rsi     # 0x130b70
leaq 0xd8(%rsp), %rdi
leaq 0xb8(%rsp), %rdx
callq 0xbafb0
jmp 0x117b1a
leaq 0x1cc60(%rip), %rdx     # 0x134781
leaq 0xf8(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x927c0
jmp 0x117b38
movq 0x48(%rsp), %rdi
movq 0x160(%rsp), %rdx
xorl %eax, %eax
movl %eax, %ecx
leaq 0xf8(%rsp), %rsi
callq 0x116e50
movb %al, 0x1f(%rsp)
jmp 0x117b5c
movb 0x1f(%rsp), %al
andb $0x1, %al
movb %al, 0x177(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x86f68
jmp 0x117b78
leaq 0xd8(%rsp), %rdi
callq 0x86f68
jmp 0x117b87
leaq 0xb8(%rsp), %rdi
callq 0x86f68
jmp 0x117b96
leaq 0xb7(%rsp), %rdi
callq 0x867b0
jmp 0x117e36
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa8(%rsp)
movl %eax, 0xa4(%rsp)
jmp 0x117c31
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa8(%rsp)
movl %eax, 0xa4(%rsp)
jmp 0x117c20
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa8(%rsp)
movl %eax, 0xa4(%rsp)
jmp 0x117c0f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa8(%rsp)
movl %eax, 0xa4(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x86f68
jmp 0x117c0d
jmp 0x117c0f
leaq 0xd8(%rsp), %rdi
callq 0x86f68
jmp 0x117c1e
jmp 0x117c20
leaq 0xb8(%rsp), %rdi
callq 0x86f68
jmp 0x117c2f
jmp 0x117c31
leaq 0xb7(%rsp), %rdi
callq 0x867b0
jmp 0x117e47
movsbl 0x11f(%rsp), %eax
subl $0x30, %eax
cltq
movq %rax, 0x98(%rsp)
movq 0x120(%rsp), %rax
cmpq 0x130(%rsp), %rax
jb 0x117cb4
movq 0x148(%rsp), %rax
movq 0x160(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x117c92
movq 0x98(%rsp), %rax
cmpq 0x128(%rsp), %rax
jbe 0x117cb2
movq 0x48(%rsp), %rdi
movq 0x160(%rsp), %rsi
callq 0x119110
andb $0x1, %al
movb %al, 0x177(%rsp)
jmp 0x117e36
jmp 0x117cb4
imulq $0xa, 0x120(%rsp), %rax
addq 0x98(%rsp), %rax
movq %rax, 0x120(%rsp)
jmp 0x117a5a
testb $0x1, 0x147(%rsp)
je 0x117d53
movq 0x120(%rsp), %rsi
negq %rsi
leaq 0x80(%rsp), %rdi
callq 0x121420
movq 0x48(%rsp), %rdi
callq 0x116f10
movq %rax, 0x10(%rsp)
jmp 0x117d05
movq 0x10(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x121b00
jmp 0x117d19
leaq 0x80(%rsp), %rdi
callq 0x121950
jmp 0x117e2e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa8(%rsp)
movl %eax, 0xa4(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x121950
jmp 0x117d4e
jmp 0x117e47
movq 0x120(%rsp), %rax
leaq 0x1cd06(%rip), %rcx     # 0x134a68
cmpq (%rcx), %rax
ja 0x117dcc
movq 0x120(%rsp), %rsi
leaq 0x68(%rsp), %rdi
callq 0x121420
movq 0x48(%rsp), %rdi
callq 0x116f10
movq %rax, 0x8(%rsp)
jmp 0x117d8a
movq 0x8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x121b00
jmp 0x117d9b
leaq 0x68(%rsp), %rdi
callq 0x121950
jmp 0x117e2c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa8(%rsp)
movl %eax, 0xa4(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x121950
jmp 0x117dca
jmp 0x117e47
movq 0x120(%rsp), %rsi
leaq 0x50(%rsp), %rdi
callq 0x121460
movq 0x48(%rsp), %rdi
callq 0x116f10
movq %rax, (%rsp)
jmp 0x117dee
movq (%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x121b00
jmp 0x117dfe
leaq 0x50(%rsp), %rdi
callq 0x121950
jmp 0x117e2c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa8(%rsp)
movl %eax, 0xa4(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x121950
jmp 0x117e2a
jmp 0x117e47
jmp 0x117e2e
movb $0x1, 0x177(%rsp)
movb 0x177(%rsp), %al
andb $0x1, %al
addq $0x178, %rsp            # imm = 0x178
retq
movq 0xa8(%rsp), %rdi
callq 0x86d80
movq %rax, %rdi
callq 0x91290
nopl (%rax)