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

	// Read in text and elements in any order.
	const char* pWithWhiteSpace = p;
	p = SkipWhiteSpace( p, encoding );

	while ( p && *p )
	{
		if ( *p != '<' )
		{
			// Take what we have, make a text element.
			TiXmlText* textNode = new TiXmlText( "" );

			if ( !textNode )
			{
			    return 0;
			}

			if ( TiXmlBase::IsWhiteSpaceCondensed() )
			{
				p = textNode->Parse( p, data, encoding );
			}
			else
			{
				// Special case: we want to keep the white space
				// so that leading spaces aren't removed.
				p = textNode->Parse( pWithWhiteSpace, data, encoding );
			}

			if ( !textNode->Blank() )
				LinkEndChild( textNode );
			else
				delete textNode;
		} 
		else 
		{
			// We hit a '<'
			// Have we hit a new element or an end tag? This could also be
			// a TiXmlText in the "CDATA" style.
			if ( StringEqual( p, "</", false, encoding ) )
			{
				return p;
			}
			else
			{
				TiXmlNode* node = Identify( p, encoding );
				if ( node )
				{
					p = node->Parse( p, data, encoding );
					LinkEndChild( node );
				}				
				else
				{
					return 0;
				}
			}
		}
		pWithWhiteSpace = p;
		p = SkipWhiteSpace( p, encoding );
	}

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x60(%rbp)
callq 0x7920
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x8e00
movq %rax, -0x18(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x18(%rbp)
movb %al, -0x61(%rbp)
je 0xa75c
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
setne %al
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0xa768
jmp 0xa8e2
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3c, %eax
je 0xa84c
movl $0x58, %edi
callq 0x3130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x70(%rbp)
leaq 0x3c52(%rip), %rsi      # 0xe3e5
callq 0x7db0
jmp 0xa79a
movq -0x70(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0xa7d5
movq $0x0, -0x8(%rbp)
jmp 0xa913
movq -0x70(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
movl $0x58, %esi
callq 0x3140
jmp 0xa920
callq 0xb9c0
testb $0x1, %al
jne 0xa7e0
jmp 0xa7fb
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
movq (%rdi), %rax
callq *0x18(%rax)
movq %rax, -0x18(%rbp)
jmp 0xa814
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
movq (%rdi), %rax
callq *0x18(%rax)
movq %rax, -0x18(%rbp)
movq -0x40(%rbp), %rdi
callq 0xa930
testb $0x1, %al
jne 0xa830
movq -0x60(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x3890
jmp 0xa84a
movq -0x40(%rbp), %rax
movq %rax, -0x78(%rbp)
cmpq $0x0, %rax
je 0xa848
movq -0x78(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0xa84a
jmp 0xa8c5
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %ecx
leaq 0x3cc1(%rip), %rsi      # 0xe51b
xorl %edx, %edx
callq 0x9540
testb $0x1, %al
jne 0xa867
jmp 0xa874
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xa913
movq -0x60(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x24(%rbp), %edx
callq 0x9d30
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0xa8b7
movq -0x58(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
movq (%rdi), %rax
callq *0x18(%rax)
movq -0x60(%rbp), %rdi
movq %rax, -0x18(%rbp)
movq -0x58(%rbp), %rsi
callq 0x3890
jmp 0xa8c1
movq $0x0, -0x8(%rbp)
jmp 0xa913
jmp 0xa8c3
jmp 0xa8c5
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x8e00
movq %rax, -0x18(%rbp)
jmp 0xa743
cmpq $0x0, -0x18(%rbp)
jne 0xa90b
cmpq $0x0, -0x30(%rbp)
je 0xa909
movq -0x30(%rbp), %rdi
movl -0x24(%rbp), %r8d
movl $0x5, %esi
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rdx
callq 0x9c50
jmp 0xa90b
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x3270
nopl (%rax)