// File: jliesch[P]ofxget/pugixml/pugixml.cpp
// Function: pugi::impl::(anonymous namespace)::utf16_writer::value_type pugi::impl::(anonymous namespace)::utf8_decoder::process<pugi::impl::(anonymous namespace)::utf16_writer>(unsigned char const*, unsigned long, pugi::impl::(anonymous namespace)::utf16_writer::value_type, pugi::impl::(anonymous namespace)::utf16_writer)
static inline typename Traits::value_type process(const uint8_t* data, size_t size, typename Traits::value_type result, Traits)
		{
			const uint8_t utf8_byte_mask = 0x3f;

			while (size)
			{
				uint8_t lead = *data;

				// 0xxxxxxx -> U+0000..U+007F
				if (lead < 0x80)
				{
					result = Traits::low(result, lead);
					data += 1;
					size -= 1;

					// process aligned single-byte (ascii) blocks
					if ((reinterpret_cast<uintptr_t>(data) & 3) == 0)
					{
						// round-trip through void* to silence 'cast increases required alignment of target type' warnings
						while (size >= 4 && (*static_cast<const uint32_t*>(static_cast<const void*>(data)) & 0x80808080) == 0)
						{
							result = Traits::low(result, data[0]);
							result = Traits::low(result, data[1]);
							result = Traits::low(result, data[2]);
							result = Traits::low(result, data[3]);
							data += 4;
							size -= 4;
						}
					}
				}
				// 110xxxxx -> U+0080..U+07FF
				else if (static_cast<unsigned int>(lead - 0xC0) < 0x20 && size >= 2 && (data[1] & 0xc0) == 0x80)
				{
					result = Traits::low(result, ((lead & ~0xC0) << 6) | (data[1] & utf8_byte_mask));
					data += 2;
					size -= 2;
				}
				// 1110xxxx -> U+0800-U+FFFF
				else if (static_cast<unsigned int>(lead - 0xE0) < 0x10 && size >= 3 && (data[1] & 0xc0) == 0x80 && (data[2] & 0xc0) == 0x80)
				{
					result = Traits::low(result, ((lead & ~0xE0) << 12) | ((data[1] & utf8_byte_mask) << 6) | (data[2] & utf8_byte_mask));
					data += 3;
					size -= 3;
				}
				// 11110xxx -> U+10000..U+10FFFF
				else if (static_cast<unsigned int>(lead - 0xF0) < 0x08 && size >= 4 && (data[1] & 0xc0) == 0x80 && (data[2] & 0xc0) == 0x80 && (data[3] & 0xc0) == 0x80)
				{
					result = Traits::high(result, ((lead & ~0xF0) << 18) | ((data[1] & utf8_byte_mask) << 12) | ((data[2] & utf8_byte_mask) << 6) | (data[3] & utf8_byte_mask));
					data += 4;
					size -= 4;
				}
				// 10xxxxxx or 11111xxx -> invalid
				else
				{
					data += 1;
					size -= 1;
				}
			}

			return result;
		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movb $0x3f, -0x21(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x5873b
movq -0x10(%rbp), %rax
movb (%rax), %al
movb %al, -0x22(%rbp)
movzbl -0x22(%rbp), %eax
cmpl $0x80, %eax
jge 0x58558
movq -0x20(%rbp), %rdi
movzbl -0x22(%rbp), %esi
callq 0x58750
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
jne 0x58553
jmp 0x584b8
xorl %eax, %eax
cmpq $0x4, -0x18(%rbp)
movb %al, -0x23(%rbp)
jb 0x584d8
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0x80808080, %eax       # imm = 0x80808080
cmpl $0x0, %eax
sete %al
movb %al, -0x23(%rbp)
movb -0x23(%rbp), %al
testb $0x1, %al
jne 0x584e1
jmp 0x58551
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl (%rax), %esi
callq 0x58750
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x1(%rax), %esi
callq 0x58750
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
callq 0x58750
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x3(%rax), %esi
callq 0x58750
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
subq $0x4, %rax
movq %rax, -0x18(%rbp)
jmp 0x584b8
jmp 0x58553
jmp 0x58736
movzbl -0x22(%rbp), %eax
subl $0xc0, %eax
cmpl $0x20, %eax
jae 0x585c5
cmpq $0x2, -0x18(%rbp)
jb 0x585c5
movq -0x10(%rbp), %rax
movzbl 0x1(%rax), %eax
andl $0xc0, %eax
cmpl $0x80, %eax
jne 0x585c5
movq -0x20(%rbp), %rdi
movzbl -0x22(%rbp), %esi
andl $0xffffff3f, %esi       # imm = 0xFFFFFF3F
shll $0x6, %esi
movq -0x10(%rbp), %rax
movzbl 0x1(%rax), %eax
andl $0x3f, %eax
orl %eax, %esi
callq 0x58750
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
subq $0x2, %rax
movq %rax, -0x18(%rbp)
jmp 0x58734
movzbl -0x22(%rbp), %eax
subl $0xe0, %eax
cmpl $0x10, %eax
jae 0x5865a
cmpq $0x3, -0x18(%rbp)
jb 0x5865a
movq -0x10(%rbp), %rax
movzbl 0x1(%rax), %eax
andl $0xc0, %eax
cmpl $0x80, %eax
jne 0x5865a
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %eax
andl $0xc0, %eax
cmpl $0x80, %eax
jne 0x5865a
movq -0x20(%rbp), %rdi
movzbl -0x22(%rbp), %esi
andl $0xffffff1f, %esi       # imm = 0xFFFFFF1F
shll $0xc, %esi
movq -0x10(%rbp), %rax
movzbl 0x1(%rax), %eax
andl $0x3f, %eax
shll $0x6, %eax
orl %eax, %esi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %eax
andl $0x3f, %eax
orl %eax, %esi
callq 0x58750
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
subq $0x3, %rax
movq %rax, -0x18(%rbp)
jmp 0x58732
movzbl -0x22(%rbp), %eax
subl $0xf0, %eax
cmpl $0x8, %eax
jae 0x58718
cmpq $0x4, -0x18(%rbp)
jb 0x58718
movq -0x10(%rbp), %rax
movzbl 0x1(%rax), %eax
andl $0xc0, %eax
cmpl $0x80, %eax
jne 0x58718
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %eax
andl $0xc0, %eax
cmpl $0x80, %eax
jne 0x58718
movq -0x10(%rbp), %rax
movzbl 0x3(%rax), %eax
andl $0xc0, %eax
cmpl $0x80, %eax
jne 0x58718
movq -0x20(%rbp), %rdi
movzbl -0x22(%rbp), %esi
andl $0xffffff0f, %esi       # imm = 0xFFFFFF0F
shll $0x12, %esi
movq -0x10(%rbp), %rax
movzbl 0x1(%rax), %eax
andl $0x3f, %eax
shll $0xc, %eax
orl %eax, %esi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %eax
andl $0x3f, %eax
shll $0x6, %eax
orl %eax, %esi
movq -0x10(%rbp), %rax
movzbl 0x3(%rax), %eax
andl $0x3f, %eax
orl %eax, %esi
callq 0x58780
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
subq $0x4, %rax
movq %rax, -0x18(%rbp)
jmp 0x58730
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x58732
jmp 0x58734
jmp 0x58736
jmp 0x58458
movq -0x20(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)