// File: /workspace/github_cpp_makefile_star2_O3/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 %r14
pushq %rbx
testq %rsi, %rsi
je 0x6ccf
movl 0x10(%rdi), %r9d
testl %r9d, %r9d
jle 0x6cca
movq 0x8(%rdi), %r11
testq %r11, %r11
je 0x6cee
movl (%rdi), %r8d
movl 0x4(%rdi), %eax
cmpq %rsi, %r11
jae 0x6cb2
movl %edx, %ecx
leaq 0x3c93(%rip), %r10      # 0xa880
movzbl (%r11), %edx
cmpl $0xc, %edx
jg 0x6c0e
cmpl $0x9, %edx
je 0x6c33
cmpl $0xa, %edx
jne 0x6c71
incl %r8d
leaq 0x1(%r11), %rdx
cmpb $0xd, 0x1(%r11)
jmp 0x6c27
cmpl $0xef, %edx
je 0x6c42
cmpl $0xd, %edx
jne 0x6c75
incl %r8d
leaq 0x1(%r11), %rdx
cmpb $0xa, 0x1(%r11)
leaq 0x2(%r11), %rax
cmoveq %rax, %rdx
xorl %eax, %eax
jmp 0x6c8f
incq %r11
cltd
idivl %r9d
incl %eax
imull %r9d, %eax
jmp 0x6c8c
leaq 0x1(%r11), %rdx
cmpl $0x1, %ecx
jne 0x6c83
movb (%rdx), %bl
testb %bl, %bl
je 0x6c8c
movb 0x2(%r11), %dl
testb %dl, %dl
je 0x6c8c
movl %ebx, %ebp
xorb $-0x45, %bpl
movl %edx, %r14d
xorb $-0x41, %r14b
orb %bpl, %r14b
jne 0x6c9d
addq $0x3, %r11
jmp 0x6c8c
testl %edx, %edx
je 0x6cca
cmpl $0x1, %ecx
jne 0x6c87
movslq (%r10,%rdx,4), %rdx
addq %rdx, %r11
jmp 0x6c8a
incl %eax
jmp 0x6c8f
incq %r11
incl %eax
movq %r11, %rdx
movq %rdx, %r11
cmpq %rsi, %rdx
jb 0x6bed
jmp 0x6cb5
cmpb $-0x41, %bl
jne 0x6cac
cmpb $-0x42, %dl
je 0x6c6b
cmpb $-0x41, %dl
je 0x6c6b
addq $0x3, %r11
jmp 0x6c8a
movq %r11, %rdx
movl %r8d, (%rdi)
movl %eax, 0x4(%rdi)
cmpl $-0x2, %r8d
jle 0x6d0d
cmpl $-0x2, %eax
jle 0x6d2c
movq %rdx, 0x8(%rdi)
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x3958(%rip), %rdi      # 0xa62e
leaq 0x3955(%rip), %rsi      # 0xa632
leaq 0x3960(%rip), %rcx      # 0xa644
movl $0xc6, %edx
callq 0x30e0
leaq 0x361e(%rip), %rdi      # 0xa313
leaq 0x3936(%rip), %rsi      # 0xa632
leaq 0x3941(%rip), %rcx      # 0xa644
movl $0xd2, %edx
callq 0x30e0
leaq 0x396a(%rip), %rdi      # 0xa67e
leaq 0x3917(%rip), %rsi      # 0xa632
leaq 0x3922(%rip), %rcx      # 0xa644
movl $0x133, %edx            # imm = 0x133
callq 0x30e0
leaq 0x395c(%rip), %rdi      # 0xa68f
leaq 0x38f8(%rip), %rsi      # 0xa632
leaq 0x3903(%rip), %rcx      # 0xa644
movl $0x134, %edx            # imm = 0x134
callq 0x30e0
nop