// File: /workspace/github_cpp_makefile_star2_O1/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, %r12d
movq %rcx, %rbx
movl %edx, %r13d
movq %rsi, %r15
movq %rdi, %r14
leaq 0x307c(%rip), %rsi      # 0xa3e5
movq %r15, %rdi
xorl %edx, %edx
callq 0x8ae8
testl %r13d, %r13d
je 0x74ea
leaq 0x8ded(%rip), %rax      # 0x10170
cmpb $0x0, (%rax)
je 0x74ea
movq %r14, %rdi
movl %ebp, %esi
callq 0x6e8a
movq %rax, %r14
testq %rax, %rax
je 0x75c0
xorl %r13d, %r13d
movzbl %r12b, %eax
movl %eax, 0x14(%rsp)
cmpb $0x0, (%r14)
je 0x75c0
movq %r14, %rdi
movq %rbx, %rsi
movl 0x14(%rsp), %edx
movl %ebp, %ecx
callq 0x7254
testb %al, %al
jne 0x75c0
movq %r13, %r12
movzbl (%r14), %r13d
cmpl $0xd, %r13d
je 0x73ef
cmpl $0xa, %r13d
je 0x73ef
movl %r13d, %edi
callq 0x3060
testl %eax, %eax
je 0x73ff
incq %r14
movb $0x1, %r13b
testq %r14, %r14
jne 0x73ad
jmp 0x75c0
cmpl $0xd, %r13d
je 0x73ef
cmpl $0xa, %r13d
je 0x73ef
movq %r12, %r13
testb $0x1, %r13b
je 0x742e
movb $0x20, 0xc(%rsp)
movl $0x1, %edx
movq %r15, %rdi
leaq 0xc(%rsp), %rsi
callq 0x8b94
xorl %r13d, %r13d
movl $0x0, 0x8(%rsp)
movl $0x1, %eax
cmpl $0x1, %ebp
jne 0x744e
movzbl (%r14), %eax
leaq 0x31c5(%rip), %rcx      # 0xa610
movl (%rcx,%rax,4), %eax
movl %eax, 0xc(%rsp)
testl %eax, %eax
je 0x747b
cmpl $0x1, %eax
jne 0x7480
movb (%r14), %al
cmpb $0x26, %al
jne 0x74af
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
leaq 0xc(%rsp), %rdx
movl %ebp, %ecx
callq 0x7038
movq %rax, %r14
jmp 0x74b6
xorl %r14d, %r14d
jmp 0x74b6
movb (%r14), %cl
testb %cl, %cl
je 0x74a8
testl %eax, %eax
movl $0x0, %edx
cmovgl %eax, %edx
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x74a8
movb %cl, 0x8(%rsp,%rsi)
movb 0x1(%r14,%rsi), %cl
incq %rsi
testb %cl, %cl
jne 0x7493
cltq
addq %rax, %r14
jmp 0x74b6
movb %al, 0x8(%rsp)
incq %r14
movslq 0xc(%rsp), %rdx
cmpq $0x1, %rdx
jne 0x74d8
movb 0x8(%rsp), %al
movb %al, 0x13(%rsp)
movl $0x1, %edx
movq %r15, %rdi
leaq 0x13(%rsp), %rsi
jmp 0x74e0
movq %r15, %rdi
leaq 0x8(%rsp), %rsi
callq 0x8b94
jmp 0x73f5
testq %r14, %r14
je 0x75bd
movzbl %r12b, %r12d
leaq 0x8(%rsp), %r13
cmpb $0x0, (%r14)
je 0x75c0
movq %r14, %rdi
movq %rbx, %rsi
movl %r12d, %edx
movl %ebp, %ecx
callq 0x7254
testb %al, %al
jne 0x75c0
movl $0x0, 0x8(%rsp)
movl $0x1, %eax
cmpl $0x1, %ebp
jne 0x753e
movzbl (%r14), %eax
leaq 0x30d5(%rip), %rcx      # 0xa610
movl (%rcx,%rax,4), %eax
movl %eax, 0xc(%rsp)
testl %eax, %eax
je 0x7569
cmpl $0x1, %eax
jne 0x756e
movb (%r14), %al
cmpb $0x26, %al
jne 0x759d
movq %r14, %rdi
movq %r13, %rsi
leaq 0xc(%rsp), %rdx
movl %ebp, %ecx
callq 0x7038
movq %rax, %r14
jmp 0x75a4
xorl %r14d, %r14d
jmp 0x75a4
movb (%r14), %cl
testb %cl, %cl
je 0x7596
testl %eax, %eax
movl $0x0, %edx
cmovgl %eax, %edx
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x7596
movb %cl, 0x8(%rsp,%rsi)
movb 0x1(%r14,%rsi), %cl
incq %rsi
testb %cl, %cl
jne 0x7581
cltq
addq %rax, %r14
jmp 0x75a4
movb %al, 0x8(%rsp)
incq %r14
movslq 0xc(%rsp), %rdx
movq %r15, %rdi
movq %r13, %rsi
callq 0x8b94
testq %r14, %r14
jne 0x74fc
xorl %r14d, %r14d
testq %r14, %r14
je 0x75d8
cmpb $0x0, (%r14)
je 0x75db
movq %rbx, %rdi
callq 0x30a0
addq %rax, %r14
jmp 0x75db
xorl %r14d, %r14d
xorl %eax, %eax
testq %r14, %r14
je 0x75ea
cmpb $0x0, (%r14)
cmovneq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop