// File: Matlock42[P]Jeopardy/./RapidXml/rapidxml.hpp
// Function: char* rapidxml::xml_document<char>::skip_and_expand_character_refs<rapidxml::xml_document<char>::attribute_value_pred<(char)39>, rapidxml::xml_document<char>::attribute_value_pure_pred<(char)39>, 0>(char*&)
static Ch *skip_and_expand_character_refs(Ch *&text)
        {
            // If entity translation, whitespace condense and whitespace trimming is disabled, use plain skip
            if (Flags & parse_no_entity_translation && 
                !(Flags & parse_normalize_whitespace) &&
                !(Flags & parse_trim_whitespace))
            {
                skip<StopPred, Flags>(text);
                return text;
            }
            
            // Use simple skip until first modification is detected
            skip<StopPredPure, Flags>(text);

            // Use translation skip
            Ch *src = text;
            Ch *dest = src;
            while (StopPred::test(*src))
            {
                // If entity translation is enabled    
                if (!(Flags & parse_no_entity_translation))
                {
                    // Test if replacement is needed
                    if (src[0] == Ch('&'))
                    {
                        switch (src[1])
                        {

                        // &amp; &apos;
                        case Ch('a'): 
                            if (src[2] == Ch('m') && src[3] == Ch('p') && src[4] == Ch(';'))
                            {
                                *dest = Ch('&');
                                ++dest;
                                src += 5;
                                continue;
                            }
                            if (src[2] == Ch('p') && src[3] == Ch('o') && src[4] == Ch('s') && src[5] == Ch(';'))
                            {
                                *dest = Ch('\'');
                                ++dest;
                                src += 6;
                                continue;
                            }
                            break;

                        // &quot;
                        case Ch('q'): 
                            if (src[2] == Ch('u') && src[3] == Ch('o') && src[4] == Ch('t') && src[5] == Ch(';'))
                            {
                                *dest = Ch('"');
                                ++dest;
                                src += 6;
                                continue;
                            }
                            break;

                        // &gt;
                        case Ch('g'): 
                            if (src[2] == Ch('t') && src[3] == Ch(';'))
                            {
                                *dest = Ch('>');
                                ++dest;
                                src += 4;
                                continue;
                            }
                            break;

                        // &lt;
                        case Ch('l'): 
                            if (src[2] == Ch('t') && src[3] == Ch(';'))
                            {
                                *dest = Ch('<');
                                ++dest;
                                src += 4;
                                continue;
                            }
                            break;

                        // &#...; - assumes ASCII
                        case Ch('#'): 
                            if (src[2] == Ch('x'))
                            {
                                unsigned long code = 0;
                                src += 3;   // Skip &#x
                                while (1)
                                {
                                    unsigned char digit = internal::lookup_tables<0>::lookup_digits[static_cast<unsigned char>(*src)];
                                    if (digit == 0xFF)
                                        break;
                                    code = code * 16 + digit;
                                    ++src;
                                }
                                insert_coded_character<Flags>(dest, code);    // Put character in output
                            }
                            else
                            {
                                unsigned long code = 0;
                                src += 2;   // Skip &#
                                while (1)
                                {
                                    unsigned char digit = internal::lookup_tables<0>::lookup_digits[static_cast<unsigned char>(*src)];
                                    if (digit == 0xFF)
                                        break;
                                    code = code * 10 + digit;
                                    ++src;
                                }
                                insert_coded_character<Flags>(dest, code);    // Put character in output
                            }
                            if (*src == Ch(';'))
                                ++src;
                            else
                                RAPIDXML_PARSE_ERROR("expected ;", src);
                            continue;

                        // Something else
                        default:
                            // Ignore, just copy '&' verbatim
                            break;

                        }
                    }
                }
                
                // If whitespace condensing is enabled
                if (Flags & parse_normalize_whitespace)
                {
                    // Test if condensing is needed                 
                    if (whitespace_pred::test(*src))
                    {
                        *dest = Ch(' '); ++dest;    // Put single space in dest
                        ++src;                      // Skip first whitespace char
                        // Skip remaining whitespace chars
                        while (whitespace_pred::test(*src))
                            ++src;
                        continue;
                    }
                }

                // No replacement, only copy character
                *dest++ = *src++;

            }

            // Return new end
            text = src;
            return dest;

        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x9dd0
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %edi
callq 0x9e20
cmpb $0x0, %al
je 0x9968
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x26, %eax
jne 0x9941
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %eax
movl %eax, -0x48(%rbp)
subl $0x23, %eax
je 0x97f4
jmp 0x9632
movl -0x48(%rbp), %eax
subl $0x61, %eax
je 0x9669
jmp 0x963c
movl -0x48(%rbp), %eax
subl $0x67, %eax
je 0x976e
jmp 0x964a
movl -0x48(%rbp), %eax
subl $0x6c, %eax
je 0x97b1
jmp 0x9658
movl -0x48(%rbp), %eax
subl $0x71, %eax
je 0x9711
jmp 0x993d
movq -0x10(%rbp), %rax
movsbl 0x2(%rax), %eax
cmpl $0x6d, %eax
jne 0x96b4
movq -0x10(%rbp), %rax
movsbl 0x3(%rax), %eax
cmpl $0x70, %eax
jne 0x96b4
movq -0x10(%rbp), %rax
movsbl 0x4(%rax), %eax
cmpl $0x3b, %eax
jne 0x96b4
movq -0x18(%rbp), %rax
movb $0x26, (%rax)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
addq $0x5, %rax
movq %rax, -0x10(%rbp)
jmp 0x95f8
movq -0x10(%rbp), %rax
movsbl 0x2(%rax), %eax
cmpl $0x70, %eax
jne 0x970c
movq -0x10(%rbp), %rax
movsbl 0x3(%rax), %eax
cmpl $0x6f, %eax
jne 0x970c
movq -0x10(%rbp), %rax
movsbl 0x4(%rax), %eax
cmpl $0x73, %eax
jne 0x970c
movq -0x10(%rbp), %rax
movsbl 0x5(%rax), %eax
cmpl $0x3b, %eax
jne 0x970c
movq -0x18(%rbp), %rax
movb $0x27, (%rax)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x10(%rbp)
jmp 0x95f8
jmp 0x993f
movq -0x10(%rbp), %rax
movsbl 0x2(%rax), %eax
cmpl $0x75, %eax
jne 0x9769
movq -0x10(%rbp), %rax
movsbl 0x3(%rax), %eax
cmpl $0x6f, %eax
jne 0x9769
movq -0x10(%rbp), %rax
movsbl 0x4(%rax), %eax
cmpl $0x74, %eax
jne 0x9769
movq -0x10(%rbp), %rax
movsbl 0x5(%rax), %eax
cmpl $0x3b, %eax
jne 0x9769
movq -0x18(%rbp), %rax
movb $0x22, (%rax)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x10(%rbp)
jmp 0x95f8
jmp 0x993f
movq -0x10(%rbp), %rax
movsbl 0x2(%rax), %eax
cmpl $0x74, %eax
jne 0x97ac
movq -0x10(%rbp), %rax
movsbl 0x3(%rax), %eax
cmpl $0x3b, %eax
jne 0x97ac
movq -0x18(%rbp), %rax
movb $0x3e, (%rax)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x10(%rbp)
jmp 0x95f8
jmp 0x993f
movq -0x10(%rbp), %rax
movsbl 0x2(%rax), %eax
cmpl $0x74, %eax
jne 0x97ef
movq -0x10(%rbp), %rax
movsbl 0x3(%rax), %eax
cmpl $0x3b, %eax
jne 0x97ef
movq -0x18(%rbp), %rax
movb $0x3c, (%rax)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x10(%rbp)
jmp 0x95f8
jmp 0x993f
movq -0x10(%rbp), %rax
movsbl 0x2(%rax), %eax
cmpl $0x78, %eax
jne 0x9868
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x311b(%rip), %rax      # 0xc940
movb (%rax,%rcx), %al
movb %al, -0x21(%rbp)
movzbl -0x21(%rbp), %eax
cmpl $0xff, %eax
jne 0x9838
jmp 0x9859
movq -0x20(%rbp), %rax
shlq $0x4, %rax
movzbl -0x21(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x9815
movq -0x20(%rbp), %rsi
leaq -0x18(%rbp), %rdi
callq 0x9e40
jmp 0x98ca
movq $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x30b4(%rip), %rax      # 0xc940
movb (%rax,%rcx), %al
movb %al, -0x31(%rbp)
movzbl -0x31(%rbp), %eax
cmpl $0xff, %eax
jne 0x989f
jmp 0x98bd
imulq $0xa, -0x30(%rbp), %rax
movzbl -0x31(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x987c
movq -0x30(%rbp), %rsi
leaq -0x18(%rbp), %rdi
callq 0x9e40
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3b, %eax
jne 0x98e4
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x9938
movl $0x18, %edi
callq 0x3120
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdx
leaq 0x2bc9(%rip), %rsi      # 0xc4cc
callq 0x81b0
jmp 0x990a
movq -0x50(%rbp), %rdi
leaq 0x8443(%rip), %rsi      # 0x11d58
leaq -0x171c(%rip), %rdx     # 0x8200
callq 0x3470
movq -0x50(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
callq 0x31e0
jmp 0x997d
jmp 0x95f8
jmp 0x993f
jmp 0x9941
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb (%rax), %cl
movq -0x18(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x18(%rbp)
movb %cl, (%rax)
jmp 0x95f8
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x34a0
nopw %cs:(%rax,%rax)