// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %ebp
movl %r8d, %r14d
movq %rcx, %rbx
movl %edx, %r12d
movq %rsi, %rax
movq %rdi, %r15
leaq 0x2fa0(%rip), %rsi      # 0x93e5
movq %rax, 0x10(%rsp)
movq %rax, %rdi
callq 0x5988
testl %r12d, %r12d
je 0x6532
leaq 0x8d0e(%rip), %rax      # 0xf170
cmpb $0x0, (%rax)
je 0x6532
movq %r15, %rdi
movl %ebp, %esi
callq 0x5fec
movq %rax, %r15
xorl %r12d, %r12d
movzbl %r14b, %r13d
xorl %r14d, %r14d
testq %r15, %r15
je 0x65ae
cmpb $0x0, (%r15)
je 0x65ae
movq %r15, %rdi
movq %rbx, %rsi
movl %r13d, %edx
movl %ebp, %ecx
callq 0x632a
testb %al, %al
jne 0x658b
movzbl (%r15), %eax
cmpl $0xd, %eax
je 0x64c7
cmpl $0xa, %eax
je 0x64c7
movsbl %al, %edi
callq 0x7582
testb %al, %al
je 0x64cf
incq %r15
movb $0x1, %r14b
jmp 0x6482
testb $0x1, %r14b
je 0x64e2
movq 0x10(%rsp), %rdi
pushq $0x20
popq %rsi
callq 0x5972
andl $0x0, 0x8(%rsp)
movq %r15, %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
leaq 0xc(%rsp), %rdx
movl %ebp, %ecx
callq 0x75be
movq %rax, %r15
movslq 0xc(%rsp), %rdx
cmpq $0x1, %rdx
jne 0x6520
movsbl 0x8(%rsp), %esi
movq 0x10(%rsp), %rdi
callq 0x5972
jmp 0x647f
movq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x78b6
jmp 0x647f
movzbl %r14b, %r13d
leaq 0x8(%rsp), %r14
leaq 0xc(%rsp), %r12
testq %r15, %r15
je 0x65ab
cmpb $0x0, (%r15)
je 0x65ab
movq %r15, %rdi
movq %rbx, %rsi
movl %r13d, %edx
movl %ebp, %ecx
callq 0x632a
testb %al, %al
jne 0x658b
andl $0x0, 0x8(%rsp)
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
movl %ebp, %ecx
callq 0x75be
movq %rax, %r15
movslq 0xc(%rsp), %rdx
movq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x78b6
jmp 0x6540
cmpb $0x0, (%r15)
je 0x65ab
movq %rbx, %rdi
callq 0x30a0
leaq (%r15,%rax), %rcx
xorl %r12d, %r12d
cmpb $0x0, (%r15,%rax)
cmovneq %rcx, %r12
jmp 0x65ae
xorl %r12d, %r12d
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq