// File: /workspace/github_cpp_makefile_star2_O3/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, %r13d
movq %rsi, %r15
movq %rdi, %r12
leaq 0x31d6(%rip), %rsi      # 0xa3e5
movq %r15, %rdi
xorl %edx, %edx
callq 0x890e
testl %r13d, %r13d
je 0x738f
leaq 0x8f47(%rip), %rax      # 0x10170
cmpb $0x0, (%rax)
je 0x738f
movq %r12, %rdi
movl %ebp, %esi
callq 0x6d4c
testq %rax, %rax
je 0x7491
movq %rax, %r12
movzbl %r14b, %eax
movl %eax, 0x14(%rsp)
xorl %r13d, %r13d
cmpb $0x0, (%r12)
je 0x7491
movq %r12, %rdi
movq %rbx, %rsi
movl 0x14(%rsp), %edx
callq 0x70e8
testb %al, %al
jne 0x7471
movzbl (%r12), %r14d
cmpl $0xd, %r14d
je 0x7286
cmpl $0xa, %r14d
jne 0x7296
incq %r12
movb $0x1, %r13b
testq %r12, %r12
jne 0x7253
jmp 0x7491
movl %r14d, %edi
callq 0x3060
cmpl $0xd, %r14d
je 0x7286
testl %eax, %eax
jne 0x7286
testb $0x1, %r13b
je 0x72c5
movb $0x20, 0xc(%rsp)
movl $0x1, %edx
movq %r15, %rdi
leaq 0xc(%rsp), %rsi
callq 0x89c2
movl $0x0, 0x8(%rsp)
cmpl $0x1, %ebp
jne 0x7324
movzbl (%r12), %eax
leaq 0x35a2(%rip), %rcx      # 0xa880
movslq (%rcx,%rax,4), %rax
movl %eax, 0xc(%rsp)
testq %rax, %rax
je 0x7374
cmpl $0x1, %eax
je 0x732c
movb (%r12), %cl
testb %cl, %cl
je 0x731f
testq %rax, %rax
movl $0x0, %edx
cmovgq %rax, %rdx
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x731f
movb %cl, 0x8(%rsp,%rsi)
movb 0x1(%r12,%rsi), %cl
incq %rsi
testb %cl, %cl
jne 0x730a
addq %rax, %r12
jmp 0x734f
movl $0x1, 0xc(%rsp)
movb (%r12), %al
cmpb $0x26, %al
jne 0x7356
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
leaq 0xc(%rsp), %rdx
movl %ebp, %ecx
callq 0x6ee8
movq %rax, %r12
movl 0xc(%rsp), %eax
cmpl $0x1, %eax
je 0x735d
jmp 0x7377
movb %al, 0x8(%rsp)
incq %r12
movb 0x8(%rsp), %al
movb %al, 0x13(%rsp)
movl $0x1, %edx
movq %r15, %rdi
leaq 0x13(%rsp), %rsi
jmp 0x7382
xorl %r12d, %r12d
movslq %eax, %rdx
movq %r15, %rdi
leaq 0x8(%rsp), %rsi
callq 0x89c2
xorl %r13d, %r13d
jmp 0x728c
testq %r12, %r12
je 0x7491
movzbl %r14b, %r13d
leaq 0x8(%rsp), %r14
cmpb $0x0, (%r12)
je 0x7491
movq %r12, %rdi
movq %rbx, %rsi
movl %r13d, %edx
callq 0x70e8
testb %al, %al
jne 0x7471
movl $0x0, 0x8(%rsp)
cmpl $0x1, %ebp
jne 0x7421
movzbl (%r12), %eax
leaq 0x34a5(%rip), %rcx      # 0xa880
movslq (%rcx,%rax,4), %rax
movl %eax, 0xc(%rsp)
cmpq $0x1, %rax
je 0x7429
testl %eax, %eax
je 0x74a5
movb (%r12), %cl
testb %cl, %cl
je 0x741c
testq %rax, %rax
movl $0x0, %edx
cmovgq %rax, %rdx
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x741c
movb %cl, 0x8(%rsp,%rsi)
movb 0x1(%r12,%rsi), %cl
incq %rsi
testb %cl, %cl
jne 0x7407
addq %rax, %r12
jmp 0x7458
movl $0x1, 0xc(%rsp)
movb (%r12), %al
cmpb $0x26, %al
jne 0x744c
movq %r12, %rdi
movq %r14, %rsi
leaq 0xc(%rsp), %rdx
movl %ebp, %ecx
callq 0x6ee8
movq %rax, %r12
movl 0xc(%rsp), %eax
jmp 0x7458
movb %al, 0x8(%rsp)
incq %r12
movl $0x1, %eax
movslq %eax, %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x89c2
testq %r12, %r12
jne 0x73a1
jmp 0x7491
cmpb $0x0, (%r12)
je 0x7491
movq %rbx, %rdi
callq 0x30a0
leaq (%r12,%rax), %rcx
xorl %ebx, %ebx
cmpb $0x0, (%r12,%rax)
cmovneq %rcx, %rbx
jmp 0x7493
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0x89c2
jmp 0x7493