// File: zeeev[P]DASVC/bamtools/src/third_party/jsoncpp/json_reader.cpp
// Function: Json::Reader::decodeUnicodeCodePoint(Json::Reader::Token&, char const*&, char const*, unsigned int&)
bool
Reader::decodeUnicodeCodePoint( Token &token, 
                                     Location &current, 
                                     Location end, 
                                     unsigned int &unicode )
{

   if ( !decodeUnicodeEscapeSequence( token, current, end, unicode ) )
      return false;
   if (unicode >= 0xD800 && unicode <= 0xDBFF)
   {
      // surrogate pairs
      if (end - current < 6)
         return addError( "additional six characters expected to parse unicode surrogate pair.", token, current );
      unsigned int surrogatePair;
      if (*(current++) == '\\' && *(current++)== 'u')
      {
         if (decodeUnicodeEscapeSequence( token, current, end, surrogatePair ))
         {
            unicode = 0x10000 + ((unicode & 0x3FF) << 10) + (surrogatePair & 0x3FF);
         } 
         else
            return false;
      } 
      else
         return addError( "expecting another \\u token to begin the second half of a unicode surrogate pair", token, current );
   }
   return true;
}

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0xa8(%rsp)
movq %rsi, 0xa0(%rsp)
movq %rdx, 0x98(%rsp)
movq %rcx, 0x90(%rsp)
movq %r8, 0x88(%rsp)
movq 0xa8(%rsp), %rdi
movq %rdi, 0x20(%rsp)
movq 0xa0(%rsp), %rsi
movq 0x98(%rsp), %rdx
movq 0x90(%rsp), %rcx
movq 0x88(%rsp), %r8
callq 0x119b50
testb $0x1, %al
jne 0x119552
movb $0x0, 0xb7(%rsp)
jmp 0x1197af
movq 0x88(%rsp), %rax
cmpl $0xd800, (%rax)         # imm = 0xD800
jb 0x1197a7
movq 0x88(%rsp), %rax
cmpl $0xdbff, (%rax)         # imm = 0xDBFF
ja 0x1197a7
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rcx
movq (%rcx), %rcx
subq %rcx, %rax
cmpq $0x6, %rax
jge 0x11964c
leaq 0x67(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x86da0
movq 0x18(%rsp), %rdx
leaq 0x1b221(%rip), %rsi     # 0x1347d6
leaq 0x68(%rsp), %rdi
callq 0x86a00
jmp 0x1195c1
movq 0x20(%rsp), %rdi
movq 0xa0(%rsp), %rdx
movq 0x98(%rsp), %rax
movq (%rax), %rcx
leaq 0x68(%rsp), %rsi
callq 0x116e50
movb %al, 0x17(%rsp)
jmp 0x1195e9
movb 0x17(%rsp), %al
andb $0x1, %al
movb %al, 0xb7(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x86f68
jmp 0x119602
leaq 0x67(%rsp), %rdi
callq 0x867b0
jmp 0x1197af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
jmp 0x11963d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x86f68
jmp 0x11963b
jmp 0x11963d
leaq 0x67(%rsp), %rdi
callq 0x867b0
jmp 0x1197c0
movq 0x98(%rsp), %rcx
movq (%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, (%rcx)
movsbl (%rax), %eax
cmpl $0x5c, %eax
jne 0x1196f9
movq 0x98(%rsp), %rcx
movq (%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, (%rcx)
movsbl (%rax), %eax
cmpl $0x75, %eax
jne 0x1196f9
movq 0x20(%rsp), %rdi
movq 0xa0(%rsp), %rsi
movq 0x98(%rsp), %rdx
movq 0x90(%rsp), %rcx
leaq 0x50(%rsp), %r8
callq 0x119b50
testb $0x1, %al
jne 0x1196b7
jmp 0x1196e7
movq 0x88(%rsp), %rax
movl (%rax), %ecx
andl $0x3ff, %ecx            # imm = 0x3FF
shll $0xa, %ecx
addl $0x10000, %ecx          # imm = 0x10000
movl 0x50(%rsp), %eax
andl $0x3ff, %eax            # imm = 0x3FF
addl %eax, %ecx
movq 0x88(%rsp), %rax
movl %ecx, (%rax)
jmp 0x1196f4
movb $0x0, 0xb7(%rsp)
jmp 0x1197af
jmp 0x1197a5
leaq 0x2f(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x86da0
movq 0x8(%rsp), %rdx
leaq 0x1b106(%rip), %rsi     # 0x13481a
leaq 0x30(%rsp), %rdi
callq 0x86a00
jmp 0x119720
movq 0x20(%rsp), %rdi
movq 0xa0(%rsp), %rdx
movq 0x98(%rsp), %rax
movq (%rax), %rcx
leaq 0x30(%rsp), %rsi
callq 0x116e50
movb %al, 0x7(%rsp)
jmp 0x119748
movb 0x7(%rsp), %al
andb $0x1, %al
movb %al, 0xb7(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x86f68
jmp 0x119761
leaq 0x2f(%rsp), %rdi
callq 0x867b0
jmp 0x1197af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
jmp 0x119799
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x86f68
jmp 0x119797
jmp 0x119799
leaq 0x2f(%rsp), %rdi
callq 0x867b0
jmp 0x1197c0
jmp 0x1197a7
movb $0x1, 0xb7(%rsp)
movb 0xb7(%rsp), %al
andb $0x1, %al
addq $0xb8, %rsp
retq
movq 0x58(%rsp), %rdi
callq 0x86d80
movq %rax, %rdi
callq 0x91290
nopw %cs:(%rax,%rax)