// File: /workspace/github_cpp_makefile_star2_O1/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 0x6e8a
testq %rax, %rax
je 0x82b5
movq %rax, %r12
cmpb $0x0, (%rax)
je 0x82b5
testq %r14, %r14
je 0x8230
movq %r14, %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0x6cd6
movq (%r14), %rax
movq %rax, 0x8(%r15)
leaq 0x20(%r15), %rsi
movq %r12, %rdi
callq 0x6f58
testq %rax, %rax
je 0x8286
cmpb $0x0, (%rax)
je 0x8286
movq %rax, %rdi
movl %ebx, %esi
callq 0x6e8a
testq %rax, %rax
je 0x8299
cmpb $0x3d, (%rax)
jne 0x8299
incq %rax
movq %rax, %rdi
movl %ebx, %esi
callq 0x6e8a
movq %rax, %r12
testq %rax, %rax
je 0x8286
movzbl (%r12), %eax
cmpl $0x27, %eax
je 0x82da
cmpl $0x22, %eax
je 0x82ca
testl %eax, %eax
jne 0x8309
movq 0x18(%r15), %rdi
testq %rdi, %rdi
je 0x82b5
movl $0x6, %esi
movq %r12, %rdx
jmp 0x82aa
movq 0x18(%r15), %rdi
testq %rdi, %rdi
je 0x82b5
movl $0x6, %esi
movq %rax, %rdx
movq %r14, %rcx
movl %ebx, %r8d
callq 0x77f6
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 0x2163(%rip), %rcx      # 0xa43b
jmp 0x82e8
incq %r12
addq $0x28, %r15
leaq 0x2073(%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 0x7342
leaq 0x28(%r15), %rdi
leaq 0x20d1(%rip), %rsi      # 0xa3e5
movq %rdi, 0x10(%rsp)
xorl %edx, %edx
callq 0x8ae8
movb (%r12), %r13b
testb %r13b, %r13b
je 0x82b8
movzbl %r13b, %ebp
movl %ebp, %edi
callq 0x3060
testl %eax, %eax
jne 0x82b8
cmpb $0x3e, %r13b
ja 0x8366
movabsq $0x4000800000002400, %rax # imm = 0x4000800000002400
btq %rbp, %rax
jb 0x82b8
movabsq $0x8400000000, %rax     # imm = 0x8400000000
btq %rbp, %rax
jb 0x8286
movb %r13b, 0xf(%rsp)
movl $0x1, %edx
movq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rsi
callq 0x8b94
movb 0x1(%r12), %r13b
incq %r12
jmp 0x8324
nop