// File: smallmuou[P]tinyhtml/tinyxmlparser.cpp
// Function: TiXmlBase::ReadText(char const*, TiXmlString*, bool, char const*, bool, TiXmlEncoding)
const char* TiXmlBase::ReadText(	const char* p, 
									TIXML_STRING * text, 
									bool trimWhiteSpace, 
									const char* endTag, 
									bool caseInsensitive,
									TiXmlEncoding encoding )
{
    *text = "";
	if (    !trimWhiteSpace			// certain tags always keep whitespace
		 || !condenseWhiteSpace )	// if true, whitespace is always kept
	{
		// Keep all the white space.
		while (	   p && *p
				&& !StringEqual( p, endTag, caseInsensitive, encoding )
			  )
		{
			int len;
			char cArr[4] = { 0, 0, 0, 0 };
			p = GetChar( p, cArr, &len, encoding );
			text->append( cArr, len );
		}
	}
	else
	{
		bool whitespace = false;

		// Remove leading white space:
		p = SkipWhiteSpace( p, encoding );
		while (	   p && *p
				&& !StringEqual( p, endTag, caseInsensitive, encoding ) )
		{
			if ( *p == '\r' || *p == '\n' )
			{
				whitespace = true;
				++p;
			}
			else if ( IsWhiteSpace( *p ) )
			{
				whitespace = true;
				++p;
			}
			else
			{
				// If we've found whitespace, add it before the
				// new character. Any whitespace just becomes a space.
				if ( whitespace )
				{
					(*text) += ' ';
					whitespace = false;
				}
				int len;
				char cArr[4] = { 0, 0, 0, 0 };
				p = GetChar( p, cArr, &len, encoding );
				if ( len == 1 )
					(*text) += cArr[0];	// more efficient
				else
					text->append( cArr, len );
			}
		}
	}
	if ( p && *p )
		p += strlen( endTag );
	return ( p && *p ) ? p : 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movb %r8b, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %dl
movb %dl, -0x11(%rbp)
movq %rcx, -0x20(%rbp)
andb $0x1, %al
movb %al, -0x21(%rbp)
movl %r9d, -0x28(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x4cc4(%rip), %rsi      # 0xe3e5
callq 0x79c0
testb $0x1, -0x11(%rbp)
je 0x973c
leaq 0xaa2d(%rip), %rax      # 0x14160
testb $0x1, (%rax)
jne 0x97be
jmp 0x973e
xorl %eax, %eax
cmpq $0x0, -0x8(%rbp)
movb %al, -0x3d(%rbp)
je 0x9775
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpb $0x0, (%rcx)
movb %al, -0x3d(%rbp)
je 0x9775
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movb -0x21(%rbp), %al
movl -0x28(%rbp), %ecx
andb $0x1, %al
movzbl %al, %edx
callq 0x9540
xorb $-0x1, %al
movb %al, -0x3d(%rbp)
movb -0x3d(%rbp), %al
testb $0x1, %al
jne 0x977e
jmp 0x97b9
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x30d0
movq -0x8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl -0x28(%rbp), %ecx
leaq -0x2c(%rbp), %rdx
callq 0xb730
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movslq -0x2c(%rbp), %rdx
callq 0xbe10
jmp 0x973e
jmp 0x98d9
movb $0x0, -0x31(%rbp)
movq -0x8(%rbp), %rdi
movl -0x28(%rbp), %esi
callq 0x8e00
movq %rax, -0x8(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x8(%rbp)
movb %al, -0x3e(%rbp)
je 0x9809
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpb $0x0, (%rcx)
movb %al, -0x3e(%rbp)
je 0x9809
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movb -0x21(%rbp), %al
movl -0x28(%rbp), %ecx
andb $0x1, %al
movzbl %al, %edx
callq 0x9540
xorb $-0x1, %al
movb %al, -0x3e(%rbp)
movb -0x3e(%rbp), %al
testb $0x1, %al
jne 0x9815
jmp 0x98d7
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xd, %eax
je 0x982d
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
jne 0x9842
movb $0x1, -0x31(%rbp)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x98d2
movq -0x8(%rbp), %rax
movsbl (%rax), %edi
callq 0xb690
testb $0x1, %al
jne 0x9854
jmp 0x9866
movb $0x1, -0x31(%rbp)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x98d0
testb $0x1, -0x31(%rbp)
je 0x987e
movq -0x10(%rbp), %rdi
movl $0x20, %esi
callq 0x7830
movb $0x0, -0x31(%rbp)
leaq -0x3c(%rbp), %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x30d0
movq -0x8(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
movl -0x28(%rbp), %ecx
leaq -0x38(%rbp), %rdx
callq 0xb730
movq %rax, -0x8(%rbp)
cmpl $0x1, -0x38(%rbp)
jne 0x98bd
movb -0x3c(%rbp), %al
movq -0x10(%rbp), %rdi
movsbl %al, %esi
callq 0x7830
jmp 0x98ce
movq -0x10(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
movslq -0x38(%rbp), %rdx
callq 0xbe10
jmp 0x98d0
jmp 0x98d2
jmp 0x97d2
jmp 0x98d9
cmpq $0x0, -0x8(%rbp)
je 0x98fa
movq -0x8(%rbp), %rax
cmpb $0x0, (%rax)
je 0x98fa
movq -0x20(%rbp), %rdi
callq 0x30a0
addq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x9914
movq -0x8(%rbp), %rax
cmpb $0x0, (%rax)
je 0x9914
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x991c
xorl %eax, %eax
movq %rax, -0x48(%rbp)
jmp 0x991c
movq -0x48(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)