// File: Matlock42[P]Jeopardy/./RapidXml/rapidxml.hpp
// Function: rapidxml::xml_node<char>* rapidxml::xml_document<char>::parse_doctype<0>(char*&)
xml_node<Ch> *parse_doctype(Ch *&text)
        {
            // Remember value start
            Ch *value = text;

            // Skip to >
            while (*text != Ch('>'))
            {
                // Determine character type
                switch (*text)
                {
                
                // If '[' encountered, scan for matching ending ']' using naive algorithm with depth
                // This works for all W3C test files except for 2 most wicked
                case Ch('['):
                {
                    ++text;     // Skip '['
                    int depth = 1;
                    while (depth > 0)
                    {
                        switch (*text)
                        {
                            case Ch('['): ++depth; break;
                            case Ch(']'): --depth; break;
                            case 0: RAPIDXML_PARSE_ERROR("unexpected end of data", text);
                        }
                        ++text;
                    }
                    break;
                }
                
                // Error on end of text
                case Ch('\0'):
                    RAPIDXML_PARSE_ERROR("unexpected end of data", text);
                
                // Other character, skip it
                default:
                    ++text;

                }
            }
            
            // If DOCTYPE nodes enabled
            if (Flags & parse_doctype_node)
            {
                // Create a new doctype node
                xml_node<Ch> *doctype = this->allocate_node(node_doctype);
                doctype->value(value, text - value);
                
                // Place zero terminator after value
                if (!(Flags & parse_no_string_terminators))
                    *text = Ch('\0');

                text += 1;      // skip '>'
                return doctype;
            }
            else
            {
                text += 1;      // skip '>'
                return 0;
            }

        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x3e, %eax
je 0x8a18
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
movl %eax, -0x30(%rbp)
testl %eax, %eax
je 0x89ae
jmp 0x88d5
movl -0x30(%rbp), %eax
subl $0x5b, %eax
jne 0x8a05
jmp 0x88e3
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movl $0x1, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jle 0x89ac
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
movl %eax, -0x34(%rbp)
testl %eax, %eax
je 0x893f
jmp 0x8915
movl -0x34(%rbp), %eax
subl $0x5b, %eax
je 0x8929
jmp 0x891f
movl -0x34(%rbp), %eax
subl $0x5d, %eax
je 0x8934
jmp 0x8999
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x8999
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x8999
movl $0x18, %edi
callq 0x3120
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdx
leaq 0x3a45(%rip), %rsi      # 0xc3a6
callq 0x81b0
jmp 0x8968
movq -0x40(%rbp), %rdi
leaq 0x93e5(%rip), %rsi      # 0x11d58
leaq -0x77a(%rip), %rdx      # 0x8200
callq 0x3470
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x31e0
jmp 0x8a2e
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x88f8
jmp 0x8a13
movl $0x18, %edi
callq 0x3120
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdx
leaq 0x39d6(%rip), %rsi      # 0xc3a6
callq 0x81b0
jmp 0x89d7
movq -0x48(%rbp), %rdi
leaq 0x9376(%rip), %rsi      # 0x11d58
leaq -0x7e9(%rip), %rdx      # 0x8200
callq 0x3470
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x31e0
jmp 0x8a2e
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x88ab
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
xorl %eax, %eax
addq $0x50, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x34a0
nopw (%rax,%rax)