// File: 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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x8e00
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xad0f
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
jne 0xad1c
movq $0x0, -0x8(%rbp)
jmp 0xb000
cmpq $0x0, -0x20(%rbp)
je 0xad4a
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x24(%rbp), %edx
callq 0x8a90
movq -0x20(%rbp), %rdi
callq 0xb950
movq %rax, %rcx
movq -0x48(%rbp), %rax
movq (%rcx), %rcx
movq %rcx, 0x8(%rax)
movq -0x48(%rbp), %rsi
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
addq $0x20, %rsi
movl -0x24(%rbp), %edx
callq 0x8f80
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xad7a
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
jne 0xadb0
movq -0x48(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xada3
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x30(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movl $0x6, %esi
callq 0x9c50
movq $0x0, -0x8(%rbp)
jmp 0xb000
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x8e00
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xaddc
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
je 0xaddc
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3d, %eax
je 0xae12
movq -0x48(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xae05
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movl $0x6, %esi
callq 0x9c50
movq $0x0, -0x8(%rbp)
jmp 0xb000
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x8e00
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xae3e
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
jne 0xae74
movq -0x48(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xae67
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movl $0x6, %esi
callq 0x9c50
movq $0x0, -0x8(%rbp)
jmp 0xb000
movb $0x27, -0x39(%rbp)
movb $0x22, -0x3a(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x27, %eax
jne 0xaec7
movq -0x48(%rbp), %rsi
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
leaq 0x34bc(%rip), %rax      # 0xe35b
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
addq $0x28, %rsi
movq -0x38(%rbp), %rcx
movl -0x24(%rbp), %r9d
xorl %r8d, %r8d
movl %r8d, %edx
callq 0x96f0
movq %rax, -0x18(%rbp)
jmp 0xaff8
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0xaf12
movq -0x48(%rbp), %rsi
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
leaq 0x3551(%rip), %rax      # 0xe43b
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
addq $0x28, %rsi
movq -0x38(%rbp), %rcx
movl -0x24(%rbp), %r9d
xorl %r8d, %r8d
movl %r8d, %edx
callq 0x96f0
movq %rax, -0x18(%rbp)
jmp 0xaff6
movq -0x48(%rbp), %rdi
addq $0x28, %rdi
leaq 0x34c4(%rip), %rsi      # 0xe3e5
callq 0x79c0
xorl %eax, %eax
cmpq $0x0, -0x18(%rbp)
movb %al, -0x49(%rbp)
je 0xaf79
movq -0x18(%rbp), %rcx
xorl %eax, %eax
cmpb $0x0, (%rcx)
movb %al, -0x49(%rbp)
je 0xaf79
movq -0x18(%rbp), %rax
movsbl (%rax), %edi
callq 0xb690
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x49(%rbp)
jne 0xaf79
movq -0x18(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x2f, %ecx
movb %al, -0x49(%rbp)
je 0xaf79
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3e, %eax
setne %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0xaf82
jmp 0xaff4
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x27, %eax
je 0xaf9a
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0xafcd
movq -0x48(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xafc3
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movl $0x6, %esi
callq 0x9c50
movq $0x0, -0x8(%rbp)
jmp 0xb000
movq -0x48(%rbp), %rdi
movq -0x18(%rbp), %rax
movb (%rax), %al
addq $0x28, %rdi
movsbl %al, %esi
callq 0x7830
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0xaf26
jmp 0xaff6
jmp 0xaff8
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)