// File: ncbi[P]amr/common.cpp
// Function: Common_sp::Token::toNumberDate()
void Token::toNumberDate ()
{
  if (empty ())
    return;
	if (   type != eName
	    && type != eText
	   )
	  return;	 
	if (contains (name, ' '))
	  return;
	
	{  
  	static const regex date_time_re {R"(\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d\.\d\d\d)"};   // Example: 2018-08-13T16:12:54.487
  	smatch sm;
  	if (regex_match (name, sm, date_time_re))
  	{
  	  type = eDateTime;
  	  return;
  	}
  }	
	  
  try
  {
    if (isLeft (name, "0x"))
	  {
 		  n = (long long) std::stoull (name. substr (2), nullptr, 16); 
   		type = eInteger;
    }
    else if (   contains (name, '.') 
    	       || contains (name, 'e') 
    	       || contains (name, 'E') 
    	      )
	  {
		  d = str2<double> (name);
  		type = eDouble;
      decimals = 0;
      size_t pos = name. find ('.');
      if (pos != string::npos)
      {
        pos++;
        while (   pos < name. size () 
               && isDigit (name [pos])
              )
        {
          pos++;
          decimals++;
        }
      }
      scientific = contains (name, 'e');
	  }
	  else
	  {
	    n = str2<long long> (name);
  		type = eInteger;
		}
  }
  catch (...) {}
}

