//-----------
//
// bml.h  BML: Binary Markup Language (bytecode v1.22)
//
// a binary encapsulation of HTML5
// by Stunt Grok Jockey Tony (@tswain555)
//
//----------

#ifndef BML_BYTECODE_H
#define BML_BYTECODE_H

#include <stdint.h>
#include <stdlib.h>
#include <string.h>   /* for memcpy */

#define BML_VERSION "1.22"

/* ================================================================
  BYTECODES
================================================================ */

#define BML_OP_DOCTYPE    0x00
#define BML_OP_A          0x01
#define BML_OP_ABBR       0x02
#define BML_OP_ADDRESS    0x03
#define BML_OP_AREA       0x04
#define BML_OP_ARTICLE    0x05
#define BML_OP_ASIDE      0x06
#define BML_OP_AUDIO      0x07
#define BML_OP_B          0x08
#define BML_OP_BASE       0x09
#define BML_OP_BDI        0x0A
#define BML_OP_BDO        0x0B
#define BML_OP_BLOCKQUOTE 0x0C
#define BML_OP_BODY       0x0D
#define BML_OP_BR         0x0E
#define BML_OP_BUTTON     0x0F
#define BML_OP_CANVAS     0x10
#define BML_OP_CAPTION    0x11
#define BML_OP_CITE       0x12
#define BML_OP_CODE       0x13
#define BML_OP_COL        0x14
#define BML_OP_COLGROUP   0x15
#define BML_OP_DATALIST   0x16
#define BML_OP_DD         0x17
#define BML_OP_DEL        0x18
#define BML_OP_DETAILS    0x19
#define BML_OP_DFN        0x1A
#define BML_OP_DIV        0x1B
#define BML_OP_DL         0x1C
#define BML_OP_DT         0x1D
#define BML_OP_EM         0x1E
#define BML_OP_EMBED      0x1F
#define BML_OP_FIELDSET   0x20
#define BML_OP_FIGCAPTION 0x21
#define BML_OP_FIGURE     0x22
#define BML_OP_FOOTER     0x23
#define BML_OP_FORM       0x24
#define BML_OP_H1         0x25
#define BML_OP_H2         0x26
#define BML_OP_H3         0x27
#define BML_OP_H4         0x28
#define BML_OP_H5         0x29
#define BML_OP_H6         0x2A
#define BML_OP_HEAD       0x2B
#define BML_OP_HEADER     0x2C
#define BML_OP_HR         0x2D
#define BML_OP_HTML       0x2E
#define BML_OP_I          0x2F
#define BML_OP_IFRAME     0x30
#define BML_OP_IMG        0x31
#define BML_OP_INPUT      0x32
#define BML_OP_INS        0x33
#define BML_OP_KBD        0x34
#define BML_OP_LABEL      0x35
#define BML_OP_LEGEND     0x36
#define BML_OP_LI         0x37
#define BML_OP_LINK       0x38
#define BML_OP_MAIN       0x39
#define BML_OP_MAP        0x3A
#define BML_OP_MARK       0x3B
#define BML_OP_META       0x3C
#define BML_OP_METER      0x3D
#define BML_OP_NAV        0x3E
#define BML_OP_NOSCRIPT   0x3F
#define BML_OP_OBJECT     0x40
#define BML_OP_OL         0x41
#define BML_OP_OPTGROUP   0x42
#define BML_OP_OPTION     0x43
#define BML_OP_OUTPUT     0x44
#define BML_OP_P          0x45
#define BML_OP_PARAM      0x46
#define BML_OP_PICTURE    0x47
#define BML_OP_PRE        0x48
#define BML_OP_PROGRESS   0x49
#define BML_OP_Q          0x4A
#define BML_OP_RP         0x4B
#define BML_OP_RT         0x4C
#define BML_OP_RUBY       0x4D
#define BML_OP_S          0x4E
#define BML_OP_SAMP       0x4F
#define BML_OP_SCRIPT     0x50
#define BML_OP_SECTION    0x51
#define BML_OP_SELECT     0x52
#define BML_OP_SMALL      0x53
#define BML_OP_SOURCE     0x54
#define BML_OP_SPAN       0x55
#define BML_OP_STRONG     0x56
#define BML_OP_STYLE      0x57
#define BML_OP_SUB        0x58
#define BML_OP_SUMMARY    0x59
#define BML_OP_SUP        0x5A
#define BML_OP_TABLE      0x5B
#define BML_OP_TBODY      0x5C
#define BML_OP_TD         0x5D
#define BML_OP_TEMPLATE   0x5E
#define BML_OP_TEXTAREA   0x5F
#define BML_OP_TFOOT      0x60
#define BML_OP_TH         0x61
#define BML_OP_THEAD      0x62
#define BML_OP_TIME       0x63
#define BML_OP_TITLE      0x64
#define BML_OP_TR         0x65
#define BML_OP_TRACK      0x66
#define BML_OP_U          0x67
#define BML_OP_UL         0x68
#define BML_OP_VAR        0x69
#define BML_OP_VIDEO      0x6A
#define BML_OP_WBR        0x6B
#define BML_OP_XTN        0x6C   /* vendor extension */

