// File: /workspace/github_cpp_makefile_star2_O1/smallmuou[P]tinyhtml/tinyxmlparser.cpp
// Function: TiXmlParsingData::Stamp(char const*, TiXmlEncoding)
void TiXmlParsingData::Stamp( const char* now, TiXmlEncoding encoding )
{
	assert( now );

	// Do nothing if the tabsize is 0.
	if ( tabsize < 1 )
	{
		return;
	}

	// Get the current row, column.
	int row = cursor.row;
	int col = cursor.col;
	const char* p = stamp;
	assert( p );

	while ( p < now )
	{
		// Treat p as unsigned, so we have a happy compiler.
		const unsigned char* pU = (const unsigned char*)p;

		// Code contributed by Fletcher Dunn: (modified by lee)
		switch (*pU) {
			case 0:
				// We *should* never get here, but in case we do, don't
				// advance past the terminating null character, ever
				return;

			case '\r':
				// bump down to the next line
				++row;
				col = 0;				
				// Eat the character
				++p;

				// Check for \r\n sequence, and treat this as a single character
				if (*p == '\n') {
					++p;
				}
				break;

			case '\n':
				// bump down to the next line
				++row;
				col = 0;

				// Eat the character
				++p;

				// Check for \n\r sequence, and treat this as a single
				// character.  (Yes, this bizarre thing does occur still
				// on some arcane platforms...)
				if (*p == '\r') {
					++p;
				}
				break;

			case '\t':
				// Eat the character
				++p;

				// Skip to next tab stop
				col = (col / tabsize + 1) * tabsize;
				break;

			case TIXML_UTF_LEAD_0:
				if ( encoding == TIXML_ENCODING_UTF8 )
				{
					if ( *(p+1) && *(p+2) )
					{
						// In these cases, don't advance the column. These are
						// 0-width spaces.
						if ( *(pU+1)==TIXML_UTF_LEAD_1 && *(pU+2)==TIXML_UTF_LEAD_2 )
							p += 3;	
						else if ( *(pU+1)==0xbfU && *(pU+2)==0xbeU )
							p += 3;	
						else if ( *(pU+1)==0xbfU && *(pU+2)==0xbfU )
							p += 3;	
						else
							{ p +=3; ++col; }	// A normal character.
					}
				}
				else
				{
					++p;
					++col;
				}
				break;

			default:
				if ( encoding == TIXML_ENCODING_UTF8 )
				{
					// Eat the 1 to 4 byte utf8 character.
					int step = TiXmlBase::utf8ByteTable[*((const unsigned char*)p)];
					if ( step == 0 )
						step = 1;		// Error case from bad encoding, but handle gracefully.
					p += step;

					// Just advance one column, of course.
					++col;
				}
				else
				{
					++p;
					++col;
				}
				break;
		}
	}
	cursor.row = row;
	cursor.col = col;
	assert( cursor.row >= -1 );
	assert( cursor.col >= -1 );
	stamp = p;
	assert( stamp );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x6e0d
movl 0x10(%rdi), %r8d
testl %r8d, %r8d
jle 0x6e02
movq 0x8(%rdi), %r10
testq %r10, %r10
je 0x6e2c
movl %edx, %ecx
movl (%rdi), %r9d
movl 0x4(%rdi), %eax
leaq 0x3901(%rip), %r11      # 0xa610
cmpq %rsi, %r10
jae 0x6ded
movzbl (%r10), %edx
cmpl $0x9, %edx
jle 0x6d3d
cmpl $0xa, %edx
je 0x6d55
cmpl $0xef, %edx
je 0x6d6f
cmpl $0xd, %edx
jne 0x6db2
incl %r9d
cmpb $0xa, 0x1(%r10)
jmp 0x6d5d
testl %edx, %edx
je 0x6dae
cmpl $0x9, %edx
jne 0x6db2
incq %r10
cltd
idivl %r8d
incl %eax
imull %r8d, %eax
jmp 0x6dce
incl %r9d
cmpb $0xd, 0x1(%r10)
leaq 0x2(%r10), %rax
leaq 0x1(%r10), %r10
cmoveq %rax, %r10
movb $0x1, %dl
xorl %eax, %eax
jmp 0x6dd0
leaq 0x1(%r10), %rbx
cmpl $0x1, %ecx
jne 0x6dc0
movb (%rbx), %bl
movb $0x1, %dl
testb %bl, %bl
je 0x6dd0
movb 0x2(%r10), %r14b
testb %r14b, %r14b
je 0x6dd0
movl %ebx, %r15d
xorb $-0x45, %r15b
movl %r14d, %ebp
xorb $-0x41, %bpl
orb %bpl, %r15b
je 0x6da8
xorb $-0x41, %bl
xorb $-0x42, %r14b
orb %bl, %r14b
jne 0x6dda
addq $0x3, %r10
jmp 0x6dd0
xorl %edx, %edx
jmp 0x6dd0
cmpl $0x1, %ecx
jne 0x6dc9
movslq (%r11,%rdx,4), %rdx
addq %rdx, %r10
jmp 0x6dcc
incl %eax
movb $0x1, %dl
movq %rbx, %r10
jmp 0x6dd0
incq %r10
incl %eax
movb $0x1, %dl
testb %dl, %dl
jne 0x6d0f
jmp 0x6e02
addq $0x3, %r10
xorl %r14d, %r14d
orb %bpl, %bl
setne %r14b
addl %r14d, %eax
jmp 0x6dd0
movl %r9d, (%rdi)
movl %eax, 0x4(%rdi)
cmpl $-0x2, %r9d
jle 0x6e4b
cmpl $-0x2, %eax
jle 0x6e6a
movq %r10, 0x8(%rdi)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3c5a(%rip), %rdi      # 0xaa6e
leaq 0x3c57(%rip), %rsi      # 0xaa72
leaq 0x3c62(%rip), %rcx      # 0xaa84
movl $0xc6, %edx
callq 0x30e0
leaq 0x34e0(%rip), %rdi      # 0xa313
leaq 0x3c38(%rip), %rsi      # 0xaa72
leaq 0x3c43(%rip), %rcx      # 0xaa84
movl $0xd2, %edx
callq 0x30e0
leaq 0x3c6c(%rip), %rdi      # 0xaabe
leaq 0x3c19(%rip), %rsi      # 0xaa72
leaq 0x3c24(%rip), %rcx      # 0xaa84
movl $0x133, %edx            # imm = 0x133
callq 0x30e0
leaq 0x3c5e(%rip), %rdi      # 0xaacf
leaq 0x3bfa(%rip), %rsi      # 0xaa72
leaq 0x3c05(%rip), %rcx      # 0xaa84
movl $0x134, %edx            # imm = 0x134
callq 0x30e0
nop