// Assembly:
subq $0x108, %rsp            # imm = 0x108
movq %rdi, 0x100(%rsp)
movq 0x100(%rsp), %rdi
movq %rdi, 0x70(%rsp)
movq (%rdi), %rax
callq *0x38(%rax)
testb $0x1, %al
jne 0x51c28
jmp 0x51c2d
jmp 0x51f02
movq 0x70(%rsp), %rax
cmpl $0x0, 0x8(%rax)
je 0x51c48
movq 0x70(%rsp), %rax
cmpl $0x2, 0x8(%rax)
je 0x51c48
jmp 0x51f02
movq 0x70(%rsp), %rdi
addq $0x10, %rdi
movl $0x20, %esi
callq 0x2dbd0
testb $0x1, %al
jne 0x51c61
jmp 0x51c66
jmp 0x51f02
cmpb $0x0, 0xb5093(%rip)     # 0x106d00
jne 0x51cc0
leaq 0xb508a(%rip), %rdi     # 0x106d00
callq 0xcd40
cmpl $0x0, %eax
je 0x51cc0
leaq 0xb5059(%rip), %rdi     # 0x106ce0
leaq 0x7cd31(%rip), %rsi     # 0xce9bf
movl $0x10, %edx
callq 0x74d10
jmp 0x51c9a
leaq 0x2311f(%rip), %rdi     # 0x74dc0
leaq 0xb5038(%rip), %rsi     # 0x106ce0
leaq 0xb4aa9(%rip), %rdx     # 0x106758
callq 0xc650
leaq 0xb5045(%rip), %rdi     # 0x106d00
callq 0xc4e0
leaq 0xd0(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0x74df0
movq 0x70(%rsp), %rdi
movq 0x60(%rsp), %rsi
addq $0x10, %rdi
leaq 0xb4ff9(%rip), %rdx     # 0x106ce0
xorl %ecx, %ecx
callq 0x74e30
movb %al, 0x6f(%rsp)
jmp 0x51cf4
movb 0x6f(%rsp), %al
testb $0x1, %al
jne 0x51cfe
jmp 0x51d62
movq 0x70(%rsp), %rax
movl $0x5, 0x8(%rax)
movl $0x1, 0xcc(%rsp)
jmp 0x51d6d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf8(%rsp)
movl %eax, 0xf4(%rsp)
leaq 0xb4fce(%rip), %rdi     # 0x106d00
callq 0xc4d0
jmp 0x520c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf8(%rsp)
movl %eax, 0xf4(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0x74e90
jmp 0x520c9
movl $0x0, 0xcc(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0x74e90
movl 0xcc(%rsp), %eax
testl %eax, %eax
je 0x51d8c
jmp 0x51d87
jmp 0x51f02
movq 0x70(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x50(%rsp)
leaq 0xa7(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0xcd00
movq 0x58(%rsp), %rdx
leaq 0x7cc31(%rip), %rsi     # 0xce9e9
leaq 0xa8(%rsp), %rdi
callq 0x29fd0
jmp 0x51dc7
movq 0x50(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x2f2f0
movb %al, 0x4f(%rsp)
jmp 0x51ddf
leaq 0xa8(%rsp), %rdi
callq 0xce98
leaq 0xa7(%rsp), %rdi
callq 0xc7a0
movb 0x4f(%rsp), %al
testb $0x1, %al
jne 0x51e06
jmp 0x51f0a
movq 0x70(%rsp), %rsi
addq $0x10, %rsi
leaq 0x80(%rsp), %rdi
movl $0x2, %edx
movq $-0x1, %rcx
callq 0xc740
jmp 0x51e2a
xorl %eax, %eax
movl %eax, %esi
leaq 0x80(%rsp), %rdi
movl $0x10, %edx
callq 0x74ea0
movq %rax, 0x40(%rsp)
jmp 0x51e47
movq 0x70(%rsp), %rax
movq 0x40(%rsp), %rcx
movq %rcx, 0x38(%rax)
leaq 0x80(%rsp), %rdi
callq 0xce98
movq 0x70(%rsp), %rax
movl $0x3, 0x8(%rax)
jmp 0x520c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf8(%rsp)
movl %eax, 0xf4(%rsp)
jmp 0x51eaa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf8(%rsp)
movl %eax, 0xf4(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0xce98
leaq 0xa7(%rsp), %rdi
callq 0xc7a0
jmp 0x51ef0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf8(%rsp)
movl %eax, 0xf4(%rsp)
jmp 0x51ef0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf8(%rsp)
movl %eax, 0xf4(%rsp)
leaq 0x80(%rsp), %rdi
callq 0xce98
movq 0xf8(%rsp), %rdi
callq 0xc2f0
callq 0xcbe0
addq $0x108, %rsp            # imm = 0x108
retq
movq 0x70(%rsp), %rdi
addq $0x10, %rdi
movl $0x2e, %esi
callq 0x2dbd0
movb %al, 0x3f(%rsp)
jmp 0x51f23
movb 0x3f(%rsp), %al
testb $0x1, %al
jne 0x51f76
jmp 0x51f2d
movq 0x70(%rsp), %rdi
addq $0x10, %rdi
movl $0x65, %esi
callq 0x2dbd0
movb %al, 0x3e(%rsp)
jmp 0x51f46
movb 0x3e(%rsp), %al
testb $0x1, %al
jne 0x51f76
jmp 0x51f50
movq 0x70(%rsp), %rdi
addq $0x10, %rdi
movl $0x45, %esi
callq 0x2dbd0
movb %al, 0x3d(%rsp)
jmp 0x51f69
movb 0x3d(%rsp), %al
testb $0x1, %al
jne 0x51f76
jmp 0x52098
movq 0x70(%rsp), %rdi
addq $0x10, %rdi
callq 0x30780
movsd %xmm0, 0x30(%rsp)
jmp 0x51f8c
movq 0x70(%rsp), %rdi
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x40(%rdi)
movl $0x4, 0x8(%rdi)
movq $0x0, 0x48(%rdi)
addq $0x10, %rdi
movl $0x2e, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0xc990
movq %rax, 0x78(%rsp)
cmpq $-0x1, 0x78(%rsp)
je 0x5206e
movq 0x78(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x78(%rsp)
movq 0x70(%rsp), %rdi
movq 0x78(%rsp), %rax
movq %rax, 0x20(%rsp)
addq $0x10, %rdi
callq 0xc530
movq 0x20(%rsp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, 0x2f(%rsp)
jae 0x5203e
movq 0x70(%rsp), %rdi
addq $0x10, %rdi
movq 0x78(%rsp), %rsi
callq 0xce50
movq %rax, 0x18(%rsp)
jmp 0x52021
movq 0x18(%rsp), %rax
movsbl (%rax), %edi
callq 0x73780
movb %al, 0x17(%rsp)
jmp 0x52034
movb 0x17(%rsp), %al
movb %al, 0x2f(%rsp)
jmp 0x5203e
movb 0x2f(%rsp), %al
testb $0x1, %al
jne 0x52048
jmp 0x5206c
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
addq $0x1, %rcx
movq %rcx, 0x78(%rsp)
movq 0x48(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x48(%rax)
jmp 0x51fdc
jmp 0x5206e
movq 0x70(%rsp), %rdi
addq $0x10, %rdi
movl $0x65, %esi
callq 0x2dbd0
movb %al, 0x16(%rsp)
jmp 0x52087
movq 0x70(%rsp), %rax
movb 0x16(%rsp), %cl
andb $0x1, %cl
movb %cl, 0x50(%rax)
jmp 0x520c2
movq 0x70(%rsp), %rdi
addq $0x10, %rdi
callq 0x74ef0
movq %rax, 0x8(%rsp)
jmp 0x520ad
movq 0x70(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, 0x38(%rax)
movl $0x3, 0x8(%rax)
jmp 0x520c4
jmp 0x51f02
movq 0xf8(%rsp), %rdi
callq 0xccf0
nopw %cs:(%rax,%rax)