/* NOP and end-of-element marker are the same byte. */
#define BML_OP_NOP        0xFF
#define BML_MARKER_END    0xFF


/* -- Attribute IDs (0x00 … 0x90) ---------------------------- */
#define BML_ATTR_ACCEPT          0x00
#define BML_ATTR_ACCEPT_CHARSET  0x01
#define BML_ATTR_ACCESSKEY       0x02
#define BML_ATTR_ACTION          0x03
#define BML_ATTR_ALIGN           0x04
#define BML_ATTR_ALLOWFULLSCREEN 0x05
#define BML_ATTR_ALT             0x06
#define BML_ATTR_AS              0x07
#define BML_ATTR_ASYNC           0x08
#define BML_ATTR_AUTOCAPITALIZE  0x09
#define BML_ATTR_AUTOCOMPLETE    0x0A
#define BML_ATTR_AUTOFOCUS       0x0B
#define BML_ATTR_AUTOPLAY        0x0C
#define BML_ATTR_BACKGROUND      0x0D
#define BML_ATTR_BGCOLOR         0x0E
#define BML_ATTR_BORDER          0x0F
#define BML_ATTR_CAPTURE         0x10
#define BML_ATTR_CHALLENGE       0x11
#define BML_ATTR_CHARSET         0x12
#define BML_ATTR_CHECKED         0x13
#define BML_ATTR_CITE            0x14
#define BML_ATTR_CLASS           0x15
#define BML_ATTR_CLEAR           0x16
#define BML_ATTR_CODE            0x17
#define BML_ATTR_COLOR           0x18
#define BML_ATTR_COLS            0x19
#define BML_ATTR_COLSPAN         0x1A
#define BML_ATTR_COMPACT         0x1B
#define BML_ATTR_CONTENT         0x1C
#define BML_ATTR_CONTENTEDITABLE 0x1D
#define BML_ATTR_CONTROLS        0x1E
#define BML_ATTR_COORDS          0x1F
#define BML_ATTR_CROSSORIGIN     0x20
#define BML_ATTR_CSP             0x21
#define BML_ATTR_DATA            0x22
#define BML_ATTR_DATA_STAR       0x23
#define BML_ATTR_DATETIME        0x24
#define BML_ATTR_DECODING        0x25
#define BML_ATTR_DEFAULT         0x26
#define BML_ATTR_DEFER           0x27
#define BML_ATTR_DIR             0x28
#define BML_ATTR_DIRNAME         0x29
#define BML_ATTR_DISABLED        0x2A
#define BML_ATTR_DOWNLOAD        0x2B
#define BML_ATTR_DRAGGABLE       0x2C
#define BML_ATTR_ELEMENTTIMING   0x2D
#define BML_ATTR_ENCTYPE         0x2E
#define BML_ATTR_ENTERKEYHINT    0x2F
#define BML_ATTR_FOR             0x30
#define BML_ATTR_FORM            0x31
#define BML_ATTR_FORMACTION      0x32
#define BML_ATTR_FORMENCTYPE     0x33
#define BML_ATTR_FORMMETHOD      0x34
#define BML_ATTR_FORMNOVALIDATE  0x35
#define BML_ATTR_FORMTARGET      0x36
#define BML_ATTR_HEADERS         0x37
#define BML_ATTR_HEIGHT          0x38
#define BML_ATTR_HIDDEN          0x39
#define BML_ATTR_HIGH            0x3A
#define BML_ATTR_HREF            0x3B
#define BML_ATTR_HREFLANG        0x3C
#define BML_ATTR_HTTP_EQUIV      0x3D
#define BML_ATTR_ID              0x3E
#define BML_ATTR_INERT           0x3F
#define BML_ATTR_INPUTMODE       0x40
#define BML_ATTR_INTEGRITY       0x41
#define BML_ATTR_IS              0x42
#define BML_ATTR_ISMAP           0x43
#define BML_ATTR_ITEMID          0x44
#define BML_ATTR_ITEMPROP        0x45
#define BML_ATTR_ITEMREF         0x46
#define BML_ATTR_ITEMSCOPE       0x47
#define BML_ATTR_ITEMTYPE        0x48
#define BML_ATTR_KIND            0x49
#define BML_ATTR_LABEL           0x4A
#define BML_ATTR_LANG            0x4B
#define BML_ATTR_LANGUAGE        0x4C
#define BML_ATTR_LIST            0x4D
#define BML_ATTR_LOADING         0x4E
#define BML_ATTR_LOOP            0x4F
#define BML_ATTR_LOW             0x50
#define BML_ATTR_MAX             0x51
#define BML_ATTR_MAXLENGTH       0x52
#define BML_ATTR_MEDIA           0x53
#define BML_ATTR_METHOD          0x54
#define BML_ATTR_MIN             0x55
#define BML_ATTR_MINLENGTH       0x56
#define BML_ATTR_MULTIPLE        0x57
#define BML_ATTR_MUTED           0x58
#define BML_ATTR_NAME            0x59
#define BML_ATTR_NOHREF          0x5A
#define BML_ATTR_NONCE           0x5B
#define BML_ATTR_NORESIZE        0x5C
#define BML_ATTR_NOSHADE         0x5D
#define BML_ATTR_NOVALIDATE      0x5E
#define BML_ATTR_NOWRAP          0x5F
#define BML_ATTR_OBJECT          0x60
#define BML_ATTR_OPEN            0x61
#define BML_ATTR_OPTIMUM         0x62
#define BML_ATTR_PATTERN         0x63
#define BML_ATTR_PING            0x64
#define BML_ATTR_PLACEHOLDER     0x65
#define BML_ATTR_PLAYSINLINE     0x66
#define BML_ATTR_POPOVER         0x67
#define BML_ATTR_POSTER          0x68
#define BML_ATTR_PRELOAD         0x69
#define BML_ATTR_PROPERTY        0x6A
#define BML_ATTR_RADIOGROUP      0x6B
#define BML_ATTR_READONLY        0x6C
#define BML_ATTR_REL             0x6D
#define BML_ATTR_REQUIRED        0x6E
#define BML_ATTR_REVERSED        0x6F
#define BML_ATTR_ROWS            0x70
#define BML_ATTR_ROWSPAN         0x71
#define BML_ATTR_SANDBOX         0x72
#define BML_ATTR_SCOPE           0x73
#define BML_ATTR_SCOPED          0x74
#define BML_ATTR_SEAMLESS        0x75
#define BML_ATTR_SELECTED        0x76
#define BML_ATTR_SHAPE           0x77
#define BML_ATTR_SIZE            0x78
#define BML_ATTR_SIZES           0x79
#define BML_ATTR_SLOT            0x7A
#define BML_ATTR_SPAN            0x7B
#define BML_ATTR_SPELLCHECK      0x7C
#define BML_ATTR_SRC             0x7D
#define BML_ATTR_SRCDOC          0x7E
#define BML_ATTR_SRCLANG         0x7F
#define BML_ATTR_SRCSET          0x80
#define BML_ATTR_START           0x81
#define BML_ATTR_STEP            0x82
#define BML_ATTR_STYLE           0x83
#define BML_ATTR_SUMMARY         0x84
#define BML_ATTR_TABINDEX        0x85
#define BML_ATTR_TARGET          0x86
#define BML_ATTR_TITLE           0x87
#define BML_ATTR_TRANSLATE       0x88
#define BML_ATTR_TYPE            0x89
#define BML_ATTR_USEMAP          0x8A
#define BML_ATTR_VALIGN          0x8B
#define BML_ATTR_VALUE           0x8C
#define BML_ATTR_VAR             0x8D
#define BML_ATTR_VLINK           0x8E
#define BML_ATTR_WIDTH           0x8F
#define BML_ATTR_WRAP            0x90

