// File: /workspace/github_cpp_makefile_star2_O1/halsafar[P]libtmx-parser/./libs/tinyxml2/tinyxml2.cpp
// Function: tinyxml2::XMLDocument::Identify(char*, tinyxml2::XMLNode**)
char* XMLDocument::Identify( char* p, XMLNode** node )
{
    char* const start = p;
    p = XMLUtil::SkipWhiteSpace( p );
    if( !p || !*p ) {
        return p;
    }

    // What is this thing?
	// These strings define the matching patters:
    static const char* xmlHeader		= { "<?" };
    static const char* commentHeader	= { "<!--" };
    static const char* dtdHeader		= { "<!" };
    static const char* cdataHeader		= { "<![CDATA[" };
    static const char* elementHeader	= { "<" };	// and a header for everything else; check last.

    static const int xmlHeaderLen		= 2;
    static const int commentHeaderLen	= 4;
    static const int dtdHeaderLen		= 2;
    static const int cdataHeaderLen		= 9;
    static const int elementHeaderLen	= 1;

#if defined(_MSC_VER)
#pragma warning ( push )
#pragma warning ( disable : 4127 )
#endif
    TIXMLASSERT( sizeof( XMLComment ) == sizeof( XMLUnknown ) );		// use same memory pool
    TIXMLASSERT( sizeof( XMLComment ) == sizeof( XMLDeclaration ) );	// use same memory pool
#if defined(_MSC_VER)
#pragma warning (pop)
#endif
    XMLNode* returnNode = 0;
    if ( XMLUtil::StringEqual( p, xmlHeader, xmlHeaderLen ) ) {
        returnNode = new (_commentPool.Alloc()) XMLDeclaration( this );
        returnNode->_memPool = &_commentPool;
        p += xmlHeaderLen;
    }
    else if ( XMLUtil::StringEqual( p, commentHeader, commentHeaderLen ) ) {
        returnNode = new (_commentPool.Alloc()) XMLComment( this );
        returnNode->_memPool = &_commentPool;
        p += commentHeaderLen;
    }
    else if ( XMLUtil::StringEqual( p, cdataHeader, cdataHeaderLen ) ) {
        XMLText* text = new (_textPool.Alloc()) XMLText( this );
        returnNode = text;
        returnNode->_memPool = &_textPool;
        p += cdataHeaderLen;
        text->SetCData( true );
    }
    else if ( XMLUtil::StringEqual( p, dtdHeader, dtdHeaderLen ) ) {
        returnNode = new (_commentPool.Alloc()) XMLUnknown( this );
        returnNode->_memPool = &_commentPool;
        p += dtdHeaderLen;
    }
    else if ( XMLUtil::StringEqual( p, elementHeader, elementHeaderLen ) ) {
        returnNode = new (_elementPool.Alloc()) XMLElement( this );
        returnNode->_memPool = &_elementPool;
        p += elementHeaderLen;
    }
    else {
        returnNode = new (_textPool.Alloc()) XMLText( this );
        returnNode->_memPool = &_textPool;
        p = start;	// Back it up, all the text counts.
    }

    *node = returnNode;
    return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r15
movb (%rsi), %al
movq %rsi, %r14
testb %al, %al
js 0xcfdd
movq %r12, %r14
movzbl %al, %edi
callq 0x4060
testl %eax, %eax
je 0xcfdd
movb 0x1(%r14), %al
incq %r14
testb %al, %al
jns 0xcfc6
movb (%r14), %al
testb %al, %al
je 0xd084
leaq 0x5a74(%rip), %rdx      # 0x12a63
cmpq %rdx, %r14
je 0xd038
cmpb $0x3c, %al
jne 0xd02f
xorl %edi, %edi
leaq 0x5a62(%rip), %rdx      # 0x12a63
movq %rdi, %rsi
movb 0x1(%r14,%rdi), %dil
testb %dil, %dil
sete %cl
je 0xd020
cmpb 0x1(%rsi,%rdx), %dil
jne 0xd020
leaq 0x1(%rsi), %rdi
testl %esi, %esi
je 0xd001
cmpl $0x1, %esi
sete %dil
addq %rsi, %rdx
incq %rdx
jmp 0xd033
xorl %edi, %edi
xorl %ecx, %ecx
testb %dil, %dil
je 0xd090
leaq 0x200(%r15), %r12
movq %r12, %rdi
callq 0x108da
movq %r15, 0x8(%rax)
movq $0x0, 0x10(%rax)
movl $0x0, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
leaq 0xc710(%rip), %rcx      # 0x19780
movq %rcx, (%rax)
movq %r12, 0x50(%rax)
addq $0x2, %r14
movq %r14, %r12
movq %rax, (%rbx)
movq %r12, %r14
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
testb %cl, %cl
je 0xd099
cmpb $0x0, (%rdx)
je 0xd038
leaq 0x59c6(%rip), %rdx      # 0x12a66
cmpq %rdx, %r14
je 0xd0ea
cmpb $0x3c, %al
jne 0xd0e1
xorl %edi, %edi
leaq 0x59b4(%rip), %rdx      # 0x12a66
movq %rdi, %rsi
movb 0x1(%r14,%rdi), %dil
testb %dil, %dil
sete %cl
je 0xd0d2
cmpb 0x1(%rsi,%rdx), %dil
jne 0xd0d2
leaq 0x1(%rsi), %rdi
cmpl $0x2, %esi
jbe 0xd0b2
cmpl $0x3, %esi
sete %dil
addq %rsi, %rdx
incq %rdx
jmp 0xd0e5
xorl %edi, %edi
xorl %ecx, %ecx
testb %dil, %dil
je 0xd132
leaq 0x200(%r15), %r12
movq %r12, %rdi
callq 0x108da
movq %r15, 0x8(%rax)
movq $0x0, 0x10(%rax)
movl $0x0, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
leaq 0xc5be(%rip), %rcx      # 0x196e0
movq %rcx, (%rax)
movq %r12, 0x50(%rax)
addq $0x4, %r14
jmp 0xd07b
testb %cl, %cl
je 0xd13b
cmpb $0x0, (%rdx)
je 0xd0ea
leaq 0x592c(%rip), %rdx      # 0x12a6e
cmpq %rdx, %r14
je 0xd18c
cmpb $0x3c, %al
jne 0xd183
xorl %edi, %edi
leaq 0x591a(%rip), %rdx      # 0x12a6e
movq %rdi, %rsi
movb 0x1(%r14,%rdi), %dil
testb %dil, %dil
sete %cl
je 0xd174
cmpb 0x1(%rsi,%rdx), %dil
jne 0xd174
leaq 0x1(%rsi), %rdi
cmpl $0x7, %esi
jbe 0xd154
cmpl $0x8, %esi
sete %dil
addq %rsi, %rdx
incq %rdx
jmp 0xd187
xorl %edi, %edi
xorl %ecx, %ecx
testb %dil, %dil
je 0xd1d8
leaq 0x180(%r15), %r12
movq %r12, %rdi
callq 0x10976
movq %r15, 0x8(%rax)
movq $0x0, 0x10(%rax)
movl $0x0, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
leaq 0xc8b4(%rip), %rcx      # 0x19a78
movq %rcx, (%rax)
movq %r12, 0x50(%rax)
addq $0x9, %r14
movb $0x1, 0x58(%rax)
jmp 0xd07b
testb %cl, %cl
je 0xd1e1
cmpb $0x0, (%rdx)
je 0xd18c
leaq 0x5883(%rip), %rdx      # 0x12a6b
cmpq %rdx, %r14
je 0xd231
cmpb $0x3c, %al
jne 0xd228
xorl %edi, %edi
leaq 0x5871(%rip), %rdx      # 0x12a6b
movq %rdi, %rsi
movb 0x1(%r14,%rdi), %dil
testb %dil, %dil
sete %cl
je 0xd219
cmpb 0x1(%rsi,%rdx), %dil
jne 0xd219
leaq 0x1(%rsi), %rdi
testl %esi, %esi
je 0xd1fa
cmpl $0x1, %esi
sete %dil
addq %rsi, %rdx
incq %rdx
jmp 0xd22c
xorl %edi, %edi
xorl %ecx, %ecx
testb %dil, %dil
je 0xd26e
leaq 0x200(%r15), %r12
movq %r12, %rdi
callq 0x108da
movq %r15, 0x8(%rax)
movq $0x0, 0x10(%rax)
movl $0x0, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
leaq 0xc5b7(%rip), %rcx      # 0x19820
jmp 0xd070
testb %cl, %cl
je 0xd277
cmpb $0x0, (%rdx)
je 0xd231
leaq 0x57fa(%rip), %rcx      # 0x12a78
cmpq %rcx, %r14
je 0xd29e
cmpb $0x3c, %al
jne 0xd298
cmpb $0x0, 0x1(%r14)
sete %dl
leaq 0x57e3(%rip), %rcx      # 0x12a79
jmp 0xd29a
xorl %edx, %edx
cmpb $0x3c, %al
jne 0xd2e6
leaq 0x80(%r15), %r12
movq %r12, %rdi
callq 0x10a12
movq %r15, 0x8(%rax)
xorl %ecx, %ecx
movq %rcx, 0x10(%rax)
movl %ecx, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
leaq 0xc5f0(%rip), %rdx      # 0x198c0
movq %rdx, (%rax)
movl %ecx, 0x58(%rax)
movq %rcx, 0x60(%rax)
movq %r12, 0x50(%rax)
incq %r14
jmp 0xd07b
testb %dl, %dl
je 0xd2ef
cmpb $0x0, (%rcx)
je 0xd29e
leaq 0x180(%r15), %r14
movq %r14, %rdi
callq 0x10976
movq %r15, 0x8(%rax)
movq $0x0, 0x10(%rax)
movl $0x0, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
leaq 0xc751(%rip), %rcx      # 0x19a78
movq %rcx, (%rax)
movb $0x0, 0x58(%rax)
movq %r14, 0x50(%rax)
jmp 0xd07e
nop