// File: /workspace/github_cpp_makefile_star2_O1/halsafar[P]libtmx-parser/./libs/tinyxml2/tinyxml2.cpp
// Function: tinyxml2::XMLElement::ParseAttributes(char*)
char* XMLElement::ParseAttributes( char* p )
{
    const char* start = p;
    XMLAttribute* prevAttribute = 0;

    // Read the attributes.
    while( p ) {
        p = XMLUtil::SkipWhiteSpace( p );
        if ( !p || !(*p) ) {
            _document->SetError( XML_ERROR_PARSING_ELEMENT, start, Name() );
            return 0;
        }

        // attribute.
        if (XMLUtil::IsNameStartChar( *p ) ) {
            XMLAttribute* attrib = new (_document->_attributePool.Alloc() ) XMLAttribute();
            attrib->_memPool = &_document->_attributePool;
			attrib->_memPool->SetTracked();

            p = attrib->ParseDeep( p, _document->ProcessEntities() );
            if ( !p || Attribute( attrib->Name() ) ) {
                DeleteAttribute( attrib );
                _document->SetError( XML_ERROR_PARSING_ATTRIBUTE, start, p );
                return 0;
            }
            // There is a minor bug here: if the attribute in the source xml
            // document is duplicated, it will not be detected and the
            // attribute will be doubly added. However, tracking the 'prevAttribute'
            // avoids re-scanning the attribute list. Preferring performance for
            // now, may reconsider in the future.
            if ( prevAttribute ) {
                prevAttribute->_next = attrib;
            }
            else {
                _rootAttribute = attrib;
            }
            prevAttribute = attrib;
        }
        // end of the tag
        else if ( *p == '/' && *(p+1) == '>' ) {
            _closingType = CLOSED;
            return p+2;	// done; sealed element.
        }
        // end of the tag
        else if ( *p == '>' ) {
            ++p;
            break;
        }
        else {
            _document->SetError( XML_ERROR_PARSING_ELEMENT, start, p );
            return 0;
        }
    }
    return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
movq %rsi, -0x30(%rbp)
xorl %r14d, %r14d
testq %rbx, %rbx
je 0xf224
movb (%rbx), %al
testb %al, %al
js 0xf0d4
movzbl %al, %edi
callq 0x4060
testl %eax, %eax
je 0xf0d4
movb 0x1(%rbx), %al
incq %rbx
jmp 0xf0bc
movzbl (%rbx), %r12d
testl %r12d, %r12d
je 0xf201
testb %r12b, %r12b
js 0xf10d
movl %r12d, %edi
callq 0x4370
testl %eax, %eax
jne 0xf10d
cmpl $0x3d, %r12d
jg 0xf103
cmpl $0x3a, %r12d
je 0xf10d
jmp 0xf238
cmpl $0x5f, %r12d
jne 0xf252
movq 0x8(%r15), %rdi
movl $0x100, %r13d           # imm = 0x100
addq %r13, %rdi
callq 0x10aae
movq %rax, %r12
leaq 0xaab7(%rip), %rax      # 0x19be0
movq %rax, (%r12)
xorl %eax, %eax
movl %eax, 0x8(%r12)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r12)
movl %eax, 0x20(%r12)
movups %xmm0, 0x28(%r12)
movups %xmm0, 0x38(%r12)
movq 0x8(%r15), %rax
leaq (%rax,%r13), %rdi
movq %rdi, 0x40(%r12)
movq 0x100(%rax), %rax
callq *0x28(%rax)
movq 0x8(%r15), %rax
movzbl 0x59(%rax), %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0xe4a2
movq %rax, %rbx
testq %rax, %rax
je 0xf1ad
movq %r12, %rdi
addq $0x8, %rdi
callq 0xc988
movq %r15, %rdi
movq %rax, %rsi
callq 0xe962
testq %rax, %rax
je 0xf1e3
addq $0x20, %rax
movq %rax, %rdi
callq 0xc988
testq %rax, %rax
je 0xf1e3
movq (%r12), %rax
movq 0x40(%r12), %r13
movq %r12, %rdi
callq *(%rax)
movq (%r13), %rax
movq %r13, %rdi
movq %r12, %rsi
callq *0x20(%rax)
movq 0x8(%r15), %rax
movl $0x8, 0x5c(%rax)
movq -0x30(%rbp), %rcx
movq %rcx, 0x68(%rax)
movq %rbx, 0x70(%rax)
xorl %eax, %eax
jmp 0xf1f7
testq %r14, %r14
je 0xf1ee
movq %r12, 0x38(%r14)
jmp 0xf1f2
movq %r12, 0x60(%r15)
movb $0x1, %al
movq %r12, %r14
testb %al, %al
jne 0xf0b1
jmp 0xf224
movq 0x8(%r15), %rbx
addq $0x18, %r15
movq %r15, %rdi
callq 0xc988
movl $0x7, 0x5c(%rbx)
movq -0x30(%rbp), %rcx
movq %rcx, 0x68(%rbx)
movq %rax, 0x70(%rbx)
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x2f, %r12d
jne 0xf25d
cmpb $0x3e, 0x1(%rbx)
jne 0xf252
movl $0x1, 0x58(%r15)
addq $0x2, %rbx
jmp 0xf226
cmpl $0x3e, %r12d
jne 0xf25d
incq %rbx
jmp 0xf226
movq 0x8(%r15), %rax
movl $0x7, 0x5c(%rax)
movq -0x30(%rbp), %rcx
movq %rcx, 0x68(%rax)
movq %rbx, 0x70(%rax)
jmp 0xf224