// File: /workspace/github_cpp_makefile_star2_O1/smallmuou[P]tinyhtml/tinyxmlparser.cpp
// Function: TiXmlElement::Parse(char const*, TiXmlParsingData*, TiXmlEncoding)
const char* TiXmlElement::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding )
{
	p = SkipWhiteSpace( p, encoding );
	TiXmlDocument* document = GetDocument();

	if ( !p || !*p )
	{
		if ( document ) document->SetError( TIXML_ERROR_PARSING_ELEMENT, 0, 0, encoding );
		return 0;
	}

	if ( data )
	{
		data->Stamp( p, encoding );
		location = data->Cursor();
	}

	if ( *p != '<' )
	{
		if ( document ) document->SetError( TIXML_ERROR_PARSING_ELEMENT, p, data, encoding );
		return 0;
	}

	p = SkipWhiteSpace( p+1, encoding );

	// Read the name.
	const char* pErr = p;

    p = ReadName( p, &value, encoding );
	if ( !p || !*p )
	{
		if ( document )	document->SetError( TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME, pErr, data, encoding );
		return 0;
	}

    TIXML_STRING endTag ("</");
	endTag += value;

	// Check for and read attributes. Also look for an empty
	// tag or an end tag.
	while ( p && *p )
	{
		pErr = p;
		p = SkipWhiteSpace( p, encoding );
		if ( !p || !*p )
		{
			if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, pErr, data, encoding );
			return 0;
		}
		if ( *p == '/' )
		{
			++p;
			// Empty tag.
			if ( *p  != '>' )
			{
				if ( document ) document->SetError( TIXML_ERROR_PARSING_EMPTY, p, data, encoding );		
				return 0;
			}
			return (p+1);
		}
		else if ( *p == '>' )
		{
			// Done with attributes (if there were any.)
			// Read the value -- which can include other
			// elements -- read the end tag, and return.
			++p;
			p = ReadValue( p, data, encoding );		// Note this is an Element method, and will set the error if one happens.
			if ( !p || !*p ) {
				// We were looking for the end tag, but found nothing.
				// Fix for [ 1663758 ] Failure to report error on bad XML
				if ( document ) document->SetError( TIXML_ERROR_READING_END_TAG, p, data, encoding );
				return 0;
			}

			// We should find the end tag now
			// note that:
			// </foo > and
			// </foo> 
			// are both valid end tags.
			if ( StringEqual( p, endTag.c_str(), false, encoding ) )
			{
				p += endTag.length();
				p = SkipWhiteSpace( p, encoding );
				if ( p && *p && *p == '>' ) {
					++p;
					return p;
				}
				if ( document ) document->SetError( TIXML_ERROR_READING_END_TAG, p, data, encoding );
				return 0;
			}
			else
			{
				if ( document ) document->SetError( TIXML_ERROR_READING_END_TAG, p, data, encoding );
				return 0;
			}
		}
		else
		{
			// Try to read an attribute:
			TiXmlAttribute* attrib = new TiXmlAttribute();
			if ( !attrib )
			{
				return 0;
			}

			attrib->SetDocument( document );
			pErr = p;
			p = attrib->Parse( p, data, encoding );

			if ( !p || !*p )
			{
				if ( document ) document->SetError( TIXML_ERROR_PARSING_ELEMENT, pErr, data, encoding );
				delete attrib;
				return 0;
			}

			// Handle the strange case of double attributes:
			#ifdef TIXML_USE_STL
			TiXmlAttribute* node = attributeSet.Find( attrib->NameTStr() );
			#else
			TiXmlAttribute* node = attributeSet.Find( attrib->Name() );
			#endif
			if ( node )
			{
				if ( document ) document->SetError( TIXML_ERROR_PARSING_ELEMENT, pErr, data, encoding );
				delete attrib;
				return 0;
			}

			attributeSet.Add( attrib );
		}
	}
	return p;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, %ebx
movq %rdx, %r15
movq %rdi, %r13
movq %rsi, %rdi
movl %ecx, %esi
callq 0x6e8a
movq %rax, %r14
movq %r13, %rdi
callq 0x3fe0
movq %rax, %r12
testq %r14, %r14
je 0x7c74
cmpb $0x0, (%r14)
je 0x7c74
testq %r15, %r15
je 0x7aec
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x6cd6
movq (%r15), %rax
movq %rax, 0x8(%r13)
cmpb $0x3c, (%r14)
jne 0x7c91
movq %r12, 0x8(%rsp)
movq %r15, 0x10(%rsp)
incq %r14
movq %r14, %rdi
movl %ebx, %esi
callq 0x6e8a
movq %rax, %r14
leaq 0x38(%r13), %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x6f58
testq %rax, %rax
je 0x7ca6
movq %rax, %rbp
cmpb $0x0, (%rax)
je 0x7ca6
leaq 0x29e0(%rip), %rsi      # 0xa51b
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x68b0
movq (%r15), %rsi
movq (%rsi), %rdx
addq $0x10, %rsi
movq %r14, %rdi
callq 0x8b94
leaq 0x50(%r13), %rax
movq %rax, 0x20(%rsp)
cmpb $0x0, (%rbp)
je 0x7d20
movq %rbp, %rdi
movl %ebx, %esi
callq 0x6e8a
testq %rax, %rax
movq 0x10(%rsp), %r15
je 0x7cd9
movq %rax, %r12
movzbl (%rax), %eax
cmpl $0x3e, %eax
je 0x7d40
cmpl $0x2f, %eax
je 0x7dab
testl %eax, %eax
je 0x7cd9
movl $0x40, %edi
callq 0x3130
movq %rax, %r14
movq $-0x1, 0x8(%rax)
movq $0x0, 0x10(%rax)
leaq 0x80a7(%rip), %rax      # 0xfc70
movq %rax, (%r14)
leaq 0x8685(%rip), %rax      # 0x10258
movq %rax, 0x20(%r14)
movq %rax, 0x28(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%r14)
movq 0x8(%rsp), %rax
movq %rax, 0x18(%r14)
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
movl %ebx, %ecx
callq 0x81e2
movq %rax, %rbp
testq %rax, %rax
je 0x7cf8
cmpb $0x0, (%rbp)
je 0x7cf8
movq 0x20(%r14), %rsi
addq $0x10, %rsi
movq 0x20(%rsp), %rdi
callq 0x3e12
movq %rax, %r15
testq %rax, %rax
je 0x7c59
cmpq $0x0, 0x8(%rsp)
je 0x7c4e
movq 0x8(%rsp), %rdi
movl $0x3, %esi
movq %r12, %rdx
movq 0x10(%rsp), %rcx
movl %ebx, %r8d
callq 0x77f6
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
jmp 0x7c66
movq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x60b0
testq %r15, %r15
je 0x7b63
jmp 0x7d1e
testq %r12, %r12
je 0x7cc5
xorl %ebp, %ebp
movq %r12, %rdi
movl $0x3, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl %ebx, %r8d
callq 0x77f6
jmp 0x7cc7
testq %r12, %r12
je 0x7cc5
movq %r12, %rdi
movl $0x3, %esi
movq %r14, %rdx
movq %r15, %rcx
jmp 0x7cbd
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x7cc5
movl $0x4, %esi
movq %r14, %rdx
movq 0x10(%rsp), %rcx
movl %ebx, %r8d
callq 0x77f6
xorl %ebp, %ebp
movq %rbp, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x6, %esi
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x7d1e
movq %rbp, %rdx
movq %r15, %rcx
movl %ebx, %r8d
callq 0x77f6
jmp 0x7d1e
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x7d15
movl $0x3, %esi
movq %r12, %rdx
movq %r15, %rcx
movl %ebx, %r8d
callq 0x77f6
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
xorl %ebp, %ebp
movq 0x18(%rsp), %rdi
cmpq 0x82b4(%rip), %rdi      # 0xffe0
sete %al
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x7cc7
callq 0x31d0
jmp 0x7cc7
incq %r12
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movl %ebx, %ecx
callq 0x7e50
movq %rax, %rbp
testq %rax, %rax
je 0x7dbf
cmpb $0x0, (%rbp)
je 0x7dbf
movq 0x18(%rsp), %rsi
addq $0x10, %rsi
movq %rbp, %rdi
xorl %edx, %edx
movl %ebx, %ecx
callq 0x7254
testb %al, %al
movq 0x10(%rsp), %r15
je 0x7e08
movq 0x18(%rsp), %rax
movq (%rax), %rdi
addq %rbp, %rdi
movl %ebx, %esi
callq 0x6e8a
movq %rax, %rbp
testq %rax, %rax
je 0x7e12
cmpb $0x3e, (%rbp)
jne 0x7e12
incq %rbp
jmp 0x7d20
cmpb $0x3e, 0x1(%r12)
jne 0x7dea
addq $0x2, %r12
movq %r12, %rbp
jmp 0x7d20
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
movq 0x10(%rsp), %r15
je 0x7d1e
movl $0x8, %esi
movq %rbp, %rdx
movq %r15, %rcx
movl %ebx, %r8d
callq 0x77f6
jmp 0x7d1e
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x7d1e
incq %r12
movl $0x7, %esi
movq %r12, %rbp
jmp 0x7ce8
movl $0x8, %esi
jmp 0x7cde
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
jne 0x7dd2
jmp 0x7d1e
jmp 0x7e27
jmp 0x7e27
jmp 0x7e27
movq %rax, %rbx
movq 0x18(%rsp), %rdi
cmpq 0x81aa(%rip), %rdi      # 0xffe0
sete %al
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x7e48
callq 0x31d0
movq %rbx, %rdi
callq 0x3280