// File: /workspace/github_cpp_makefile_star2_O1/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, %rbx
movq %rdi, (%rsp)
leaq 0x1(%rdi), %r14
movzbl 0x1(%rdi), %eax
cmpl $0x66, %eax
jle 0x29508
cmpl $0x67, %eax
je 0x29552
cmpl $0x6c, %eax
je 0x2956b
cmpl $0x71, %eax
jne 0x296c3
cmpb $0x75, 0x2(%rdi)
jne 0x2958f
cmpb $0x6f, 0x3(%rdi)
jne 0x295e4
cmpb $0x74, 0x4(%rdi)
jne 0x29618
cmpb $0x3b, 0x5(%rdi)
jne 0x29659
movq %r14, (%rsp)
movb $0x22, (%rdi)
jmp 0x295d9
cmpl $0x23, %eax
je 0x29598
cmpl $0x61, %eax
jne 0x296c3
movzbl 0x2(%rdi), %eax
cmpl $0x70, %eax
je 0x295bc
cmpl $0x6d, %eax
jne 0x2958f
cmpb $0x70, 0x3(%rdi)
jne 0x295e4
cmpb $0x3b, 0x4(%rdi)
jne 0x29618
movq %r14, (%rsp)
movb $0x26, (%rdi)
addq $0x5, %rdi
movl $0x4, %edx
jmp 0x29587
cmpb $0x74, 0x2(%rdi)
jne 0x2958f
cmpb $0x3b, 0x3(%rdi)
jne 0x295e4
movq %r14, (%rsp)
movb $0x3e, (%rdi)
jmp 0x2957e
cmpb $0x74, 0x2(%rdi)
jne 0x2958f
cmpb $0x3b, 0x3(%rdi)
jne 0x295e4
movq %r14, (%rsp)
movb $0x3c, (%rdi)
addq $0x4, %rdi
movl $0x3, %edx
movq %rdi, %r14
jmp 0x296b8
addq $0x2, %rdi
jmp 0x2965d
leaq 0x2(%rdi), %r14
movzbl 0x2(%rdi), %eax
cmpl $0x3b, %eax
je 0x295b5
cmpl $0x78, %eax
jne 0x295ea
movb 0x3(%rdi), %al
cmpb $0x3b, %al
jne 0x2961e
leaq 0x3(%rdi), %r14
xorl %esi, %esi
jmp 0x29665
cmpb $0x6f, 0x3(%rdi)
jne 0x295e4
cmpb $0x73, 0x4(%rdi)
jne 0x29618
cmpb $0x3b, 0x5(%rdi)
jne 0x29659
movq %r14, (%rsp)
movb $0x27, (%rdi)
addq $0x6, %rdi
movl $0x5, %edx
jmp 0x29587
addq $0x3, %rdi
jmp 0x2965d
movsbl %al, %ecx
addl $-0x30, %ecx
xorl %esi, %esi
cmpl $0x9, %ecx
ja 0x2960f
xorl %esi, %esi
leal (%rsi,%rsi,4), %eax
leal (%rcx,%rax,2), %esi
movsbl 0x1(%r14), %eax
incq %r14
leal -0x30(%rax), %ecx
cmpl $0xa, %ecx
jb 0x295f9
cmpb $0x3b, %al
jne 0x29665
incq %r14
jmp 0x29655
addq $0x4, %rdi
jmp 0x2965d
leaq 0x4(%rdi), %r14
xorl %esi, %esi
movsbl %al, %ecx
leal -0x30(%rcx), %edx
cmpl $0x9, %edx
ja 0x29636
shll $0x4, %esi
orl %edx, %esi
jmp 0x29649
orl $0x20, %ecx
leal -0x61(%rcx), %edx
cmpl $0x5, %edx
ja 0x29651
shll $0x4, %esi
addl %ecx, %esi
addl $-0x57, %esi
movb (%r14), %al
incq %r14
jmp 0x29624
cmpb $0x3b, %al
jne 0x29662
movb $0x1, %al
jmp 0x29667
addq $0x5, %rdi
movq %rdi, %r14
jmp 0x296c3
decq %r14
xorl %eax, %eax
testb %al, %al
je 0x296c3
cmpl $0xffff, %esi           # imm = 0xFFFF
ja 0x2967d
callq 0x29088
movq %rax, %rdi
jmp 0x296ae
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 %r14, %rdx
subq %rdi, %rdx
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x296ce
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq