// File: /workspace/github_cpp_makefile_star2_O3/smallmuou[P]tinyhtml/tinyxml.cpp
// Function: TiXmlBase::EncodeString(TiXmlString const&, TiXmlString*)
void TiXmlBase::EncodeString( const TIXML_STRING& str, TIXML_STRING* outString )
{
	int i=0;

	while( i<(int)str.length() )
	{
		unsigned char c = (unsigned char) str[i];

		if (    c == '&' 
		     && i < ( (int)str.length() - 2 )
			 && str[i+1] == '#'
			 && str[i+2] == 'x' )
		{
			// Hexadecimal character reference.
			// Pass through unchanged.
			// &#xA9;	-- copyright symbol, for example.
			//
			// The -1 is a bug fix from Rob Laveaux. It keeps
			// an overflow from happening if there is no ';'.
			// There are actually 2 ways to exit this loop -
			// while fails (error case) and break (semicolon found).
			// However, there is no mechanism (currently) for
			// this function to return an error.
			while ( i<(int)str.length()-1 )
			{
				outString->append( str.c_str() + i, 1 );
				++i;
				if ( str[i] == ';' )
					break;
			}
		}
		else if ( c == '&' )
		{
			outString->append( entity[0].str, entity[0].strLength );
			++i;
		}
		else if ( c == '<' )
		{
			outString->append( entity[1].str, entity[1].strLength );
			++i;
		}
		else if ( c == '>' )
		{
			outString->append( entity[2].str, entity[2].strLength );
			++i;
		}
		else if ( c == '\"' )
		{
			outString->append( entity[3].str, entity[3].strLength );
			++i;
		}
		else if ( c == '\'' )
		{
			outString->append( entity[4].str, entity[4].strLength );
			++i;
		}
		else if ( c < 32 )
		{
			// Easy pass at non-alpha/numeric/symbol
			// Below 32 is symbolic.
			char buf[ 32 ];
			
			#if defined(TIXML_SNPRINTF)		
				TIXML_SNPRINTF( buf, sizeof(buf), "&#x%02X;", (unsigned) ( c & 0xff ) );
			#else
				sprintf( buf, "&#x%02X;", (unsigned) ( c & 0xff ) );
			#endif		

			//*ME:	warning C4267: convert 'size_t' to 'int'
			//*ME:	Int-Cast to make compiler happy ...
			outString->append( buf, (int)strlen( buf ) );
			++i;
		}
		else
		{
			//char realc = (char) c;
			//outString->append( &realc, 1 );
			*outString += (char) c;	// somewhat more efficient function call.
			++i;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq (%rdi), %rax
movq (%rax), %rsi
testl %esi, %esi
jle 0x35cc
movq %rdi, %r14
leaq 0xcd25(%rip), %r13      # 0x10180
movq %rsi, %rdx
xorl %r15d, %r15d
movslq %r15d, %rbp
cmpq %rbp, %rdx
jbe 0x35db
movb 0x10(%rax,%rbp), %dil
movzbl %dil, %ecx
cmpl $0x26, %ecx
jle 0x34a3
cmpl $0x27, %ecx
je 0x3534
cmpl $0x3c, %ecx
je 0x353e
cmpl $0x3e, %ecx
jne 0x356f
movq 0x20(%r13), %rsi
movl 0x28(%r13), %edx
jmp 0x3550
cmpl $0x22, %ecx
je 0x3548
cmpl $0x26, %ecx
jne 0x356f
addl $-0x2, %esi
leaq 0x1(%rbp), %r12
cmpl %esi, %r15d
jge 0x35a1
cmpq %r12, %rdx
jbe 0x35db
cmpb $0x23, 0x10(%rax,%r12)
jne 0x35a1
leaq 0x2(%rbp), %rcx
cmpq %rcx, %rdx
jbe 0x35db
cmpb $0x78, 0x10(%rax,%rcx)
jne 0x35a1
decl %edx
movslq %edx, %rcx
cmpq %rcx, %rbp
jge 0x35c7
leaq (%rax,%rbp), %rsi
addq $0x10, %rsi
movl $0x1, %edx
movq %rbx, %rdi
callq 0x89c2
leaq 0x1(%rbp), %r15
movq (%r14), %rax
movq (%rax), %rdx
cmpq %r15, %rdx
jbe 0x35db
cmpb $0x3b, 0x11(%rax,%rbp)
movq %r15, %rbp
jne 0x34f2
jmp 0x355b
movq 0x40(%r13), %rsi
movl 0x48(%r13), %edx
jmp 0x3550
movq 0x10(%r13), %rsi
movl 0x18(%r13), %edx
jmp 0x3550
movq 0x30(%r13), %rsi
movl 0x38(%r13), %edx
movq %rbx, %rdi
callq 0x89c2
incl %r15d
movq (%r14), %rax
movq (%rax), %rsi
movq %rsi, %rdx
cmpl %esi, %r15d
jl 0x3461
jmp 0x35cc
cmpb $0x1f, %dil
ja 0x35b6
movl $0x20, %esi
movq %rsp, %r12
movq %r12, %rdi
leaq 0x6a7d(%rip), %rdx      # 0xa004
xorl %eax, %eax
callq 0x3240
movq %r12, %rdi
callq 0x30a0
movslq %eax, %rdx
movq %rbx, %rdi
movq %r12, %rsi
jmp 0x3553
movq (%r13), %rsi
movl 0x8(%r13), %edx
movq %rbx, %rdi
callq 0x89c2
movl %r12d, %r15d
jmp 0x355b
movb %dil, (%rsp)
movl $0x1, %edx
movq %rbx, %rdi
movq %rsp, %rsi
jmp 0x3553
movq %rbp, %r15
jmp 0x355b
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6f4f(%rip), %rdi      # 0xa531
leaq 0x6f59(%rip), %rsi      # 0xa542
leaq 0x6f5e(%rip), %rcx      # 0xa54e
movl $0x9c, %edx
callq 0x30e0