/* -- Value type IDs ---------------------------------------- */
#define BML_TYPE_BOOL        0x00
#define BML_TYPE_DOUBLE      0x01
#define BML_TYPE_INT32       0x03
#define BML_TYPE_STRING      0x04
#define BML_TYPE_UINT8_ENUM  0x05
#define BML_TYPE_UINT16      0x06
#define BML_TYPE_UINT32      0x07


/* -- Tag information table (for decoders) ------------------ */
struct BMLTagInfo {
    uint8_t  opcode;
    char    *html_tag;
    char    *description;
    char    *mnemonic;
};

/* Tags in the same order as the opcodes (0x00 … 0x6C). */
static const struct BMLTagInfo bml_tag_table[] = {
    {0x00, "<!DOCTYPE>",   "Defines the document type",                          "DOCT"},
    {0x01, "<a>",          "Defines a hyperlink",                                "ANCH"},
    {0x02, "<abbr>",       "Defines an abbreviation",                            "ABBR"},
    {0x03, "<address>",    "Defines an address element",                         "ADDR"},
    {0x04, "<area>",       "Defines an area inside an image map",                "AREA"},
    {0x05, "<article>",    "Defines an article",                                 "ARTI"},
    {0x06, "<aside>",      "Defines content aside from the page content",        "ASID"},
    {0x07, "<audio>",      "Defines sound content",                              "AUDI"},
    {0x08, "<b>",          "Defines bold text",                                  "BOLD"},
    {0x09, "<base>",       "Defines a base URL for all the links in a page",     "BASE"},
    {0x0A, "<bdi>",        "Isolates text direction in a block",                 "BDI"},
    {0x0B, "<bdo>",        "Defines the direction of text display",              "BDOT"},
    {0x0C, "<blockquote>", "Defines a long quotation",                           "BLOQ"},
    {0x0D, "<body>",       "Defines the body element",                           "BODY"},
    {0x0E, "<br>",         "Inserts a single line break",                        "BREK"},
    {0x0F, "<button>",     "Defines a push button",                              "BUTN"},
    {0x10, "<canvas>",     "Defines graphics, via JavaScript",                   "CNVS"},
    {0x11, "<caption>",    "Defines a table caption",                            "CAPT"},
    {0x12, "<cite>",       "Defines a citation",                                 "CITE"},
    {0x13, "<code>",       "Defines computer code text",                         "CODE"},
    {0x14, "<col>",        "Defines attributes for table columns",               "COLM"},
    {0x15, "<colgroup>",   "Defines groups of table columns",                    "COLG"},
    {0x16, "<datalist>",   "Defines an input field option list",                 "DTLI"},
    {0x17, "<dd>",         "Defines a definition description",                   "DEFD"},
    {0x18, "<del>",        "Defines deleted text",                               "DELT"},
    {0x19, "<details>",    "Defines additional details user can view or hide",   "DTLS"},
    {0x1A, "<dfn>",        "Defines a definition term",                          "DFNT"},
    {0x1B, "<div>",        "Defines a section in a document",                    "DIVD"},
    {0x1C, "<dl>",         "Defines a definition list",                          "DEFL"},
    {0x1D, "<dt>",         "Defines a definition term",                          "DEFT"},
    {0x1E, "<em>",         "Defines emphasized text",                            "EMPH"},
    {0x1F, "<embed>",      "Defines external interactive content or plugin",     "EMBD"},
    {0x20, "<fieldset>",   "Groups related elements in a form",                  "FDST"},
    {0x21, "<figcaption>", "Defines a caption for an element",                   "FICP"},
    {0x22, "<figure>",     "Specifies self-contained content",                   "FIGR"},
    {0x23, "<footer>",     "Defines a footer for a section or page",             "FOOT"},
    {0x24, "<form>",       "Defines a form",                                     "FORM"},
    {0x25, "<h1>",         "Defines largest heading",                            "HD1"},
    {0x26, "<h2>",         "Defines a heading",                                  "HD2"},
    {0x27, "<h3>",         "Defines a heading",                                  "HD3"},
    {0x28, "<h4>",         "Defines a heading",                                  "HD4"},
    {0x29, "<h5>",         "Defines a heading",                                  "HD5"},
    {0x2A, "<h6>",         "Defines smallest heading",                           "HD6"},
    {0x2B, "<head>",       "Defines information about the document",             "HEAD"},
    {0x2C, "<header>",     "Defines a header for a section or page",             "HEDR"},
    {0x2D, "<hr>",         "Defines a thematic change in the content",           "HRUL"},
    {0x2E, "<html>",       "Defines an HTML document",                           "HTML"},
    {0x2F, "<i>",          "Defines italic text",                                "ITLC"},
    {0x30, "<iframe>",     "Defines an inline frame",                            "IFRM"},
    {0x31, "<img>",        "Defines an image",                                   "IMAG"},
    {0x32, "<input>",      "Defines an input control",                           "INPT"},
    {0x33, "<ins>",        "Defines inserted text",                              "INST"},
    {0x34, "<kbd>",        "Defines keyboard input",                             "KBTX"},
    {0x35, "<label>",      "Defines a label for an input element",               "LABL"},
    {0x36, "<legend>",     "Defines a caption for an input element",             "LGND"},
    {0x37, "<li>",         "Defines a list item",                                "LITM"},
    {0x38, "<link>",       "Defines relationship document to external resource", "LINK"},
    {0x39, "<main>",       "Specifies the main content of a document",           "MAIN"},
    {0x3A, "<map>",        "Defines an image map",                               "IMMP"},
    {0x3B, "<mark>",       "Defines marked/highlighted text",                    "MARK"},
    {0x3C, "<meta>",       "Defines metadata about an HTML document",            "META"},
    {0x3D, "<meter>",      "Defines a scalar measurement within a known range",  "METR"},
    {0x3E, "<nav>",        "Defines navigation links",                           "NAVL"},
    {0x3F, "<noscript>",   "Alternative for non scripters",                      "NSCP"},
    {0x40, "<object>",     "Defines an embedded object",                         "OBJT"},
    {0x41, "<ol>",         "Defines an ordered list",                            "ORLI"},
    {0x42, "<optgroup>",   "Defines a group of related options in a drop-down list","OPGP"},
    {0x43, "<option>",     "Defines an option in a drop-down list",              "OPTN"},
    {0x44, "<output>",     "Defines the result of a calculation",                "OUTP"},
    {0x45, "<p>",          "Defines a paragraph",                                "PRGR"},
    {0x46, "<param>",      "Defines a parameter for an object",                  "PARM"},
    {0x47, "<picture>",    "Defines a container for multiple image resources",   "PICT"},
    {0x48, "<pre>",        "Defines preformatted text",                          "PRET"},
    {0x49, "<progress>",   "Represents the progress of a task",                  "PROG"},
    {0x4A, "<q>",          "Defines a short quotation",                          "QUOT"},
    {0x4B, "<rp>",         "Parentheses/ruby text",                              "RUBY"},
    {0x4C, "<rt>",         "Explanation/pronunciation of characters east Asian", "RUBT"},
    {0x4D, "<ruby>",       "Defines a ruby annotation (East Asian typography)",  "RUBY"},
    {0x4E, "<s>",          "Defines text that is no longer correct",             "STRU"},
    {0x4F, "<samp>",       "Defines sample output from a computer program",      "SAMP"},
    {0x50, "<script>",     "Defines a script",                                   "SCPT"},
    {0x51, "<section>",    "Defines a section in a document",                    "SECT"},
    {0x52, "<select>",     "Defines a drop-down list",                           "SLCT"},
    {0x53, "<small>",      "Defines smaller text",                               "SMLL"},
    {0x54, "<source>",     "Defines multiple media resources for media elements","SRCE"},
    {0x55, "<span>",       "Defines a section in a document",                    "SPAN"},
    {0x56, "<strong>",     "Defines important text",                             "STNG"},
    {0x57, "<style>",      "Defines style information for a document",           "STYL"},
    {0x58, "<sub>",        "Defines subscript text",                             "SUBS"},
    {0x59, "<summary>",    "Defines a visible heading for element",              "SUMM"},
    {0x5A, "<sup>",        "Defines superscript text",                           "SUPS"},
    {0x5B, "<table>",      "Defines a table",                                    "TBLE"},
    {0x5C, "<tbody>",      "Groups the body content in a table",                 "TBODY"},
    {0x5D, "<td>",         "Defines a cell in a table",                          "TCEL"},
    {0x5E, "<template>",   "Holds HTML content hidden from the client",          "TEMP"},
    {0x5F, "<textarea>",   "Defines a multi-line text input control",            "TXAR"},
    {0x60, "<tfoot>",      "Groups the footer content in a table",               "TFOOT"},
    {0x61, "<th>",         "Defines a header cell in a table",                   "THED"},
    {0x62, "<thead>",      "Groups the header content in a table",               "THEAD"},
    {0x63, "<time>",       "Defines a date/time",                                "TME"},
    {0x64, "<title>",      "Defines a title for the document",                   "TTL"},
    {0x65, "<tr>",         "Defines a row in a table",                           "TROW"},
    {0x66, "<track>",      "Defines text tracks for media elements",             "TRCK"},
    {0x67, "<u>",          "Defines text stylistically different from normal",   "UND"},
    {0x68, "<ul>",         "Defines an unordered list",                          "ULIS"},
    {0x69, "<var>",        "Defines a variable",                                 "VAR"},
    {0x6A, "<video>",      "Defines a video or movie",                           "VID"},
    {0x6B, "<wbr>",        "Defines a possible line-break",                      "WBR"},
    {0x6C, "<XTN>",        "Vendor extension tag",                               "XTN"},
    {0xFF, "NOP",          "No operation / end marker",                          "NOP"}   /* NOP at end */
};


