// File: /workspace/github_cpp_makefile_star2_O3/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 $0x18, %rsp
movl %ecx, %ebx
movq %rdx, (%rsp)
movq %rdi, %r13
movq %rsi, %rdi
movl %ecx, %esi
callq 0x6d4c
movq %rax, %r14
movq %r13, %rdi
callq 0x3fac
movq %rax, %r15
testq %r14, %r14
je 0x7abf
movb (%r14), %al
testb %al, %al
je 0x7abf
movq (%rsp), %rcx
testq %rcx, %rcx
je 0x797e
movq (%rsp), %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x6bae
movq (%rsp), %rcx
movq (%rcx), %rax
movq %rax, 0x8(%r13)
movb (%r14), %al
cmpb $0x3c, %al
jne 0x7add
incq %r14
movq %r14, %rdi
movl %ebx, %esi
callq 0x6d4c
movq %rax, %r14
leaq 0x38(%r13), %rbp
movq %rax, %rdi
movq %rbp, %rsi
callq 0x6e14
testq %rax, %rax
je 0x7aef
movq %rax, %r12
cmpb $0x0, (%rax)
je 0x7aef
leaq 0x2b5a(%rip), %rsi      # 0xa51b
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x67b0
movq (%rbp), %rsi
movq (%rsi), %rdx
addq $0x10, %rsi
movq %r14, %rdi
callq 0x89c2
leaq 0x50(%r13), %rax
movq %rax, 0x10(%rsp)
cmpb $0x0, (%r12)
je 0x7c0d
movq %r12, %rdi
movl %ebx, %esi
callq 0x6d4c
testq %rax, %rax
je 0x7b20
movq %rax, %rbp
movzbl (%rax), %eax
cmpl $0x3e, %eax
je 0x7b6a
cmpl $0x2f, %eax
je 0x7bd6
testl %eax, %eax
je 0x7b20
movl $0x40, %edi
callq 0x3130
movq %rax, %r14
movq $-0x1, 0x8(%rax)
movq $0x0, 0x10(%rax)
leaq 0x8224(%rip), %rax      # 0xfc70
movq %rax, (%r14)
leaq 0x8802(%rip), %rax      # 0x10258
movq %rax, 0x20(%r14)
movq %rax, 0x28(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%r14)
movq %r15, 0x18(%r14)
movq %r14, %rdi
movq %rbp, %rsi
movq (%rsp), %rdx
movl %ebx, %ecx
callq 0x802c
movq %rax, %r12
testq %rax, %rax
je 0x7b45
cmpb $0x0, (%r12)
je 0x7b45
movq 0x20(%r14), %rsi
addq $0x10, %rsi
movq 0x10(%rsp), %rdi
callq 0x3df4
testq %rax, %rax
jne 0x7be5
movq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x5ff6
jmp 0x79ea
testq %r15, %r15
je 0x7b0b
xorl %r12d, %r12d
movq %r15, %rdi
movl $0x3, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl %ebx, %r8d
callq 0x768c
jmp 0x7b0e
testq %r15, %r15
je 0x7b0b
movq %r15, %rdi
movl $0x3, %esi
movq %r14, %rdx
jmp 0x7b03
testq %r15, %r15
je 0x7b0b
movq %r15, %rdi
movl $0x4, %esi
movq %r14, %rdx
movq (%rsp), %rcx
movl %ebx, %r8d
callq 0x768c
xorl %r12d, %r12d
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x6, %esi
testq %r15, %r15
je 0x7c0a
movq %r15, %rdi
movq %r12, %rdx
movq (%rsp), %rcx
movl %ebx, %r8d
callq 0x768c
jmp 0x7c0a
testq %r15, %r15
je 0x7c01
movq %r15, %rdi
movl $0x3, %esi
movq %rbp, %rdx
movq (%rsp), %rcx
movl %ebx, %r8d
callq 0x768c
jmp 0x7c01
incq %rbp
movq %r13, %rdi
movq %rbp, %rsi
movq (%rsp), %rdx
movl %ebx, %ecx
callq 0x7ca2
movq %rax, %r12
testq %rax, %rax
je 0x7c34
cmpb $0x0, (%r12)
je 0x7c34
movq 0x8(%rsp), %rsi
addq $0x10, %rsi
movq %r12, %rdi
xorl %edx, %edx
callq 0x70e8
testb %al, %al
je 0x7c67
movq 0x8(%rsp), %rax
movq (%rax), %rdi
addq %r12, %rdi
movl %ebx, %esi
callq 0x6d4c
movq %rax, %r12
testq %rax, %rax
je 0x7c34
cmpb $0x3e, (%r12)
jne 0x7c34
incq %r12
jmp 0x7c0d
cmpb $0x3e, 0x1(%rbp)
jne 0x7c52
addq $0x2, %rbp
movq %rbp, %r12
jmp 0x7c0d
testq %r15, %r15
je 0x7c01
movq %r15, %rdi
movl $0x3, %esi
movq %rbp, %rdx
movq (%rsp), %rcx
movl %ebx, %r8d
callq 0x768c
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
xorl %r12d, %r12d
movq 0x8(%rsp), %rdi
cmpq 0x83c7(%rip), %rdi      # 0xffe0
sete %al
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x7b0e
callq 0x31d0
jmp 0x7b0e
testq %r15, %r15
je 0x7c0a
movq %r15, %rdi
movl $0x8, %esi
movq %r12, %rdx
movq (%rsp), %rcx
movl %ebx, %r8d
callq 0x768c
jmp 0x7c0a
testq %r15, %r15
je 0x7c0a
incq %rbp
movl $0x7, %esi
movq %rbp, %r12
jmp 0x7b2e
movl $0x8, %esi
jmp 0x7b25
jmp 0x7c79
jmp 0x7c79
jmp 0x7c79
jmp 0x7c79
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq 0x8358(%rip), %rdi      # 0xffe0
sete %al
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x7c9a
callq 0x31d0
movq %rbx, %rdi
callq 0x3280