// File: /workspace/github_cpp_makefile_star2_O2/halsafar[P]libtmx-parser/./libs/tinyxml2/tinyxml2.cpp
// Function: tinyxml2::StrPair::GetStr()
const char* StrPair::GetStr()
{
    if ( _flags & NEEDS_FLUSH ) {
        *_end = 0;
        _flags ^= NEEDS_FLUSH;

        if ( _flags ) {
            char* p = _start;	// the read pointer
            char* q = _start;	// the write pointer

            while( p < _end ) {
                if ( (_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == CR ) {
                    // CR-LF pair becomes LF
                    // CR alone becomes LF
                    // LF-CR becomes LF
                    if ( *(p+1) == LF ) {
                        p += 2;
                    }
                    else {
                        ++p;
                    }
                    *q++ = LF;
                }
                else if ( (_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == LF ) {
                    if ( *(p+1) == CR ) {
                        p += 2;
                    }
                    else {
                        ++p;
                    }
                    *q++ = LF;
                }
                else if ( (_flags & NEEDS_ENTITY_PROCESSING) && *p == '&' ) {
                    // Entities handled by tinyXML2:
                    // - special entities in the entity table [in/out]
                    // - numeric character reference [in]
                    //   &#20013; or &#x4e2d;

                    if ( *(p+1) == '#' ) {
                        const int buflen = 10;
                        char buf[buflen] = { 0 };
                        int len = 0;
                        p = const_cast<char*>( XMLUtil::GetCharacterRef( p, buf, &len ) );
                        TIXMLASSERT( 0 <= len && len <= buflen );
                        TIXMLASSERT( q + len <= p );
                        memcpy( q, buf, len );
                        q += len;
                    }
                    else {
                        int i=0;
                        for(; i<NUM_ENTITIES; ++i ) {
                            const Entity& entity = entities[i];
                            if ( strncmp( p + 1, entity.pattern, entity.length ) == 0
                                    && *( p + entity.length + 1 ) == ';' ) {
                                // Found an entity - convert.
                                *q = entity.value;
                                ++q;
                                p += entity.length + 2;
                                break;
                            }
                        }
                        if ( i == NUM_ENTITIES ) {
                            // fixme: treat as error?
                            ++p;
                            ++q;
                        }
                    }
                }
                else {
                    *q = *p;
                    ++p;
                    ++q;
                }
            }
            *q = 0;
        }
        // The loop below has plenty going on, and this
        // is a less useful mode. Break it out.
        if ( _flags & COLLAPSE_WHITESPACE ) {
            CollapseWhitespace();
        }
        _flags = (_flags & NEEDS_DELETE);
    }
    return _start;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
testb $0x1, 0x1(%rdi)
je 0xb230
movq 0x10(%r14), %rax
movb $0x0, (%rax)
movl (%r14), %ecx
movl $0x100, %edx            # imm = 0x100
movl %ecx, %eax
xorl %edx, %eax
movl %eax, (%r14)
xorl %eax, %eax
cmpl %edx, %ecx
je 0xb228
movq 0x8(%r14), %r12
leaq 0xd4f5(%rip), %rbx      # 0x185f0
movq %r12, %r13
movq %r14, -0x50(%rbp)
cmpq 0x10(%r14), %r13
jae 0xb211
movl (%r14), %ecx
movb (%r13), %al
testb $0x2, %cl
je 0xb12c
movzbl %al, %edx
cmpl $0xa, %edx
je 0xb187
cmpl $0xd, %edx
jne 0xb12c
cmpb $0xa, 0x1(%r13)
jmp 0xb18c
testb $0x1, %cl
je 0xb178
cmpb $0x26, %al
jne 0xb178
cmpb $0x23, 0x1(%r13)
jne 0xb1a5
andw $0x0, -0x40(%rbp)
andq $0x0, -0x48(%rbp)
andl $0x0, -0x2c(%rbp)
movq %r13, %rdi
leaq -0x48(%rbp), %r15
movq %r15, %rsi
leaq -0x2c(%rbp), %rdx
callq 0xb244
movq %rax, %r13
movslq -0x2c(%rbp), %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x4190
movslq -0x2c(%rbp), %rax
addq %rax, %r12
jmp 0xb102
movb %al, (%r12)
incq %r13
incq %r12
jmp 0xb102
cmpb $0xd, 0x1(%r13)
leaq 0x2(%r13), %rax
leaq 0x1(%r13), %r13
cmoveq %rax, %r13
movb $0xa, (%r12)
incq %r12
jmp 0xb102
movq %r12, -0x38(%rbp)
leaq 0x1(%r13), %r12
pushq $0xc
popq %r14
cmpq $0x5c, %r14
je 0xb1dd
movq -0xc(%r14,%rbx), %rsi
movslq -0x4(%r14,%rbx), %r15
movq %r12, %rdi
movq %r15, %rdx
callq 0x4120
testl %eax, %eax
jne 0xb1d7
cmpb $0x3b, (%r12,%r15)
je 0xb1e3
addq $0x10, %r14
jmp 0xb1b1
movq -0x38(%rbp), %r12
jmp 0xb1f9
movb (%r14,%rbx), %al
movq -0x38(%rbp), %r12
movb %al, (%r12)
incq %r12
addq %r15, %r13
addq $0x2, %r13
xorl %eax, %eax
cmpq $0x5c, %r14
sete %al
addq %rax, %r12
addq %rax, %r13
movq -0x50(%rbp), %r14
jmp 0xb102
movb $0x0, (%r12)
movl (%r14), %eax
testb $0x4, %al
je 0xb228
movq %r14, %rdi
callq 0xb04a
movl (%r14), %eax
andl $0x200, %eax            # imm = 0x200
movl %eax, (%r14)
movq 0x8(%r14), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop