// File: /workspace/github_cpp_makefile_star2_O1/tdv[P]boss/boss/include/other/rapidxml-1.13/rapidxml.hpp
// Function: rapidxml::xml_node<char>* rapidxml::xml_document<char>::parse_doctype<992>(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 %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq (%rsi), %r14
movq %r14, %rax
movzbl (%rax), %ecx
cmpl $0x5b, %ecx
je 0x2583c
cmpl $0x3e, %ecx
je 0x2586c
testl %ecx, %ecx
je 0x258b4
incq %rax
movq %rax, (%rbx)
jmp 0x2581f
incq %rax
movq %rax, (%rbx)
movl $0x1, %ecx
movzbl (%rax), %edx
cmpl $0x5b, %edx
je 0x2585e
cmpl $0x5d, %edx
je 0x2585a
testl %edx, %edx
jne 0x25860
jmp 0x258b4
decl %ecx
jmp 0x25860
incl %ecx
incq %rax
movq %rax, (%rbx)
testl %ecx, %ecx
jg 0x25847
jmp 0x2581f
addq $0x60, %rdi
movl $0x60, %esi
callq 0x25d52
xorl %ecx, %ecx
movq %rcx, 0x20(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movl $0x6, 0x28(%rax)
movq %rcx, 0x30(%rax)
movq %rcx, 0x40(%rax)
movq (%rbx), %rcx
subq %r14, %rcx
movq %r14, 0x8(%rax)
movq %rcx, 0x18(%rax)
movq (%rbx), %rcx
movb $0x0, (%rcx)
incq (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x18, %edi
callq 0x2cb60
movq (%rbx), %rcx
leaq 0xf7a18(%rip), %rdx     # 0x11d2e0
movq %rdx, (%rax)
leaq 0xb4c83(%rip), %rdx     # 0xda555
movq %rdx, 0x8(%rax)
movq %rcx, 0x10(%rax)
leaq 0xf79d7(%rip), %rsi     # 0x11d2b8
leaq 0x7528(%rip), %rdx      # 0x2ce10
movq %rax, %rdi
callq 0x2dbb0