/* -- Allowed attributes per tag (sorted by attribute ID) ----
   Each entry is: [count] [attr_id1, attr_id2, …] (sorted ascending). */
struct BMLTagAllowedAttrs {
    uint8_t  tag_id;       /* opcode of the tag */
    uint8_t  count;
    const uint8_t *attr_ids;
};

/* Attribute ID lists. Sorted. */
static const uint8_t doct_allowed_attrs[] = {0};
static const uint8_t anch_allowed_attrs[] = {24, 0x02,0x15,0x1D,0x23,0x28,0x2B,0x2C,0x2F,0x39,0x3B,0x3C,0x3E,0x3F,0x40,0x4B,0x64,0x67,0x6D,0x7C,0x83,0x85,0x86,0x87,0x88};
static const uint8_t abbr_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t addr_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t area_allowed_attrs[] = {25, 0x02,0x06,0x15,0x1D,0x23,0x28,0x2B,0x2C,0x2F,0x39,0x3B,0x3C,0x3E,0x3F,0x40,0x4B,0x64,0x67,0x77,0x7C,0x83,0x85,0x86,0x87,0x88};
static const uint8_t arti_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t asid_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t audi_allowed_attrs[] = {24, 0x02,0x08,0x0C,0x15,0x1D,0x20,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x4F,0x58,0x67,0x69,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t bold_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t base_allowed_attrs[] = {20, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3B,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x86,0x87,0x88};
static const uint8_t bdi_allowed_attrs[]  = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t bdot_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t bloq_allowed_attrs[] = {18, 0x02,0x14,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t body_allowed_attrs[] = {22, 0x02,0x0D,0x0E,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88,0x8E};
static const uint8_t brek_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t butn_allowed_attrs[] = {29, 0x02,0x0B,0x15,0x1D,0x23,0x28,0x2A,0x2C,0x2F,0x31,0x32,0x33,0x34,0x35,0x36,0x39,0x3E,0x3F,0x40,0x4B,0x59,0x67,0x7C,0x83,0x85,0x87,0x88,0x89,0x8C};
static const uint8_t cnvs_allowed_attrs[] = {20, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x38,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88,0x8F};
static const uint8_t capt_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t cite_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t code_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t colm_allowed_attrs[] = {19, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7B,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t colg_allowed_attrs[] = {19, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7B,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t dtli_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t defd_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t delt_allowed_attrs[] = {20, 0x02,0x14,0x15,0x1D,0x23,0x24,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t dtls_allowed_attrs[] = {18, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x61,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t dfnt_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t divd_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t defl_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t deft_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t emph_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t embd_allowed_attrs[] = {21, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x38,0x39,0x3E,0x3F,0x40,0x4B,0x60,0x67,0x7C,0x83,0x85,0x87,0x88,0x89,0x8F};
static const uint8_t fdst_allowed_attrs[] = {21, 0x02,0x15,0x1D,0x23,0x28,0x2A,0x2C,0x2F,0x31,0x39,0x3E,0x3F,0x40,0x4B,0x59,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t ficp_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t figr_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t foot_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t form_allowed_attrs[] = {24, 0x01,0x03,0x0A,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x31,0x39,0x3E,0x3F,0x40,0x4B,0x54,0x5E,0x67,0x86,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t hd1_allowed_attrs[]  = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t head_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t hedr_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t hrul_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t html_allowed_attrs[] = {18, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t itlc_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t ifrm_allowed_attrs[] = {24, 0x02,0x05,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x38,0x39,0x3E,0x3F,0x40,0x4B,0x59,0x67,0x7C,0x7D,0x7E,0x83,0x85,0x87,0x88,0x8F};
static const uint8_t imag_allowed_attrs[] = {28, 0x02,0x06,0x15,0x1D,0x20,0x23,0x25,0x28,0x2C,0x2F,0x38,0x39,0x3E,0x3F,0x40,0x4B,0x4E,0x67,0x79,0x7C,0x7D,0x80,0x83,0x85,0x87,0x88,0x8A,0x8F};
static const uint8_t inpt_allowed_attrs[] = {41, 0x00,0x06,0x0A,0x0B,0x13,0x15,0x1D,0x23,0x28,0x29,0x2A,0x2C,0x2F,0x31,0x32,0x33,0x34,0x35,0x36,0x38,0x39,0x3E,0x3F,0x40,0x4B,0x4D,0x51,0x52,0x56,0x57,0x59,0x65,0x67,0x7C,0x83,0x85,0x87,0x88,0x89,0x8C,0x8F};
static const uint8_t inst_allowed_attrs[] = {20, 0x02,0x14,0x15,0x1D,0x23,0x24,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t kbtx_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t labl_allowed_attrs[] = {19, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x30,0x31,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t lgnd_allowed_attrs[] = {18, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x31,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t litm_allowed_attrs[] = {18, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x81,0x83,0x85,0x87,0x88};
static const uint8_t link_allowed_attrs[] = {27, 0x02,0x07,0x15,0x1D,0x20,0x23,0x28,0x2C,0x2F,0x39,0x3B,0x3C,0x3E,0x3F,0x40,0x41,0x4B,0x53,0x67,0x79,0x7C,0x83,0x85,0x87,0x88,0x89};
static const uint8_t main_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t immp_allowed_attrs[] = {18, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x59,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t mark_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t meta_allowed_attrs[] = {20, 0x02,0x12,0x15,0x1C,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3D,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t metr_allowed_attrs[] = {24, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x31,0x39,0x3A,0x3E,0x3F,0x40,0x4B,0x50,0x51,0x55,0x62,0x67,0x7C,0x83,0x85,0x87,0x88,0x8C};
static const uint8_t navl_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t nscp_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t objt_allowed_attrs[] = {23, 0x02,0x15,0x1D,0x22,0x23,0x28,0x2C,0x2F,0x31,0x38,0x39,0x3E,0x3F,0x40,0x4B,0x59,0x67,0x83,0x85,0x87,0x88,0x89,0x8F};
static const uint8_t orli_allowed_attrs[] = {21, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x6F,0x7C,0x81,0x83,0x85,0x87,0x88,0x89};
static const uint8_t opgp_allowed_attrs[] = {18, 0x02,0x15,0x1D,0x23,0x28,0x2A,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4A,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t optn_allowed_attrs[] = {21, 0x02,0x15,0x1D,0x23,0x28,0x2A,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4A,0x4B,0x67,0x76,0x7C,0x83,0x85,0x87,0x88,0x8C};
static const uint8_t outp_allowed_attrs[] = {19, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x30,0x31,0x39,0x3E,0x3F,0x40,0x4B,0x59,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t prgr_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t parm_allowed_attrs[] = {20, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x59,0x67,0x7C,0x83,0x85,0x87,0x88,0x8C};
static const uint8_t pict_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t pret_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t prog_allowed_attrs[] = {21, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x31,0x39,0x3E,0x3F,0x40,0x4B,0x51,0x67,0x7C,0x83,0x85,0x87,0x88,0x8C};
static const uint8_t quot_allowed_attrs[] = {18, 0x02,0x14,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t ruby_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t stru_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t samp_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t scpt_allowed_attrs[] = {25, 0x02,0x08,0x15,0x1D,0x20,0x23,0x27,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x41,0x4B,0x5B,0x67,0x7C,0x7D,0x83,0x85,0x87,0x88,0x89};
static const uint8_t sect_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t slct_allowed_attrs[] = {23, 0x02,0x0A,0x15,0x1D,0x23,0x28,0x2A,0x2C,0x2F,0x31,0x39,0x3E,0x3F,0x40,0x4B,0x57,0x67,0x78,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t smll_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t srce_allowed_attrs[] = {20, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x53,0x67,0x79,0x7C,0x83,0x85,0x87,0x88,0x89};
static const uint8_t span_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t stng_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t styl_allowed_attrs[] = {20, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x53,0x5B,0x67,0x7C,0x83,0x85,0x87,0x88,0x89};
static const uint8_t subs_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t summ_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t sups_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t tble_allowed_attrs[] = {19, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x84,0x85,0x87,0x88};
static const uint8_t tbody_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t tcel_allowed_attrs[] = {21, 0x02,0x15,0x1D,0x16,0x23,0x28,0x2C,0x2F,0x37,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x71,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t temp_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t txar_allowed_attrs[] = {29, 0x02,0x0A,0x15,0x19,0x1D,0x23,0x28,0x29,0x2A,0x2C,0x2F,0x31,0x39,0x3E,0x3F,0x40,0x4B,0x52,0x56,0x59,0x65,0x67,0x70,0x7C,0x83,0x85,0x87,0x88,0x90};
static const uint8_t tfoot_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t thed_allowed_attrs[] = {23, 0x02,0x15,0x1D,0x16,0x23,0x28,0x2C,0x2F,0x37,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x71,0x73,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t thead_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t tme_allowed_attrs[]  = {18, 0x02,0x15,0x1D,0x23,0x24,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t ttl_allowed_attrs[]  = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t trow_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t trck_allowed_attrs[] = {21, 0x02,0x15,0x1D,0x23,0x26,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4A,0x4B,0x67,0x7C,0x7D,0x7F,0x83,0x85,0x87,0x88};
static const uint8_t und_allowed_attrs[]  = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t ulis_allowed_attrs[] = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t var_allowed_attrs[]  = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t vid_allowed_attrs[]  = {25, 0x02,0x0C,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x38,0x39,0x3E,0x3F,0x40,0x4B,0x4F,0x66,0x67,0x68,0x69,0x7C,0x83,0x85,0x87,0x88,0x8F};
static const uint8_t wbr_allowed_attrs[]  = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t xtn_allowed_attrs[]  = {17, 0x02,0x15,0x1D,0x23,0x28,0x2C,0x2F,0x39,0x3E,0x3F,0x40,0x4B,0x67,0x7C,0x83,0x85,0x87,0x88};
static const uint8_t nop_allowed_attrs[]  = {0};   /* NOP has no attributes */

static const struct BMLTagAllowedAttrs bml_tag_allowed_attrs[] = {
    {0x00, 0,  doct_allowed_attrs},   /* <!DOCTYPE> */
    {0x01, 24, anch_allowed_attrs},
    {0x02, 17, abbr_allowed_attrs},
    {0x03, 17, addr_allowed_attrs},
    {0x04, 25, area_allowed_attrs},
    {0x05, 17, arti_allowed_attrs},
    {0x06, 17, asid_allowed_attrs},
    {0x07, 24, audi_allowed_attrs},
    {0x08, 17, bold_allowed_attrs},
    {0x09, 20, base_allowed_attrs},
    {0x0A, 17, bdi_allowed_attrs},
    {0x0B, 17, bdot_allowed_attrs},
    {0x0C, 18, bloq_allowed_attrs},
    {0x0D, 22, body_allowed_attrs},
    {0x0E, 17, brek_allowed_attrs},
    {0x0F, 29, butn_allowed_attrs},
    {0x10, 20, cnvs_allowed_attrs},
    {0x11, 17, capt_allowed_attrs},
    {0x12, 17, cite_allowed_attrs},
    {0x13, 17, code_allowed_attrs},
    {0x14, 19, colm_allowed_attrs},
    {0x15, 19, colg_allowed_attrs},
    {0x16, 17, dtli_allowed_attrs},
    {0x17, 17, defd_allowed_attrs},
    {0x18, 20, delt_allowed_attrs},
    {0x19, 18, dtls_allowed_attrs},
    {0x1A, 17, dfnt_allowed_attrs},
    {0x1B, 17, divd_allowed_attrs},
    {0x1C, 17, defl_allowed_attrs},
    {0x1D, 17, deft_allowed_attrs},
    {0x1E, 17, emph_allowed_attrs},
    {0x1F, 21, embd_allowed_attrs},
    {0x20, 21, fdst_allowed_attrs},
    {0x21, 17, ficp_allowed_attrs},
    {0x22, 17, figr_allowed_attrs},
    {0x23, 17, foot_allowed_attrs},
    {0x24, 24, form_allowed_attrs},
    {0x25, 17, hd1_allowed_attrs},    /* h1 */
    {0x26, 17, hd1_allowed_attrs},    /* h2 */
    {0x27, 17, hd1_allowed_attrs},    /* h3 */
    {0x28, 17, hd1_allowed_attrs},    /* h4 */
    {0x29, 17, hd1_allowed_attrs},    /* h5 */
    {0x2A, 17, hd1_allowed_attrs},    /* h6 */
    {0x2B, 17, head_allowed_attrs},
    {0x2C, 17, hedr_allowed_attrs},
    {0x2D, 17, hrul_allowed_attrs},
    {0x2E, 18, html_allowed_attrs},
    {0x2F, 17, itlc_allowed_attrs},
    {0x30, 24, ifrm_allowed_attrs},
    {0x31, 28, imag_allowed_attrs},
    {0x32, 41, inpt_allowed_attrs},
    {0x33, 20, inst_allowed_attrs},
    {0x34, 17, kbtx_allowed_attrs},
    {0x35, 19, labl_allowed_attrs},
    {0x36, 18, lgnd_allowed_attrs},
    {0x37, 18, litm_allowed_attrs},
    {0x38, 27, link_allowed_attrs},
    {0x39, 17, main_allowed_attrs},
    {0x3A, 18, immp_allowed_attrs},
    {0x3B, 17, mark_allowed_attrs},
    {0x3C, 20, meta_allowed_attrs},
    {0x3D, 24, metr_allowed_attrs},
    {0x3E, 17, navl_allowed_attrs},
    {0x3F, 17, nscp_allowed_attrs},
    {0x40, 23, objt_allowed_attrs},
    {0x41, 21, orli_allowed_attrs},
    {0x42, 18, opgp_allowed_attrs},
    {0x43, 21, optn_allowed_attrs},
    {0x44, 19, outp_allowed_attrs},
    {0x45, 17, prgr_allowed_attrs},
    {0x46, 20, parm_allowed_attrs},
    {0x47, 17, pict_allowed_attrs},
    {0x48, 17, pret_allowed_attrs},
    {0x49, 21, prog_allowed_attrs},
    {0x4A, 18, quot_allowed_attrs},
    {0x4B, 17, ruby_allowed_attrs},   /* rp */
    {0x4C, 17, ruby_allowed_attrs},   /* rt */
    {0x4D, 17, ruby_allowed_attrs},   /* ruby */
    {0x4E, 17, stru_allowed_attrs},
    {0x4F, 17, samp_allowed_attrs},
    {0x50, 25, scpt_allowed_attrs},
    {0x51, 17, sect_allowed_attrs},
    {0x52, 23, slct_allowed_attrs},
    {0x53, 17, smll_allowed_attrs},
    {0x54, 20, srce_allowed_attrs},
    {0x55, 17, span_allowed_attrs},
    {0x56, 17, stng_allowed_attrs},
    {0x57, 20, styl_allowed_attrs},
    {0x58, 17, subs_allowed_attrs},
    {0x59, 17, summ_allowed_attrs},
    {0x5A, 17, sups_allowed_attrs},
    {0x5B, 19, tble_allowed_attrs},
    {0x5C, 17, tbody_allowed_attrs},
    {0x5D, 21, tcel_allowed_attrs},
    {0x5E, 17, temp_allowed_attrs},
    {0x5F, 29, txar_allowed_attrs},
    {0x60, 17, tfoot_allowed_attrs},
    {0x61, 23, thed_allowed_attrs},
    {0x62, 17, thead_allowed_attrs},
    {0x63, 18, tme_allowed_attrs},
    {0x64, 17, ttl_allowed_attrs},
    {0x65, 17, trow_allowed_attrs},
    {0x66, 21, trck_allowed_attrs},
    {0x67, 17, und_allowed_attrs},
    {0x68, 17, ulis_allowed_attrs},
    {0x69, 17, var_allowed_attrs},
    {0x6A, 25, vid_allowed_attrs},
    {0x6B, 17, wbr_allowed_attrs},
    {0x6C, 17, xtn_allowed_attrs},
    {0xFF, 0,  nop_allowed_attrs}     /* NOP */
};


/* -- Allowed value types per attribute (sorted by type ID) -- */
struct BMLAttrAllowedTypes {
    uint8_t  attr_id;
    uint8_t  count;
    const uint8_t *type_ids;
};

/* (tables omitted for brevity in this snippet – see the full file) */

#endif /* BML_BYTECODE_H */
