// File: ncbi[P]amr/common.cpp
// Function: Common_sp::Json::parse(Common_sp::CharInput&, Common_sp::Token const&, Common_sp::JsonContainer*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Json::parse (CharInput& in,
                  const Token& firstToken,
                  JsonContainer* parent,
                  const string& name)
{
  switch (firstToken. type)
  {
    case Token::eName:
      {
        string tokenName (firstToken. name);
        strLower (tokenName);
        if (   tokenName == "null"
            || tokenName == "nan"
           )
          new JsonNull (parent, name);
        else if (tokenName == "true")
          new JsonBoolean (true, parent, name);
        else if (tokenName == "false")
          new JsonBoolean (false, parent, name);
        else
          new JsonString (firstToken. name, parent, name);
      }
      break;
    case Token::eText: new JsonString (firstToken. name, parent, name); break;
    case Token::eInteger: new JsonInt (firstToken. n, parent, name); break;
    case Token::eDouble: new JsonDouble (firstToken. d, firstToken. decimals, parent, name); break;
    case Token::eDelimiter:
      switch (firstToken. name [0])
      {
        case '{': new JsonMap   (in, parent, name); break;
        case '[': new JsonArray (in, parent, name); break;
        default: in. error ("Bad delimiter", false);
      }
      break;
    default: in. error ("Bad token", false);
  }
}

