// File: /workspace/github_cpp_makefile_star2_O2/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
movq %rsi, %rdi
callq 0xe6ba
testq %rax, %rax
je 0xb641
movq %rax, %r14
cmpb $0x0, (%rax)
je 0xb6fe
leaq 0x5383(%rip), %rsi      # 0x10973
pushq $0x2
popq %rdx
movq %r14, %rdi
callq 0xe378
testb %al, %al
je 0xb649
leaq 0x200(%r15), %r12
movq %r12, %rdi
callq 0xe3b2
movq %r15, 0x8(%rax)
andq $0x0, 0x10(%rax)
andl $0x0, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
leaq 0xd15f(%rip), %rcx      # 0x18790
movq %rcx, (%rax)
movq %r12, 0x50(%rax)
addq $0x2, %r14
jmp 0xb6f5
xorl %r14d, %r14d
jmp 0xb6fe
leaq 0x5326(%rip), %rsi      # 0x10976
pushq $0x4
popq %rdx
movq %r14, %rdi
callq 0xe378
testb %al, %al
je 0xb69e
leaq 0x200(%r15), %r12
movq %r12, %rdi
callq 0xe3b2
movq %r15, 0x8(%rax)
andq $0x0, 0x10(%rax)
andl $0x0, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
leaq 0xd05f(%rip), %rcx      # 0x186f0
movq %rcx, (%rax)
movq %r12, 0x50(%rax)
addq $0x4, %r14
jmp 0xb6f5
leaq 0x52d9(%rip), %rsi      # 0x1097e
pushq $0x9
popq %rdx
movq %r14, %rdi
callq 0xe378
testb %al, %al
je 0xb70a
leaq 0x180(%r15), %r12
movq %r12, %rdi
callq 0xe43a
movq %r15, 0x8(%rax)
andq $0x0, 0x10(%rax)
andl $0x0, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
leaq 0xd3a2(%rip), %rcx      # 0x18a88
movq %rcx, (%rax)
movq %r12, 0x50(%rax)
addq $0x9, %r14
movb $0x1, 0x58(%rax)
movq %r14, %r12
movq %rax, (%rbx)
movq %r12, %r14
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x526a(%rip), %rsi      # 0x1097b
pushq $0x2
popq %rdx
movq %r14, %rdi
callq 0xe378
testb %al, %al
je 0xb757
leaq 0x200(%r15), %r12
movq %r12, %rdi
callq 0xe3b2
movq %r15, 0x8(%rax)
andq $0x0, 0x10(%rax)
andl $0x0, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
leaq 0xd0de(%rip), %rcx      # 0x18830
jmp 0xb631
leaq 0x522a(%rip), %rsi      # 0x10988
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0xe378
testb %al, %al
je 0xb7b7
leaq 0x80(%r15), %r12
movq %r12, %rdi
callq 0xe4c2
movq %r15, 0x8(%rax)
andq $0x0, 0x10(%rax)
andl $0x0, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
leaq 0xd131(%rip), %rcx      # 0x188d0
movq %rcx, (%rax)
andl $0x0, 0x58(%rax)
andq $0x0, 0x60(%rax)
movq %r12, 0x50(%rax)
incq %r14
jmp 0xb6f5
leaq 0x180(%r15), %r14
movq %r14, %rdi
callq 0xe43a
movq %r15, 0x8(%rax)
andq $0x0, 0x10(%rax)
andl $0x0, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
leaq 0xd29f(%rip), %rcx      # 0x18a88
movq %rcx, (%rax)
movb $0x0, 0x58(%rax)
movq %r14, 0x50(%rax)
jmp 0xb6f8
nop