// File: /workspace/github_cpp_makefile_star2_O2/jliesch[P]ofxget/pugixml/pugixml.cpp
// Function: pugi::impl::(anonymous namespace)::strconv_escape(char*, pugi::impl::(anonymous namespace)::gap&)
PUGI__FN char_t* strconv_escape(char_t* s, gap& g)
	{
		char_t* stre = s + 1;

		switch (*stre)
		{
			case '#':	// &#...
			{
				unsigned int ucsc = 0;

				if (stre[1] == 'x') // &#x... (hex code)
				{
					stre += 2;

					char_t ch = *stre;

					if (ch == ';') return stre;

					for (;;)
					{
						if (static_cast<unsigned int>(ch - '0') <= 9)
							ucsc = 16 * ucsc + (ch - '0');
						else if (static_cast<unsigned int>((ch | ' ') - 'a') <= 5)
							ucsc = 16 * ucsc + ((ch | ' ') - 'a' + 10);
						else if (ch == ';')
							break;
						else // cancel
							return stre;

						ch = *++stre;
					}

					++stre;
				}
				else	// &#... (dec code)
				{
					char_t ch = *++stre;

					if (ch == ';') return stre;

					for (;;)
					{
						if (static_cast<unsigned int>(ch - '0') <= 9)
							ucsc = 10 * ucsc + (ch - '0');
						else if (ch == ';')
							break;
						else // cancel
							return stre;

						ch = *++stre;
					}

					++stre;
				}

			#ifdef PUGIXML_WCHAR_MODE
				s = reinterpret_cast<char_t*>(wchar_writer::any(reinterpret_cast<wchar_writer::value_type>(s), ucsc));
			#else
				s = reinterpret_cast<char_t*>(utf8_writer::any(reinterpret_cast<uint8_t*>(s), ucsc));
			#endif

				g.push(s, stre - s);
				return stre;
			}

			case 'a':	// &a
			{
				++stre;

				if (*stre == 'm') // &am
				{
					if (*++stre == 'p' && *++stre == ';') // &amp;
					{
						*s++ = '&';
						++stre;

						g.push(s, stre - s);
						return stre;
					}
				}
				else if (*stre == 'p') // &ap
				{
					if (*++stre == 'o' && *++stre == 's' && *++stre == ';') // &apos;
					{
						*s++ = '\'';
						++stre;

						g.push(s, stre - s);
						return stre;
					}
				}
				break;
			}

			case 'g': // &g
			{
				if (*++stre == 't' && *++stre == ';') // &gt;
				{
					*s++ = '>';
					++stre;

					g.push(s, stre - s);
					return stre;
				}
				break;
			}

			case 'l': // &l
			{
				if (*++stre == 't' && *++stre == ';') // &lt;
				{
					*s++ = '<';
					++stre;

					g.push(s, stre - s);
					return stre;
				}
				break;
			}

			case 'q': // &q
			{
				if (*++stre == 'u' && *++stre == 'o' && *++stre == 't' && *++stre == ';') // &quot;
				{
					*s++ = '"';
					++stre;

					g.push(s, stre - s);
					return stre;
				}
				break;
			}

			default:
				break;
		}

		return stre;
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
leaq 0x1(%rdi), %rbx
movzbl 0x1(%rdi), %eax
cmpl $0x71, %eax
je 0x23ccf
cmpl $0x61, %eax
je 0x23c63
cmpl $0x67, %eax
je 0x23cad
cmpl $0x6c, %eax
je 0x23c98
cmpl $0x23, %eax
jne 0x23d85
leaq 0x2(%rdi), %rbx
movzbl 0x2(%rdi), %eax
cmpl $0x3b, %eax
je 0x23d85
cmpl $0x78, %eax
jne 0x23d24
leaq 0x3(%rdi), %rbx
movb 0x3(%rdi), %al
cmpb $0x3b, %al
je 0x23d85
xorl %esi, %esi
movsbl %al, %ecx
leal -0x30(%rcx), %edx
cmpl $0x9, %edx
ja 0x23c44
shll $0x4, %esi
orl %edx, %esi
jmp 0x23c5b
orl $0x20, %ecx
leal -0x61(%rcx), %edx
cmpl $0x5, %edx
ja 0x23d4c
shll $0x4, %esi
addl %ecx, %esi
addl $-0x57, %esi
movb 0x1(%rbx), %al
incq %rbx
jmp 0x23c32
movzbl 0x2(%rdi), %eax
cmpl $0x70, %eax
je 0x23cfd
cmpl $0x6d, %eax
jne 0x23cf4
cmpb $0x70, 0x3(%rdi)
jne 0x23d1e
cmpb $0x3b, 0x4(%rdi)
jne 0x23d46
movq %rbx, (%rsp)
movb $0x26, (%rdi)
addq $0x5, %rdi
pushq $0x4
jmp 0x23cc6
cmpb $0x74, 0x2(%rdi)
jne 0x23cf4
cmpb $0x3b, 0x3(%rdi)
jne 0x23d1e
movq %rbx, (%rsp)
movb $0x3c, (%rdi)
jmp 0x23cc0
cmpb $0x74, 0x2(%rdi)
jne 0x23cf4
cmpb $0x3b, 0x3(%rdi)
jne 0x23d1e
movq %rbx, (%rsp)
movb $0x3e, (%rdi)
addq $0x4, %rdi
pushq $0x3
popq %rdx
movq %rdi, %rbx
jmp 0x23d71
cmpb $0x75, 0x2(%rdi)
jne 0x23cf4
cmpb $0x6f, 0x3(%rdi)
jne 0x23d1e
cmpb $0x74, 0x4(%rdi)
jne 0x23d46
cmpb $0x3b, 0x5(%rdi)
jne 0x23d7e
movq %rbx, (%rsp)
movb $0x22, (%rdi)
jmp 0x23d16
addq $0x2, %rdi
jmp 0x23d82
cmpb $0x6f, 0x3(%rdi)
jne 0x23d1e
cmpb $0x73, 0x4(%rdi)
jne 0x23d46
cmpb $0x3b, 0x5(%rdi)
jne 0x23d7e
movq %rbx, (%rsp)
movb $0x27, (%rdi)
addq $0x6, %rdi
pushq $0x5
jmp 0x23cc6
addq $0x3, %rdi
jmp 0x23d82
xorl %esi, %esi
movsbl %al, %ecx
addl $-0x30, %ecx
cmpl $0x9, %ecx
ja 0x23d40
imull $0xa, %esi, %eax
addl %eax, %ecx
movb 0x1(%rbx), %al
incq %rbx
movl %ecx, %esi
jmp 0x23d26
cmpb $0x3b, %al
je 0x23d50
jmp 0x23d85
addq $0x4, %rdi
jmp 0x23d82
cmpb $0x3b, %al
jne 0x23d85
incq %rbx
cmpl $0xffff, %esi           # imm = 0xFFFF
ja 0x23d62
callq 0x232cc
jmp 0x23d67
callq 0x23326
movq %rax, (%rsp)
movq %rbx, %rdx
subq %rax, %rdx
movq %rsp, %rsi
movq %r14, %rdi
callq 0x23d90
jmp 0x23d85
addq $0x5, %rdi
movq %rdi, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq