// File: /workspace/github_cpp_makefile_star2_O3/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 $0x66, %eax
jle 0x28e2a
cmpl $0x67, %eax
je 0x28e74
cmpl $0x6c, %eax
je 0x28e8d
cmpl $0x71, %eax
jne 0x28f99
cmpb $0x75, 0x2(%rdi)
jne 0x28ec0
cmpb $0x6f, 0x3(%rdi)
jne 0x28f44
cmpb $0x74, 0x4(%rdi)
jne 0x28f73
cmpb $0x3b, 0x5(%rdi)
jne 0x28f92
movq %rbx, (%rsp)
movb $0x22, (%rdi)
jmp 0x28f36
cmpl $0x23, %eax
je 0x28ec9
cmpl $0x61, %eax
jne 0x28f99
movzbl 0x2(%rdi), %eax
cmpl $0x70, %eax
je 0x28f1d
cmpl $0x6d, %eax
jne 0x28ec0
cmpb $0x70, 0x3(%rdi)
jne 0x28f44
cmpb $0x3b, 0x4(%rdi)
jne 0x28f73
movq %rbx, (%rsp)
movb $0x26, (%rdi)
addq $0x5, %rdi
movl $0x4, %edx
jmp 0x28ead
cmpb $0x74, 0x2(%rdi)
jne 0x28ec0
cmpb $0x3b, 0x3(%rdi)
jne 0x28f44
movq %rbx, (%rsp)
movb $0x3e, (%rdi)
jmp 0x28ea4
cmpb $0x74, 0x2(%rdi)
jne 0x28ec0
cmpb $0x3b, 0x3(%rdi)
jne 0x28f44
movq %rbx, (%rsp)
movb $0x3c, (%rdi)
addq $0x4, %rdi
movl $0x3, %edx
movq %rdi, %rbx
movq %rsp, %rsi
movq %r14, %rdi
callq 0x28fe4
jmp 0x28f99
addq $0x2, %rdi
jmp 0x28f96
leaq 0x2(%rdi), %rbx
movzbl 0x2(%rdi), %eax
cmpl $0x3b, %eax
je 0x28f99
cmpl $0x78, %eax
jne 0x28f4a
leaq 0x3(%rdi), %rbx
movb 0x3(%rdi), %al
cmpb $0x3b, %al
je 0x28f99
xorl %esi, %esi
movsbl %al, %ecx
leal -0x30(%rcx), %edx
cmpl $0x9, %edx
ja 0x28f02
shll $0x4, %esi
orl %edx, %esi
jmp 0x28f15
orl $0x20, %ecx
leal -0x61(%rcx), %edx
cmpl $0x5, %edx
ja 0x28f79
shll $0x4, %esi
addl %ecx, %esi
addl $-0x57, %esi
movb 0x1(%rbx), %al
incq %rbx
jmp 0x28ef0
cmpb $0x6f, 0x3(%rdi)
jne 0x28f44
cmpb $0x73, 0x4(%rdi)
jne 0x28f73
cmpb $0x3b, 0x5(%rdi)
jne 0x28f92
movq %rbx, (%rsp)
movb $0x27, (%rdi)
addq $0x6, %rdi
movl $0x5, %edx
jmp 0x28ead
addq $0x3, %rdi
jmp 0x28f96
movsbl %al, %eax
addl $-0x30, %eax
cmpl $0x9, %eax
ja 0x28f99
xorl %esi, %esi
leal (%rsi,%rsi,4), %ecx
leal (%rax,%rcx,2), %esi
movsbl 0x1(%rbx), %ecx
incq %rbx
leal -0x30(%rcx), %eax
cmpl $0xa, %eax
jb 0x28f57
cmpb $0x3b, %cl
je 0x28f7d
jmp 0x28f99
addq $0x4, %rdi
jmp 0x28f96
cmpb $0x3b, %al
jne 0x28f99
incq %rbx
cmpl $0xffff, %esi           # imm = 0xFFFF
ja 0x28fa4
callq 0x28d0e
movq %rax, %rdi
jmp 0x28fd5
addq $0x5, %rdi
movq %rdi, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl %esi, %eax
shrl $0x12, %eax
orb $-0x10, %al
movb %al, (%rdi)
movl %esi, %eax
shrl $0xc, %eax
andb $0x3f, %al
orb $-0x80, %al
movb %al, 0x1(%rdi)
movl %esi, %eax
shrl $0x6, %eax
andb $0x3f, %al
orb $-0x80, %al
movb %al, 0x2(%rdi)
andb $0x3f, %sil
orb $-0x80, %sil
movb %sil, 0x3(%rdi)
addq $0x4, %rdi
movq %rdi, (%rsp)
movq %rbx, %rdx
subq %rdi, %rdx
jmp 0x28eb0