// File: /workspace/github_cpp_makefile_star2_O3/smallmuou[P]tinyhtml/tinyxmlparser.cpp
// Function: TiXmlAttribute::Parse(char const*, TiXmlParsingData*, TiXmlEncoding)
const char* TiXmlAttribute::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding )
{
	p = SkipWhiteSpace( p, encoding );
	if ( !p || !*p ) return 0;

	if ( data )
	{
		data->Stamp( p, encoding );
		location = data->Cursor();
	}
	// Read the name, the '=' and the value.
	const char* pErr = p;
	p = ReadName( p, &name, encoding );
	if ( !p || !*p )
	{
		if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, pErr, data, encoding );
		return 0;
	}
	p = SkipWhiteSpace( p, encoding );
	if ( !p || !*p || *p != '=' )
	{
		if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding );
		return 0;
	}

	++p;	// skip '='
	p = SkipWhiteSpace( p, encoding );
	if ( !p || !*p )
	{
		if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding );
		return 0;
	}
	
	const char* end;
	const char SINGLE_QUOTE = '\'';
	const char DOUBLE_QUOTE = '\"';

	if ( *p == SINGLE_QUOTE )
	{
		++p;
		end = "\'";		// single quote in string
		p = ReadText( p, &value, false, end, false, encoding );
	}
	else if ( *p == DOUBLE_QUOTE )
	{
		++p;
		end = "\"";		// double quote in string
		p = ReadText( p, &value, false, end, false, encoding );
	}
	else
	{
		// All attribute values should be in single or double quotes.
		// But this is such a common error that the parser will try
		// its best, even without them.
		value = "";
		while (    p && *p											// existence
				&& !IsWhiteSpace( *p )								// whitespace
				&& *p != '/' && *p != '>' )							// tag end
		{
			if ( *p == SINGLE_QUOTE || *p == DOUBLE_QUOTE ) {
				// [ 1451649 ] Attribute values with trailing quotes not handled correctly
				// We did not have an opening quote but seem to have a 
				// closing one. Give up and throw an error.
				if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding );
				return 0;
			}
			value += *p;
			++p;
		}
	}
	return p;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebx
movq %rdx, %r14
movq %rdi, %r15
movq %rsi, %rdi
movl %ecx, %esi
callq 0x6d4c
testq %rax, %rax
je 0x80ff
movq %rax, %r12
cmpb $0x0, (%rax)
je 0x80ff
testq %r14, %r14
je 0x807a
movq %r14, %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0x6bae
movq (%r14), %rax
movq %rax, 0x8(%r15)
leaq 0x20(%r15), %rsi
movq %r12, %rdi
callq 0x6e14
testq %rax, %rax
je 0x80d0
cmpb $0x0, (%rax)
je 0x80d0
movq %rax, %rdi
movl %ebx, %esi
callq 0x6d4c
testq %rax, %rax
je 0x80e3
cmpb $0x3d, (%rax)
jne 0x80e3
incq %rax
movq %rax, %rdi
movl %ebx, %esi
callq 0x6d4c
movq %rax, %r12
testq %rax, %rax
je 0x80d0
movzbl (%r12), %eax
cmpl $0x27, %eax
je 0x8124
cmpl $0x22, %eax
je 0x8114
testl %eax, %eax
jne 0x8153
movq 0x18(%r15), %rdi
testq %rdi, %rdi
je 0x80ff
movl $0x6, %esi
movq %r12, %rdx
jmp 0x80f4
movq 0x18(%r15), %rdi
testq %rdi, %rdi
je 0x80ff
movl $0x6, %esi
movq %rax, %rdx
movq %r14, %rcx
movl %ebx, %r8d
callq 0x768c
xorl %r12d, %r12d
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
incq %r12
addq $0x28, %r15
leaq 0x2319(%rip), %rcx      # 0xa43b
jmp 0x8132
incq %r12
addq $0x28, %r15
leaq 0x2229(%rip), %rcx      # 0xa35b
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
xorl %r8d, %r8d
movl %ebx, %r9d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x71e8
leaq 0x28(%r15), %rdi
leaq 0x2287(%rip), %rsi      # 0xa3e5
movq %rdi, 0x10(%rsp)
xorl %edx, %edx
callq 0x890e
movb (%r12), %r13b
testb %r13b, %r13b
je 0x8102
movzbl %r13b, %ebp
movl %ebp, %edi
callq 0x3060
testl %eax, %eax
jne 0x8102
cmpb $0x3e, %r13b
ja 0x81b0
movabsq $0x4000800000002400, %rax # imm = 0x4000800000002400
btq %rbp, %rax
jb 0x8102
movabsq $0x8400000000, %rax     # imm = 0x8400000000
btq %rbp, %rax
jb 0x80d0
movb %r13b, 0xf(%rsp)
movl $0x1, %edx
movq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rsi
callq 0x89c2
movb 0x1(%r12), %r13b
incq %r12
jmp 0x816e
nop