// File: jliesch[P]ofxget/pugixml/pugixml.cpp
// Function: pugi::impl::(anonymous namespace)::text_output_escaped(pugi::impl::(anonymous namespace)::xml_buffered_writer&, char const*, pugi::impl::(anonymous namespace)::chartypex_t)
PUGI__FN void text_output_escaped(xml_buffered_writer& writer, const char_t* s, chartypex_t type)
	{
		while (*s)
		{
			const char_t* prev = s;

			// While *s is a usual symbol
			PUGI__SCANWHILE_UNROLL(!PUGI__IS_CHARTYPEX(ss, type));

			writer.write_buffer(prev, static_cast<size_t>(s - prev));

			switch (*s)
			{
				case 0: break;
				case '&':
					writer.write('&', 'a', 'm', 'p', ';');
					++s;
					break;
				case '<':
					writer.write('&', 'l', 't', ';');
					++s;
					break;
				case '>':
					writer.write('&', 'g', 't', ';');
					++s;
					break;
				case '"':
					writer.write('&', 'q', 'u', 'o', 't', ';');
					++s;
					break;
				default: // s is not a usual symbol
				{
					unsigned int ch = static_cast<unsigned int>(*s++);
					assert(ch < 32);

					writer.write('&', '#', static_cast<char_t>((ch / 10) + '0'), static_cast<char_t>((ch % 10) + '0'), ';');
				}
			}
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x57db9
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movb (%rax), %al
movb %al, -0x21(%rbp)
movzbl -0x21(%rbp), %eax
movl %eax, %ecx
leaq 0x136b2(%rip), %rax     # 0x6b1e0
movzbl (%rax,%rcx), %eax
andl -0x14(%rbp), %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x57b45
jmp 0x57b4a
jmp 0x57c12
movq -0x10(%rbp), %rax
movb 0x1(%rax), %al
movb %al, -0x21(%rbp)
movzbl -0x21(%rbp), %eax
movl %eax, %ecx
leaq 0x1367f(%rip), %rax     # 0x6b1e0
movzbl (%rax,%rcx), %eax
andl -0x14(%rbp), %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x57b78
jmp 0x57b89
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x57c12
movq -0x10(%rbp), %rax
movb 0x2(%rax), %al
movb %al, -0x21(%rbp)
movzbl -0x21(%rbp), %eax
movl %eax, %ecx
leaq 0x13640(%rip), %rax     # 0x6b1e0
movzbl (%rax,%rcx), %eax
andl -0x14(%rbp), %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x57bb7
jmp 0x57bc5
movq -0x10(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x10(%rbp)
jmp 0x57c12
movq -0x10(%rbp), %rax
movb 0x3(%rax), %al
movb %al, -0x21(%rbp)
movzbl -0x21(%rbp), %eax
movl %eax, %ecx
leaq 0x13604(%rip), %rax     # 0x6b1e0
movzbl (%rax,%rcx), %eax
andl -0x14(%rbp), %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x57bf3
jmp 0x57c01
movq -0x10(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x10(%rbp)
jmp 0x57c12
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x10(%rbp)
jmp 0x57b18
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdx
subq %rsi, %rdx
callq 0x57dc0
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x2c(%rbp)
testl %eax, %eax
je 0x57c65
jmp 0x57c36
movl -0x2c(%rbp), %eax
subl $0x22, %eax
je 0x57cfd
jmp 0x57c44
movl -0x2c(%rbp), %eax
subl $0x26, %eax
je 0x57c6a
jmp 0x57c4e
movl -0x2c(%rbp), %eax
subl $0x3c, %eax
je 0x57c9f
jmp 0x57c58
movl -0x2c(%rbp), %eax
subl $0x3e, %eax
je 0x57cce
jmp 0x57d36
jmp 0x57db4
movq -0x8(%rbp), %rdi
movl $0x26, %esi
movl $0x61, %edx
movl $0x6d, %ecx
movl $0x70, %r8d
movl $0x3b, %r9d
callq 0x579a0
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x57db4
movq -0x8(%rbp), %rdi
movl $0x26, %esi
movl $0x6c, %edx
movl $0x74, %ecx
movl $0x3b, %r8d
callq 0x57a60
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x57db4
movq -0x8(%rbp), %rdi
movl $0x26, %esi
movl $0x67, %edx
movl $0x74, %ecx
movl $0x3b, %r8d
callq 0x57a60
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x57db4
movq -0x8(%rbp), %rdi
movl $0x26, %esi
movl $0x71, %edx
movl $0x75, %ecx
movl $0x6f, %r8d
movl $0x74, %r9d
movl $0x3b, (%rsp)
callq 0x57e40
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x57db4
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movsbl (%rax), %eax
movl %eax, -0x28(%rbp)
cmpl $0x20, -0x28(%rbp)
jae 0x57d53
jmp 0x57d72
leaq 0x14f59(%rip), %rdi     # 0x6ccb3
leaq 0x135f4(%rip), %rsi     # 0x6b355
movl $0xf63, %edx            # imm = 0xF63
leaq 0x14f4e(%rip), %rcx     # 0x6ccbb
callq 0x7180
movq -0x8(%rbp), %rdi
movl -0x28(%rbp), %eax
movl $0xa, %ecx
xorl %edx, %edx
divl %ecx
addl $0x30, %eax
movb %al, %cl
movl -0x28(%rbp), %eax
movl $0xa, %esi
xorl %edx, %edx
divl %esi
addl $0x30, %edx
movb %dl, %al
movl $0x26, %esi
movl $0x23, %edx
movl $0x3b, %r9d
movsbl %cl, %ecx
movsbl %al, %r8d
callq 0x579a0
jmp 0x57b03
addq $0x40, %rsp
popq %rbp
retq
nop