// Assembly:
subq $0x138, %rsp            # imm = 0x138
movq %rdi, 0x130(%rsp)
movq %rsi, 0x128(%rsp)
movq %rdx, 0x120(%rsp)
movq %rcx, 0x118(%rsp)
movq 0x128(%rsp), %rax
movl 0x8(%rax), %eax
movq %rax, 0x90(%rsp)
subq $0x4, %rax
ja 0x5c481
movq 0x90(%rsp), %rax
leaq 0x71765(%rip), %rcx     # 0xcd698
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x128(%rsp), %rsi
addq $0x10, %rsi
leaq 0xf8(%rsp), %rdi
movq %rdi, 0x88(%rsp)
callq 0xc320
movq 0x88(%rsp), %rdi
callq 0x41ac0
jmp 0x5bf6c
leaq 0x75d71(%rip), %rsi     # 0xd1ce4
leaq 0xf8(%rsp), %rdi
callq 0x2e1b0
movb %al, 0x87(%rsp)
jmp 0x5bf89
movb 0x87(%rsp), %al
testb $0x1, %al
jne 0x5bfc0
jmp 0x5bf96
leaq 0x72e81(%rip), %rsi     # 0xcee1e
leaq 0xf8(%rsp), %rdi
callq 0x2e1b0
movb %al, 0x86(%rsp)
jmp 0x5bfb3
movb 0x86(%rsp), %al
testb $0x1, %al
jne 0x5bfc0
jmp 0x5c033
movl $0x8, %edi
callq 0xc700
movq %rax, 0x78(%rsp)
jmp 0x5bfd1
movq 0x78(%rsp), %rdi
movq 0x120(%rsp), %rsi
movq 0x118(%rsp), %rdx
callq 0x759f0
jmp 0x5bfed
jmp 0x5c197
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
jmp 0x5c1a9
movq 0x78(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
movl $0x8, %esi
callq 0xc710
jmp 0x5c1a9
leaq 0x75299(%rip), %rsi     # 0xd12d3
leaq 0xf8(%rsp), %rdi
callq 0x2e1b0
movb %al, 0x77(%rsp)
jmp 0x5c04d
movb 0x77(%rsp), %al
testb $0x1, %al
jne 0x5c057
jmp 0x5c0b6
movl $0x10, %edi
callq 0xc700
movq %rax, 0x68(%rsp)
jmp 0x5c068
movq 0x68(%rsp), %rdi
movq 0x120(%rsp), %rdx
movq 0x118(%rsp), %rcx
movl $0x1, %esi
callq 0x75a40
jmp 0x5c089
jmp 0x5c195
movq 0x68(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
movl $0x10, %esi
callq 0xc710
jmp 0x5c1a9
leaq 0x72d65(%rip), %rsi     # 0xcee22
leaq 0xf8(%rsp), %rdi
callq 0x2e1b0
movb %al, 0x67(%rsp)
jmp 0x5c0d0
movb 0x67(%rsp), %al
testb $0x1, %al
jne 0x5c0da
jmp 0x5c133
movl $0x10, %edi
callq 0xc700
movq %rax, 0x58(%rsp)
jmp 0x5c0eb
movq 0x58(%rsp), %rdi
movq 0x120(%rsp), %rdx
movq 0x118(%rsp), %rcx
xorl %esi, %esi
callq 0x75a40
jmp 0x5c109
jmp 0x5c193
movq 0x58(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
movl $0x10, %esi
callq 0xc710
jmp 0x5c1a9
movl $0x28, %edi
callq 0xc700
movq %rax, 0x50(%rsp)
jmp 0x5c144
movq 0x50(%rsp), %rdi
movq 0x128(%rsp), %rsi
addq $0x10, %rsi
movq 0x120(%rsp), %rdx
movq 0x118(%rsp), %rcx
callq 0x75aa0
jmp 0x5c16c
jmp 0x5c193
movq 0x50(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
movl $0x28, %esi
callq 0xc710
jmp 0x5c1a9
jmp 0x5c195
jmp 0x5c197
leaq 0xf8(%rsp), %rdi
callq 0xce98
jmp 0x5c515
leaq 0xf8(%rsp), %rdi
callq 0xce98
jmp 0x5c51d
movl $0x28, %edi
callq 0xc700
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x48(%rsp)
movq 0x128(%rsp), %rsi
addq $0x10, %rsi
movq 0x120(%rsp), %rdx
movq 0x118(%rsp), %rcx
callq 0x75aa0
jmp 0x5c1f3
jmp 0x5c515
movq 0x48(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
movl $0x28, %esi
callq 0xc710
jmp 0x5c51d
movl $0x10, %edi
callq 0xc700
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x40(%rsp)
movq 0x128(%rsp), %rax
movq 0x38(%rax), %rsi
movq 0x120(%rsp), %rdx
movq 0x118(%rsp), %rcx
callq 0x75b20
jmp 0x5c258
jmp 0x5c515
movq 0x40(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
movl $0x10, %esi
callq 0xc710
jmp 0x5c51d
movl $0x20, %edi
callq 0xc700
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x38(%rsp)
movq 0x128(%rsp), %rax
movsd 0x40(%rax), %xmm0
movq 0x48(%rax), %rsi
movq 0x120(%rsp), %rdx
movq 0x118(%rsp), %rcx
callq 0x75b70
jmp 0x5c2c2
jmp 0x5c515
movq 0x38(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
movl $0x20, %esi
callq 0xc710
jmp 0x5c51d
movq 0x128(%rsp), %rdi
addq $0x10, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xc7d0
movsbl (%rax), %eax
movl %eax, 0x34(%rsp)
subl $0x5b, %eax
je 0x5c382
jmp 0x5c312
movl 0x34(%rsp), %eax
subl $0x7b, %eax
jne 0x5c3e3
jmp 0x5c321
movl $0x38, %edi
callq 0xc700
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x28(%rsp)
movq 0x130(%rsp), %rsi
movq 0x120(%rsp), %rdx
movq 0x118(%rsp), %rcx
callq 0x75c50
jmp 0x5c355
jmp 0x5c47c
movq 0x28(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
movl $0x38, %esi
callq 0xc710
jmp 0x5c51d
movl $0x28, %edi
callq 0xc700
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x20(%rsp)
movq 0x130(%rsp), %rsi
movq 0x120(%rsp), %rdx
movq 0x118(%rsp), %rcx
callq 0x5ced0
jmp 0x5c3b6
jmp 0x5c47c
movq 0x20(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
movl $0x28, %esi
callq 0xc710
jmp 0x5c51d
movq 0x130(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0xc7(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0xcd00
movq 0x18(%rsp), %rdx
leaq 0x72a1a(%rip), %rsi     # 0xcee28
leaq 0xc8(%rsp), %rdi
callq 0x29fd0
jmp 0x5c41d
movq 0x10(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
xorl %edx, %edx
callq 0x748c0
jmp 0x5c433
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
jmp 0x5c46a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0xce98
leaq 0xc7(%rsp), %rdi
callq 0xc7a0
jmp 0x5c51d
jmp 0x5c515
movq 0x130(%rsp), %rax
movq %rax, (%rsp)
leaq 0x9f(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0xcd00
movq 0x8(%rsp), %rdx
leaq 0x7298b(%rip), %rsi     # 0xcee36
leaq 0xa0(%rsp), %rdi
callq 0x29fd0
jmp 0x5c4ba
movq (%rsp), %rdi
leaq 0xa0(%rsp), %rsi
xorl %edx, %edx
callq 0x748c0
jmp 0x5c4cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
jmp 0x5c506
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0xce98
leaq 0x9f(%rsp), %rdi
callq 0xc7a0
jmp 0x5c51d
addq $0x138, %rsp            # imm = 0x138
retq
movq 0xf0(%rsp), %rdi
callq 0xccf0
nopw (%rax,%rax)